{"action":"created","comment":{"url":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/comments/225991928","pull_request_review_id":165708197,"id":225991928,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNTk5MTkyOA==","diff_hunk":"@@ -10,17 +10,40 @@ const IN_TO_LOCATION = require('./in_to_location')\n // Normalize OpenAPI security request parameters into specification-agnostic\n // format\n const getSecParams = function({\n-  spec: { securityDefinitions, security: apiSecurity = [] },\n+  spec: {\n+    securityDefinitions,\n+    security: apiSecurity = [],\n+    components: {\n+      securitySchemes: secSchemes\n+    }\n+  },\n   operation: { security = apiSecurity },\n }) {\n   const secRefs = getSecRefs({ security })\n+  const secDef = getSecDefs({ securityDefinitions, securitySchemes: secSchemes})\n   const secParams = secRefs.map(([secName, scopes]) =>\n-    getSecParam({ secName, scopes, securityDefinitions }),\n+    getSecParam({ secName, scopes, securityDefinitions: secDef }),\n   )\n   const secParamsA = Object.assign({}, ...secParams)\n   return secParamsA\n }\n \n+const getSecDefs = function({ securityDefinitions, securitySchemes }) {","path":"src/core/spec/start/normalize/params/security.js","position":24,"original_position":24,"commit_id":"efdaac4bc5990df618d578e0332e9f2d36e7ed4a","original_commit_id":"efdaac4bc5990df618d578e0332e9f2d36e7ed4a","user":{"login":"jpettit","id":146540,"node_id":"MDQ6VXNlcjE0NjU0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/146540?v=4","gravatar_id":"","url":"https://api.github.com/users/jpettit","html_url":"https://github.com/jpettit","followers_url":"https://api.github.com/users/jpettit/followers","following_url":"https://api.github.com/users/jpettit/following{/other_user}","gists_url":"https://api.github.com/users/jpettit/gists{/gist_id}","starred_url":"https://api.github.com/users/jpettit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpettit/subscriptions","organizations_url":"https://api.github.com/users/jpettit/orgs","repos_url":"https://api.github.com/users/jpettit/repos","events_url":"https://api.github.com/users/jpettit/events{/privacy}","received_events_url":"https://api.github.com/users/jpettit/received_events","type":"User","site_admin":false},"body":"This isn't a good solution for checking 2.0 and 3.0 specs.  Just throwing up the most basic PR here.","created_at":"2018-10-17T15:54:12Z","updated_at":"2018-10-17T15:54:12Z","html_url":"https://github.com/Cardero-X/test-openapi/pull/3#discussion_r225991928","pull_request_url":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/3","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/comments/225991928"},"html":{"href":"https://github.com/Cardero-X/test-openapi/pull/3#discussion_r225991928"},"pull_request":{"href":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/3","id":223659098,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzNjU5MDk4","html_url":"https://github.com/Cardero-X/test-openapi/pull/3","diff_url":"https://github.com/Cardero-X/test-openapi/pull/3.diff","patch_url":"https://github.com/Cardero-X/test-openapi/pull/3.patch","issue_url":"https://api.github.com/repos/Cardero-X/test-openapi/issues/3","number":3,"state":"open","locked":false,"title":"OpenAPI 3.0 support for basic bearer auth security type","user":{"login":"jpettit","id":146540,"node_id":"MDQ6VXNlcjE0NjU0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/146540?v=4","gravatar_id":"","url":"https://api.github.com/users/jpettit","html_url":"https://github.com/jpettit","followers_url":"https://api.github.com/users/jpettit/followers","following_url":"https://api.github.com/users/jpettit/following{/other_user}","gists_url":"https://api.github.com/users/jpettit/gists{/gist_id}","starred_url":"https://api.github.com/users/jpettit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpettit/subscriptions","organizations_url":"https://api.github.com/users/jpettit/orgs","repos_url":"https://api.github.com/users/jpettit/repos","events_url":"https://api.github.com/users/jpettit/events{/privacy}","received_events_url":"https://api.github.com/users/jpettit/received_events","type":"User","site_admin":false},"body":"When attempting to use the `components.securitySchemes` definition in OAPI 3.0 I get the following error.  This stubs in basic support and is probably a starting point for 2.0 support (not tested)?\r\n\r\nThis allows a task to define an auth header as such:\r\n\r\nauthHeader.tasks.yml\r\n```\r\n- name: authExampleTest\r\n  spec:\r\n    ...\r\n  call:\r\n    ...\r\n    headers.authorization: 'Bearer TOKEN'\r\n  validate:\r\n    ...\r\n```\r\n\r\n\r\nopenapi.yml 3.0 example\r\n```\r\nsecurity:\r\n  - bearerAuth: []\r\n\r\n...\r\n\r\ncomponents:\r\n  securitySchemes:\r\n    bearerAuth:\r\n      type: http\r\n      scheme: bearer\r\n\r\n```\r\n\r\n```\r\n⢀⠀ 0/1A bug occurred.\r\nPlease report an issue on the 'test-openapi-plugin-spec' code repository and paste the following lines:\r\n\r\nOS: darwin\r\nnode.js: v10.11.0\r\ntest-openapi: 38.1.1\r\n\r\nTypeError: Cannot read property 'bearerAuth' of undefined\r\n    at getSecParam (/Users/jpettit/dev/github/test-openapi/src/core/spec/start/normalize/params/security.js:33:42)\r\n    at secRefs.map (/Users/jpettit/dev/github/test-openapi/src/core/spec/start/normalize/params/security.js:18:5)\r\n    at Array.map (<anonymous>)\r\n    at getSecParams (/Users/jpettit/dev/github/test-openapi/src/core/spec/start/normalize/params/security.js:17:29)\r\n    at getParams (/Users/jpettit/dev/github/test-openapi/src/core/spec/start/normalize/params/main.js:32:21)\r\n    at getOperation (/Users/jpettit/dev/github/test-openapi/src/core/spec/start/normalize/main.js:34:18)\r\n    at Object.entries.map (/Users/jpettit/dev/github/test-openapi/src/core/spec/start/normalize/main.js:27:5)\r\n    at Array.map (<anonymous>)\r\n    at getOperationsByPath (/Users/jpettit/dev/github/test-openapi/src/core/spec/start/normalize/main.js:26:35)\r\n    at Object.entries.map (/Users/jpettit/dev/github/test-openapi/src/core/spec/start/normalize/main.js:16:5)\r\n```","created_at":"2018-10-17T15:50:45Z","updated_at":"2018-10-17T15:54:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52534b92b11c6c87faacd22503cfa50845180cda","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/3/commits","review_comments_url":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/3/comments","review_comment_url":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Cardero-X/test-openapi/issues/3/comments","statuses_url":"https://api.github.com/repos/Cardero-X/test-openapi/statuses/efdaac4bc5990df618d578e0332e9f2d36e7ed4a","head":{"label":"jpettit:jpettit/oapi3_bearer","ref":"jpettit/oapi3_bearer","sha":"efdaac4bc5990df618d578e0332e9f2d36e7ed4a","user":{"login":"jpettit","id":146540,"node_id":"MDQ6VXNlcjE0NjU0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/146540?v=4","gravatar_id":"","url":"https://api.github.com/users/jpettit","html_url":"https://github.com/jpettit","followers_url":"https://api.github.com/users/jpettit/followers","following_url":"https://api.github.com/users/jpettit/following{/other_user}","gists_url":"https://api.github.com/users/jpettit/gists{/gist_id}","starred_url":"https://api.github.com/users/jpettit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpettit/subscriptions","organizations_url":"https://api.github.com/users/jpettit/orgs","repos_url":"https://api.github.com/users/jpettit/repos","events_url":"https://api.github.com/users/jpettit/events{/privacy}","received_events_url":"https://api.github.com/users/jpettit/received_events","type":"User","site_admin":false},"repo":{"id":153481662,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM0ODE2NjI=","name":"test-openapi","full_name":"jpettit/test-openapi","private":false,"owner":{"login":"jpettit","id":146540,"node_id":"MDQ6VXNlcjE0NjU0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/146540?v=4","gravatar_id":"","url":"https://api.github.com/users/jpettit","html_url":"https://github.com/jpettit","followers_url":"https://api.github.com/users/jpettit/followers","following_url":"https://api.github.com/users/jpettit/following{/other_user}","gists_url":"https://api.github.com/users/jpettit/gists{/gist_id}","starred_url":"https://api.github.com/users/jpettit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpettit/subscriptions","organizations_url":"https://api.github.com/users/jpettit/orgs","repos_url":"https://api.github.com/users/jpettit/repos","events_url":"https://api.github.com/users/jpettit/events{/privacy}","received_events_url":"https://api.github.com/users/jpettit/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jpettit/test-openapi","description":"Automatic API integration testing","fork":true,"url":"https://api.github.com/repos/jpettit/test-openapi","forks_url":"https://api.github.com/repos/jpettit/test-openapi/forks","keys_url":"https://api.github.com/repos/jpettit/test-openapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpettit/test-openapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpettit/test-openapi/teams","hooks_url":"https://api.github.com/repos/jpettit/test-openapi/hooks","issue_events_url":"https://api.github.com/repos/jpettit/test-openapi/issues/events{/number}","events_url":"https://api.github.com/repos/jpettit/test-openapi/events","assignees_url":"https://api.github.com/repos/jpettit/test-openapi/assignees{/user}","branches_url":"https://api.github.com/repos/jpettit/test-openapi/branches{/branch}","tags_url":"https://api.github.com/repos/jpettit/test-openapi/tags","blobs_url":"https://api.github.com/repos/jpettit/test-openapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpettit/test-openapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpettit/test-openapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpettit/test-openapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpettit/test-openapi/statuses/{sha}","languages_url":"https://api.github.com/repos/jpettit/test-openapi/languages","stargazers_url":"https://api.github.com/repos/jpettit/test-openapi/stargazers","contributors_url":"https://api.github.com/repos/jpettit/test-openapi/contributors","subscribers_url":"https://api.github.com/repos/jpettit/test-openapi/subscribers","subscription_url":"https://api.github.com/repos/jpettit/test-openapi/subscription","commits_url":"https://api.github.com/repos/jpettit/test-openapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpettit/test-openapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpettit/test-openapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpettit/test-openapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpettit/test-openapi/contents/{+path}","compare_url":"https://api.github.com/repos/jpettit/test-openapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpettit/test-openapi/merges","archive_url":"https://api.github.com/repos/jpettit/test-openapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpettit/test-openapi/downloads","issues_url":"https://api.github.com/repos/jpettit/test-openapi/issues{/number}","pulls_url":"https://api.github.com/repos/jpettit/test-openapi/pulls{/number}","milestones_url":"https://api.github.com/repos/jpettit/test-openapi/milestones{/number}","notifications_url":"https://api.github.com/repos/jpettit/test-openapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpettit/test-openapi/labels{/name}","releases_url":"https://api.github.com/repos/jpettit/test-openapi/releases{/id}","deployments_url":"https://api.github.com/repos/jpettit/test-openapi/deployments","created_at":"2018-10-17T15:36:49Z","updated_at":"2018-10-17T15:36:51Z","pushed_at":"2018-10-17T15:46:00Z","git_url":"git://github.com/jpettit/test-openapi.git","ssh_url":"git@github.com:jpettit/test-openapi.git","clone_url":"https://github.com/jpettit/test-openapi.git","svn_url":"https://github.com/jpettit/test-openapi","homepage":"","size":1575,"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":"Cardero-X:master","ref":"master","sha":"16e12dce99eaa953f3ac54335fa2a77b7e8303a3","user":{"login":"Cardero-X","id":34079026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MDc5MDI2","avatar_url":"https://avatars3.githubusercontent.com/u/34079026?v=4","gravatar_id":"","url":"https://api.github.com/users/Cardero-X","html_url":"https://github.com/Cardero-X","followers_url":"https://api.github.com/users/Cardero-X/followers","following_url":"https://api.github.com/users/Cardero-X/following{/other_user}","gists_url":"https://api.github.com/users/Cardero-X/gists{/gist_id}","starred_url":"https://api.github.com/users/Cardero-X/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cardero-X/subscriptions","organizations_url":"https://api.github.com/users/Cardero-X/orgs","repos_url":"https://api.github.com/users/Cardero-X/repos","events_url":"https://api.github.com/users/Cardero-X/events{/privacy}","received_events_url":"https://api.github.com/users/Cardero-X/received_events","type":"Organization","site_admin":false},"repo":{"id":132117130,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIxMTcxMzA=","name":"test-openapi","full_name":"Cardero-X/test-openapi","private":false,"owner":{"login":"Cardero-X","id":34079026,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MDc5MDI2","avatar_url":"https://avatars3.githubusercontent.com/u/34079026?v=4","gravatar_id":"","url":"https://api.github.com/users/Cardero-X","html_url":"https://github.com/Cardero-X","followers_url":"https://api.github.com/users/Cardero-X/followers","following_url":"https://api.github.com/users/Cardero-X/following{/other_user}","gists_url":"https://api.github.com/users/Cardero-X/gists{/gist_id}","starred_url":"https://api.github.com/users/Cardero-X/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cardero-X/subscriptions","organizations_url":"https://api.github.com/users/Cardero-X/orgs","repos_url":"https://api.github.com/users/Cardero-X/repos","events_url":"https://api.github.com/users/Cardero-X/events{/privacy}","received_events_url":"https://api.github.com/users/Cardero-X/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Cardero-X/test-openapi","description":"Automatic API integration testing","fork":false,"url":"https://api.github.com/repos/Cardero-X/test-openapi","forks_url":"https://api.github.com/repos/Cardero-X/test-openapi/forks","keys_url":"https://api.github.com/repos/Cardero-X/test-openapi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Cardero-X/test-openapi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Cardero-X/test-openapi/teams","hooks_url":"https://api.github.com/repos/Cardero-X/test-openapi/hooks","issue_events_url":"https://api.github.com/repos/Cardero-X/test-openapi/issues/events{/number}","events_url":"https://api.github.com/repos/Cardero-X/test-openapi/events","assignees_url":"https://api.github.com/repos/Cardero-X/test-openapi/assignees{/user}","branches_url":"https://api.github.com/repos/Cardero-X/test-openapi/branches{/branch}","tags_url":"https://api.github.com/repos/Cardero-X/test-openapi/tags","blobs_url":"https://api.github.com/repos/Cardero-X/test-openapi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Cardero-X/test-openapi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Cardero-X/test-openapi/git/refs{/sha}","trees_url":"https://api.github.com/repos/Cardero-X/test-openapi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Cardero-X/test-openapi/statuses/{sha}","languages_url":"https://api.github.com/repos/Cardero-X/test-openapi/languages","stargazers_url":"https://api.github.com/repos/Cardero-X/test-openapi/stargazers","contributors_url":"https://api.github.com/repos/Cardero-X/test-openapi/contributors","subscribers_url":"https://api.github.com/repos/Cardero-X/test-openapi/subscribers","subscription_url":"https://api.github.com/repos/Cardero-X/test-openapi/subscription","commits_url":"https://api.github.com/repos/Cardero-X/test-openapi/commits{/sha}","git_commits_url":"https://api.github.com/repos/Cardero-X/test-openapi/git/commits{/sha}","comments_url":"https://api.github.com/repos/Cardero-X/test-openapi/comments{/number}","issue_comment_url":"https://api.github.com/repos/Cardero-X/test-openapi/issues/comments{/number}","contents_url":"https://api.github.com/repos/Cardero-X/test-openapi/contents/{+path}","compare_url":"https://api.github.com/repos/Cardero-X/test-openapi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Cardero-X/test-openapi/merges","archive_url":"https://api.github.com/repos/Cardero-X/test-openapi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Cardero-X/test-openapi/downloads","issues_url":"https://api.github.com/repos/Cardero-X/test-openapi/issues{/number}","pulls_url":"https://api.github.com/repos/Cardero-X/test-openapi/pulls{/number}","milestones_url":"https://api.github.com/repos/Cardero-X/test-openapi/milestones{/number}","notifications_url":"https://api.github.com/repos/Cardero-X/test-openapi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Cardero-X/test-openapi/labels{/name}","releases_url":"https://api.github.com/repos/Cardero-X/test-openapi/releases{/id}","deployments_url":"https://api.github.com/repos/Cardero-X/test-openapi/deployments","created_at":"2018-05-04T09:11:20Z","updated_at":"2018-10-17T13:56:50Z","pushed_at":"2018-10-17T15:50:46Z","git_url":"git://github.com/Cardero-X/test-openapi.git","ssh_url":"git@github.com:Cardero-X/test-openapi.git","clone_url":"https://github.com/Cardero-X/test-openapi.git","svn_url":"https://github.com/Cardero-X/test-openapi","homepage":"","size":1575,"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":2,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/3"},"html":{"href":"https://github.com/Cardero-X/test-openapi/pull/3"},"issue":{"href":"https://api.github.com/repos/Cardero-X/test-openapi/issues/3"},"comments":{"href":"https://api.github.com/repos/Cardero-X/test-openapi/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Cardero-X/test-openapi/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/Cardero-X/test-openapi/statuses/efdaac4bc5990df618d578e0332e9f2d36e7ed4a"}},"author_association":"NONE"}}
{"actor":{"display_login":"jpettit"}}