fix(data_classes): support path parameters in APIGatewayAuthorizerResponse#8001
Open
abhu85 wants to merge 1 commit intoaws-powertools:developfrom
Open
fix(data_classes): support path parameters in APIGatewayAuthorizerResponse#8001abhu85 wants to merge 1 commit intoaws-powertools:developfrom
abhu85 wants to merge 1 commit intoaws-powertools:developfrom
Conversation
…ponse
Update the path_regex pattern to support API Gateway path parameters
including standard path parameters ({param}) and greedy path parameters
({proxy+}). Previously the regex would reject these valid resource paths.
The updated regex allows {, }, and + characters in addition to the
existing allowed characters (/, ., alphanumerics, -, _, *).
Fixes aws-powertools#7979
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Claude OSS Fixer <noreply@anthropic.com>
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Update the
path_regexpattern inAPIGatewayAuthorizerResponseto support API Gateway path parameters including:{param}{proxy+}Previously, the regex
r"^[/.a-zA-Z0-9-_\*]+$"did not allow{,}, or+characters, causingallow_routeanddeny_routeto reject valid API Gateway resource paths like/{proxy+}.Root Cause
The regex pattern at line 440 in
api_gateway_authorizer_event.pywas too restrictive and didn't account for path parameter syntax that API Gateway supports.Changes
path_regextor"^[/.a-zA-Z0-9-_\*{}+]+$"to allow path parametersTest Plan
pytest tests/unit/data_classes/required_dependencies/test_api_gateway_authorizer.py)builder.allow_route(http_method='GET', resource='/{proxy+}')ruff check)ruff format --check)Fixes #7979
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.