{"action":"created","comment":{"url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/comments/82057461","pull_request_review_id":2991564,"id":82057461,"diff_hunk":"@@ -0,0 +1,76 @@\n+var passport = require('passport-strategy')\n+var util = require('util');\n+var BypassAuth = require('./bypass_auth.js');\n+\n+/**\n+ * `BypassJwtStrategy` constructor.\n+ *\n+ * The bypass authentication strategy authenticates requests based on the\n+ * session token submitted in the Bypass custom headers.\n+ *\n+ * Unlike most Passport strategies, this does not require a verify method,\n+ * as we automatically conform the the Bypass session token strategy.\n+ *\n+ * Examples:\n+ *\n+ *     passport.use(new BypassJwtStrategy());\n+ *\n+ * @api public\n+ */\n+\n+function BypassJwtStrategy(options) {\n+  if (!options || !options.server) {\n+    throw new Error(\"A server is required\");\n+  }\n+\n+  passport.Strategy.call(this);\n+  this.options = options;\n+  this.BYPASS_JWT_HEADER = \"x-bypass-jwt\";","path":"lib/bypass_jwt_strategy.js","position":28,"original_position":28,"commit_id":"ff53af912b58faf6bc2bd7d38b4b57abea1d8060","original_commit_id":"ff53af912b58faf6bc2bd7d38b4b57abea1d8060","user":{"login":"jspies","id":13679,"avatar_url":"https://avatars.githubusercontent.com/u/13679?v=3","gravatar_id":"","url":"https://api.github.com/users/jspies","html_url":"https://github.com/jspies","followers_url":"https://api.github.com/users/jspies/followers","following_url":"https://api.github.com/users/jspies/following{/other_user}","gists_url":"https://api.github.com/users/jspies/gists{/gist_id}","starred_url":"https://api.github.com/users/jspies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jspies/subscriptions","organizations_url":"https://api.github.com/users/jspies/orgs","repos_url":"https://api.github.com/users/jspies/repos","events_url":"https://api.github.com/users/jspies/events{/privacy}","received_events_url":"https://api.github.com/users/jspies/received_events","type":"User","site_admin":false},"body":"let's change this to something descriptive about the device token","created_at":"2016-10-05T20:00:47Z","updated_at":"2016-10-05T20:03:38Z","html_url":"https://github.com/bypasslane/bypass-passport-strategy/pull/2#discussion_r82057461","pull_request_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/comments/82057461"},"html":{"href":"https://github.com/bypasslane/bypass-passport-strategy/pull/2#discussion_r82057461"},"pull_request":{"href":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/2","id":88129302,"html_url":"https://github.com/bypasslane/bypass-passport-strategy/pull/2","diff_url":"https://github.com/bypasslane/bypass-passport-strategy/pull/2.diff","patch_url":"https://github.com/bypasslane/bypass-passport-strategy/pull/2.patch","issue_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues/2","number":2,"state":"open","locked":false,"title":"[CON-9] added an authentication strategy for jwts","user":{"login":"bbwharris","id":43513,"avatar_url":"https://avatars.githubusercontent.com/u/43513?v=3","gravatar_id":"","url":"https://api.github.com/users/bbwharris","html_url":"https://github.com/bbwharris","followers_url":"https://api.github.com/users/bbwharris/followers","following_url":"https://api.github.com/users/bbwharris/following{/other_user}","gists_url":"https://api.github.com/users/bbwharris/gists{/gist_id}","starred_url":"https://api.github.com/users/bbwharris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbwharris/subscriptions","organizations_url":"https://api.github.com/users/bbwharris/orgs","repos_url":"https://api.github.com/users/bbwharris/repos","events_url":"https://api.github.com/users/bbwharris/events{/privacy}","received_events_url":"https://api.github.com/users/bbwharris/received_events","type":"User","site_admin":false},"body":"# 📇  JIRA\r\nhttps://bypassmobile.atlassian.net/browse/CON-9\r\n\r\n# 📄  Notes\r\nThis is a carbon copy of the current session token strategy, it just looks for the new jwt in the header specified. This will probably change in the near future as well, but this will keep the momentum moving.","created_at":"2016-10-05T18:15:53Z","updated_at":"2016-10-05T20:03:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f52bcd15c9e782b7581591aef804a3ecdc23bbca","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/2/commits","review_comments_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/2/comments","review_comment_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues/2/comments","statuses_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/statuses/ff53af912b58faf6bc2bd7d38b4b57abea1d8060","head":{"label":"bypasslane:bh-CON-8","ref":"bh-CON-8","sha":"ff53af912b58faf6bc2bd7d38b4b57abea1d8060","user":{"login":"bypasslane","id":527428,"avatar_url":"https://avatars.githubusercontent.com/u/527428?v=3","gravatar_id":"","url":"https://api.github.com/users/bypasslane","html_url":"https://github.com/bypasslane","followers_url":"https://api.github.com/users/bypasslane/followers","following_url":"https://api.github.com/users/bypasslane/following{/other_user}","gists_url":"https://api.github.com/users/bypasslane/gists{/gist_id}","starred_url":"https://api.github.com/users/bypasslane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bypasslane/subscriptions","organizations_url":"https://api.github.com/users/bypasslane/orgs","repos_url":"https://api.github.com/users/bypasslane/repos","events_url":"https://api.github.com/users/bypasslane/events{/privacy}","received_events_url":"https://api.github.com/users/bypasslane/received_events","type":"Organization","site_admin":false},"repo":{"id":49388176,"name":"bypass-passport-strategy","full_name":"bypasslane/bypass-passport-strategy","owner":{"login":"bypasslane","id":527428,"avatar_url":"https://avatars.githubusercontent.com/u/527428?v=3","gravatar_id":"","url":"https://api.github.com/users/bypasslane","html_url":"https://github.com/bypasslane","followers_url":"https://api.github.com/users/bypasslane/followers","following_url":"https://api.github.com/users/bypasslane/following{/other_user}","gists_url":"https://api.github.com/users/bypasslane/gists{/gist_id}","starred_url":"https://api.github.com/users/bypasslane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bypasslane/subscriptions","organizations_url":"https://api.github.com/users/bypasslane/orgs","repos_url":"https://api.github.com/users/bypasslane/repos","events_url":"https://api.github.com/users/bypasslane/events{/privacy}","received_events_url":"https://api.github.com/users/bypasslane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bypasslane/bypass-passport-strategy","description":"Express.js Passport Strategy to handle Bypass session tokens.","fork":false,"url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy","forks_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/forks","keys_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/teams","hooks_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/hooks","issue_events_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues/events{/number}","events_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/events","assignees_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/assignees{/user}","branches_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/branches{/branch}","tags_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/tags","blobs_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/refs{/sha}","trees_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/statuses/{sha}","languages_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/languages","stargazers_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/stargazers","contributors_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/contributors","subscribers_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/subscribers","subscription_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/subscription","commits_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/commits{/sha}","git_commits_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/commits{/sha}","comments_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/comments{/number}","issue_comment_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues/comments{/number}","contents_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/contents/{+path}","compare_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/merges","archive_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/downloads","issues_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues{/number}","pulls_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls{/number}","milestones_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/milestones{/number}","notifications_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/labels{/name}","releases_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/releases{/id}","deployments_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/deployments","created_at":"2016-01-10T22:19:43Z","updated_at":"2016-02-25T05:01:03Z","pushed_at":"2016-10-05T18:15:54Z","git_url":"git://github.com/bypasslane/bypass-passport-strategy.git","ssh_url":"git@github.com:bypasslane/bypass-passport-strategy.git","clone_url":"https://github.com/bypasslane/bypass-passport-strategy.git","svn_url":"https://github.com/bypasslane/bypass-passport-strategy","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"bypasslane:master","ref":"master","sha":"4f6c4103254bc505ae5b2d89cf7dbfb197f9b715","user":{"login":"bypasslane","id":527428,"avatar_url":"https://avatars.githubusercontent.com/u/527428?v=3","gravatar_id":"","url":"https://api.github.com/users/bypasslane","html_url":"https://github.com/bypasslane","followers_url":"https://api.github.com/users/bypasslane/followers","following_url":"https://api.github.com/users/bypasslane/following{/other_user}","gists_url":"https://api.github.com/users/bypasslane/gists{/gist_id}","starred_url":"https://api.github.com/users/bypasslane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bypasslane/subscriptions","organizations_url":"https://api.github.com/users/bypasslane/orgs","repos_url":"https://api.github.com/users/bypasslane/repos","events_url":"https://api.github.com/users/bypasslane/events{/privacy}","received_events_url":"https://api.github.com/users/bypasslane/received_events","type":"Organization","site_admin":false},"repo":{"id":49388176,"name":"bypass-passport-strategy","full_name":"bypasslane/bypass-passport-strategy","owner":{"login":"bypasslane","id":527428,"avatar_url":"https://avatars.githubusercontent.com/u/527428?v=3","gravatar_id":"","url":"https://api.github.com/users/bypasslane","html_url":"https://github.com/bypasslane","followers_url":"https://api.github.com/users/bypasslane/followers","following_url":"https://api.github.com/users/bypasslane/following{/other_user}","gists_url":"https://api.github.com/users/bypasslane/gists{/gist_id}","starred_url":"https://api.github.com/users/bypasslane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bypasslane/subscriptions","organizations_url":"https://api.github.com/users/bypasslane/orgs","repos_url":"https://api.github.com/users/bypasslane/repos","events_url":"https://api.github.com/users/bypasslane/events{/privacy}","received_events_url":"https://api.github.com/users/bypasslane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bypasslane/bypass-passport-strategy","description":"Express.js Passport Strategy to handle Bypass session tokens.","fork":false,"url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy","forks_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/forks","keys_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/teams","hooks_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/hooks","issue_events_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues/events{/number}","events_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/events","assignees_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/assignees{/user}","branches_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/branches{/branch}","tags_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/tags","blobs_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/refs{/sha}","trees_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/statuses/{sha}","languages_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/languages","stargazers_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/stargazers","contributors_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/contributors","subscribers_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/subscribers","subscription_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/subscription","commits_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/commits{/sha}","git_commits_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/git/commits{/sha}","comments_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/comments{/number}","issue_comment_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues/comments{/number}","contents_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/contents/{+path}","compare_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/merges","archive_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/downloads","issues_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues{/number}","pulls_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls{/number}","milestones_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/milestones{/number}","notifications_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/labels{/name}","releases_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/releases{/id}","deployments_url":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/deployments","created_at":"2016-01-10T22:19:43Z","updated_at":"2016-02-25T05:01:03Z","pushed_at":"2016-10-05T18:15:54Z","git_url":"git://github.com/bypasslane/bypass-passport-strategy.git","ssh_url":"git@github.com:bypasslane/bypass-passport-strategy.git","clone_url":"https://github.com/bypasslane/bypass-passport-strategy.git","svn_url":"https://github.com/bypasslane/bypass-passport-strategy","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/2"},"html":{"href":"https://github.com/bypasslane/bypass-passport-strategy/pull/2"},"issue":{"href":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues/2"},"comments":{"href":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/bypasslane/bypass-passport-strategy/statuses/ff53af912b58faf6bc2bd7d38b4b57abea1d8060"}}}}
{"actor":{"display_login":"jspies"}}