{"action":"created","comment":{"url":"https://api.github.com/repos/flynn/go-tuf/pulls/comments/22420325","id":22420325,"diff_hunk":"@@ -0,0 +1,28 @@\n+package main\n+\n+import (\n+\t\"encoding/json\"\n+\t\"log\"\n+\t\"os\"\n+\n+\t\"github.com/flynn/go-docopt\"\n+\t\"github.com/flynn/go-tuf\"\n+)\n+\n+func init() {\n+\tregister(\"root-keys\", cmdRootKeys, `\n+usage: tuf root-keys\n+\n+Outputs a JSON serialized array of root keys to STDOUT.\n+\n+The resulting JSON should be distributed to clients for performing initial updates.\n+`)\n+}\n+\n+func cmdRootKeys(args *docopt.Args, repo *tuf.Repo) error {\n+\tkeys, err := repo.RootKeys()\n+\tif err != nil {\n+\t\tlog.Fatal(err)","path":"tuf/root_keys.go","position":25,"original_position":25,"commit_id":"b0dbf83993efb53e6ad3090e6f9cad13808b9f9a","original_commit_id":"b0dbf83993efb53e6ad3090e6f9cad13808b9f9a","user":{"login":"titanous","id":13026,"avatar_url":"https://avatars.githubusercontent.com/u/13026?v=3","gravatar_id":"","url":"https://api.github.com/users/titanous","html_url":"https://github.com/titanous","followers_url":"https://api.github.com/users/titanous/followers","following_url":"https://api.github.com/users/titanous/following{/other_user}","gists_url":"https://api.github.com/users/titanous/gists{/gist_id}","starred_url":"https://api.github.com/users/titanous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/titanous/subscriptions","organizations_url":"https://api.github.com/users/titanous/orgs","repos_url":"https://api.github.com/users/titanous/repos","events_url":"https://api.github.com/users/titanous/events{/privacy}","received_events_url":"https://api.github.com/users/titanous/received_events","type":"User","site_admin":false},"body":"Can we just return the error?","created_at":"2015-01-02T19:45:03Z","updated_at":"2015-01-02T19:45:03Z","html_url":"https://github.com/flynn/go-tuf/pull/19#discussion_r22420325","pull_request_url":"https://api.github.com/repos/flynn/go-tuf/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/flynn/go-tuf/pulls/comments/22420325"},"html":{"href":"https://github.com/flynn/go-tuf/pull/19#discussion_r22420325"},"pull_request":{"href":"https://api.github.com/repos/flynn/go-tuf/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/flynn/go-tuf/pulls/19","id":26768068,"html_url":"https://github.com/flynn/go-tuf/pull/19","diff_url":"https://github.com/flynn/go-tuf/pull/19.diff","patch_url":"https://github.com/flynn/go-tuf/pull/19.patch","issue_url":"https://api.github.com/repos/flynn/go-tuf/issues/19","number":19,"state":"open","locked":false,"title":"Add root-keys command","user":{"login":"lmars","id":488515,"avatar_url":"https://avatars.githubusercontent.com/u/488515?v=3","gravatar_id":"","url":"https://api.github.com/users/lmars","html_url":"https://github.com/lmars","followers_url":"https://api.github.com/users/lmars/followers","following_url":"https://api.github.com/users/lmars/following{/other_user}","gists_url":"https://api.github.com/users/lmars/gists{/gist_id}","starred_url":"https://api.github.com/users/lmars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmars/subscriptions","organizations_url":"https://api.github.com/users/lmars/orgs","repos_url":"https://api.github.com/users/lmars/repos","events_url":"https://api.github.com/users/lmars/events{/privacy}","received_events_url":"https://api.github.com/users/lmars/received_events","type":"User","site_admin":false},"body":"The client will need the root keys when performing the initial update, so this change helps the maintainer distribute those keys.","created_at":"2015-01-02T19:36:36Z","updated_at":"2015-01-02T19:45:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"323c2cfecdde081540038ecb518f0aa13feaaf42","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flynn/go-tuf/pulls/19/commits","review_comments_url":"https://api.github.com/repos/flynn/go-tuf/pulls/19/comments","review_comment_url":"https://api.github.com/repos/flynn/go-tuf/pulls/comments/{number}","comments_url":"https://api.github.com/repos/flynn/go-tuf/issues/19/comments","statuses_url":"https://api.github.com/repos/flynn/go-tuf/statuses/b0dbf83993efb53e6ad3090e6f9cad13808b9f9a","head":{"label":"flynn:root-keys","ref":"root-keys","sha":"b0dbf83993efb53e6ad3090e6f9cad13808b9f9a","user":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"repo":{"id":27903690,"name":"go-tuf","full_name":"flynn/go-tuf","owner":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flynn/go-tuf","description":"WIP Go implementation of The Update Framework","fork":false,"url":"https://api.github.com/repos/flynn/go-tuf","forks_url":"https://api.github.com/repos/flynn/go-tuf/forks","keys_url":"https://api.github.com/repos/flynn/go-tuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flynn/go-tuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flynn/go-tuf/teams","hooks_url":"https://api.github.com/repos/flynn/go-tuf/hooks","issue_events_url":"https://api.github.com/repos/flynn/go-tuf/issues/events{/number}","events_url":"https://api.github.com/repos/flynn/go-tuf/events","assignees_url":"https://api.github.com/repos/flynn/go-tuf/assignees{/user}","branches_url":"https://api.github.com/repos/flynn/go-tuf/branches{/branch}","tags_url":"https://api.github.com/repos/flynn/go-tuf/tags","blobs_url":"https://api.github.com/repos/flynn/go-tuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flynn/go-tuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flynn/go-tuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/flynn/go-tuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flynn/go-tuf/statuses/{sha}","languages_url":"https://api.github.com/repos/flynn/go-tuf/languages","stargazers_url":"https://api.github.com/repos/flynn/go-tuf/stargazers","contributors_url":"https://api.github.com/repos/flynn/go-tuf/contributors","subscribers_url":"https://api.github.com/repos/flynn/go-tuf/subscribers","subscription_url":"https://api.github.com/repos/flynn/go-tuf/subscription","commits_url":"https://api.github.com/repos/flynn/go-tuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/flynn/go-tuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/flynn/go-tuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/flynn/go-tuf/issues/comments/{number}","contents_url":"https://api.github.com/repos/flynn/go-tuf/contents/{+path}","compare_url":"https://api.github.com/repos/flynn/go-tuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flynn/go-tuf/merges","archive_url":"https://api.github.com/repos/flynn/go-tuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flynn/go-tuf/downloads","issues_url":"https://api.github.com/repos/flynn/go-tuf/issues{/number}","pulls_url":"https://api.github.com/repos/flynn/go-tuf/pulls{/number}","milestones_url":"https://api.github.com/repos/flynn/go-tuf/milestones{/number}","notifications_url":"https://api.github.com/repos/flynn/go-tuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flynn/go-tuf/labels{/name}","releases_url":"https://api.github.com/repos/flynn/go-tuf/releases{/id}","created_at":"2014-12-12T03:31:16Z","updated_at":"2014-12-31T21:17:55Z","pushed_at":"2015-01-02T19:35:10Z","git_url":"git://github.com/flynn/go-tuf.git","ssh_url":"git@github.com:flynn/go-tuf.git","clone_url":"https://github.com/flynn/go-tuf.git","svn_url":"https://github.com/flynn/go-tuf","homepage":"http://theupdateframework.com/","size":336,"stargazers_count":38,"watchers_count":38,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":38,"default_branch":"master"}},"base":{"label":"flynn:master","ref":"master","sha":"cc0fde7fc701e6d3a3021827fdd9677ca1f24e95","user":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"repo":{"id":27903690,"name":"go-tuf","full_name":"flynn/go-tuf","owner":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flynn/go-tuf","description":"WIP Go implementation of The Update Framework","fork":false,"url":"https://api.github.com/repos/flynn/go-tuf","forks_url":"https://api.github.com/repos/flynn/go-tuf/forks","keys_url":"https://api.github.com/repos/flynn/go-tuf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flynn/go-tuf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flynn/go-tuf/teams","hooks_url":"https://api.github.com/repos/flynn/go-tuf/hooks","issue_events_url":"https://api.github.com/repos/flynn/go-tuf/issues/events{/number}","events_url":"https://api.github.com/repos/flynn/go-tuf/events","assignees_url":"https://api.github.com/repos/flynn/go-tuf/assignees{/user}","branches_url":"https://api.github.com/repos/flynn/go-tuf/branches{/branch}","tags_url":"https://api.github.com/repos/flynn/go-tuf/tags","blobs_url":"https://api.github.com/repos/flynn/go-tuf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flynn/go-tuf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flynn/go-tuf/git/refs{/sha}","trees_url":"https://api.github.com/repos/flynn/go-tuf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flynn/go-tuf/statuses/{sha}","languages_url":"https://api.github.com/repos/flynn/go-tuf/languages","stargazers_url":"https://api.github.com/repos/flynn/go-tuf/stargazers","contributors_url":"https://api.github.com/repos/flynn/go-tuf/contributors","subscribers_url":"https://api.github.com/repos/flynn/go-tuf/subscribers","subscription_url":"https://api.github.com/repos/flynn/go-tuf/subscription","commits_url":"https://api.github.com/repos/flynn/go-tuf/commits{/sha}","git_commits_url":"https://api.github.com/repos/flynn/go-tuf/git/commits{/sha}","comments_url":"https://api.github.com/repos/flynn/go-tuf/comments{/number}","issue_comment_url":"https://api.github.com/repos/flynn/go-tuf/issues/comments/{number}","contents_url":"https://api.github.com/repos/flynn/go-tuf/contents/{+path}","compare_url":"https://api.github.com/repos/flynn/go-tuf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flynn/go-tuf/merges","archive_url":"https://api.github.com/repos/flynn/go-tuf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flynn/go-tuf/downloads","issues_url":"https://api.github.com/repos/flynn/go-tuf/issues{/number}","pulls_url":"https://api.github.com/repos/flynn/go-tuf/pulls{/number}","milestones_url":"https://api.github.com/repos/flynn/go-tuf/milestones{/number}","notifications_url":"https://api.github.com/repos/flynn/go-tuf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flynn/go-tuf/labels{/name}","releases_url":"https://api.github.com/repos/flynn/go-tuf/releases{/id}","created_at":"2014-12-12T03:31:16Z","updated_at":"2014-12-31T21:17:55Z","pushed_at":"2015-01-02T19:35:10Z","git_url":"git://github.com/flynn/go-tuf.git","ssh_url":"git@github.com:flynn/go-tuf.git","clone_url":"https://github.com/flynn/go-tuf.git","svn_url":"https://github.com/flynn/go-tuf","homepage":"http://theupdateframework.com/","size":336,"stargazers_count":38,"watchers_count":38,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flynn/go-tuf/pulls/19"},"html":{"href":"https://github.com/flynn/go-tuf/pull/19"},"issue":{"href":"https://api.github.com/repos/flynn/go-tuf/issues/19"},"comments":{"href":"https://api.github.com/repos/flynn/go-tuf/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/flynn/go-tuf/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/flynn/go-tuf/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/flynn/go-tuf/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/flynn/go-tuf/statuses/b0dbf83993efb53e6ad3090e6f9cad13808b9f9a"}}}}