{"action":"created","comment":{"url":"https://api.github.com/repos/docker/notary/pulls/comments/52251231","id":52251231,"diff_hunk":"@@ -829,28 +839,65 @@ func (r *NotaryRepository) validateRoot(rootJSON []byte) (*data.SignedRoot, erro\n // creates and adds one new key or delegates managing the key to the server.\n // These changes are staged in a changelist until publish is called.\n func (r *NotaryRepository) RotateKey(role string, serverManagesKey bool) error {\n-\tif role == data.CanonicalRootRole || role == data.CanonicalTimestampRole {\n+\tif role == data.CanonicalRootRole {\n \t\treturn fmt.Errorf(\n \t\t\t\"notary does not currently support rotating the %s key\", role)\n \t}\n \tif serverManagesKey && role == data.CanonicalTargetsRole {\n \t\treturn ErrInvalidRemoteRole{Role: data.CanonicalTargetsRole}\n \t}\n+\tif !serverManagesKey && role == data.CanonicalTimestampRole {\n+\t\treturn ErrInvalidLocalRole{Role: data.CanonicalTimestampRole}\n+\t}\n \n \tvar (\n-\t\tpubKey data.PublicKey\n-\t\terr    error\n+\t\tpubKey       data.PublicKey\n+\t\terrFmtString string\n+\t\terr          error\n \t)\n \tif serverManagesKey {\n-\t\tpubKey, err = getRemoteKey(r.baseURL, r.gun, role, r.roundTrip)\n+\t\tif err := r.bootstrapRepo(); err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\t// get root keys - since we bootstrapped the repo, a valid root should always specify\n+\t\t// the root role\n+\t\trootRole, ok := r.tufRepo.Root.Signed.Roles[data.CanonicalRootRole]","path":"client/client.go","position":71,"original_position":71,"commit_id":"413e1cdb0418cac9eb66b777896f3fa0d6fa7619","original_commit_id":"413e1cdb0418cac9eb66b777896f3fa0d6fa7619","user":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"body":"I was thinking about adding a `GetSigningKeys` to `tuf.Repo`, which already has logic similar to this for getting signing keys for signing a particular role.","created_at":"2016-02-09T00:27:51Z","updated_at":"2016-02-09T00:27:51Z","html_url":"https://github.com/docker/notary/pull/553#discussion_r52251231","pull_request_url":"https://api.github.com/repos/docker/notary/pulls/553","_links":{"self":{"href":"https://api.github.com/repos/docker/notary/pulls/comments/52251231"},"html":{"href":"https://github.com/docker/notary/pull/553#discussion_r52251231"},"pull_request":{"href":"https://api.github.com/repos/docker/notary/pulls/553"}}},"pull_request":{"url":"https://api.github.com/repos/docker/notary/pulls/553","id":58681591,"html_url":"https://github.com/docker/notary/pull/553","diff_url":"https://github.com/docker/notary/pull/553.diff","patch_url":"https://github.com/docker/notary/pull/553.patch","issue_url":"https://api.github.com/repos/docker/notary/issues/553","number":553,"state":"open","locked":false,"title":"Client rotate remote key","user":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"body":"This supercedes https://github.com/docker/notary/pull/529.\r\n\r\nThis adds the functionality for the client to rotate remote keys, including the timestamp key.\r\n\r\nIn order to do so, it must sign a request with the root key, in order to prove that it has the root key, and the rotation is published right away.\r\n\r\nPart of addressing #347","created_at":"2016-02-08T23:07:22Z","updated_at":"2016-02-09T00:27:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"63030f70cba6c7d88455361f125623dfd4b073ba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/notary/pulls/553/commits","review_comments_url":"https://api.github.com/repos/docker/notary/pulls/553/comments","review_comment_url":"https://api.github.com/repos/docker/notary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/notary/issues/553/comments","statuses_url":"https://api.github.com/repos/docker/notary/statuses/413e1cdb0418cac9eb66b777896f3fa0d6fa7619","head":{"label":"docker:client-rotate-remote","ref":"client-rotate-remote","sha":"413e1cdb0418cac9eb66b777896f3fa0d6fa7619","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":37743436,"name":"notary","full_name":"docker/notary","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/notary","description":"Notary is a Docker project that allows anyone to have trust over arbitrary collections of data","fork":false,"url":"https://api.github.com/repos/docker/notary","forks_url":"https://api.github.com/repos/docker/notary/forks","keys_url":"https://api.github.com/repos/docker/notary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/notary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/notary/teams","hooks_url":"https://api.github.com/repos/docker/notary/hooks","issue_events_url":"https://api.github.com/repos/docker/notary/issues/events{/number}","events_url":"https://api.github.com/repos/docker/notary/events","assignees_url":"https://api.github.com/repos/docker/notary/assignees{/user}","branches_url":"https://api.github.com/repos/docker/notary/branches{/branch}","tags_url":"https://api.github.com/repos/docker/notary/tags","blobs_url":"https://api.github.com/repos/docker/notary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/notary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/notary/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/notary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/notary/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/notary/languages","stargazers_url":"https://api.github.com/repos/docker/notary/stargazers","contributors_url":"https://api.github.com/repos/docker/notary/contributors","subscribers_url":"https://api.github.com/repos/docker/notary/subscribers","subscription_url":"https://api.github.com/repos/docker/notary/subscription","commits_url":"https://api.github.com/repos/docker/notary/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/notary/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/notary/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/notary/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/notary/contents/{+path}","compare_url":"https://api.github.com/repos/docker/notary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/notary/merges","archive_url":"https://api.github.com/repos/docker/notary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/notary/downloads","issues_url":"https://api.github.com/repos/docker/notary/issues{/number}","pulls_url":"https://api.github.com/repos/docker/notary/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/notary/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/notary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/notary/labels{/name}","releases_url":"https://api.github.com/repos/docker/notary/releases{/id}","deployments_url":"https://api.github.com/repos/docker/notary/deployments","created_at":"2015-06-19T20:07:53Z","updated_at":"2016-02-06T17:57:37Z","pushed_at":"2016-02-09T00:16:11Z","git_url":"git://github.com/docker/notary.git","ssh_url":"git@github.com:docker/notary.git","clone_url":"https://github.com/docker/notary.git","svn_url":"https://github.com/docker/notary","homepage":"https://docker.com","size":23971,"stargazers_count":474,"watchers_count":474,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":75,"forks":72,"open_issues":75,"watchers":474,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"3b3026c121c3d2aa9893c6e32b72e2440356e10a","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":37743436,"name":"notary","full_name":"docker/notary","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/notary","description":"Notary is a Docker project that allows anyone to have trust over arbitrary collections of data","fork":false,"url":"https://api.github.com/repos/docker/notary","forks_url":"https://api.github.com/repos/docker/notary/forks","keys_url":"https://api.github.com/repos/docker/notary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/notary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/notary/teams","hooks_url":"https://api.github.com/repos/docker/notary/hooks","issue_events_url":"https://api.github.com/repos/docker/notary/issues/events{/number}","events_url":"https://api.github.com/repos/docker/notary/events","assignees_url":"https://api.github.com/repos/docker/notary/assignees{/user}","branches_url":"https://api.github.com/repos/docker/notary/branches{/branch}","tags_url":"https://api.github.com/repos/docker/notary/tags","blobs_url":"https://api.github.com/repos/docker/notary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/notary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/notary/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/notary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/notary/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/notary/languages","stargazers_url":"https://api.github.com/repos/docker/notary/stargazers","contributors_url":"https://api.github.com/repos/docker/notary/contributors","subscribers_url":"https://api.github.com/repos/docker/notary/subscribers","subscription_url":"https://api.github.com/repos/docker/notary/subscription","commits_url":"https://api.github.com/repos/docker/notary/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/notary/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/notary/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/notary/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/notary/contents/{+path}","compare_url":"https://api.github.com/repos/docker/notary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/notary/merges","archive_url":"https://api.github.com/repos/docker/notary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/notary/downloads","issues_url":"https://api.github.com/repos/docker/notary/issues{/number}","pulls_url":"https://api.github.com/repos/docker/notary/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/notary/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/notary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/notary/labels{/name}","releases_url":"https://api.github.com/repos/docker/notary/releases{/id}","deployments_url":"https://api.github.com/repos/docker/notary/deployments","created_at":"2015-06-19T20:07:53Z","updated_at":"2016-02-06T17:57:37Z","pushed_at":"2016-02-09T00:16:11Z","git_url":"git://github.com/docker/notary.git","ssh_url":"git@github.com:docker/notary.git","clone_url":"https://github.com/docker/notary.git","svn_url":"https://github.com/docker/notary","homepage":"https://docker.com","size":23971,"stargazers_count":474,"watchers_count":474,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":75,"forks":72,"open_issues":75,"watchers":474,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/notary/pulls/553"},"html":{"href":"https://github.com/docker/notary/pull/553"},"issue":{"href":"https://api.github.com/repos/docker/notary/issues/553"},"comments":{"href":"https://api.github.com/repos/docker/notary/issues/553/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/notary/pulls/553/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/notary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/notary/pulls/553/commits"},"statuses":{"href":"https://api.github.com/repos/docker/notary/statuses/413e1cdb0418cac9eb66b777896f3fa0d6fa7619"}}}}