{"action":"created","comment":{"url":"https://api.github.com/repos/ethcore/parity/pulls/comments/98327414","pull_request_review_id":18970269,"id":98327414,"diff_hunk":"@@ -161,14 +190,47 @@ impl KeyDirectory for DiskDirectory {\n \t}\n \n \tfn path(&self) -> Option<&PathBuf> { Some(&self.path) }\n+\n+\tfn as_vault_provider(&self) -> Option<&VaultKeyDirectoryProvider> {\n+\t\tSome(self)\n+\t}\n+}\n+\n+impl<T> VaultKeyDirectoryProvider for DiskDirectory<T> where T: KeyFileManager {\n+\tfn create(&self, name: &str, key: VaultKey) -> Result<Box<VaultKeyDirectory>, Error> {\n+\t\tlet vault_dir = VaultDiskDirectory::create(&self.path, name, key)?;\n+\t\tOk(Box::new(vault_dir))\n+\t}\n+\n+\tfn open(&self, name: &str, key: VaultKey) -> Result<Box<VaultKeyDirectory>, Error> {\n+\t\tlet vault_dir = VaultDiskDirectory::at(&self.path, name, key)?;\n+\t\tOk(Box::new(vault_dir))\n+\t}\n }\n \n+impl DiskKeyFileManager {\n+\tpub fn new() -> Self {\n+\t\tDiskKeyFileManager {}","path":"ethstore/src/dir/disk.rs","position":null,"original_position":191,"commit_id":"b527db89d92cd60980dd2540f6ab903bd23f4cd3","original_commit_id":"b2472c647727c4dee77cb61d829d91775ab05979","user":{"login":"svyatonik","id":985319,"avatar_url":"https://avatars.githubusercontent.com/u/985319?v=3","gravatar_id":"","url":"https://api.github.com/users/svyatonik","html_url":"https://github.com/svyatonik","followers_url":"https://api.github.com/users/svyatonik/followers","following_url":"https://api.github.com/users/svyatonik/following{/other_user}","gists_url":"https://api.github.com/users/svyatonik/gists{/gist_id}","starred_url":"https://api.github.com/users/svyatonik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svyatonik/subscriptions","organizations_url":"https://api.github.com/users/svyatonik/orgs","repos_url":"https://api.github.com/users/svyatonik/repos","events_url":"https://api.github.com/users/svyatonik/events{/privacy}","received_events_url":"https://api.github.com/users/svyatonik/received_events","type":"User","site_admin":false},"body":"done","created_at":"2017-01-28T08:49:18Z","updated_at":"2017-01-28T08:49:18Z","html_url":"https://github.com/ethcore/parity/pull/4312#discussion_r98327414","pull_request_url":"https://api.github.com/repos/ethcore/parity/pulls/4312","_links":{"self":{"href":"https://api.github.com/repos/ethcore/parity/pulls/comments/98327414"},"html":{"href":"https://github.com/ethcore/parity/pull/4312#discussion_r98327414"},"pull_request":{"href":"https://api.github.com/repos/ethcore/parity/pulls/4312"}}},"pull_request":{"url":"https://api.github.com/repos/ethcore/parity/pulls/4312","id":103280029,"html_url":"https://github.com/ethcore/parity/pull/4312","diff_url":"https://github.com/ethcore/parity/pull/4312.diff","patch_url":"https://github.com/ethcore/parity/pull/4312.patch","issue_url":"https://api.github.com/repos/ethcore/parity/issues/4312","number":4312,"state":"open","locked":false,"title":"Initial commit for vaults","user":{"login":"svyatonik","id":985319,"avatar_url":"https://avatars.githubusercontent.com/u/985319?v=3","gravatar_id":"","url":"https://api.github.com/users/svyatonik","html_url":"https://github.com/svyatonik","followers_url":"https://api.github.com/users/svyatonik/followers","following_url":"https://api.github.com/users/svyatonik/following{/other_user}","gists_url":"https://api.github.com/users/svyatonik/gists{/gist_id}","starred_url":"https://api.github.com/users/svyatonik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svyatonik/subscriptions","organizations_url":"https://api.github.com/users/svyatonik/orgs","repos_url":"https://api.github.com/users/svyatonik/repos","events_url":"https://api.github.com/users/svyatonik/events{/privacy}","received_events_url":"https://api.github.com/users/svyatonik/received_events","type":"User","site_admin":false},"body":"Initial commit for vaults\r\n\r\nThis is first part of implementation of #3501. Here's outline (and some caveats) of implementation:\r\n1) vault are implemented sub-directories of key directory with name of directory = name of vault. This leads to the fact that we can't use special symbols in vaults name. So I've added restriction that vault name can consist of alphanumeric chars, whitespace chars, dash && underscore.\r\nAnother approach is to unlink name of vault from name of vault-dir && have some metadata file in keys directory, which will be of form [{ \"vault_name\": \"MyVault\", \"vault_dir\": \"abcdef-123141-125421-12\" }].\r\nFor me, the former is better, as it is more self-descriptive (it maybe more convenient for users who want to copy vaults) + we avoid some errors (like adding vaults with duplicate names => unable to work with both vaults at all, etc).\r\nAnyway, this is discussable.\r\n2) all accounts in the same vaults are protected with the same password. Here comes two caveats:\r\n2.1) vault can be empty, but it still has to be protected with password. So here's vault.json file (aka vault_file.rs) in each vault, which contains encrypted password. Password is encrypted with the same password, so that decrypt(what: encrypted, with: password) = password. I'm not sure this is cryptographically strong, but I don't have another ideas how to achieve the same result.\r\n2.2) some operations on accounts require no password (for example: changing name of account, changing meta). But this data is password-protected for vault accounts => password is stored in memory for all the time, when vault is open. I don't see another option currently. Maybe we should change API to support vault accounts? Or use some OS-backed protected memory (haven't found any cross-platform solutions for now) in future.\r\n3) vaults exist as an addition to main key directory (aka RootDiskDirectory) && can be loaded/unloaded at any time\r\n4) copying/moving accounts between vaults && root directory is possible\r\n\r\nJSONRPC && Parity Wallet integration is yet to be done.\r\n","created_at":"2017-01-26T10:07:51Z","updated_at":"2017-01-28T08:49:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75ab6ee8e2c69bade6c3e5435e4017b741919f87","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ethcore/parity/pulls/4312/commits","review_comments_url":"https://api.github.com/repos/ethcore/parity/pulls/4312/comments","review_comment_url":"https://api.github.com/repos/ethcore/parity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethcore/parity/issues/4312/comments","statuses_url":"https://api.github.com/repos/ethcore/parity/statuses/b527db89d92cd60980dd2540f6ab903bd23f4cd3","head":{"label":"ethcore:vaults","ref":"vaults","sha":"b527db89d92cd60980dd2540f6ab903bd23f4cd3","user":{"login":"ethcore","id":14176906,"avatar_url":"https://avatars.githubusercontent.com/u/14176906?v=3","gravatar_id":"","url":"https://api.github.com/users/ethcore","html_url":"https://github.com/ethcore","followers_url":"https://api.github.com/users/ethcore/followers","following_url":"https://api.github.com/users/ethcore/following{/other_user}","gists_url":"https://api.github.com/users/ethcore/gists{/gist_id}","starred_url":"https://api.github.com/users/ethcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethcore/subscriptions","organizations_url":"https://api.github.com/users/ethcore/orgs","repos_url":"https://api.github.com/users/ethcore/repos","events_url":"https://api.github.com/users/ethcore/events{/privacy}","received_events_url":"https://api.github.com/users/ethcore/received_events","type":"Organization","site_admin":false},"repo":{"id":46714939,"name":"parity","full_name":"ethcore/parity","owner":{"login":"ethcore","id":14176906,"avatar_url":"https://avatars.githubusercontent.com/u/14176906?v=3","gravatar_id":"","url":"https://api.github.com/users/ethcore","html_url":"https://github.com/ethcore","followers_url":"https://api.github.com/users/ethcore/followers","following_url":"https://api.github.com/users/ethcore/following{/other_user}","gists_url":"https://api.github.com/users/ethcore/gists{/gist_id}","starred_url":"https://api.github.com/users/ethcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethcore/subscriptions","organizations_url":"https://api.github.com/users/ethcore/orgs","repos_url":"https://api.github.com/users/ethcore/repos","events_url":"https://api.github.com/users/ethcore/events{/privacy}","received_events_url":"https://api.github.com/users/ethcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethcore/parity","description":"Fast, light, robust Ethereum implementation","fork":false,"url":"https://api.github.com/repos/ethcore/parity","forks_url":"https://api.github.com/repos/ethcore/parity/forks","keys_url":"https://api.github.com/repos/ethcore/parity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethcore/parity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethcore/parity/teams","hooks_url":"https://api.github.com/repos/ethcore/parity/hooks","issue_events_url":"https://api.github.com/repos/ethcore/parity/issues/events{/number}","events_url":"https://api.github.com/repos/ethcore/parity/events","assignees_url":"https://api.github.com/repos/ethcore/parity/assignees{/user}","branches_url":"https://api.github.com/repos/ethcore/parity/branches{/branch}","tags_url":"https://api.github.com/repos/ethcore/parity/tags","blobs_url":"https://api.github.com/repos/ethcore/parity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethcore/parity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethcore/parity/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethcore/parity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethcore/parity/statuses/{sha}","languages_url":"https://api.github.com/repos/ethcore/parity/languages","stargazers_url":"https://api.github.com/repos/ethcore/parity/stargazers","contributors_url":"https://api.github.com/repos/ethcore/parity/contributors","subscribers_url":"https://api.github.com/repos/ethcore/parity/subscribers","subscription_url":"https://api.github.com/repos/ethcore/parity/subscription","commits_url":"https://api.github.com/repos/ethcore/parity/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethcore/parity/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethcore/parity/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethcore/parity/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethcore/parity/contents/{+path}","compare_url":"https://api.github.com/repos/ethcore/parity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethcore/parity/merges","archive_url":"https://api.github.com/repos/ethcore/parity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethcore/parity/downloads","issues_url":"https://api.github.com/repos/ethcore/parity/issues{/number}","pulls_url":"https://api.github.com/repos/ethcore/parity/pulls{/number}","milestones_url":"https://api.github.com/repos/ethcore/parity/milestones{/number}","notifications_url":"https://api.github.com/repos/ethcore/parity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethcore/parity/labels{/name}","releases_url":"https://api.github.com/repos/ethcore/parity/releases{/id}","deployments_url":"https://api.github.com/repos/ethcore/parity/deployments","created_at":"2015-11-23T11:07:32Z","updated_at":"2017-01-28T05:03:11Z","pushed_at":"2017-01-28T08:44:57Z","git_url":"git://github.com/ethcore/parity.git","ssh_url":"git@github.com:ethcore/parity.git","clone_url":"https://github.com/ethcore/parity.git","svn_url":"https://github.com/ethcore/parity","homepage":"","size":80715,"stargazers_count":763,"watchers_count":763,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":154,"mirror_url":null,"open_issues_count":298,"forks":154,"open_issues":298,"watchers":763,"default_branch":"master"}},"base":{"label":"ethcore:master","ref":"master","sha":"79481b8ab503b51041b86f6845c6458ecd55d5e8","user":{"login":"ethcore","id":14176906,"avatar_url":"https://avatars.githubusercontent.com/u/14176906?v=3","gravatar_id":"","url":"https://api.github.com/users/ethcore","html_url":"https://github.com/ethcore","followers_url":"https://api.github.com/users/ethcore/followers","following_url":"https://api.github.com/users/ethcore/following{/other_user}","gists_url":"https://api.github.com/users/ethcore/gists{/gist_id}","starred_url":"https://api.github.com/users/ethcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethcore/subscriptions","organizations_url":"https://api.github.com/users/ethcore/orgs","repos_url":"https://api.github.com/users/ethcore/repos","events_url":"https://api.github.com/users/ethcore/events{/privacy}","received_events_url":"https://api.github.com/users/ethcore/received_events","type":"Organization","site_admin":false},"repo":{"id":46714939,"name":"parity","full_name":"ethcore/parity","owner":{"login":"ethcore","id":14176906,"avatar_url":"https://avatars.githubusercontent.com/u/14176906?v=3","gravatar_id":"","url":"https://api.github.com/users/ethcore","html_url":"https://github.com/ethcore","followers_url":"https://api.github.com/users/ethcore/followers","following_url":"https://api.github.com/users/ethcore/following{/other_user}","gists_url":"https://api.github.com/users/ethcore/gists{/gist_id}","starred_url":"https://api.github.com/users/ethcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethcore/subscriptions","organizations_url":"https://api.github.com/users/ethcore/orgs","repos_url":"https://api.github.com/users/ethcore/repos","events_url":"https://api.github.com/users/ethcore/events{/privacy}","received_events_url":"https://api.github.com/users/ethcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethcore/parity","description":"Fast, light, robust Ethereum implementation","fork":false,"url":"https://api.github.com/repos/ethcore/parity","forks_url":"https://api.github.com/repos/ethcore/parity/forks","keys_url":"https://api.github.com/repos/ethcore/parity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethcore/parity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethcore/parity/teams","hooks_url":"https://api.github.com/repos/ethcore/parity/hooks","issue_events_url":"https://api.github.com/repos/ethcore/parity/issues/events{/number}","events_url":"https://api.github.com/repos/ethcore/parity/events","assignees_url":"https://api.github.com/repos/ethcore/parity/assignees{/user}","branches_url":"https://api.github.com/repos/ethcore/parity/branches{/branch}","tags_url":"https://api.github.com/repos/ethcore/parity/tags","blobs_url":"https://api.github.com/repos/ethcore/parity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethcore/parity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethcore/parity/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethcore/parity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethcore/parity/statuses/{sha}","languages_url":"https://api.github.com/repos/ethcore/parity/languages","stargazers_url":"https://api.github.com/repos/ethcore/parity/stargazers","contributors_url":"https://api.github.com/repos/ethcore/parity/contributors","subscribers_url":"https://api.github.com/repos/ethcore/parity/subscribers","subscription_url":"https://api.github.com/repos/ethcore/parity/subscription","commits_url":"https://api.github.com/repos/ethcore/parity/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethcore/parity/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethcore/parity/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethcore/parity/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethcore/parity/contents/{+path}","compare_url":"https://api.github.com/repos/ethcore/parity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethcore/parity/merges","archive_url":"https://api.github.com/repos/ethcore/parity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethcore/parity/downloads","issues_url":"https://api.github.com/repos/ethcore/parity/issues{/number}","pulls_url":"https://api.github.com/repos/ethcore/parity/pulls{/number}","milestones_url":"https://api.github.com/repos/ethcore/parity/milestones{/number}","notifications_url":"https://api.github.com/repos/ethcore/parity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethcore/parity/labels{/name}","releases_url":"https://api.github.com/repos/ethcore/parity/releases{/id}","deployments_url":"https://api.github.com/repos/ethcore/parity/deployments","created_at":"2015-11-23T11:07:32Z","updated_at":"2017-01-28T05:03:11Z","pushed_at":"2017-01-28T08:44:57Z","git_url":"git://github.com/ethcore/parity.git","ssh_url":"git@github.com:ethcore/parity.git","clone_url":"https://github.com/ethcore/parity.git","svn_url":"https://github.com/ethcore/parity","homepage":"","size":80715,"stargazers_count":763,"watchers_count":763,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":154,"mirror_url":null,"open_issues_count":298,"forks":154,"open_issues":298,"watchers":763,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ethcore/parity/pulls/4312"},"html":{"href":"https://github.com/ethcore/parity/pull/4312"},"issue":{"href":"https://api.github.com/repos/ethcore/parity/issues/4312"},"comments":{"href":"https://api.github.com/repos/ethcore/parity/issues/4312/comments"},"review_comments":{"href":"https://api.github.com/repos/ethcore/parity/pulls/4312/comments"},"review_comment":{"href":"https://api.github.com/repos/ethcore/parity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethcore/parity/pulls/4312/commits"},"statuses":{"href":"https://api.github.com/repos/ethcore/parity/statuses/b527db89d92cd60980dd2540f6ab903bd23f4cd3"}}}}
{"actor":{"display_login":"svyatonik"}}