-
-
Notifications
You must be signed in to change notification settings - Fork 798
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: skip adding authorizer to event if no authorizer is configured #1786
Conversation
Hi @DorianMazur i have another one for you to 👀 ! |
|
||
if (!endpoint.authorizer) { | ||
log.debug("no authorizer configured, deleting authorizer payload") | ||
delete event.requestContext.authorizer |
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.
I think this will collide with customizations.offline?.customAuthenticationProvider, that's why tests are failing.
Co-authored-by: Dorian <46839236+DorianMazur@users.noreply.github.com>
thank you! i ran a limited set of the tests locally until it worked so i must have missed customAuthenticationProvider |
* master: refactor: use provided log utils (dherault#1784) fix: skip adding authorizer to event if no authorizer is configured (dherault#1786) Update README.md
Description
AWS API Gateway does not include the
event.requestContext.authorizer
field if there is noauthorizer
configured for the function.This PR deletes the
event.requestContext.authorizer
field if the function does not have an authorizer.Motivation and Context
authorizer
payload didn't match what it expectedserverless-offline
was always settingevent.requestContext.authorizer
if aBearer
token comes through in the HTTP Authorization headers.event.requestContext.authorizer
if the lambda function does not have anauthorizer
set.How Has This Been Tested?
I've written tests and included them in this PR. Please let me know if you want me to kick the tires in any other ways!