{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/autopush/pulls/comments/69759223","id":69759223,"diff_hunk":"@@ -649,12 +649,11 @@ def post(self, router_type=\"\", router_token=\"\", uaid=\"\", chid=\"\"):\n             return self._write_response(\n                 400, 108, message=\"Invalid router\")\n         router = self.ap_settings.routers[router_type]\n-        valid, router_token = router.check_token(router_token)\n+        relo_url = self._relocate(router_type, uaid, chid)\n+        valid, writer = router.check_token(router_token, self._write_response,","path":"autopush/endpoint.py","position":19,"original_position":19,"commit_id":"b2d29c7d84a05ca1d6e098f543680cb2eba12633","original_commit_id":"b2d29c7d84a05ca1d6e098f543680cb2eba12633","user":{"login":"bbangert","id":100193,"avatar_url":"https://avatars.githubusercontent.com/u/100193?v=3","gravatar_id":"","url":"https://api.github.com/users/bbangert","html_url":"https://github.com/bbangert","followers_url":"https://api.github.com/users/bbangert/followers","following_url":"https://api.github.com/users/bbangert/following{/other_user}","gists_url":"https://api.github.com/users/bbangert/gists{/gist_id}","starred_url":"https://api.github.com/users/bbangert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbangert/subscriptions","organizations_url":"https://api.github.com/users/bbangert/orgs","repos_url":"https://api.github.com/users/bbangert/repos","events_url":"https://api.github.com/users/bbangert/events{/privacy}","received_events_url":"https://api.github.com/users/bbangert/received_events","type":"User","site_admin":false},"body":"I'm very nervous about inverting control of output writing to a router interface function. It drops the separation of responsibility for what chunk of code is responsible for which portion of the process.","created_at":"2016-07-06T15:58:50Z","updated_at":"2016-07-06T15:58:51Z","html_url":"https://github.com/mozilla-services/autopush/pull/504#discussion_r69759223","pull_request_url":"https://api.github.com/repos/mozilla-services/autopush/pulls/504","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/comments/69759223"},"html":{"href":"https://github.com/mozilla-services/autopush/pull/504#discussion_r69759223"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/504"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/autopush/pulls/504","id":76045477,"html_url":"https://github.com/mozilla-services/autopush/pull/504","diff_url":"https://github.com/mozilla-services/autopush/pull/504.diff","patch_url":"https://github.com/mozilla-services/autopush/pull/504.patch","issue_url":"https://api.github.com/repos/mozilla-services/autopush/issues/504","number":504,"state":"open","locked":false,"title":"feat: change how bad bridge tokens are handled","user":{"login":"jrconlin","id":35755,"avatar_url":"https://avatars.githubusercontent.com/u/35755?v=3","gravatar_id":"","url":"https://api.github.com/users/jrconlin","html_url":"https://github.com/jrconlin","followers_url":"https://api.github.com/users/jrconlin/followers","following_url":"https://api.github.com/users/jrconlin/following{/other_user}","gists_url":"https://api.github.com/users/jrconlin/gists{/gist_id}","starred_url":"https://api.github.com/users/jrconlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrconlin/subscriptions","organizations_url":"https://api.github.com/users/jrconlin/orgs","repos_url":"https://api.github.com/users/jrconlin/repos","events_url":"https://api.github.com/users/jrconlin/events{/privacy}","received_events_url":"https://api.github.com/users/jrconlin/received_events","type":"User","site_admin":false},"body":"Refactored things a bit to have router.check_token write out the\r\nresponse. Added comment to discuss how clients fail on non 200, since\r\nGCM may allow senderID swapping again in the future, or a new bridge\r\nallows for token exchange.\r\n\r\nAlso changed up the relocation URL to be a bit more generic and handled\r\nby the check_token function.\r\n\r\ncloses #486 \r\n\r\n@bbangert r?","created_at":"2016-07-01T22:47:39Z","updated_at":"2016-07-06T15:58:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3f16ad5ce41e746f4b37c5261fc3bb22e816acf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-services/autopush/pulls/504/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/autopush/pulls/504/comments","review_comment_url":"https://api.github.com/repos/mozilla-services/autopush/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-services/autopush/issues/504/comments","statuses_url":"https://api.github.com/repos/mozilla-services/autopush/statuses/b2d29c7d84a05ca1d6e098f543680cb2eba12633","head":{"label":"mozilla-services:bug/486","ref":"bug/486","sha":"b2d29c7d84a05ca1d6e098f543680cb2eba12633","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":31746003,"name":"autopush","full_name":"mozilla-services/autopush","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/autopush","description":"Python Web Push Server used by Mozilla","fork":false,"url":"https://api.github.com/repos/mozilla-services/autopush","forks_url":"https://api.github.com/repos/mozilla-services/autopush/forks","keys_url":"https://api.github.com/repos/mozilla-services/autopush/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/autopush/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/autopush/teams","hooks_url":"https://api.github.com/repos/mozilla-services/autopush/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/autopush/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/autopush/events","assignees_url":"https://api.github.com/repos/mozilla-services/autopush/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/autopush/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/autopush/tags","blobs_url":"https://api.github.com/repos/mozilla-services/autopush/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/autopush/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/autopush/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/autopush/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/autopush/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/autopush/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/autopush/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/autopush/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/autopush/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/autopush/subscription","commits_url":"https://api.github.com/repos/mozilla-services/autopush/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/autopush/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/autopush/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/autopush/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/autopush/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/autopush/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/autopush/merges","archive_url":"https://api.github.com/repos/mozilla-services/autopush/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/autopush/downloads","issues_url":"https://api.github.com/repos/mozilla-services/autopush/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/autopush/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/autopush/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/autopush/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/autopush/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/autopush/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-services/autopush/deployments","created_at":"2015-03-06T01:19:24Z","updated_at":"2016-07-04T16:23:04Z","pushed_at":"2016-07-05T16:53:45Z","git_url":"git://github.com/mozilla-services/autopush.git","ssh_url":"git@github.com:mozilla-services/autopush.git","clone_url":"https://github.com/mozilla-services/autopush.git","svn_url":"https://github.com/mozilla-services/autopush","homepage":"https://autopush.readthedocs.io/","size":2041,"stargazers_count":50,"watchers_count":50,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":30,"forks":13,"open_issues":30,"watchers":50,"default_branch":"master"}},"base":{"label":"mozilla-services:master","ref":"master","sha":"338e8da47dd8fe7a3590b9ac733836b8e5e100aa","user":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"repo":{"id":31746003,"name":"autopush","full_name":"mozilla-services/autopush","owner":{"login":"mozilla-services","id":1066228,"avatar_url":"https://avatars.githubusercontent.com/u/1066228?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-services","html_url":"https://github.com/mozilla-services","followers_url":"https://api.github.com/users/mozilla-services/followers","following_url":"https://api.github.com/users/mozilla-services/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-services/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-services/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-services/subscriptions","organizations_url":"https://api.github.com/users/mozilla-services/orgs","repos_url":"https://api.github.com/users/mozilla-services/repos","events_url":"https://api.github.com/users/mozilla-services/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-services/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-services/autopush","description":"Python Web Push Server used by Mozilla","fork":false,"url":"https://api.github.com/repos/mozilla-services/autopush","forks_url":"https://api.github.com/repos/mozilla-services/autopush/forks","keys_url":"https://api.github.com/repos/mozilla-services/autopush/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-services/autopush/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-services/autopush/teams","hooks_url":"https://api.github.com/repos/mozilla-services/autopush/hooks","issue_events_url":"https://api.github.com/repos/mozilla-services/autopush/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-services/autopush/events","assignees_url":"https://api.github.com/repos/mozilla-services/autopush/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-services/autopush/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-services/autopush/tags","blobs_url":"https://api.github.com/repos/mozilla-services/autopush/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-services/autopush/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-services/autopush/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-services/autopush/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-services/autopush/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-services/autopush/languages","stargazers_url":"https://api.github.com/repos/mozilla-services/autopush/stargazers","contributors_url":"https://api.github.com/repos/mozilla-services/autopush/contributors","subscribers_url":"https://api.github.com/repos/mozilla-services/autopush/subscribers","subscription_url":"https://api.github.com/repos/mozilla-services/autopush/subscription","commits_url":"https://api.github.com/repos/mozilla-services/autopush/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-services/autopush/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-services/autopush/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-services/autopush/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-services/autopush/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-services/autopush/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-services/autopush/merges","archive_url":"https://api.github.com/repos/mozilla-services/autopush/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-services/autopush/downloads","issues_url":"https://api.github.com/repos/mozilla-services/autopush/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-services/autopush/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-services/autopush/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-services/autopush/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-services/autopush/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-services/autopush/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-services/autopush/deployments","created_at":"2015-03-06T01:19:24Z","updated_at":"2016-07-04T16:23:04Z","pushed_at":"2016-07-05T16:53:45Z","git_url":"git://github.com/mozilla-services/autopush.git","ssh_url":"git@github.com:mozilla-services/autopush.git","clone_url":"https://github.com/mozilla-services/autopush.git","svn_url":"https://github.com/mozilla-services/autopush","homepage":"https://autopush.readthedocs.io/","size":2041,"stargazers_count":50,"watchers_count":50,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":30,"forks":13,"open_issues":30,"watchers":50,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/504"},"html":{"href":"https://github.com/mozilla-services/autopush/pull/504"},"issue":{"href":"https://api.github.com/repos/mozilla-services/autopush/issues/504"},"comments":{"href":"https://api.github.com/repos/mozilla-services/autopush/issues/504/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/504/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/504/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/autopush/statuses/b2d29c7d84a05ca1d6e098f543680cb2eba12633"}}}}
{"actor":{"display_login":"bbangert"}}