{"action":"created","comment":{"url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/comments/189371648","pull_request_review_id":121545513,"id":189371648,"diff_hunk":"@@ -0,0 +1,212 @@\n+/*!\n+ * Copyright (c) 2018 Digital Bazaar, Inc. All rights reserved.\n+ */\n+'use strict';\n+\n+const axios = require('axios');\n+const chai = require('chai');\n+const config = require('./config');\n+const fs = require('fs');\n+const helpers = require('./helpers');\n+const https = require('https');\n+const mockData = require('./mock-data');\n+const mockServer = require('./mock-server');\n+const should = chai.should();\n+\n+process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n+\n+let server = null;\n+\n+describe('http-signature-middleware', () => {\n+  before(() => {\n+    const key = fs.readFileSync('./test/basic-server.key');\n+    const cert = fs.readFileSync('./test/basic-server.crt');\n+    server = https.createServer({cert, key}, mockServer.createServer());\n+    server.listen(config.port);","path":"test/test.js","position":25,"original_position":25,"commit_id":"f6ae7aed59a2dac15fb4fae11a1690763c10c450","original_commit_id":"f6ae7aed59a2dac15fb4fae11a1690763c10c450","user":{"login":"davidlehn","id":109587,"avatar_url":"https://avatars0.githubusercontent.com/u/109587?v=4","gravatar_id":"","url":"https://api.github.com/users/davidlehn","html_url":"https://github.com/davidlehn","followers_url":"https://api.github.com/users/davidlehn/followers","following_url":"https://api.github.com/users/davidlehn/following{/other_user}","gists_url":"https://api.github.com/users/davidlehn/gists{/gist_id}","starred_url":"https://api.github.com/users/davidlehn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidlehn/subscriptions","organizations_url":"https://api.github.com/users/davidlehn/orgs","repos_url":"https://api.github.com/users/davidlehn/repos","events_url":"https://api.github.com/users/davidlehn/events{/privacy}","received_events_url":"https://api.github.com/users/davidlehn/received_events","type":"User","site_admin":false},"body":"Should this (and the after/close below?) be using callbacks? Something like:\r\n```js\r\nbefore(callback => {\r\n  ...\r\n  server.listen(config.port, callback);\r\n})\r\n```\r\nPerhaps same for the after/close call below too.","created_at":"2018-05-18T19:29:03Z","updated_at":"2018-05-18T19:29:03Z","html_url":"https://github.com/digitalbazaar/http-signature-middleware/pull/1#discussion_r189371648","pull_request_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/1","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/comments/189371648"},"html":{"href":"https://github.com/digitalbazaar/http-signature-middleware/pull/1#discussion_r189371648"},"pull_request":{"href":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/1","id":188754484,"html_url":"https://github.com/digitalbazaar/http-signature-middleware/pull/1","diff_url":"https://github.com/digitalbazaar/http-signature-middleware/pull/1.diff","patch_url":"https://github.com/digitalbazaar/http-signature-middleware/pull/1.patch","issue_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues/1","number":1,"state":"open","locked":false,"title":"Implementation","user":{"login":"mattcollier","id":902041,"avatar_url":"https://avatars2.githubusercontent.com/u/902041?v=4","gravatar_id":"","url":"https://api.github.com/users/mattcollier","html_url":"https://github.com/mattcollier","followers_url":"https://api.github.com/users/mattcollier/followers","following_url":"https://api.github.com/users/mattcollier/following{/other_user}","gists_url":"https://api.github.com/users/mattcollier/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcollier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcollier/subscriptions","organizations_url":"https://api.github.com/users/mattcollier/orgs","repos_url":"https://api.github.com/users/mattcollier/repos","events_url":"https://api.github.com/users/mattcollier/events{/privacy}","received_events_url":"https://api.github.com/users/mattcollier/received_events","type":"User","site_admin":false},"body":"Will be adding more tests.\r\n\r\nLooking for suggestions about how to handle `validateHost` (string/function)\r\n\r\nCarried the comment about validating a nonce over from bedrock-passport.  Is this a concern at this time?\r\n\r\nAlso, looking for clarification about what is to be done about `getIdentity`.  Seems to me that the existing implementation provides for maximum flexibility.  Maybe just need to rename `getIdentity` to something else?","created_at":"2018-05-17T14:23:02Z","updated_at":"2018-05-18T19:29:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c01928fc3c01a0c79b42409230248805355c702","assignee":{"login":"mattcollier","id":902041,"avatar_url":"https://avatars2.githubusercontent.com/u/902041?v=4","gravatar_id":"","url":"https://api.github.com/users/mattcollier","html_url":"https://github.com/mattcollier","followers_url":"https://api.github.com/users/mattcollier/followers","following_url":"https://api.github.com/users/mattcollier/following{/other_user}","gists_url":"https://api.github.com/users/mattcollier/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcollier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcollier/subscriptions","organizations_url":"https://api.github.com/users/mattcollier/orgs","repos_url":"https://api.github.com/users/mattcollier/repos","events_url":"https://api.github.com/users/mattcollier/events{/privacy}","received_events_url":"https://api.github.com/users/mattcollier/received_events","type":"User","site_admin":false},"assignees":[{"login":"mattcollier","id":902041,"avatar_url":"https://avatars2.githubusercontent.com/u/902041?v=4","gravatar_id":"","url":"https://api.github.com/users/mattcollier","html_url":"https://github.com/mattcollier","followers_url":"https://api.github.com/users/mattcollier/followers","following_url":"https://api.github.com/users/mattcollier/following{/other_user}","gists_url":"https://api.github.com/users/mattcollier/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcollier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcollier/subscriptions","organizations_url":"https://api.github.com/users/mattcollier/orgs","repos_url":"https://api.github.com/users/mattcollier/repos","events_url":"https://api.github.com/users/mattcollier/events{/privacy}","received_events_url":"https://api.github.com/users/mattcollier/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/1/commits","review_comments_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/1/comments","review_comment_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues/1/comments","statuses_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/statuses/f6ae7aed59a2dac15fb4fae11a1690763c10c450","head":{"label":"digitalbazaar:implementation","ref":"implementation","sha":"f6ae7aed59a2dac15fb4fae11a1690763c10c450","user":{"login":"digitalbazaar","id":167436,"avatar_url":"https://avatars3.githubusercontent.com/u/167436?v=4","gravatar_id":"","url":"https://api.github.com/users/digitalbazaar","html_url":"https://github.com/digitalbazaar","followers_url":"https://api.github.com/users/digitalbazaar/followers","following_url":"https://api.github.com/users/digitalbazaar/following{/other_user}","gists_url":"https://api.github.com/users/digitalbazaar/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalbazaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalbazaar/subscriptions","organizations_url":"https://api.github.com/users/digitalbazaar/orgs","repos_url":"https://api.github.com/users/digitalbazaar/repos","events_url":"https://api.github.com/users/digitalbazaar/events{/privacy}","received_events_url":"https://api.github.com/users/digitalbazaar/received_events","type":"Organization","site_admin":false},"repo":{"id":133677806,"name":"http-signature-middleware","full_name":"digitalbazaar/http-signature-middleware","owner":{"login":"digitalbazaar","id":167436,"avatar_url":"https://avatars3.githubusercontent.com/u/167436?v=4","gravatar_id":"","url":"https://api.github.com/users/digitalbazaar","html_url":"https://github.com/digitalbazaar","followers_url":"https://api.github.com/users/digitalbazaar/followers","following_url":"https://api.github.com/users/digitalbazaar/following{/other_user}","gists_url":"https://api.github.com/users/digitalbazaar/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalbazaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalbazaar/subscriptions","organizations_url":"https://api.github.com/users/digitalbazaar/orgs","repos_url":"https://api.github.com/users/digitalbazaar/repos","events_url":"https://api.github.com/users/digitalbazaar/events{/privacy}","received_events_url":"https://api.github.com/users/digitalbazaar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/digitalbazaar/http-signature-middleware","description":null,"fork":false,"url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware","forks_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/forks","keys_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/teams","hooks_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/hooks","issue_events_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues/events{/number}","events_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/events","assignees_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/assignees{/user}","branches_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/branches{/branch}","tags_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/tags","blobs_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/refs{/sha}","trees_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/statuses/{sha}","languages_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/languages","stargazers_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/stargazers","contributors_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/contributors","subscribers_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/subscribers","subscription_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/subscription","commits_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/commits{/sha}","git_commits_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/commits{/sha}","comments_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/comments{/number}","issue_comment_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues/comments{/number}","contents_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/contents/{+path}","compare_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/merges","archive_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/downloads","issues_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues{/number}","pulls_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls{/number}","milestones_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/milestones{/number}","notifications_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/labels{/name}","releases_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/releases{/id}","deployments_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/deployments","created_at":"2018-05-16T14:26:40Z","updated_at":"2018-05-17T14:15:01Z","pushed_at":"2018-05-18T18:25:18Z","git_url":"git://github.com/digitalbazaar/http-signature-middleware.git","ssh_url":"git@github.com:digitalbazaar/http-signature-middleware.git","clone_url":"https://github.com/digitalbazaar/http-signature-middleware.git","svn_url":"https://github.com/digitalbazaar/http-signature-middleware","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"digitalbazaar:master","ref":"master","sha":"2c48df793baf0681777bfd2fcf85492c952db486","user":{"login":"digitalbazaar","id":167436,"avatar_url":"https://avatars3.githubusercontent.com/u/167436?v=4","gravatar_id":"","url":"https://api.github.com/users/digitalbazaar","html_url":"https://github.com/digitalbazaar","followers_url":"https://api.github.com/users/digitalbazaar/followers","following_url":"https://api.github.com/users/digitalbazaar/following{/other_user}","gists_url":"https://api.github.com/users/digitalbazaar/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalbazaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalbazaar/subscriptions","organizations_url":"https://api.github.com/users/digitalbazaar/orgs","repos_url":"https://api.github.com/users/digitalbazaar/repos","events_url":"https://api.github.com/users/digitalbazaar/events{/privacy}","received_events_url":"https://api.github.com/users/digitalbazaar/received_events","type":"Organization","site_admin":false},"repo":{"id":133677806,"name":"http-signature-middleware","full_name":"digitalbazaar/http-signature-middleware","owner":{"login":"digitalbazaar","id":167436,"avatar_url":"https://avatars3.githubusercontent.com/u/167436?v=4","gravatar_id":"","url":"https://api.github.com/users/digitalbazaar","html_url":"https://github.com/digitalbazaar","followers_url":"https://api.github.com/users/digitalbazaar/followers","following_url":"https://api.github.com/users/digitalbazaar/following{/other_user}","gists_url":"https://api.github.com/users/digitalbazaar/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalbazaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalbazaar/subscriptions","organizations_url":"https://api.github.com/users/digitalbazaar/orgs","repos_url":"https://api.github.com/users/digitalbazaar/repos","events_url":"https://api.github.com/users/digitalbazaar/events{/privacy}","received_events_url":"https://api.github.com/users/digitalbazaar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/digitalbazaar/http-signature-middleware","description":null,"fork":false,"url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware","forks_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/forks","keys_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/teams","hooks_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/hooks","issue_events_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues/events{/number}","events_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/events","assignees_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/assignees{/user}","branches_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/branches{/branch}","tags_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/tags","blobs_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/refs{/sha}","trees_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/statuses/{sha}","languages_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/languages","stargazers_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/stargazers","contributors_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/contributors","subscribers_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/subscribers","subscription_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/subscription","commits_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/commits{/sha}","git_commits_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/git/commits{/sha}","comments_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/comments{/number}","issue_comment_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues/comments{/number}","contents_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/contents/{+path}","compare_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/merges","archive_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/downloads","issues_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues{/number}","pulls_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls{/number}","milestones_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/milestones{/number}","notifications_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/labels{/name}","releases_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/releases{/id}","deployments_url":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/deployments","created_at":"2018-05-16T14:26:40Z","updated_at":"2018-05-17T14:15:01Z","pushed_at":"2018-05-18T18:25:18Z","git_url":"git://github.com/digitalbazaar/http-signature-middleware.git","ssh_url":"git@github.com:digitalbazaar/http-signature-middleware.git","clone_url":"https://github.com/digitalbazaar/http-signature-middleware.git","svn_url":"https://github.com/digitalbazaar/http-signature-middleware","homepage":null,"size":33,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/1"},"html":{"href":"https://github.com/digitalbazaar/http-signature-middleware/pull/1"},"issue":{"href":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues/1"},"comments":{"href":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/digitalbazaar/http-signature-middleware/statuses/f6ae7aed59a2dac15fb4fae11a1690763c10c450"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"davidlehn"}}