{"action":"created","comment":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/comments/69805702","id":69805702,"diff_hunk":"@@ -1316,3 +1323,42 @@ func postCreateUser(c *Command, r *http.Request, user *auth.UserState) Response\n \n \treturn SyncResponse(createResponseData, nil)\n }\n+\n+type buyResponseData struct {\n+\tState string `json:\"state,omitempty\"`\n+}\n+\n+func postBuy(c *Command, r *http.Request, user *auth.UserState) Response {\n+\tvar buyInstruction store.BuyOptions\n+\n+\tdecoder := json.NewDecoder(r.Body)\n+\terr := decoder.Decode(&buyInstruction)\n+\tif err != nil {\n+\t\treturn BadRequest(\"cannot decode buying instruction data from request body: %v\", err)\n+\t}\n+\n+\tbuyInstruction.Auther, err = c.d.auther(r)","path":"daemon/api.go","position":39,"original_position":39,"commit_id":"f972e82e378753d0d618581911f47e91323aad11","original_commit_id":"f972e82e378753d0d618581911f47e91323aad11","user":{"login":"niemeyer","id":378683,"avatar_url":"https://avatars.githubusercontent.com/u/378683?v=3","gravatar_id":"","url":"https://api.github.com/users/niemeyer","html_url":"https://github.com/niemeyer","followers_url":"https://api.github.com/users/niemeyer/followers","following_url":"https://api.github.com/users/niemeyer/following{/other_user}","gists_url":"https://api.github.com/users/niemeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/niemeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niemeyer/subscriptions","organizations_url":"https://api.github.com/users/niemeyer/orgs","repos_url":"https://api.github.com/users/niemeyer/repos","events_url":"https://api.github.com/users/niemeyer/events{/privacy}","received_events_url":"https://api.github.com/users/niemeyer/received_events","type":"User","site_admin":false},"body":"`c.d.auther` is obsolete.. we should really remove it.\r\n\r\nWe have the authenticated user at hand here:  \r\n\r\n```\r\nif user != nil {\r\n        opts.Auther = user.Authenticator()\r\n}\r\n```","created_at":"2016-07-06T20:30:24Z","updated_at":"2016-07-06T20:30:24Z","html_url":"https://github.com/snapcore/snapd/pull/1439#discussion_r69805702","pull_request_url":"https://api.github.com/repos/snapcore/snapd/pulls/1439","_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments/69805702"},"html":{"href":"https://github.com/snapcore/snapd/pull/1439#discussion_r69805702"},"pull_request":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1439"}}},"pull_request":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/1439","id":75644252,"html_url":"https://github.com/snapcore/snapd/pull/1439","diff_url":"https://github.com/snapcore/snapd/pull/1439.diff","patch_url":"https://github.com/snapcore/snapd/pull/1439.patch","issue_url":"https://api.github.com/repos/snapcore/snapd/issues/1439","number":1439,"state":"open","locked":false,"title":"daemon, overlord: add buy endpoint to REST API","user":{"login":"pete-woods","id":152569,"avatar_url":"https://avatars.githubusercontent.com/u/152569?v=3","gravatar_id":"","url":"https://api.github.com/users/pete-woods","html_url":"https://github.com/pete-woods","followers_url":"https://api.github.com/users/pete-woods/followers","following_url":"https://api.github.com/users/pete-woods/following{/other_user}","gists_url":"https://api.github.com/users/pete-woods/gists{/gist_id}","starred_url":"https://api.github.com/users/pete-woods/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pete-woods/subscriptions","organizations_url":"https://api.github.com/users/pete-woods/orgs","repos_url":"https://api.github.com/users/pete-woods/repos","events_url":"https://api.github.com/users/pete-woods/events{/privacy}","received_events_url":"https://api.github.com/users/pete-woods/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-29T13:06:20Z","updated_at":"2016-07-06T20:30:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31dd045a89375cee4bd80d3a3e506c1f5eba2df0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/snapcore/snapd/pulls/1439/commits","review_comments_url":"https://api.github.com/repos/snapcore/snapd/pulls/1439/comments","review_comment_url":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snapcore/snapd/issues/1439/comments","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/f972e82e378753d0d618581911f47e91323aad11","head":{"label":"pete-woods:buy-rest-api","ref":"buy-rest-api","sha":"f972e82e378753d0d618581911f47e91323aad11","user":{"login":"pete-woods","id":152569,"avatar_url":"https://avatars.githubusercontent.com/u/152569?v=3","gravatar_id":"","url":"https://api.github.com/users/pete-woods","html_url":"https://github.com/pete-woods","followers_url":"https://api.github.com/users/pete-woods/followers","following_url":"https://api.github.com/users/pete-woods/following{/other_user}","gists_url":"https://api.github.com/users/pete-woods/gists{/gist_id}","starred_url":"https://api.github.com/users/pete-woods/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pete-woods/subscriptions","organizations_url":"https://api.github.com/users/pete-woods/orgs","repos_url":"https://api.github.com/users/pete-woods/repos","events_url":"https://api.github.com/users/pete-woods/events{/privacy}","received_events_url":"https://api.github.com/users/pete-woods/received_events","type":"User","site_admin":false},"repo":{"id":51448306,"name":"snapd","full_name":"pete-woods/snapd","owner":{"login":"pete-woods","id":152569,"avatar_url":"https://avatars.githubusercontent.com/u/152569?v=3","gravatar_id":"","url":"https://api.github.com/users/pete-woods","html_url":"https://github.com/pete-woods","followers_url":"https://api.github.com/users/pete-woods/followers","following_url":"https://api.github.com/users/pete-woods/following{/other_user}","gists_url":"https://api.github.com/users/pete-woods/gists{/gist_id}","starred_url":"https://api.github.com/users/pete-woods/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pete-woods/subscriptions","organizations_url":"https://api.github.com/users/pete-woods/orgs","repos_url":"https://api.github.com/users/pete-woods/repos","events_url":"https://api.github.com/users/pete-woods/events{/privacy}","received_events_url":"https://api.github.com/users/pete-woods/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pete-woods/snapd","description":"Snappy is the software at the heart of Ubuntu Core.","fork":true,"url":"https://api.github.com/repos/pete-woods/snapd","forks_url":"https://api.github.com/repos/pete-woods/snapd/forks","keys_url":"https://api.github.com/repos/pete-woods/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pete-woods/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pete-woods/snapd/teams","hooks_url":"https://api.github.com/repos/pete-woods/snapd/hooks","issue_events_url":"https://api.github.com/repos/pete-woods/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/pete-woods/snapd/events","assignees_url":"https://api.github.com/repos/pete-woods/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/pete-woods/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/pete-woods/snapd/tags","blobs_url":"https://api.github.com/repos/pete-woods/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pete-woods/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pete-woods/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/pete-woods/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pete-woods/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/pete-woods/snapd/languages","stargazers_url":"https://api.github.com/repos/pete-woods/snapd/stargazers","contributors_url":"https://api.github.com/repos/pete-woods/snapd/contributors","subscribers_url":"https://api.github.com/repos/pete-woods/snapd/subscribers","subscription_url":"https://api.github.com/repos/pete-woods/snapd/subscription","commits_url":"https://api.github.com/repos/pete-woods/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/pete-woods/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/pete-woods/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/pete-woods/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/pete-woods/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/pete-woods/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pete-woods/snapd/merges","archive_url":"https://api.github.com/repos/pete-woods/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pete-woods/snapd/downloads","issues_url":"https://api.github.com/repos/pete-woods/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/pete-woods/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/pete-woods/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/pete-woods/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pete-woods/snapd/labels{/name}","releases_url":"https://api.github.com/repos/pete-woods/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/pete-woods/snapd/deployments","created_at":"2016-02-10T15:05:48Z","updated_at":"2016-05-25T07:36:15Z","pushed_at":"2016-07-06T13:52:39Z","git_url":"git://github.com/pete-woods/snapd.git","ssh_url":"git@github.com:pete-woods/snapd.git","clone_url":"https://github.com/pete-woods/snapd.git","svn_url":"https://github.com/pete-woods/snapd","homepage":null,"size":32030,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"snapcore:master","ref":"master","sha":"c2c2358f1f090f12d819791ea54db31ddca23516","user":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"repo":{"id":44672744,"name":"snapd","full_name":"snapcore/snapd","owner":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars.githubusercontent.com/u/19532717?v=3","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/snapcore/snapd","description":"The snapd and snap tools enable systems to work with .snap files.","fork":false,"url":"https://api.github.com/repos/snapcore/snapd","forks_url":"https://api.github.com/repos/snapcore/snapd/forks","keys_url":"https://api.github.com/repos/snapcore/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snapcore/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snapcore/snapd/teams","hooks_url":"https://api.github.com/repos/snapcore/snapd/hooks","issue_events_url":"https://api.github.com/repos/snapcore/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/snapcore/snapd/events","assignees_url":"https://api.github.com/repos/snapcore/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/snapcore/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/snapcore/snapd/tags","blobs_url":"https://api.github.com/repos/snapcore/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snapcore/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snapcore/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/snapcore/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/snapcore/snapd/languages","stargazers_url":"https://api.github.com/repos/snapcore/snapd/stargazers","contributors_url":"https://api.github.com/repos/snapcore/snapd/contributors","subscribers_url":"https://api.github.com/repos/snapcore/snapd/subscribers","subscription_url":"https://api.github.com/repos/snapcore/snapd/subscription","commits_url":"https://api.github.com/repos/snapcore/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/snapcore/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/snapcore/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/snapcore/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/snapcore/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/snapcore/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snapcore/snapd/merges","archive_url":"https://api.github.com/repos/snapcore/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snapcore/snapd/downloads","issues_url":"https://api.github.com/repos/snapcore/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/snapcore/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/snapcore/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/snapcore/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snapcore/snapd/labels{/name}","releases_url":"https://api.github.com/repos/snapcore/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/snapcore/snapd/deployments","created_at":"2015-10-21T11:51:46Z","updated_at":"2016-07-06T07:40:31Z","pushed_at":"2016-07-06T20:21:08Z","git_url":"git://github.com/snapcore/snapd.git","ssh_url":"git@github.com:snapcore/snapd.git","clone_url":"https://github.com/snapcore/snapd.git","svn_url":"https://github.com/snapcore/snapd","homepage":"","size":33950,"stargazers_count":345,"watchers_count":345,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":67,"mirror_url":null,"open_issues_count":27,"forks":67,"open_issues":27,"watchers":345,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1439"},"html":{"href":"https://github.com/snapcore/snapd/pull/1439"},"issue":{"href":"https://api.github.com/repos/snapcore/snapd/issues/1439"},"comments":{"href":"https://api.github.com/repos/snapcore/snapd/issues/1439/comments"},"review_comments":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1439/comments"},"review_comment":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/1439/commits"},"statuses":{"href":"https://api.github.com/repos/snapcore/snapd/statuses/f972e82e378753d0d618581911f47e91323aad11"}}}}
{"actor":{"display_login":"niemeyer"}}