dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.16k stars 794 forks source link

fix: improve wildcard handling in authorizer policy resource parser #1797

Closed G-Rath closed 2 weeks ago

G-Rath commented 3 weeks ago

Description

Improves the parsing logic of resource arns in authorizer policies so that it handles wildcards more correctly

Motivation and Context

Currently serverless-offline will crash if you use a resource arn that ends with a wildcard'd segment even though that is allowed per the docs:

If you specify a wildcard (*), the Resource expression applies the wildcard to the rest of the expression.

and here too:

If the wildcard (*) is the last character of a resource ARN segment, it can expand to match beyond colon boundaries

Resolves #1794

How Has This Been Tested?

I ran the test suite and tried it out locally.

Screenshots (if appropriate):