-
-
Notifications
You must be signed in to change notification settings - Fork 797
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: LambdaProxyIntegrationEventV2 authorizer context #1630
Conversation
thank you for your PR @rishi8094 I have not looked into the details of your PR yet, but you might have to fix the test? |
Thank you for taking a look. I have now updated the relevant test case for the proposed fix. |
@dnalborczyk recently pushed the passing test case, think it's good for a review now. |
Hey @dnalborczyk, wanted to follow up on this PR. |
Hello! My team is utilizing custom authorizers in Serverless and running locally with serverless-offline, and we have noticed the issue which this PR is setup to fix. For more context, it appears that AWS uses APIGatewayProxyEventV2WithLambdaAuthorizer for the event-argument of a Lambda behind an Authorizer (seen here), and if you follow the types through their generic arguments, you get to APIGatewayEventRequestContextLambdaAuthorizer, where the actual authorizer's context is in fact wrapped as an object under the Our code will be partially incorrect and more brittle until this PR is merged and released, so I urge you to please merge this at your earliest convenience. Thank you! |
close/re-open in order to run ci. |
thank you @rishi8094 |
Description
The
LambdaProxyIntegrationEventV2
does not return custom authorizer contexts in the correct format. Currently, any context data is returned directly within theauthorizer
object:Instead of being nested in the
lambda
object:Motivation and Context
This change is required as it breaks the local implementation of the custom authorizer.