-
Notifications
You must be signed in to change notification settings - Fork 154
Bug: API Gateway Console Test button fails validation with @parser envelope ApiGatewayEnvelope because requestContext -> identity -> sourceIp value is not a valid IPv4 or IPv6 network #2526
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hi @Cihaan - thank you for reporting this and for opening the issue after our chat on Discord. I'll be working on a PR to apply the workaround on the Excluding major issues, the fix should land in the next release. |
The PR is up and ready for review - as soon as another maintainer picks it up we'll likely be able to merge it. Just to manage expectations, most of the team is attending events this and next week so I can't commit to a date for a release. Thank you for your patience. |
hey @dreamorosi, alright! thank you for taking the time |
This issue is now closed. Please be mindful that future comments are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so. |
This is now released under v2.2.0 version! |
Expected Behavior
We should be able to generate a test form the API Gateway console that allows the ApiGatewayProxyEventModel to be validated and parsed by Zod.
Current Behavior
When generating a test from the API Gateway console, the value for the sourceIp in requestContext -> identity is "test-invoke-source-ip". Since this value is defined to be an ip here And so test events from the API Gateway console fail with a 502 error because of the resulting Zod ValidationError.
Code snippet
Steps to Reproduce
/upload
route in the Api Gateway AWS Consolefollowing conversation in the Discord: https://discord.com/channels/1006478942305263677/1006527385409179678/1239877018653560872
(related to aws-powertools/powertools-lambda-python/issues/1562)
Possible Solution
update the Api Gateway zod schema to be:
Powertools for AWS Lambda (TypeScript) version
2.1.1-beta
AWS Lambda function runtime
20.x
Packaging format used
npm
Execution logs
No response
The text was updated successfully, but these errors were encountered: