GitHub PullRequestReviewCommentEvent at 2014-06-16 13:46:07
Repository: firefoxos-loop-client
Actor: borjasalguero
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/comments/13805656","id":13805656,"diff_hunk":"@@ -48,24 +70,65 @@\n       return SERVER_URL;\n     },\n \n-    register: function register(pushEndpoint, onsuccess, onerror) {\n+    signUp: function signUp(credentials, pushEndpoint, onsuccess, onerror) {\n       _request({\n-        method: 'POST',\n-        url: SERVER_URL + '/registration',\n-        body: {\n-          simple_push_url: pushEndpoint\n-        }\n-      }, onsuccess, onerror);\n+          method: 'POST',\n+          url: SERVER_URL + '/registration',\n+          body: {\n+            simple_push_url: pushEndpoint\n+          },\n+          credentials: credentials\n+        },\n+        function onSuccess(result, sessionToken) {\n+          if (!sessionToken) {\n+            _callback(onerror, [new Error('No session token')]);\n+            return;\n+          }\n+          deriveHawkCredentials(sessionToken, 'sessionToken', 2 * 32,\n+            function(hawkCredentials) {\n+              _hawkCredentials = {\n+                type: 'Hawk',\n+                value: hawkCredentials\n+              };\n+              _callback(onsuccess, [result, _hawkCredentials]);\n+          });\n+        },\n+        onerror);\n+    },\n+\n+    signIn: function signIn(credentials, pushEndpoint, onsuccess, onerror) {","path":"js/client_request_helper.js","position":101,"original_position":101,"commit_id":"832412a84241dd6bb7b714e68c6b9f9ff764f2a9","original_commit_id":"832412a84241dd6bb7b714e68c6b9f9ff764f2a9","user":{"login":"borjasalguero","id":1785537,"avatar_url":"https://avatars.githubusercontent.com/u/1785537?","gravatar_id":"689d1b5fac1582c8ae615fd77cb85e71","url":"https://api.github.com/users/borjasalguero","html_url":"https://github.com/borjasalguero","followers_url":"https://api.github.com/users/borjasalguero/followers","following_url":"https://api.github.com/users/borjasalguero/following{/other_user}","gists_url":"https://api.github.com/users/borjasalguero/gists{/gist_id}","starred_url":"https://api.github.com/users/borjasalguero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borjasalguero/subscriptions","organizations_url":"https://api.github.com/users/borjasalguero/orgs","repos_url":"https://api.github.com/users/borjasalguero/repos","events_url":"https://api.github.com/users/borjasalguero/events{/privacy}","received_events_url":"https://api.github.com/users/borjasalguero/received_events","type":"User","site_admin":false},"body":"I don't see why we have 2 functions. Everytime a new user is logged, we need to set again the 'hawkCredentials' and store them in our `AccountHelper`, and we are going to keep them until logging out of the App (or FxA). So I would keep the previous `register` method, which is enough.","created_at":"2014-06-16T13:46:07Z","updated_at":"2014-06-16T13:46:07Z","html_url":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/10#discussion_r13805656","pull_request_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/comments/13805656"},"html":{"href":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/10#discussion_r13805656"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/10","id":16477351,"html_url":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/10","diff_url":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/10.diff","patch_url":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/10.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/10","number":10,"state":"open","title":"Bug 1016423 - Use Hawk for making authenticated HTTP requests and support FxA assertions","user":{"login":"jaoo","id":690184,"avatar_url":"https://avatars.githubusercontent.com/u/690184?","gravatar_id":"811e37bbe77e6821bc1b4233438e7c2e","url":"https://api.github.com/users/jaoo","html_url":"https://github.com/jaoo","followers_url":"https://api.github.com/users/jaoo/followers","following_url":"https://api.github.com/users/jaoo/following{/other_user}","gists_url":"https://api.github.com/users/jaoo/gists{/gist_id}","starred_url":"https://api.github.com/users/jaoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaoo/subscriptions","organizations_url":"https://api.github.com/users/jaoo/orgs","repos_url":"https://api.github.com/users/jaoo/repos","events_url":"https://api.github.com/users/jaoo/events{/privacy}","received_events_url":"https://api.github.com/users/jaoo/received_events","type":"User","site_admin":false},"body":"See bug https://bugzilla.mozilla.org/show_bug.cgi?id=1016423 please.","created_at":"2014-05-29T12:03:17Z","updated_at":"2014-06-16T13:46:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27c1f3eaf39b3469e58f0509a4f1ac93ae2aa0ca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/10/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/10/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/10/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/statuses/832412a84241dd6bb7b714e68c6b9f9ff764f2a9","head":{"label":"jaoo:1016423","ref":"1016423","sha":"832412a84241dd6bb7b714e68c6b9f9ff764f2a9","user":{"login":"jaoo","id":690184,"avatar_url":"https://avatars.githubusercontent.com/u/690184?","gravatar_id":"811e37bbe77e6821bc1b4233438e7c2e","url":"https://api.github.com/users/jaoo","html_url":"https://github.com/jaoo","followers_url":"https://api.github.com/users/jaoo/followers","following_url":"https://api.github.com/users/jaoo/following{/other_user}","gists_url":"https://api.github.com/users/jaoo/gists{/gist_id}","starred_url":"https://api.github.com/users/jaoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaoo/subscriptions","organizations_url":"https://api.github.com/users/jaoo/orgs","repos_url":"https://api.github.com/users/jaoo/repos","events_url":"https://api.github.com/users/jaoo/events{/privacy}","received_events_url":"https://api.github.com/users/jaoo/received_events","type":"User","site_admin":false},"repo":{"id":18265175,"name":"firefoxos-loop-client","full_name":"jaoo/firefoxos-loop-client","owner":{"login":"jaoo","id":690184,"avatar_url":"https://avatars.githubusercontent.com/u/690184?","gravatar_id":"811e37bbe77e6821bc1b4233438e7c2e","url":"https://api.github.com/users/jaoo","html_url":"https://github.com/jaoo","followers_url":"https://api.github.com/users/jaoo/followers","following_url":"https://api.github.com/users/jaoo/following{/other_user}","gists_url":"https://api.github.com/users/jaoo/gists{/gist_id}","starred_url":"https://api.github.com/users/jaoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaoo/subscriptions","organizations_url":"https://api.github.com/users/jaoo/orgs","repos_url":"https://api.github.com/users/jaoo/repos","events_url":"https://api.github.com/users/jaoo/events{/privacy}","received_events_url":"https://api.github.com/users/jaoo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jaoo/firefoxos-loop-client","description":"Firefox OS client for the Loop service","fork":true,"url":"https://api.github.com/repos/jaoo/firefoxos-loop-client","forks_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/forks","keys_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/teams","hooks_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/hooks","issue_events_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/issues/events{/number}","events_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/events","assignees_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/assignees{/user}","branches_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/branches{/branch}","tags_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/tags","blobs_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/statuses/{sha}","languages_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/languages","stargazers_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/stargazers","contributors_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/contributors","subscribers_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/subscribers","subscription_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/subscription","commits_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/issues/comments/{number}","contents_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/contents/{+path}","compare_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/merges","archive_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/downloads","issues_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/issues{/number}","pulls_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/pulls{/number}","milestones_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/milestones{/number}","notifications_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/labels{/name}","releases_url":"https://api.github.com/repos/jaoo/firefoxos-loop-client/releases{/id}","created_at":"2014-03-30T14:03:34Z","updated_at":"2014-06-16T10:32:23Z","pushed_at":"2014-06-16T10:32:22Z","git_url":"git://github.com/jaoo/firefoxos-loop-client.git","ssh_url":"git@github.com:jaoo/firefoxos-loop-client.git","clone_url":"https://github.com/jaoo/firefoxos-loop-client.git","svn_url":"https://github.com/jaoo/firefoxos-loop-client","homepage":null,"size":1427,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","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":1,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"2afaec78cbf898c5c5f538f277f5b844e759439f","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?","gravatar_id":"b1de11f7d6ddaf7b9d527281297c2ee1","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":18225071,"name":"firefoxos-loop-client","full_name":"mozilla-b2g/firefoxos-loop-client","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?","gravatar_id":"b1de11f7d6ddaf7b9d527281297c2ee1","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/firefoxos-loop-client","description":"Firefox OS client for the Loop service","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client","forks_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/releases{/id}","created_at":"2014-03-28T20:10:24Z","updated_at":"2014-06-11T12:59:48Z","pushed_at":"2014-06-11T12:59:48Z","git_url":"git://github.com/mozilla-b2g/firefoxos-loop-client.git","ssh_url":"git@github.com:mozilla-b2g/firefoxos-loop-client.git","clone_url":"https://github.com/mozilla-b2g/firefoxos-loop-client.git","svn_url":"https://github.com/mozilla-b2g/firefoxos-loop-client","homepage":null,"size":626,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/10"},"html":{"href":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/10"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/10"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/statuses/832412a84241dd6bb7b714e68c6b9f9ff764f2a9"}}}}