Skip to content

Add support for authorizer REQUEST type#1113

Closed
ppartarr wants to merge 9 commits into
zappa:masterfrom
ppartarr:master
Closed

Add support for authorizer REQUEST type#1113
ppartarr wants to merge 9 commits into
zappa:masterfrom
ppartarr:master

Conversation

@ppartarr
Copy link
Copy Markdown

@ppartarr ppartarr commented Feb 25, 2022

Description

AWS gateway supports the use of Lambda authorizers to perform authorization (grant access to certain resources) based on a given authentication strategy (OpenID connect, basic auth, SAML etc). AWS Gateway offers two kinds of authorizers: REQUEST & TOKEN.

TOKEN authorizers receive the bearer token, like a JWT or a OAuth token.

REQUEST authorizers receive a combination of headers, query strings, stage variables and context variables.

Zappa only supports TOKEN authorizers, which is quite limiting since some authentication schemes may depend on information provided in the request.

This PR adds support for REQUEST authorizers. The authorizer config now takes a new type field as well as an identity_sources object which can be a combination of the various request expressions needed for the REQUEST authorizer (header, query string, stage variable, or context). We don't explicity support multi stage variable since fields can appear multiple times e.g.

"authorizer": {
  "type": "REQUEST",
  "function": "auth.lambda_handler",
  "identity_sources": {
    "headers": ["Authorization", "Host"],
    "stage_variables": ["prod", "dev"]
  },
}

For backwards compatibility, if the type of an authorizer is not specified, it defaults to TOKEN.

GitHub Issues

#847
Miserlou/Zappa#1159

@ppartarr
Copy link
Copy Markdown
Author

ppartarr commented Feb 28, 2022

@hellno @javulticat @wrboyce can this PR get a review?

@monkut
Copy link
Copy Markdown
Collaborator

monkut commented Nov 12, 2022

@ppartarr Can you check why this is failing? You may need need to run make isort / make black.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 3, 2024

Hi there! Unfortunately, this PR has not seen any activity for at least 90 days. If the PR is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

@github-actions github-actions Bot added the no-activity [Bot] Closing soon if no new activity label Apr 3, 2024
@github-actions
Copy link
Copy Markdown

Hi there! Unfortunately, this PR was automatically closed as it had not seen any activity in at least 100 days. If the PR is still relevant to the latest version of Zappa, please open a new PR.

@github-actions github-actions Bot added the auto-closed [Bot] Closed, details in comments label Apr 13, 2024
@github-actions github-actions Bot closed this Apr 13, 2024
@monkut monkut reopened this Nov 24, 2025
@monkut monkut removed no-activity [Bot] Closing soon if no new activity auto-closed [Bot] Closed, details in comments labels Nov 24, 2025
@monkut
Copy link
Copy Markdown
Collaborator

monkut commented Nov 24, 2025

Looks like this may need to be re-based off the lastest head.

@github-actions
Copy link
Copy Markdown

Hi there! Unfortunately, this PR has not seen any activity for at least 90 days. If the PR is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

@github-actions github-actions Bot added the no-activity [Bot] Closing soon if no new activity label Feb 22, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2026

Hi there! Unfortunately, this PR was automatically closed as it had not seen any activity in at least 100 days. If the PR is still relevant to the latest version of Zappa, please open a new PR.

@github-actions github-actions Bot added the auto-closed [Bot] Closed, details in comments label Mar 4, 2026
@github-actions github-actions Bot closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-closed [Bot] Closed, details in comments no-activity [Bot] Closing soon if no new activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants