From 40dc3c4ceab6da249c634356dcb191996b60964f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Franz=C3=A9n?= Date: Tue, 10 Sep 2019 13:25:06 +0200 Subject: [PATCH 1/2] Add another style of policyResource We are using a resource policy("arn:aws:execute-api:*:*:*") that works fine on aws but not when using serverless, this took some time to figure out. Could we add it? --- src/api-gateway/authMatchPolicyResource.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api-gateway/authMatchPolicyResource.js b/src/api-gateway/authMatchPolicyResource.js index 00c216d34..fb5a1018f 100644 --- a/src/api-gateway/authMatchPolicyResource.js +++ b/src/api-gateway/authMatchPolicyResource.js @@ -20,6 +20,10 @@ export default function authMatchPolicyResource(policyResource, resource) { // better fix for #523 return true } + + if (policyResource === 'arn:aws:execute-api:*:*:*') { + return true + } if (policyResource.includes('*') || policyResource.includes('?')) { // Policy contains a wildcard resource From 67ff7d27fe82602af040f314559428897bab69fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Franz=C3=A9n?= Date: Tue, 10 Sep 2019 13:38:43 +0200 Subject: [PATCH 2/2] Remove whitespace --- src/api-gateway/authMatchPolicyResource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api-gateway/authMatchPolicyResource.js b/src/api-gateway/authMatchPolicyResource.js index fb5a1018f..9aecdcd57 100644 --- a/src/api-gateway/authMatchPolicyResource.js +++ b/src/api-gateway/authMatchPolicyResource.js @@ -20,7 +20,7 @@ export default function authMatchPolicyResource(policyResource, resource) { // better fix for #523 return true } - + if (policyResource === 'arn:aws:execute-api:*:*:*') { return true }