{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/comments/52127164","id":52127164,"diff_hunk":"@@ -0,0 +1,107 @@\n+/* This Source Code Form is subject to the terms of the Mozilla Public\n+ * License, v. 2.0. If a copy of the MPL was not distributed with this\n+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n+\n+var tap = require('tap')\n+var test = tap.test\n+var uuid = require('uuid')\n+\n+var butil = require('../../lib/crypto/butil')\n+var unbuffer = butil.unbuffer\n+var config = require('../../config').getProperties()\n+var TestServer = require('../test_server')\n+\n+var zeroBuffer16 = Buffer('00000000000000000000000000000000', 'hex')\n+var zeroBuffer32 = Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex')\n+\n+\n+var DB = require('../../lib/db')()\n+\n+function createTestAccount() {\n+  var account = {\n+    uid: uuid.v4('binary'),\n+    email: 'foo' + Math.random() + '@bar.com',\n+    emailCode: zeroBuffer16,\n+    emailVerified: false,\n+    verifierVersion: 1,\n+    verifyHash: zeroBuffer32,\n+    authSalt: zeroBuffer32,\n+    kA: zeroBuffer32,\n+    wrapWrapKb: zeroBuffer32,\n+    createdAt: Date.now(),\n+    verifierSetAt: Date.now()\n+  }\n+\n+  account.normalizedEmail = account.email.toLowerCase()\n+\n+  return account\n+}\n+\n+var dbServer\n+var dbConn = TestServer.start(config)\n+  .then(\n+    function (server) {\n+      dbServer = server\n+      return DB.connect(config[config.db.backend])\n+    }\n+  )\n+\n+test(\n+  'ping',\n+  function (t) {\n+    t.plan(1)\n+    return dbConn\n+      .then(function (db) {\n+        return db.ping()\n+      })\n+      .then(function () {\n+        t.pass('Got the ping ok')\n+      }, function (err) {\n+        throw err\n+      })\n+  }\n+)\n+\n+\n+test(\n+  'get email record',","path":"test/local/db_tests.js","position":67,"original_position":67,"commit_id":"f187ccd11d88bbb89f02fb23a4a753e8310113b6","original_commit_id":"f187ccd11d88bbb89f02fb23a4a753e8310113b6","user":{"login":"vladikoff","id":128755,"avatar_url":"https://avatars.githubusercontent.com/u/128755?v=3","gravatar_id":"","url":"https://api.github.com/users/vladikoff","html_url":"https://github.com/vladikoff","followers_url":"https://api.github.com/users/vladikoff/followers","following_url":"https://api.github.com/users/vladikoff/following{/other_user}","gists_url":"https://api.github.com/users/vladikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vladikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladikoff/subscriptions","organizations_url":"https://api.github.com/users/vladikoff/orgs","repos_url":"https://api.github.com/users/vladikoff/repos","events_url":"https://api.github.com/users/vladikoff/events{/privacy}","received_events_url":"https://api.github.com/users/vladikoff/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2016-02-07T23:28:02Z","updated_at":"2016-02-07T23:28:02Z","html_url":"https://github.com/mozilla/fxa-auth-mailer/pull/113#discussion_r52127164","pull_request_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/113","_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/comments/52127164"},"html":{"href":"https://github.com/mozilla/fxa-auth-mailer/pull/113#discussion_r52127164"},"pull_request":{"href":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/113","id":58092096,"html_url":"https://github.com/mozilla/fxa-auth-mailer/pull/113","diff_url":"https://github.com/mozilla/fxa-auth-mailer/pull/113.diff","patch_url":"https://github.com/mozilla/fxa-auth-mailer/pull/113.patch","issue_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues/113","number":113,"state":"open","locked":false,"title":"feat(db): add ability to check account verification status","user":{"login":"vladikoff","id":128755,"avatar_url":"https://avatars.githubusercontent.com/u/128755?v=3","gravatar_id":"","url":"https://api.github.com/users/vladikoff","html_url":"https://github.com/vladikoff","followers_url":"https://api.github.com/users/vladikoff/followers","following_url":"https://api.github.com/users/vladikoff/following{/other_user}","gists_url":"https://api.github.com/users/vladikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vladikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladikoff/subscriptions","organizations_url":"https://api.github.com/users/vladikoff/orgs","repos_url":"https://api.github.com/users/vladikoff/repos","events_url":"https://api.github.com/users/vladikoff/events{/privacy}","received_events_url":"https://api.github.com/users/vladikoff/received_events","type":"User","site_admin":false},"body":"Fixes #111","created_at":"2016-02-03T05:07:36Z","updated_at":"2016-02-07T23:28:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0e5edef070dc3f6040fcf30c68b0fb7b0fdeaa10","assignee":null,"milestone":{"url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/milestones/21","html_url":"https://github.com/mozilla/fxa-auth-mailer/milestones/FxA-57:%20verification%20reminder","labels_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/milestones/21/labels","id":1358277,"number":21,"title":"FxA-57: verification reminder","description":"https://mozilla.aha.io/features/FXA-57","creator":{"login":"vladikoff","id":128755,"avatar_url":"https://avatars.githubusercontent.com/u/128755?v=3","gravatar_id":"","url":"https://api.github.com/users/vladikoff","html_url":"https://github.com/vladikoff","followers_url":"https://api.github.com/users/vladikoff/followers","following_url":"https://api.github.com/users/vladikoff/following{/other_user}","gists_url":"https://api.github.com/users/vladikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vladikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladikoff/subscriptions","organizations_url":"https://api.github.com/users/vladikoff/orgs","repos_url":"https://api.github.com/users/vladikoff/repos","events_url":"https://api.github.com/users/vladikoff/events{/privacy}","received_events_url":"https://api.github.com/users/vladikoff/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":3,"state":"open","created_at":"2015-10-15T21:46:25Z","updated_at":"2016-02-03T05:07:36Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/113/commits","review_comments_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/113/comments","review_comment_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues/113/comments","statuses_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/statuses/f187ccd11d88bbb89f02fb23a4a753e8310113b6","head":{"label":"mozilla:db-connect","ref":"db-connect","sha":"f187ccd11d88bbb89f02fb23a4a753e8310113b6","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":20310822,"name":"fxa-auth-mailer","full_name":"mozilla/fxa-auth-mailer","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-mailer","description":"Helper server for fxa-auth-server to send email","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-auth-mailer","forks_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/deployments","created_at":"2014-05-29T22:53:57Z","updated_at":"2016-01-19T22:41:24Z","pushed_at":"2016-02-05T22:45:47Z","git_url":"git://github.com/mozilla/fxa-auth-mailer.git","ssh_url":"git@github.com:mozilla/fxa-auth-mailer.git","clone_url":"https://github.com/mozilla/fxa-auth-mailer.git","svn_url":"https://github.com/mozilla/fxa-auth-mailer","homepage":"","size":126,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":14,"forks":12,"open_issues":14,"watchers":2,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"26ced35d881466fb4b38b093445b18c0c2db9281","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":20310822,"name":"fxa-auth-mailer","full_name":"mozilla/fxa-auth-mailer","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-mailer","description":"Helper server for fxa-auth-server to send email","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-auth-mailer","forks_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa-auth-mailer/deployments","created_at":"2014-05-29T22:53:57Z","updated_at":"2016-01-19T22:41:24Z","pushed_at":"2016-02-05T22:45:47Z","git_url":"git://github.com/mozilla/fxa-auth-mailer.git","ssh_url":"git@github.com:mozilla/fxa-auth-mailer.git","clone_url":"https://github.com/mozilla/fxa-auth-mailer.git","svn_url":"https://github.com/mozilla/fxa-auth-mailer","homepage":"","size":126,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":14,"forks":12,"open_issues":14,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/113"},"html":{"href":"https://github.com/mozilla/fxa-auth-mailer/pull/113"},"issue":{"href":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues/113"},"comments":{"href":"https://api.github.com/repos/mozilla/fxa-auth-mailer/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/fxa-auth-mailer/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/fxa-auth-mailer/statuses/f187ccd11d88bbb89f02fb23a4a753e8310113b6"}}}}