-
Notifications
You must be signed in to change notification settings - Fork 381
Description
Originally from: Miserlou/Zappa#2093 by tommie-lie
Description
Support for REQUEST authorizers was almost there, as the type authorizer property was mostly passed through to the CloudFormation templates. This PR extends the handler middleware to also treat events of type REQUEST as authorization events. It also extends the template creation to treat TOKEN and REQUEST type authorizers equal (defaulting to TOKEN just as before).
The most significant change is in the logic how the authorization type for API routes is derived from the authorizer type: Instead of assuming CUSTOM if the type is not specified, the authorizer type correctly defaults to TOKEN. The authorization type is then mapped to CUSTOM for both, TOKEN and REQUEST authorizers.
Added unit tests and tested on live environments on AWS.
GitHub Issues
Fixes #1159