RFC: Generic Authorizer Support in Lambda Powertools Router #7480
Unanswered
tonnico
asked this question in
RFCs (Requests for Comments)
Replies: 1 comment
-
Hey @tonnico, thank you for the submission – we'll bring this up in our next planning session (today) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is this related to an existing feature request or issue?
No response
Which Powertools for AWS Lambda (Python) utility does this relate to?
Event Handler - REST API
Summary
This RFC proposes extending the Lambda Powertools Router and APIGatewayRestResolver to support authorization metadata on routes and introduce a pluggable Authorizer framework.
This enables developers to declare authorization requirements directly alongside route definitions, and delegate enforcement to customizable authorizer classes.
The framework should:
Use case
Example today:
With proposal:
Proposal
Extend route registration
Add an optional authorize kwarg to methods.
Example:
Internally, this metadata is stored alongside the route definition.
Authorizer Baseclass
Introduce a
BaseAuthorizer
contract:Developer workflow
Add routes with authorize=....
Instantiate an authorizer with the app.
Reference the authorizer in Lambda:
Out of scope
Potential challenges
Metadata typing
Extensibility without lock-in
Performance
Developer ergonomics
authorize=...
should feel as natural as adding a route.Dependencies and Integrations
Alternative solutions
Custom Lambda Authorizer without Powertools integration
Middleware approach
Acknowledgment
Beta Was this translation helpful? Give feedback.
All reactions