{"action":"created","comment":{"url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/comments/210734507","pull_request_review_id":147014932,"id":210734507,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDczNDUwNw==","diff_hunk":"@@ -40,6 +51,35 @@ describe('module', function () {\n \t\texpect($webhook.validateSecret(false, request)).to.be.false;\n \t\texpect($webhook.validateSecret({}, request)).to.be.false;\n \t\texpect($webhook.validateSecret({ webhookId: 125 }, request)).to.be.false;\n+\t\texpect($webhook.validateSecret(multiConfigSettings.crazyKeyString, request)).to.be.true;\n+\t});\n+\n+\tit('returns only valid configId from multi configs', function () {\n+\t\texpect($webhook.getValidatedMultiConfigId(multiConfigSettings, request)).to.equal('crazyKeyString');\n+\n+\t\tconst reqWithBadHeader = {\n+\t\t\theaders: {},\n+\t\t\tbody: {\n+\t\t\t\twebhook: {\n+\t\t\t\t\tid: 123\n+\t\t\t\t}\n+\t\t\t}\n+\t\t};\n+\n+\t\texpect($webhook.getValidatedMultiConfigId(multiConfigSettings, reqWithBadHeader)).to.equal(undefined);\n+\n+\t\tconst reqWithBadId = {\n+\t\t\theaders: {\n+\t\t\t\t'x-zengine-webhook-key': 456\n+\t\t\t},\n+\t\t\tbody: {\n+\t\t\t\twebhook: {\n+\t\t\t\t\tid: 987\n+\t\t\t\t}\n+\t\t\t}\n+\t\t};\n+\n+\t\texpect($webhook.getValidatedMultiConfigId(multiConfigSettings, reqWithBadId)).to.equal(undefined);","path":"test/test.js","position":54,"original_position":54,"commit_id":"af44bc0dd18735cc73cd420f9b27b703cba8e135","original_commit_id":"af44bc0dd18735cc73cd420f9b27b703cba8e135","user":{"login":"alexweber","id":14409,"node_id":"MDQ6VXNlcjE0NDA5","avatar_url":"https://avatars1.githubusercontent.com/u/14409?v=4","gravatar_id":"","url":"https://api.github.com/users/alexweber","html_url":"https://github.com/alexweber","followers_url":"https://api.github.com/users/alexweber/followers","following_url":"https://api.github.com/users/alexweber/following{/other_user}","gists_url":"https://api.github.com/users/alexweber/gists{/gist_id}","starred_url":"https://api.github.com/users/alexweber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexweber/subscriptions","organizations_url":"https://api.github.com/users/alexweber/orgs","repos_url":"https://api.github.com/users/alexweber/repos","events_url":"https://api.github.com/users/alexweber/events{/privacy}","received_events_url":"https://api.github.com/users/alexweber/received_events","type":"User","site_admin":false},"body":"@tehpsalmist im almost certain there's a \"better\" version which is`expect(foo).to.be.undefined`","created_at":"2018-08-16T20:40:06Z","updated_at":"2018-08-16T20:40:06Z","html_url":"https://github.com/ZengineHQ/zn-backend-webhooks/pull/2#discussion_r210734507","pull_request_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/comments/210734507"},"html":{"href":"https://github.com/ZengineHQ/zn-backend-webhooks/pull/2#discussion_r210734507"},"pull_request":{"href":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/2","id":208975694,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4OTc1Njk0","html_url":"https://github.com/ZengineHQ/zn-backend-webhooks/pull/2","diff_url":"https://github.com/ZengineHQ/zn-backend-webhooks/pull/2.diff","patch_url":"https://github.com/ZengineHQ/zn-backend-webhooks/pull/2.patch","issue_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/issues/2","number":2,"state":"open","locked":false,"title":"Validate multi config","user":{"login":"tehpsalmist","id":26337310,"node_id":"MDQ6VXNlcjI2MzM3MzEw","avatar_url":"https://avatars3.githubusercontent.com/u/26337310?v=4","gravatar_id":"","url":"https://api.github.com/users/tehpsalmist","html_url":"https://github.com/tehpsalmist","followers_url":"https://api.github.com/users/tehpsalmist/followers","following_url":"https://api.github.com/users/tehpsalmist/following{/other_user}","gists_url":"https://api.github.com/users/tehpsalmist/gists{/gist_id}","starred_url":"https://api.github.com/users/tehpsalmist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tehpsalmist/subscriptions","organizations_url":"https://api.github.com/users/tehpsalmist/orgs","repos_url":"https://api.github.com/users/tehpsalmist/repos","events_url":"https://api.github.com/users/tehpsalmist/events{/privacy}","received_events_url":"https://api.github.com/users/tehpsalmist/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-16T20:30:17Z","updated_at":"2018-08-16T20:40:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"928bb2560f80335e14ef3fea7c6bed27b305642b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/2/commits","review_comments_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/2/comments","review_comment_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/issues/2/comments","statuses_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/statuses/af44bc0dd18735cc73cd420f9b27b703cba8e135","head":{"label":"tehpsalmist:validate-multi-config","ref":"validate-multi-config","sha":"af44bc0dd18735cc73cd420f9b27b703cba8e135","user":{"login":"tehpsalmist","id":26337310,"node_id":"MDQ6VXNlcjI2MzM3MzEw","avatar_url":"https://avatars3.githubusercontent.com/u/26337310?v=4","gravatar_id":"","url":"https://api.github.com/users/tehpsalmist","html_url":"https://github.com/tehpsalmist","followers_url":"https://api.github.com/users/tehpsalmist/followers","following_url":"https://api.github.com/users/tehpsalmist/following{/other_user}","gists_url":"https://api.github.com/users/tehpsalmist/gists{/gist_id}","starred_url":"https://api.github.com/users/tehpsalmist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tehpsalmist/subscriptions","organizations_url":"https://api.github.com/users/tehpsalmist/orgs","repos_url":"https://api.github.com/users/tehpsalmist/repos","events_url":"https://api.github.com/users/tehpsalmist/events{/privacy}","received_events_url":"https://api.github.com/users/tehpsalmist/received_events","type":"User","site_admin":false},"repo":{"id":145023292,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUwMjMyOTI=","name":"zn-backend-webhooks","full_name":"tehpsalmist/zn-backend-webhooks","owner":{"login":"tehpsalmist","id":26337310,"node_id":"MDQ6VXNlcjI2MzM3MzEw","avatar_url":"https://avatars3.githubusercontent.com/u/26337310?v=4","gravatar_id":"","url":"https://api.github.com/users/tehpsalmist","html_url":"https://github.com/tehpsalmist","followers_url":"https://api.github.com/users/tehpsalmist/followers","following_url":"https://api.github.com/users/tehpsalmist/following{/other_user}","gists_url":"https://api.github.com/users/tehpsalmist/gists{/gist_id}","starred_url":"https://api.github.com/users/tehpsalmist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tehpsalmist/subscriptions","organizations_url":"https://api.github.com/users/tehpsalmist/orgs","repos_url":"https://api.github.com/users/tehpsalmist/repos","events_url":"https://api.github.com/users/tehpsalmist/events{/privacy}","received_events_url":"https://api.github.com/users/tehpsalmist/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tehpsalmist/zn-backend-webhooks","description":"Helper module for working with Webhooks in Zengine backend plugins.","fork":true,"url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks","forks_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/forks","keys_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/teams","hooks_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/hooks","issue_events_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/issues/events{/number}","events_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/events","assignees_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/assignees{/user}","branches_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/branches{/branch}","tags_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/tags","blobs_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/git/refs{/sha}","trees_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/statuses/{sha}","languages_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/languages","stargazers_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/stargazers","contributors_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/contributors","subscribers_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/subscribers","subscription_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/subscription","commits_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/commits{/sha}","git_commits_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/git/commits{/sha}","comments_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/comments{/number}","issue_comment_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/issues/comments{/number}","contents_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/contents/{+path}","compare_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/merges","archive_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/downloads","issues_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/issues{/number}","pulls_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/pulls{/number}","milestones_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/milestones{/number}","notifications_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/labels{/name}","releases_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/releases{/id}","deployments_url":"https://api.github.com/repos/tehpsalmist/zn-backend-webhooks/deployments","created_at":"2018-08-16T18:08:42Z","updated_at":"2018-08-16T18:08:45Z","pushed_at":"2018-08-16T20:26:18Z","git_url":"git://github.com/tehpsalmist/zn-backend-webhooks.git","ssh_url":"git@github.com:tehpsalmist/zn-backend-webhooks.git","clone_url":"https://github.com/tehpsalmist/zn-backend-webhooks.git","svn_url":"https://github.com/tehpsalmist/zn-backend-webhooks","homepage":"https://zenginehq.github.io/zn-backend-webhooks/","size":424,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ZengineHQ:master","ref":"master","sha":"ff2db19446670f5aaf3fdf2f9f1a53612b6e1371","user":{"login":"ZengineHQ","id":8379785,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgzNzk3ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/8379785?v=4","gravatar_id":"","url":"https://api.github.com/users/ZengineHQ","html_url":"https://github.com/ZengineHQ","followers_url":"https://api.github.com/users/ZengineHQ/followers","following_url":"https://api.github.com/users/ZengineHQ/following{/other_user}","gists_url":"https://api.github.com/users/ZengineHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ZengineHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZengineHQ/subscriptions","organizations_url":"https://api.github.com/users/ZengineHQ/orgs","repos_url":"https://api.github.com/users/ZengineHQ/repos","events_url":"https://api.github.com/users/ZengineHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ZengineHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":138316974,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgzMTY5NzQ=","name":"zn-backend-webhooks","full_name":"ZengineHQ/zn-backend-webhooks","owner":{"login":"ZengineHQ","id":8379785,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgzNzk3ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/8379785?v=4","gravatar_id":"","url":"https://api.github.com/users/ZengineHQ","html_url":"https://github.com/ZengineHQ","followers_url":"https://api.github.com/users/ZengineHQ/followers","following_url":"https://api.github.com/users/ZengineHQ/following{/other_user}","gists_url":"https://api.github.com/users/ZengineHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ZengineHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZengineHQ/subscriptions","organizations_url":"https://api.github.com/users/ZengineHQ/orgs","repos_url":"https://api.github.com/users/ZengineHQ/repos","events_url":"https://api.github.com/users/ZengineHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ZengineHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ZengineHQ/zn-backend-webhooks","description":"Helper module for working with Webhooks in Zengine backend plugins.","fork":false,"url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks","forks_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/forks","keys_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/teams","hooks_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/hooks","issue_events_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/issues/events{/number}","events_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/events","assignees_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/assignees{/user}","branches_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/branches{/branch}","tags_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/tags","blobs_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/statuses/{sha}","languages_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/languages","stargazers_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/stargazers","contributors_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/contributors","subscribers_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/subscribers","subscription_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/subscription","commits_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/contents/{+path}","compare_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/merges","archive_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/downloads","issues_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/issues{/number}","pulls_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls{/number}","milestones_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/milestones{/number}","notifications_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/labels{/name}","releases_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/releases{/id}","deployments_url":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/deployments","created_at":"2018-06-22T15:11:06Z","updated_at":"2018-07-30T15:53:06Z","pushed_at":"2018-08-16T20:30:18Z","git_url":"git://github.com/ZengineHQ/zn-backend-webhooks.git","ssh_url":"git@github.com:ZengineHQ/zn-backend-webhooks.git","clone_url":"https://github.com/ZengineHQ/zn-backend-webhooks.git","svn_url":"https://github.com/ZengineHQ/zn-backend-webhooks","homepage":"https://zenginehq.github.io/zn-backend-webhooks/","size":424,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/2"},"html":{"href":"https://github.com/ZengineHQ/zn-backend-webhooks/pull/2"},"issue":{"href":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/issues/2"},"comments":{"href":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/ZengineHQ/zn-backend-webhooks/statuses/af44bc0dd18735cc73cd420f9b27b703cba8e135"}},"author_association":"NONE"}}
{"actor":{"display_login":"alexweber"}}