Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jun 18, 2024

Conversation

G-Rath
Copy link
Contributor

@G-Rath G-Rath commented Jun 15, 2024

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):

@DorianMazur DorianMazur merged commit 0203d04 into dherault:master Jun 18, 2024
9 checks passed
cnuss added a commit to scaffoldly/serverless-offline that referenced this pull request Jun 19, 2024
* master:
  fix: improve wildcard handling in authorizer policy resource parser (dherault#1797)
  fix: ensure resource policy matches the whole arn (dherault#1798)
@G-Rath G-Rath deleted the fix-parse-resource branch June 21, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when custom authorizer's policyResource is 'arn:aws:execute-api:*'
2 participants