{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/comments/62130229","id":62130229,"diff_hunk":"@@ -0,0 +1,142 @@\n+-- This migration:\n+--\n+-- * Changes the type of the devices.callbackPublicKey column\n+-- * Add a new devices.callbackAuthKey column\n+-- * Updates the accountDevices stored procedure with the new column\n+-- * Alters three stored procedures, createDevice, updateDevice and\n+--   sessionWithDevice to work with the new columns\n+\n+-- 2-steps callbackPublicKey change: we avoid junk values, and we don't block\n+-- concurent queries.\n+\n+ALTER TABLE devices\n+CHANGE callbackPublicKey oldCallbackPublicKey BINARY(32),\n+ADD COLUMN callbackPublicKey CHAR(88),\n+ADD COLUMN callbackAuthKey CHAR(24),\n+ALGORITHM = INPLACE, LOCK = NONE;\n+\n+ALTER TABLE devices\n+DROP COLUMN oldCallbackPublicKey,\n+ALGORITHM = INPLACE, LOCK = NONE;\n+","path":"lib/db/schema/patch-022-023.sql","position":21,"original_position":21,"commit_id":"b1261bcf11a81a94ea93ed2f913b6c1e83cff21d","original_commit_id":"b1261bcf11a81a94ea93ed2f913b6c1e83cff21d","user":{"login":"jrgm","id":758162,"avatar_url":"https://avatars.githubusercontent.com/u/758162?v=3","gravatar_id":"","url":"https://api.github.com/users/jrgm","html_url":"https://github.com/jrgm","followers_url":"https://api.github.com/users/jrgm/followers","following_url":"https://api.github.com/users/jrgm/following{/other_user}","gists_url":"https://api.github.com/users/jrgm/gists{/gist_id}","starred_url":"https://api.github.com/users/jrgm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrgm/subscriptions","organizations_url":"https://api.github.com/users/jrgm/orgs","repos_url":"https://api.github.com/users/jrgm/repos","events_url":"https://api.github.com/users/jrgm/events{/privacy}","received_events_url":"https://api.github.com/users/jrgm/received_events","type":"User","site_admin":false},"body":"This can't be deployed in production with a live running build touching this table (at great rates of queries at the moment on top of that). \r\n\r\nAccording to the tests in 0.59.0, the change in column type for callbackPublicKey leads to failure.","created_at":"2016-05-04T23:14:00Z","updated_at":"2016-05-04T23:14:00Z","html_url":"https://github.com/mozilla/fxa-auth-db-mysql/pull/133#discussion_r62130229","pull_request_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/133","_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/comments/62130229"},"html":{"href":"https://github.com/mozilla/fxa-auth-db-mysql/pull/133#discussion_r62130229"},"pull_request":{"href":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/133"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/133","id":66388744,"html_url":"https://github.com/mozilla/fxa-auth-db-mysql/pull/133","diff_url":"https://github.com/mozilla/fxa-auth-db-mysql/pull/133.diff","patch_url":"https://github.com/mozilla/fxa-auth-db-mysql/pull/133.patch","issue_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/133","number":133,"state":"closed","locked":false,"title":"feat(db): store push keys according to the current implementation","user":{"login":"eoger","id":6424575,"avatar_url":"https://avatars.githubusercontent.com/u/6424575?v=3","gravatar_id":"","url":"https://api.github.com/users/eoger","html_url":"https://github.com/eoger","followers_url":"https://api.github.com/users/eoger/followers","following_url":"https://api.github.com/users/eoger/following{/other_user}","gists_url":"https://api.github.com/users/eoger/gists{/gist_id}","starred_url":"https://api.github.com/users/eoger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eoger/subscriptions","organizations_url":"https://api.github.com/users/eoger/orgs","repos_url":"https://api.github.com/users/eoger/repos","events_url":"https://api.github.com/users/eoger/events{/privacy}","received_events_url":"https://api.github.com/users/eoger/received_events","type":"User","site_admin":false},"body":"This PR:\r\n- Stores the Public Key according to the current (probably last) browser implementation\r\n- Adds support for the Auth Key\r\n\r\nWe store:\r\n- The Public Key as a urlsafe base 64 string (65 bytes array = string of 88 chars max)\r\n- The Auth Key as a urlsafe base 64 string (16 bytes array = string of 24 chars max)\r\n\r\nI would love to have some feedback on this.\r\n\r\nResources used for implementation:\r\nhttps://www.w3.org/TR/push-api/\r\nhttps://jrconlin.github.io/WebPushDataTestPage/","created_at":"2016-04-13T20:47:04Z","updated_at":"2016-05-04T23:14:00Z","closed_at":"2016-05-04T17:43:12Z","merged_at":"2016-05-04T17:43:12Z","merge_commit_sha":"cbb508fb9456e90a6ab470c6a9e93e6cdcef8c5b","assignee":{"login":"eoger","id":6424575,"avatar_url":"https://avatars.githubusercontent.com/u/6424575?v=3","gravatar_id":"","url":"https://api.github.com/users/eoger","html_url":"https://github.com/eoger","followers_url":"https://api.github.com/users/eoger/followers","following_url":"https://api.github.com/users/eoger/following{/other_user}","gists_url":"https://api.github.com/users/eoger/gists{/gist_id}","starred_url":"https://api.github.com/users/eoger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eoger/subscriptions","organizations_url":"https://api.github.com/users/eoger/orgs","repos_url":"https://api.github.com/users/eoger/repos","events_url":"https://api.github.com/users/eoger/events{/privacy}","received_events_url":"https://api.github.com/users/eoger/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/133/commits","review_comments_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/133/comments","review_comment_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/133/comments","statuses_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/statuses/b1261bcf11a81a94ea93ed2f913b6c1e83cff21d","head":{"label":"eoger:sync-push","ref":"sync-push","sha":"b1261bcf11a81a94ea93ed2f913b6c1e83cff21d","user":{"login":"eoger","id":6424575,"avatar_url":"https://avatars.githubusercontent.com/u/6424575?v=3","gravatar_id":"","url":"https://api.github.com/users/eoger","html_url":"https://github.com/eoger","followers_url":"https://api.github.com/users/eoger/followers","following_url":"https://api.github.com/users/eoger/following{/other_user}","gists_url":"https://api.github.com/users/eoger/gists{/gist_id}","starred_url":"https://api.github.com/users/eoger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eoger/subscriptions","organizations_url":"https://api.github.com/users/eoger/orgs","repos_url":"https://api.github.com/users/eoger/repos","events_url":"https://api.github.com/users/eoger/events{/privacy}","received_events_url":"https://api.github.com/users/eoger/received_events","type":"User","site_admin":false},"repo":{"id":35975487,"name":"fxa-auth-db-mysql","full_name":"eoger/fxa-auth-db-mysql","owner":{"login":"eoger","id":6424575,"avatar_url":"https://avatars.githubusercontent.com/u/6424575?v=3","gravatar_id":"","url":"https://api.github.com/users/eoger","html_url":"https://github.com/eoger","followers_url":"https://api.github.com/users/eoger/followers","following_url":"https://api.github.com/users/eoger/following{/other_user}","gists_url":"https://api.github.com/users/eoger/gists{/gist_id}","starred_url":"https://api.github.com/users/eoger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eoger/subscriptions","organizations_url":"https://api.github.com/users/eoger/orgs","repos_url":"https://api.github.com/users/eoger/repos","events_url":"https://api.github.com/users/eoger/events{/privacy}","received_events_url":"https://api.github.com/users/eoger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eoger/fxa-auth-db-mysql","description":"MySql backend for the fxa-auth-db-server","fork":true,"url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql","forks_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/forks","keys_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/teams","hooks_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/hooks","issue_events_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/issues/events{/number}","events_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/events","assignees_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/assignees{/user}","branches_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/branches{/branch}","tags_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/tags","blobs_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/git/refs{/sha}","trees_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/statuses/{sha}","languages_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/languages","stargazers_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/stargazers","contributors_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/contributors","subscribers_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/subscribers","subscription_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/subscription","commits_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/commits{/sha}","git_commits_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/git/commits{/sha}","comments_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/comments{/number}","issue_comment_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/issues/comments{/number}","contents_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/contents/{+path}","compare_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/merges","archive_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/downloads","issues_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/issues{/number}","pulls_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/pulls{/number}","milestones_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/milestones{/number}","notifications_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/labels{/name}","releases_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/releases{/id}","deployments_url":"https://api.github.com/repos/eoger/fxa-auth-db-mysql/deployments","created_at":"2015-05-20T21:33:54Z","updated_at":"2016-04-12T17:08:14Z","pushed_at":"2016-05-02T18:17:07Z","git_url":"git://github.com/eoger/fxa-auth-db-mysql.git","ssh_url":"git@github.com:eoger/fxa-auth-db-mysql.git","clone_url":"https://github.com/eoger/fxa-auth-db-mysql.git","svn_url":"https://github.com/eoger/fxa-auth-db-mysql","homepage":"","size":577,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mozilla:master","ref":"master","sha":"70e3ce0ddded7d34876f569eeb97d1a93363c66f","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":23937466,"name":"fxa-auth-db-mysql","full_name":"mozilla/fxa-auth-db-mysql","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/fxa-auth-db-mysql","description":"MySql backend for the fxa-auth-db-server","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql","forks_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/deployments","created_at":"2014-09-11T22:06:52Z","updated_at":"2016-01-11T04:47:05Z","pushed_at":"2016-05-04T17:43:13Z","git_url":"git://github.com/mozilla/fxa-auth-db-mysql.git","ssh_url":"git@github.com:mozilla/fxa-auth-db-mysql.git","clone_url":"https://github.com/mozilla/fxa-auth-db-mysql.git","svn_url":"https://github.com/mozilla/fxa-auth-db-mysql","homepage":"","size":677,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":4,"forks":13,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/133"},"html":{"href":"https://github.com/mozilla/fxa-auth-db-mysql/pull/133"},"issue":{"href":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/133"},"comments":{"href":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/133/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/133/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/pulls/133/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/statuses/b1261bcf11a81a94ea93ed2f913b6c1e83cff21d"}}}}