{"action":"created","comment":{"url":"https://api.github.com/repos/juju/charmstore/pulls/comments/191671983","pull_request_review_id":124280286,"id":191671983,"diff_hunk":"@@ -119,16 +126,29 @@ func (h *Handler) Token(p httprequest.Params, req *tokenRequest) (*tokenResponse\n \t\t\tExpiresAt: expiresAt.Unix(),\n \t\t\tIssuedAt:  issuedAt.Unix(),\n \t\t\tNotBefore: issuedAt.Unix(),\n-\t\t\tIssuer:    h.Location,\n+\t\t\tIssuer:    issuer,\n \t\t},\n \t\tAccess: ras,\n \t}\n-\ttok, err := jwt.NewWithClaims(jwt.SigningMethodRS256, claims).SignedString(h.Key)\n+\tvar sm jwt.SigningMethod\n+\tswitch h.Key.(type) {\n+\tcase *ecdsa.PrivateKey:\n+\t\tsm = jwt.SigningMethodES256\n+\tcase *rsa.PrivateKey:\n+\t\tsm = jwt.SigningMethodRS256\n+\t}\n+\ttok := jwt.NewWithClaims(sm, claims)\n+\tcerts := make([]string, len(h.Certs))\n+\tfor i, c := range h.Certs {\n+\t\tcerts[i] = base64.StdEncoding.EncodeToString(c.Raw)\n+\t}\n+\ttok.Header[\"x5c\"] = certs","path":"internal/dockerauth/api.go","position":61,"original_position":61,"commit_id":"1be08f69323bbbfd11906f6ea57417b386ff89d8","original_commit_id":"1be08f69323bbbfd11906f6ea57417b386ff89d8","user":{"login":"urosj","id":8036113,"avatar_url":"https://avatars1.githubusercontent.com/u/8036113?v=4","gravatar_id":"","url":"https://api.github.com/users/urosj","html_url":"https://github.com/urosj","followers_url":"https://api.github.com/users/urosj/followers","following_url":"https://api.github.com/users/urosj/following{/other_user}","gists_url":"https://api.github.com/users/urosj/gists{/gist_id}","starred_url":"https://api.github.com/users/urosj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urosj/subscriptions","organizations_url":"https://api.github.com/users/urosj/orgs","repos_url":"https://api.github.com/users/urosj/repos","events_url":"https://api.github.com/users/urosj/events{/privacy}","received_events_url":"https://api.github.com/users/urosj/received_events","type":"User","site_admin":false},"body":"Please make a comment in code why this header is required.","created_at":"2018-05-30T07:51:30Z","updated_at":"2018-05-30T07:56:04Z","html_url":"https://github.com/juju/charmstore/pull/798#discussion_r191671983","pull_request_url":"https://api.github.com/repos/juju/charmstore/pulls/798","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/juju/charmstore/pulls/comments/191671983"},"html":{"href":"https://github.com/juju/charmstore/pull/798#discussion_r191671983"},"pull_request":{"href":"https://api.github.com/repos/juju/charmstore/pulls/798"}}},"pull_request":{"url":"https://api.github.com/repos/juju/charmstore/pulls/798","id":191355971,"html_url":"https://github.com/juju/charmstore/pull/798","diff_url":"https://github.com/juju/charmstore/pull/798.diff","patch_url":"https://github.com/juju/charmstore/pull/798.patch","issue_url":"https://api.github.com/repos/juju/charmstore/issues/798","number":798,"state":"open","locked":false,"title":"cmd/charmd: enable docker-registry auth API support","user":{"login":"mhilton","id":1136018,"avatar_url":"https://avatars3.githubusercontent.com/u/1136018?v=4","gravatar_id":"","url":"https://api.github.com/users/mhilton","html_url":"https://github.com/mhilton","followers_url":"https://api.github.com/users/mhilton/followers","following_url":"https://api.github.com/users/mhilton/following{/other_user}","gists_url":"https://api.github.com/users/mhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/mhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhilton/subscriptions","organizations_url":"https://api.github.com/users/mhilton/orgs","repos_url":"https://api.github.com/users/mhilton/repos","events_url":"https://api.github.com/users/mhilton/events{/privacy}","received_events_url":"https://api.github.com/users/mhilton/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-30T07:20:48Z","updated_at":"2018-05-30T07:56:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6333501f8710202e96d88a94f12c1989a47053b4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/juju/charmstore/pulls/798/commits","review_comments_url":"https://api.github.com/repos/juju/charmstore/pulls/798/comments","review_comment_url":"https://api.github.com/repos/juju/charmstore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/charmstore/issues/798/comments","statuses_url":"https://api.github.com/repos/juju/charmstore/statuses/1be08f69323bbbfd11906f6ea57417b386ff89d8","head":{"label":"mhilton:081-charmd-docker-registry","ref":"081-charmd-docker-registry","sha":"1be08f69323bbbfd11906f6ea57417b386ff89d8","user":{"login":"mhilton","id":1136018,"avatar_url":"https://avatars3.githubusercontent.com/u/1136018?v=4","gravatar_id":"","url":"https://api.github.com/users/mhilton","html_url":"https://github.com/mhilton","followers_url":"https://api.github.com/users/mhilton/followers","following_url":"https://api.github.com/users/mhilton/following{/other_user}","gists_url":"https://api.github.com/users/mhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/mhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhilton/subscriptions","organizations_url":"https://api.github.com/users/mhilton/orgs","repos_url":"https://api.github.com/users/mhilton/repos","events_url":"https://api.github.com/users/mhilton/events{/privacy}","received_events_url":"https://api.github.com/users/mhilton/received_events","type":"User","site_admin":false},"repo":{"id":24229515,"name":"juju-charmstore","full_name":"mhilton/juju-charmstore","owner":{"login":"mhilton","id":1136018,"avatar_url":"https://avatars3.githubusercontent.com/u/1136018?v=4","gravatar_id":"","url":"https://api.github.com/users/mhilton","html_url":"https://github.com/mhilton","followers_url":"https://api.github.com/users/mhilton/followers","following_url":"https://api.github.com/users/mhilton/following{/other_user}","gists_url":"https://api.github.com/users/mhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/mhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhilton/subscriptions","organizations_url":"https://api.github.com/users/mhilton/orgs","repos_url":"https://api.github.com/users/mhilton/repos","events_url":"https://api.github.com/users/mhilton/events{/privacy}","received_events_url":"https://api.github.com/users/mhilton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mhilton/juju-charmstore","description":"The charm store server.","fork":true,"url":"https://api.github.com/repos/mhilton/juju-charmstore","forks_url":"https://api.github.com/repos/mhilton/juju-charmstore/forks","keys_url":"https://api.github.com/repos/mhilton/juju-charmstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mhilton/juju-charmstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mhilton/juju-charmstore/teams","hooks_url":"https://api.github.com/repos/mhilton/juju-charmstore/hooks","issue_events_url":"https://api.github.com/repos/mhilton/juju-charmstore/issues/events{/number}","events_url":"https://api.github.com/repos/mhilton/juju-charmstore/events","assignees_url":"https://api.github.com/repos/mhilton/juju-charmstore/assignees{/user}","branches_url":"https://api.github.com/repos/mhilton/juju-charmstore/branches{/branch}","tags_url":"https://api.github.com/repos/mhilton/juju-charmstore/tags","blobs_url":"https://api.github.com/repos/mhilton/juju-charmstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mhilton/juju-charmstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mhilton/juju-charmstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/mhilton/juju-charmstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mhilton/juju-charmstore/statuses/{sha}","languages_url":"https://api.github.com/repos/mhilton/juju-charmstore/languages","stargazers_url":"https://api.github.com/repos/mhilton/juju-charmstore/stargazers","contributors_url":"https://api.github.com/repos/mhilton/juju-charmstore/contributors","subscribers_url":"https://api.github.com/repos/mhilton/juju-charmstore/subscribers","subscription_url":"https://api.github.com/repos/mhilton/juju-charmstore/subscription","commits_url":"https://api.github.com/repos/mhilton/juju-charmstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/mhilton/juju-charmstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/mhilton/juju-charmstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/mhilton/juju-charmstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/mhilton/juju-charmstore/contents/{+path}","compare_url":"https://api.github.com/repos/mhilton/juju-charmstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mhilton/juju-charmstore/merges","archive_url":"https://api.github.com/repos/mhilton/juju-charmstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mhilton/juju-charmstore/downloads","issues_url":"https://api.github.com/repos/mhilton/juju-charmstore/issues{/number}","pulls_url":"https://api.github.com/repos/mhilton/juju-charmstore/pulls{/number}","milestones_url":"https://api.github.com/repos/mhilton/juju-charmstore/milestones{/number}","notifications_url":"https://api.github.com/repos/mhilton/juju-charmstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mhilton/juju-charmstore/labels{/name}","releases_url":"https://api.github.com/repos/mhilton/juju-charmstore/releases{/id}","deployments_url":"https://api.github.com/repos/mhilton/juju-charmstore/deployments","created_at":"2014-09-19T12:48:28Z","updated_at":"2015-11-09T16:16:46Z","pushed_at":"2018-05-30T07:16:03Z","git_url":"git://github.com/mhilton/juju-charmstore.git","ssh_url":"git@github.com:mhilton/juju-charmstore.git","clone_url":"https://github.com/mhilton/juju-charmstore.git","svn_url":"https://github.com/mhilton/juju-charmstore","homepage":null,"size":5606,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"v4"}},"base":{"label":"juju:v5","ref":"v5","sha":"b16bf82852048c39afb65b90490d1aa742e7f86c","user":{"login":"juju","id":4604548,"avatar_url":"https://avatars0.githubusercontent.com/u/4604548?v=4","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"repo":{"id":20720417,"name":"charmstore","full_name":"juju/charmstore","owner":{"login":"juju","id":4604548,"avatar_url":"https://avatars0.githubusercontent.com/u/4604548?v=4","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juju/charmstore","description":"The charm store server.","fork":false,"url":"https://api.github.com/repos/juju/charmstore","forks_url":"https://api.github.com/repos/juju/charmstore/forks","keys_url":"https://api.github.com/repos/juju/charmstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju/charmstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju/charmstore/teams","hooks_url":"https://api.github.com/repos/juju/charmstore/hooks","issue_events_url":"https://api.github.com/repos/juju/charmstore/issues/events{/number}","events_url":"https://api.github.com/repos/juju/charmstore/events","assignees_url":"https://api.github.com/repos/juju/charmstore/assignees{/user}","branches_url":"https://api.github.com/repos/juju/charmstore/branches{/branch}","tags_url":"https://api.github.com/repos/juju/charmstore/tags","blobs_url":"https://api.github.com/repos/juju/charmstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju/charmstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju/charmstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju/charmstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju/charmstore/statuses/{sha}","languages_url":"https://api.github.com/repos/juju/charmstore/languages","stargazers_url":"https://api.github.com/repos/juju/charmstore/stargazers","contributors_url":"https://api.github.com/repos/juju/charmstore/contributors","subscribers_url":"https://api.github.com/repos/juju/charmstore/subscribers","subscription_url":"https://api.github.com/repos/juju/charmstore/subscription","commits_url":"https://api.github.com/repos/juju/charmstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju/charmstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju/charmstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju/charmstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju/charmstore/contents/{+path}","compare_url":"https://api.github.com/repos/juju/charmstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju/charmstore/merges","archive_url":"https://api.github.com/repos/juju/charmstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju/charmstore/downloads","issues_url":"https://api.github.com/repos/juju/charmstore/issues{/number}","pulls_url":"https://api.github.com/repos/juju/charmstore/pulls{/number}","milestones_url":"https://api.github.com/repos/juju/charmstore/milestones{/number}","notifications_url":"https://api.github.com/repos/juju/charmstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju/charmstore/labels{/name}","releases_url":"https://api.github.com/repos/juju/charmstore/releases{/id}","deployments_url":"https://api.github.com/repos/juju/charmstore/deployments","created_at":"2014-06-11T09:53:37Z","updated_at":"2018-05-29T11:32:13Z","pushed_at":"2018-05-30T07:20:49Z","git_url":"git://github.com/juju/charmstore.git","ssh_url":"git@github.com:juju/charmstore.git","clone_url":"https://github.com/juju/charmstore.git","svn_url":"https://github.com/juju/charmstore","homepage":"http://gopkg.in/juju/charmstore.v5-unstable","size":5614,"stargazers_count":11,"watchers_count":11,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"archived":false,"open_issues_count":60,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":27,"open_issues":60,"watchers":11,"default_branch":"v5"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/charmstore/pulls/798"},"html":{"href":"https://github.com/juju/charmstore/pull/798"},"issue":{"href":"https://api.github.com/repos/juju/charmstore/issues/798"},"comments":{"href":"https://api.github.com/repos/juju/charmstore/issues/798/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/charmstore/pulls/798/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/charmstore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/charmstore/pulls/798/commits"},"statuses":{"href":"https://api.github.com/repos/juju/charmstore/statuses/1be08f69323bbbfd11906f6ea57417b386ff89d8"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"urosj"}}