GitHub PullRequestEvent at 2014-10-14 16:11:42
Repository: ruby-macaroons
Actor: ecordell
Payload: {"action":"opened","number":5,"pull_request":{"url":"https://api.github.com/repos/localmed/ruby-macaroons/pulls/5","id":22723109,"html_url":"https://github.com/localmed/ruby-macaroons/pull/5","diff_url":"https://github.com/localmed/ruby-macaroons/pull/5.diff","patch_url":"https://github.com/localmed/ruby-macaroons/pull/5.patch","issue_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/5","number":5,"state":"open","locked":false,"title":"Adds binary serialization/deserialization","user":{"login":"ecordell","id":58055,"avatar_url":"https://avatars.githubusercontent.com/u/58055?v=2","gravatar_id":"","url":"https://api.github.com/users/ecordell","html_url":"https://github.com/ecordell","followers_url":"https://api.github.com/users/ecordell/followers","following_url":"https://api.github.com/users/ecordell/following{/other_user}","gists_url":"https://api.github.com/users/ecordell/gists{/gist_id}","starred_url":"https://api.github.com/users/ecordell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecordell/subscriptions","organizations_url":"https://api.github.com/users/ecordell/orgs","repos_url":"https://api.github.com/users/ecordell/repos","events_url":"https://api.github.com/users/ecordell/events{/privacy}","received_events_url":"https://api.github.com/users/ecordell/received_events","type":"User","site_admin":false},"body":"This adds binary serialization/deserialization for macaroons. I verified that the serialized text is the same as for the python library. (A little more work should be done - serializing a macaroon with first and third party caveats and loading them into the python library along with discharge macaroons and vice-versa).\r\n\r\nWouldn't mind suggestions on the creation patterns here. The external interface is good (I think) but the internal passes a lot of nils around (I guess that's fine, though).\r\n\r\nExample:\r\n\r\n```ruby\r\nm = Macaroon.new('123', '456', 'http://localmed.com')\r\nm.add_first_party_caveat('caveat_1')\r\nm.add_third_party_caveat('caveat_key', 'caveat_id', 'http://localmed')\r\nn = Macaroon.from_binary(m.serialize)\r\nm\r\n=> #<Macaroons::Macaroon:0x007fc08d0bc368 @raw_macaroon=#<Macaroons::RawMacaroon:0x007fc08d0bc1d8 @key=\"123\", @identifier=\"456\", @location=\"http://localmed.com\", @signature=\"WE\\xFE3\\x0E=&zEFP\\xC8>,\\xE7\\xF61Nh\\xC5$\\xEC\\xA9\\xEE\\xA5\\xFD\\x90\\x82&\\xF4\\x9B\\x18\", @caveats=[#<Macaroons::Caveat:0x007fc08d0d75c8 @caveat_id=\"caveat_1\", @verification_id=nil, @caveat_location=nil>, #<Macaroons::Caveat:0x007fc08d0ec1a8 @caveat_id=\"caveat_id\", @verification_id=\"sovf8T2TAjnxWDvVFSR5MLQ1ukPwndwkTzBCjjqU6btaFAL+Y+ini3SIna1s\\nluU2c3SDRB8+GlfzJLk6fBuDcbY1vetjDLul\\n\", @caveat_location=\"http://localmed\">]>>\r\nn\r\n=> #<Macaroons::Macaroon:0x007fc08d10db00 @raw_macaroon=#<Macaroons::RawMacaroon:0x007fc08d10da60 @key=nil, @identifier=\"456\", @location=\"http://localmed.com\", @signature=\"WE\\xFE3\\x0E=&zEFP\\xC8>,\\xE7\\xF61Nh\\xC5$\\xEC\\xA9\\xEE\\xA5\\xFD\\x90\\x82&\\xF4\\x9B\\x18\", @caveats=[#<Macaroons::Caveat:0x007fc08d116958 @caveat_id=\"caveat_1\", @verification_id=nil, @caveat_location=nil>, #<Macaroons::Caveat:0x007fc08d115c88 @caveat_id=\"caveat_id\", @verification_id=\"sovf8T2TAjnxWDvVFSR5MLQ1ukPwndwkTzBCjjqU6btaFAL+Y+ini3SIna1s\\nluU2c3SDRB8+GlfzJLk6fBuDcbY1vetjDLul\\n\", @caveat_location=\"http://localmed\">]>>\r\n```\r\n\r\n@joeljames @petebrowne ","created_at":"2014-10-14T16:11:41Z","updated_at":"2014-10-14T16:11:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/localmed/ruby-macaroons/pulls/5/commits","review_comments_url":"https://api.github.com/repos/localmed/ruby-macaroons/pulls/5/comments","review_comment_url":"https://api.github.com/repos/localmed/ruby-macaroons/pulls/comments/{number}","comments_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/5/comments","statuses_url":"https://api.github.com/repos/localmed/ruby-macaroons/statuses/d5895174203260a53b47b662fec0a23dd88abdb0","head":{"label":"localmed:MR-11/binary-serialization-deserialization","ref":"MR-11/binary-serialization-deserialization","sha":"d5895174203260a53b47b662fec0a23dd88abdb0","user":{"login":"localmed","id":2736522,"avatar_url":"https://avatars.githubusercontent.com/u/2736522?v=2","gravatar_id":"","url":"https://api.github.com/users/localmed","html_url":"https://github.com/localmed","followers_url":"https://api.github.com/users/localmed/followers","following_url":"https://api.github.com/users/localmed/following{/other_user}","gists_url":"https://api.github.com/users/localmed/gists{/gist_id}","starred_url":"https://api.github.com/users/localmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/localmed/subscriptions","organizations_url":"https://api.github.com/users/localmed/orgs","repos_url":"https://api.github.com/users/localmed/repos","events_url":"https://api.github.com/users/localmed/events{/privacy}","received_events_url":"https://api.github.com/users/localmed/received_events","type":"Organization","site_admin":false},"repo":{"id":24465291,"name":"ruby-macaroons","full_name":"localmed/ruby-macaroons","owner":{"login":"localmed","id":2736522,"avatar_url":"https://avatars.githubusercontent.com/u/2736522?v=2","gravatar_id":"","url":"https://api.github.com/users/localmed","html_url":"https://github.com/localmed","followers_url":"https://api.github.com/users/localmed/followers","following_url":"https://api.github.com/users/localmed/following{/other_user}","gists_url":"https://api.github.com/users/localmed/gists{/gist_id}","starred_url":"https://api.github.com/users/localmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/localmed/subscriptions","organizations_url":"https://api.github.com/users/localmed/orgs","repos_url":"https://api.github.com/users/localmed/repos","events_url":"https://api.github.com/users/localmed/events{/privacy}","received_events_url":"https://api.github.com/users/localmed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/localmed/ruby-macaroons","description":"","fork":false,"url":"https://api.github.com/repos/localmed/ruby-macaroons","forks_url":"https://api.github.com/repos/localmed/ruby-macaroons/forks","keys_url":"https://api.github.com/repos/localmed/ruby-macaroons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/localmed/ruby-macaroons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/localmed/ruby-macaroons/teams","hooks_url":"https://api.github.com/repos/localmed/ruby-macaroons/hooks","issue_events_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/events{/number}","events_url":"https://api.github.com/repos/localmed/ruby-macaroons/events","assignees_url":"https://api.github.com/repos/localmed/ruby-macaroons/assignees{/user}","branches_url":"https://api.github.com/repos/localmed/ruby-macaroons/branches{/branch}","tags_url":"https://api.github.com/repos/localmed/ruby-macaroons/tags","blobs_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/refs{/sha}","trees_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/localmed/ruby-macaroons/statuses/{sha}","languages_url":"https://api.github.com/repos/localmed/ruby-macaroons/languages","stargazers_url":"https://api.github.com/repos/localmed/ruby-macaroons/stargazers","contributors_url":"https://api.github.com/repos/localmed/ruby-macaroons/contributors","subscribers_url":"https://api.github.com/repos/localmed/ruby-macaroons/subscribers","subscription_url":"https://api.github.com/repos/localmed/ruby-macaroons/subscription","commits_url":"https://api.github.com/repos/localmed/ruby-macaroons/commits{/sha}","git_commits_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/commits{/sha}","comments_url":"https://api.github.com/repos/localmed/ruby-macaroons/comments{/number}","issue_comment_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/comments/{number}","contents_url":"https://api.github.com/repos/localmed/ruby-macaroons/contents/{+path}","compare_url":"https://api.github.com/repos/localmed/ruby-macaroons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/localmed/ruby-macaroons/merges","archive_url":"https://api.github.com/repos/localmed/ruby-macaroons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/localmed/ruby-macaroons/downloads","issues_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues{/number}","pulls_url":"https://api.github.com/repos/localmed/ruby-macaroons/pulls{/number}","milestones_url":"https://api.github.com/repos/localmed/ruby-macaroons/milestones{/number}","notifications_url":"https://api.github.com/repos/localmed/ruby-macaroons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/localmed/ruby-macaroons/labels{/name}","releases_url":"https://api.github.com/repos/localmed/ruby-macaroons/releases{/id}","created_at":"2014-09-25T16:07:41Z","updated_at":"2014-10-02T18:54:36Z","pushed_at":"2014-10-14T16:07:11Z","git_url":"git://github.com/localmed/ruby-macaroons.git","ssh_url":"git@github.com:localmed/ruby-macaroons.git","clone_url":"https://github.com/localmed/ruby-macaroons.git","svn_url":"https://github.com/localmed/ruby-macaroons","homepage":null,"size":348,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"localmed:development","ref":"development","sha":"405189e3e10a71a61fac1e895e7520d7b19cc278","user":{"login":"localmed","id":2736522,"avatar_url":"https://avatars.githubusercontent.com/u/2736522?v=2","gravatar_id":"","url":"https://api.github.com/users/localmed","html_url":"https://github.com/localmed","followers_url":"https://api.github.com/users/localmed/followers","following_url":"https://api.github.com/users/localmed/following{/other_user}","gists_url":"https://api.github.com/users/localmed/gists{/gist_id}","starred_url":"https://api.github.com/users/localmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/localmed/subscriptions","organizations_url":"https://api.github.com/users/localmed/orgs","repos_url":"https://api.github.com/users/localmed/repos","events_url":"https://api.github.com/users/localmed/events{/privacy}","received_events_url":"https://api.github.com/users/localmed/received_events","type":"Organization","site_admin":false},"repo":{"id":24465291,"name":"ruby-macaroons","full_name":"localmed/ruby-macaroons","owner":{"login":"localmed","id":2736522,"avatar_url":"https://avatars.githubusercontent.com/u/2736522?v=2","gravatar_id":"","url":"https://api.github.com/users/localmed","html_url":"https://github.com/localmed","followers_url":"https://api.github.com/users/localmed/followers","following_url":"https://api.github.com/users/localmed/following{/other_user}","gists_url":"https://api.github.com/users/localmed/gists{/gist_id}","starred_url":"https://api.github.com/users/localmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/localmed/subscriptions","organizations_url":"https://api.github.com/users/localmed/orgs","repos_url":"https://api.github.com/users/localmed/repos","events_url":"https://api.github.com/users/localmed/events{/privacy}","received_events_url":"https://api.github.com/users/localmed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/localmed/ruby-macaroons","description":"","fork":false,"url":"https://api.github.com/repos/localmed/ruby-macaroons","forks_url":"https://api.github.com/repos/localmed/ruby-macaroons/forks","keys_url":"https://api.github.com/repos/localmed/ruby-macaroons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/localmed/ruby-macaroons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/localmed/ruby-macaroons/teams","hooks_url":"https://api.github.com/repos/localmed/ruby-macaroons/hooks","issue_events_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/events{/number}","events_url":"https://api.github.com/repos/localmed/ruby-macaroons/events","assignees_url":"https://api.github.com/repos/localmed/ruby-macaroons/assignees{/user}","branches_url":"https://api.github.com/repos/localmed/ruby-macaroons/branches{/branch}","tags_url":"https://api.github.com/repos/localmed/ruby-macaroons/tags","blobs_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/refs{/sha}","trees_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/localmed/ruby-macaroons/statuses/{sha}","languages_url":"https://api.github.com/repos/localmed/ruby-macaroons/languages","stargazers_url":"https://api.github.com/repos/localmed/ruby-macaroons/stargazers","contributors_url":"https://api.github.com/repos/localmed/ruby-macaroons/contributors","subscribers_url":"https://api.github.com/repos/localmed/ruby-macaroons/subscribers","subscription_url":"https://api.github.com/repos/localmed/ruby-macaroons/subscription","commits_url":"https://api.github.com/repos/localmed/ruby-macaroons/commits{/sha}","git_commits_url":"https://api.github.com/repos/localmed/ruby-macaroons/git/commits{/sha}","comments_url":"https://api.github.com/repos/localmed/ruby-macaroons/comments{/number}","issue_comment_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues/comments/{number}","contents_url":"https://api.github.com/repos/localmed/ruby-macaroons/contents/{+path}","compare_url":"https://api.github.com/repos/localmed/ruby-macaroons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/localmed/ruby-macaroons/merges","archive_url":"https://api.github.com/repos/localmed/ruby-macaroons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/localmed/ruby-macaroons/downloads","issues_url":"https://api.github.com/repos/localmed/ruby-macaroons/issues{/number}","pulls_url":"https://api.github.com/repos/localmed/ruby-macaroons/pulls{/number}","milestones_url":"https://api.github.com/repos/localmed/ruby-macaroons/milestones{/number}","notifications_url":"https://api.github.com/repos/localmed/ruby-macaroons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/localmed/ruby-macaroons/labels{/name}","releases_url":"https://api.github.com/repos/localmed/ruby-macaroons/releases{/id}","created_at":"2014-09-25T16:07:41Z","updated_at":"2014-10-02T18:54:36Z","pushed_at":"2014-10-14T16:07:11Z","git_url":"git://github.com/localmed/ruby-macaroons.git","ssh_url":"git@github.com:localmed/ruby-macaroons.git","clone_url":"https://github.com/localmed/ruby-macaroons.git","svn_url":"https://github.com/localmed/ruby-macaroons","homepage":null,"size":348,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/localmed/ruby-macaroons/pulls/5"},"html":{"href":"https://github.com/localmed/ruby-macaroons/pull/5"},"issue":{"href":"https://api.github.com/repos/localmed/ruby-macaroons/issues/5"},"comments":{"href":"https://api.github.com/repos/localmed/ruby-macaroons/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/localmed/ruby-macaroons/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/localmed/ruby-macaroons/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/localmed/ruby-macaroons/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/localmed/ruby-macaroons/statuses/d5895174203260a53b47b662fec0a23dd88abdb0"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":96,"deletions":2,"changed_files":3}}