That there isn't an error, since this is a valid ARN per the docs:
If the wildcard (*) is the last character of a resource ARN segment, it can expand to match beyond colon boundaries
(I've also been using this for a while without any errors or warnings)
Environment
serverless version: 3.38.0
serverless-offline version: 13.6.0
node.js version: v20
OS: Ubuntu via WSLv2
Possible Solution
Modify the code to check to handle the above, with an optional region check.
Additional context/Screenshots
This was hard to debug because the whole authorizer block is wrapped in a big try/catch which doesn't actually print the error and returns unauthorized - I think ideally that should be changed to 1. print the error and 2. return 500, as that better matches what API Gateway will do.
I'm a bit stretched for time and couldn't easily tell if this had already been reported - I'll try doing PRs for both of these soon; if people are happy for PRs without tests I should be able to chuck some up in the next week or so.
Bug Report
Current Behavior
An error is thrown by the
parseResource
function:Sample Code
Expected behavior/code
That there isn't an error, since this is a valid ARN per the docs:
(I've also been using this for a while without any errors or warnings)
Environment
serverless
version: 3.38.0serverless-offline
version: 13.6.0node.js
version: v20OS
: Ubuntu via WSLv2Possible Solution
Modify the code to check to handle the above, with an optional region check.
Additional context/Screenshots
This was hard to debug because the whole authorizer block is wrapped in a big try/catch which doesn't actually print the error and returns unauthorized - I think ideally that should be changed to 1. print the error and 2. return 500, as that better matches what API Gateway will do.
I'm a bit stretched for time and couldn't easily tell if this had already been reported - I'll try doing PRs for both of these soon; if people are happy for PRs without tests I should be able to chuck some up in the next week or so.