You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The examples provided below are far from exhaustive - the data classes themselves are designed to provide a form of
83
84
documentation inherently (via autocompletion, types and docstrings).
84
85
86
+
### API Gateway Authorizer
87
+
88
+
> New in 1.20.0
89
+
90
+
It is used for API Gateway Rest API lambda authorizer payload. See docs on
91
+
[Use API Gateway Lambda authorizers](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html){target="_blank"}
92
+
for more details. Use `APIGatewayAuthorizerRequestEvent` for type "REQUEST" and `APIGatewayAuthorizerTokenEvent` for
93
+
type "TOKEN".
94
+
95
+
Below is 2 examples of a Rest API lambda authorizer. One looking up user details by `Authorization` header and using
96
+
`APIGatewayAuthorizerResponse` to return the declined response when user is not found or authorized and include
97
+
the user details in the request context and full access for admin users. And another using
98
+
`APIGatewayAuthorizerTokenEvent` to get the `authorization_token`.
99
+
100
+
=== "app_type_request.py"
101
+
102
+
```python
103
+
from aws_lambda_powertools.utilities.data_classes import event_source
104
+
from aws_lambda_powertools.utilities.data_classes.api_gateway_authorizer_event import (
0 commit comments