-
Notifications
You must be signed in to change notification settings - Fork 171
feat(parser): add IPv6 support for sourceIp in API Gateway schemas #4398
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
feat(parser): add IPv6 support for sourceIp in API Gateway schemas #4398
Conversation
- Updated api-gateway.ts to support both IPv4 and IPv6 addresses - Updated api-gatewayv2.ts to support both IPv4 and IPv6 addresses - Updated appsync-shared.ts to support both IPv4 and IPv6 addresses - Added comprehensive tests for IPv6 support in all affected schemas Closes aws-powertools#4348
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
- Reverted IPv6 support in appsync-shared.ts (AppSync doesn't support IPv6 yet) - Removed IPv6 test cases from appsync.test.ts - Kept IPv6 support for API Gateway and API Gateway v2 only As mentioned in issue aws-powertools#4348, AppSync does not currently support IPv6
I've also marked the SonarQube findings as safe since the ip is hardcoded just for the tests. |
- Replace 'as any' with proper TypeScript types in test files - Use APIGatewayProxyEvent type for API Gateway tests - Use APIGatewayProxyEventV2 type for API Gateway v2 tests - Import types from '../../../src/types/schema.js' This addresses code review feedback for better type safety
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks @dcabib for your contribution
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Description
This PR adds IPv6 support for sourceIp fields in API Gateway, API Gateway v2, and AppSync parser schemas.
Changes
packages/parser/src/schemas/api-gateway.ts
to accept both IPv4 and IPv6 addresses forsourceIp
fieldpackages/parser/src/schemas/api-gatewayv2.ts
to accept both IPv4 and IPv6 addresses forhttp.sourceIp
fieldpackages/parser/src/schemas/appsync-shared.ts
to accept arrays of both IPv4 and IPv6 addresses forsourceIp
fieldTesting
packages/parser/tests/unit/schema/apigw.test.ts
packages/parser/tests/unit/schema/apigwv2.test.ts
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.
Closes #4348