{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-services/autopush/pulls/comments/46196012","id":46196012,"diff_hunk":"@@ -833,52 +1064,54 @@ def _deleteChannel(self, message, uaid, chid):\n         message.unregister_channel(uaid, chid)\n \n     def _deleteUaid(self, message, uaid, router):\n-        message.delete_all_for_user(uaid)\n-        router.drop_user(uaid)\n+        message.delete_user(uaid)\n+        if not router.drop_user(uaid):\n+            raise ItemNotFound(\"UAID not found\")\n \n     @cyclone.web.asynchronous\n-    def delete(self, combo):\n+    def delete(self, router_type=\"\", router_token=\"\", uaid=\"\", chid=\"\"):\n         \"\"\"HTTP DELETE\n \n         Invalidate a UAID (and all channels associated with it).\n \n         \"\"\"\n-        combo = combo.strip(\"/\")\n-        if \"/\" in combo:\n-            (uaid, chid) = combo.split(\"/\", 2)\n-        else:\n-            uaid = combo\n-            chid = None\n-        # what is request\n+        # what is the request\n         if not self._validate_auth(uaid):\n             return self._write_response(\n                 401, 109, message=\"Invalid Authentication\")\n+        if router_type not in self.ap_settings.routers:\n+            log.msg(\"Invalid parameters\", **self._client_info())\n+            return self._write_response(\n+                400, 108, message=\"Invalid arguments\")\n+        router = self.ap_settings.routers[router_type]\n+        (valid, router_token) = router.check_token(router_token)","path":"autopush/endpoint.py","position":779,"original_position":779,"commit_id":"e62f9440584b0c4915fc6e833acd3f6684472255","original_commit_id":"e62f9440584b0c4915fc6e833acd3f6684472255","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":"nit: parens not needed","created_at":"2015-11-30T20:08:35Z","updated_at":"2015-11-30T20:08:35Z","html_url":"https://github.com/mozilla-services/autopush/pull/256#discussion_r46196012","pull_request_url":"https://api.github.com/repos/mozilla-services/autopush/pulls/256","_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/comments/46196012"},"html":{"href":"https://github.com/mozilla-services/autopush/pull/256#discussion_r46196012"},"pull_request":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/256"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-services/autopush/pulls/256","id":51582284,"html_url":"https://github.com/mozilla-services/autopush/pull/256","diff_url":"https://github.com/mozilla-services/autopush/pull/256.diff","patch_url":"https://github.com/mozilla-services/autopush/pull/256.patch","issue_url":"https://api.github.com/repos/mozilla-services/autopush/issues/256","number":256,"state":"open","locked":false,"title":"Feature/new http","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":"This PR replaces the previous HTTP Bridge API with a new, optimized version. Auth has been converted to a Bearer Token based mechanism for Bridging clients. See (api/endpoint docs for a full description of the API) In addition, the endpoint docs have been cleaned up a bit and made more visible from the top page.\r\n\r\nThis PR closes the following issues: #238, #250, #251, #215 \r\n\r\n@bbangert, @ncalexan r?\r\n","created_at":"2015-11-23T21:24:26Z","updated_at":"2015-11-30T20:08:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d649219ae99972c3be1c126bf9a110d444bafb0","assignee":{"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},"milestone":{"url":"https://api.github.com/repos/mozilla-services/autopush/milestones/9","html_url":"https://github.com/mozilla-services/autopush/milestones/PUSHSVC-2:%20Push%20Service%20Support%20for%20GCM%20Bridge","labels_url":"https://api.github.com/repos/mozilla-services/autopush/milestones/9/labels","id":1369357,"number":9,"title":"PUSHSVC-2: Push Service Support for GCM Bridge","description":"https://mozilla.aha.io/features/PUSHSVC-2","creator":{"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},"open_issues":2,"closed_issues":9,"state":"open","created_at":"2015-10-21T22:36:46Z","updated_at":"2015-11-23T21:44:53Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mozilla-services/autopush/pulls/256/commits","review_comments_url":"https://api.github.com/repos/mozilla-services/autopush/pulls/256/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/256/comments","statuses_url":"https://api.github.com/repos/mozilla-services/autopush/statuses/e62f9440584b0c4915fc6e833acd3f6684472255","head":{"label":"mozilla-services:feature/new_http","ref":"feature/new_http","sha":"e62f9440584b0c4915fc6e833acd3f6684472255","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 Push Server","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}","created_at":"2015-03-06T01:19:24Z","updated_at":"2015-10-27T23:57:47Z","pushed_at":"2015-11-24T19:33:17Z","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":"http://autopush.readthedocs.org/","size":969,"stargazers_count":16,"watchers_count":16,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":26,"forks":3,"open_issues":26,"watchers":16,"default_branch":"master"}},"base":{"label":"mozilla-services:master","ref":"master","sha":"3f4fb1151868ac3c1a7199ea48a67043c714d8ce","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 Push Server","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}","created_at":"2015-03-06T01:19:24Z","updated_at":"2015-10-27T23:57:47Z","pushed_at":"2015-11-24T19:33:17Z","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":"http://autopush.readthedocs.org/","size":969,"stargazers_count":16,"watchers_count":16,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":26,"forks":3,"open_issues":26,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/256"},"html":{"href":"https://github.com/mozilla-services/autopush/pull/256"},"issue":{"href":"https://api.github.com/repos/mozilla-services/autopush/issues/256"},"comments":{"href":"https://api.github.com/repos/mozilla-services/autopush/issues/256/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-services/autopush/pulls/256/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/256/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-services/autopush/statuses/e62f9440584b0c4915fc6e833acd3f6684472255"}}}}