GitHub PullRequestReviewCommentEvent at 2014-06-24 10:10:43
Repository: macaroon
Actor: rogpeppe
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/rogpeppe/macaroon/pulls/comments/14121598","id":14121598,"diff_hunk":"@@ -211,6 +255,52 @@ func (m *Macaroon) verify(rootSig []byte, rootKey []byte, check func(caveat stri\n \treturn true, nil\n }\n \n+// Implement Marshaler\n+func (m *Macaroon) MarshalJSON() ([]byte, error) {\n+\tmjson := macaroonJSON{}\n+\tmjson.Location = m.Location()\n+\tmjson.Identifier = hex.EncodeToString(m.Id())\n+\tmjson.Signature = hex.EncodeToString(m.Signature())\n+\tmjson.Caveats = make([]caveatJSON, 0, len(m.caveats))\n+\tfor _, cav := range m.caveats {\n+\t\tcavJSON := caveatJSON{\n+\t\t\tLocation: cav.location,\n+\t\t\tCID:      hex.EncodeToString(cav.caveatId),\n+\t\t\tVID:      hex.EncodeToString(cav.verificationId)}\n+\t\tmjson.Caveats = append(mjson.Caveats, cavJSON)\n+\t}\n+\tdata, err := json.Marshal(mjson)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\treturn data, nil\n+}\n+\n+// Implement Unmarshaler\n+func (m *Macaroon) UnmarshalJSON(jsonData []byte) error {\n+\tmjson := macaroonJSON{}\n+\terr := json.Unmarshal(jsonData, &mjson)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tm.location = mjson.Location\n+\tm.id, err = hex.DecodeString(mjson.Identifier)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tm.sig, err = hex.DecodeString(mjson.Signature)\n+\tif err != nil {\n+\t\treturn err","path":"macaroon.go","position":141,"original_position":141,"commit_id":"097407d47df64013cf325e6dd319ea5ca51fc2e4","original_commit_id":"097407d47df64013cf325e6dd319ea5ca51fc2e4","user":{"login":"rogpeppe","id":66491,"avatar_url":"https://avatars.githubusercontent.com/u/66491?","gravatar_id":"e0dedec2ffb08c81d5eb0d3d8fb966d7","url":"https://api.github.com/users/rogpeppe","html_url":"https://github.com/rogpeppe","followers_url":"https://api.github.com/users/rogpeppe/followers","following_url":"https://api.github.com/users/rogpeppe/following{/other_user}","gists_url":"https://api.github.com/users/rogpeppe/gists{/gist_id}","starred_url":"https://api.github.com/users/rogpeppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogpeppe/subscriptions","organizations_url":"https://api.github.com/users/rogpeppe/orgs","repos_url":"https://api.github.com/users/rogpeppe/repos","events_url":"https://api.github.com/users/rogpeppe/events{/privacy}","received_events_url":"https://api.github.com/users/rogpeppe/received_events","type":"User","site_admin":false},"body":"return fmt.Errorf(\"cannot decode macaroon signature %q: %v\", m.id, err)","created_at":"2014-06-24T10:10:43Z","updated_at":"2014-06-24T10:10:43Z","html_url":"https://github.com/rogpeppe/macaroon/pull/1#discussion_r14121598","pull_request_url":"https://api.github.com/repos/rogpeppe/macaroon/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/rogpeppe/macaroon/pulls/comments/14121598"},"html":{"href":"https://github.com/rogpeppe/macaroon/pull/1#discussion_r14121598"},"pull_request":{"href":"https://api.github.com/repos/rogpeppe/macaroon/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/rogpeppe/macaroon/pulls/1","id":17522122,"html_url":"https://github.com/rogpeppe/macaroon/pull/1","diff_url":"https://github.com/rogpeppe/macaroon/pull/1.diff","patch_url":"https://github.com/rogpeppe/macaroon/pull/1.patch","issue_url":"https://api.github.com/repos/rogpeppe/macaroon/issues/1","number":1,"state":"open","title":"Implementing Marshaler and Unmarshaler interfaces for Macaroon and Caveat.","user":{"login":"vds","id":411489,"avatar_url":"https://avatars.githubusercontent.com/u/411489?","gravatar_id":"a0112ff31bdc0fff724c46b43ab7e387","url":"https://api.github.com/users/vds","html_url":"https://github.com/vds","followers_url":"https://api.github.com/users/vds/followers","following_url":"https://api.github.com/users/vds/following{/other_user}","gists_url":"https://api.github.com/users/vds/gists{/gist_id}","starred_url":"https://api.github.com/users/vds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vds/subscriptions","organizations_url":"https://api.github.com/users/vds/orgs","repos_url":"https://api.github.com/users/vds/repos","events_url":"https://api.github.com/users/vds/events{/privacy}","received_events_url":"https://api.github.com/users/vds/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-06-24T09:55:10Z","updated_at":"2014-06-24T10:10:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e610e88edaaa7c554a6c3372ee9051a21f6b8807","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rogpeppe/macaroon/pulls/1/commits","review_comments_url":"https://api.github.com/repos/rogpeppe/macaroon/pulls/1/comments","review_comment_url":"https://api.github.com/repos/rogpeppe/macaroon/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rogpeppe/macaroon/issues/1/comments","statuses_url":"https://api.github.com/repos/rogpeppe/macaroon/statuses/097407d47df64013cf325e6dd319ea5ca51fc2e4","head":{"label":"vds:master","ref":"master","sha":"097407d47df64013cf325e6dd319ea5ca51fc2e4","user":{"login":"vds","id":411489,"avatar_url":"https://avatars.githubusercontent.com/u/411489?","gravatar_id":"a0112ff31bdc0fff724c46b43ab7e387","url":"https://api.github.com/users/vds","html_url":"https://github.com/vds","followers_url":"https://api.github.com/users/vds/followers","following_url":"https://api.github.com/users/vds/following{/other_user}","gists_url":"https://api.github.com/users/vds/gists{/gist_id}","starred_url":"https://api.github.com/users/vds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vds/subscriptions","organizations_url":"https://api.github.com/users/vds/orgs","repos_url":"https://api.github.com/users/vds/repos","events_url":"https://api.github.com/users/vds/events{/privacy}","received_events_url":"https://api.github.com/users/vds/received_events","type":"User","site_admin":false},"repo":{"id":21121692,"name":"macaroon","full_name":"vds/macaroon","owner":{"login":"vds","id":411489,"avatar_url":"https://avatars.githubusercontent.com/u/411489?","gravatar_id":"a0112ff31bdc0fff724c46b43ab7e387","url":"https://api.github.com/users/vds","html_url":"https://github.com/vds","followers_url":"https://api.github.com/users/vds/followers","following_url":"https://api.github.com/users/vds/following{/other_user}","gists_url":"https://api.github.com/users/vds/gists{/gist_id}","starred_url":"https://api.github.com/users/vds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vds/subscriptions","organizations_url":"https://api.github.com/users/vds/orgs","repos_url":"https://api.github.com/users/vds/repos","events_url":"https://api.github.com/users/vds/events{/privacy}","received_events_url":"https://api.github.com/users/vds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vds/macaroon","description":"A native Go implementation of macaroons","fork":true,"url":"https://api.github.com/repos/vds/macaroon","forks_url":"https://api.github.com/repos/vds/macaroon/forks","keys_url":"https://api.github.com/repos/vds/macaroon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vds/macaroon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vds/macaroon/teams","hooks_url":"https://api.github.com/repos/vds/macaroon/hooks","issue_events_url":"https://api.github.com/repos/vds/macaroon/issues/events{/number}","events_url":"https://api.github.com/repos/vds/macaroon/events","assignees_url":"https://api.github.com/repos/vds/macaroon/assignees{/user}","branches_url":"https://api.github.com/repos/vds/macaroon/branches{/branch}","tags_url":"https://api.github.com/repos/vds/macaroon/tags","blobs_url":"https://api.github.com/repos/vds/macaroon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vds/macaroon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vds/macaroon/git/refs{/sha}","trees_url":"https://api.github.com/repos/vds/macaroon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vds/macaroon/statuses/{sha}","languages_url":"https://api.github.com/repos/vds/macaroon/languages","stargazers_url":"https://api.github.com/repos/vds/macaroon/stargazers","contributors_url":"https://api.github.com/repos/vds/macaroon/contributors","subscribers_url":"https://api.github.com/repos/vds/macaroon/subscribers","subscription_url":"https://api.github.com/repos/vds/macaroon/subscription","commits_url":"https://api.github.com/repos/vds/macaroon/commits{/sha}","git_commits_url":"https://api.github.com/repos/vds/macaroon/git/commits{/sha}","comments_url":"https://api.github.com/repos/vds/macaroon/comments{/number}","issue_comment_url":"https://api.github.com/repos/vds/macaroon/issues/comments/{number}","contents_url":"https://api.github.com/repos/vds/macaroon/contents/{+path}","compare_url":"https://api.github.com/repos/vds/macaroon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vds/macaroon/merges","archive_url":"https://api.github.com/repos/vds/macaroon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vds/macaroon/downloads","issues_url":"https://api.github.com/repos/vds/macaroon/issues{/number}","pulls_url":"https://api.github.com/repos/vds/macaroon/pulls{/number}","milestones_url":"https://api.github.com/repos/vds/macaroon/milestones{/number}","notifications_url":"https://api.github.com/repos/vds/macaroon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vds/macaroon/labels{/name}","releases_url":"https://api.github.com/repos/vds/macaroon/releases{/id}","created_at":"2014-06-23T10:04:52Z","updated_at":"2014-06-24T09:55:10Z","pushed_at":"2014-06-24T09:42:29Z","git_url":"git://github.com/vds/macaroon.git","ssh_url":"git@github.com:vds/macaroon.git","clone_url":"https://github.com/vds/macaroon.git","svn_url":"https://github.com/vds/macaroon","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rogpeppe:master","ref":"master","sha":"3d36f0e927058a00e2b679a8c718e0932418d9a4","user":{"login":"rogpeppe","id":66491,"avatar_url":"https://avatars.githubusercontent.com/u/66491?","gravatar_id":"e0dedec2ffb08c81d5eb0d3d8fb966d7","url":"https://api.github.com/users/rogpeppe","html_url":"https://github.com/rogpeppe","followers_url":"https://api.github.com/users/rogpeppe/followers","following_url":"https://api.github.com/users/rogpeppe/following{/other_user}","gists_url":"https://api.github.com/users/rogpeppe/gists{/gist_id}","starred_url":"https://api.github.com/users/rogpeppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogpeppe/subscriptions","organizations_url":"https://api.github.com/users/rogpeppe/orgs","repos_url":"https://api.github.com/users/rogpeppe/repos","events_url":"https://api.github.com/users/rogpeppe/events{/privacy}","received_events_url":"https://api.github.com/users/rogpeppe/received_events","type":"User","site_admin":false},"repo":{"id":20922666,"name":"macaroon","full_name":"rogpeppe/macaroon","owner":{"login":"rogpeppe","id":66491,"avatar_url":"https://avatars.githubusercontent.com/u/66491?","gravatar_id":"e0dedec2ffb08c81d5eb0d3d8fb966d7","url":"https://api.github.com/users/rogpeppe","html_url":"https://github.com/rogpeppe","followers_url":"https://api.github.com/users/rogpeppe/followers","following_url":"https://api.github.com/users/rogpeppe/following{/other_user}","gists_url":"https://api.github.com/users/rogpeppe/gists{/gist_id}","starred_url":"https://api.github.com/users/rogpeppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogpeppe/subscriptions","organizations_url":"https://api.github.com/users/rogpeppe/orgs","repos_url":"https://api.github.com/users/rogpeppe/repos","events_url":"https://api.github.com/users/rogpeppe/events{/privacy}","received_events_url":"https://api.github.com/users/rogpeppe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rogpeppe/macaroon","description":"A native Go implementation of macaroons","fork":false,"url":"https://api.github.com/repos/rogpeppe/macaroon","forks_url":"https://api.github.com/repos/rogpeppe/macaroon/forks","keys_url":"https://api.github.com/repos/rogpeppe/macaroon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rogpeppe/macaroon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rogpeppe/macaroon/teams","hooks_url":"https://api.github.com/repos/rogpeppe/macaroon/hooks","issue_events_url":"https://api.github.com/repos/rogpeppe/macaroon/issues/events{/number}","events_url":"https://api.github.com/repos/rogpeppe/macaroon/events","assignees_url":"https://api.github.com/repos/rogpeppe/macaroon/assignees{/user}","branches_url":"https://api.github.com/repos/rogpeppe/macaroon/branches{/branch}","tags_url":"https://api.github.com/repos/rogpeppe/macaroon/tags","blobs_url":"https://api.github.com/repos/rogpeppe/macaroon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rogpeppe/macaroon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rogpeppe/macaroon/git/refs{/sha}","trees_url":"https://api.github.com/repos/rogpeppe/macaroon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rogpeppe/macaroon/statuses/{sha}","languages_url":"https://api.github.com/repos/rogpeppe/macaroon/languages","stargazers_url":"https://api.github.com/repos/rogpeppe/macaroon/stargazers","contributors_url":"https://api.github.com/repos/rogpeppe/macaroon/contributors","subscribers_url":"https://api.github.com/repos/rogpeppe/macaroon/subscribers","subscription_url":"https://api.github.com/repos/rogpeppe/macaroon/subscription","commits_url":"https://api.github.com/repos/rogpeppe/macaroon/commits{/sha}","git_commits_url":"https://api.github.com/repos/rogpeppe/macaroon/git/commits{/sha}","comments_url":"https://api.github.com/repos/rogpeppe/macaroon/comments{/number}","issue_comment_url":"https://api.github.com/repos/rogpeppe/macaroon/issues/comments/{number}","contents_url":"https://api.github.com/repos/rogpeppe/macaroon/contents/{+path}","compare_url":"https://api.github.com/repos/rogpeppe/macaroon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rogpeppe/macaroon/merges","archive_url":"https://api.github.com/repos/rogpeppe/macaroon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rogpeppe/macaroon/downloads","issues_url":"https://api.github.com/repos/rogpeppe/macaroon/issues{/number}","pulls_url":"https://api.github.com/repos/rogpeppe/macaroon/pulls{/number}","milestones_url":"https://api.github.com/repos/rogpeppe/macaroon/milestones{/number}","notifications_url":"https://api.github.com/repos/rogpeppe/macaroon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rogpeppe/macaroon/labels{/name}","releases_url":"https://api.github.com/repos/rogpeppe/macaroon/releases{/id}","created_at":"2014-06-17T12:38:20Z","updated_at":"2014-06-20T06:58:57Z","pushed_at":"2014-06-17T12:43:36Z","git_url":"git://github.com/rogpeppe/macaroon.git","ssh_url":"git@github.com:rogpeppe/macaroon.git","clone_url":"https://github.com/rogpeppe/macaroon.git","svn_url":"https://github.com/rogpeppe/macaroon","homepage":null,"size":0,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rogpeppe/macaroon/pulls/1"},"html":{"href":"https://github.com/rogpeppe/macaroon/pull/1"},"issue":{"href":"https://api.github.com/repos/rogpeppe/macaroon/issues/1"},"comments":{"href":"https://api.github.com/repos/rogpeppe/macaroon/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/rogpeppe/macaroon/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/rogpeppe/macaroon/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rogpeppe/macaroon/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/rogpeppe/macaroon/statuses/097407d47df64013cf325e6dd319ea5ca51fc2e4"}}}}