Skip to content

[Migrated] Add support for REQUEST type Lambda Authorizers #847

@jneves

Description

@jneves

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions