-
Notifications
You must be signed in to change notification settings - Fork 380
fix(lambda-events): Deprecate authorizer-specific fields in ApiGatewayV2httpRequest #1089
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(lambda-events): Deprecate authorizer-specific fields in ApiGatewayV2httpRequest #1089
Conversation
…yV2httpRequest Deprecates fields in ApiGatewayV2httpRequest that are only present in Custom Authorizer v1 payloads but not in standard HTTP API v2 requests: - kind (type) - method_arn - http_method - identity_source - authorization_token The http_method field incorrectly defaults to GET when missing, which can lead to security issues as POST/PUT/DELETE requests may be treated as GET. For standard HTTP API v2 requests, users should use request_context.http.method to get the correct HTTP method. For Custom Authorizer v1 payloads, users should use the dedicated ApiGatewayV2CustomAuthorizerV1Request struct. Adds comprehensive documentation explaining the correct usage patterns and a test demonstrating how to properly access the HTTP method for standard HTTP API v2 requests. Fixes aws#1080
Semver Check Failure - Expected BehaviorThe What the semver checker found:
Resolution:This is expected and correct behavior. The version bump will be handled by the maintainers during the release process. The deprecations are necessary to guide users away from fields that can cause security issues (as described in #1080). Why this change is important:The deprecated |
FullyTyped
left a comment
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.
We will be bumping to 1.1.0 soon, so we are good to merge without.
I think the version is wrong though, this should be 1.0.2 or whatever we currently have.
|
Thanks for the quick review! I've updated the deprecation version, but I want to confirm the correct value for the
Should the
I currently have it set to |
|
Sorry yeah, 1.1.0 is appropriate. We will be bumping that as we are adding the builders. |
Thanks, I will commit the changes now. |
Address review feedback to correct the 'since' parameter in deprecated attributes to match the upcoming release version.
|
✅ Updated! All deprecation attributes now use |
Description
This PR addresses issue #1080 by deprecating fields in
ApiGatewayV2httpRequestthat are only present in Custom Authorizer v1 payloads but not in standard HTTP API v2 requests.Changes
Deprecates the following fields in
ApiGatewayV2httpRequest:kind(type)method_arnhttp_methodidentity_sourceauthorization_tokenProblem
The
http_methodfield incorrectly defaults toGETwhen missing from the JSON payload. This is problematic because:httpMethodfieldrequestContext.http.methodGETcan cause POST/PUT/DELETE requests to be incorrectly treated as GET requestsSolution
#[deprecated]attributes to all authorizer-specific fields with clear guidancerequest_context.http.methodApiGatewayV2CustomAuthorizerV1Requestapigw_v2_correct_http_method_usage()demonstrating the correct usage patternBackward Compatibility
All deprecated fields remain functional and existing code will continue to work. Users will receive deprecation warnings guiding them to the correct approach.
Semver Check Status
semvercheck failure is expected and correct. Marking public fields as deprecated requires a minor version bump (1.0.3 → 1.1.0) according to semantic versioning rules, which will be handled by maintainers during the release process.Testing
rustfmtFixes #1080