Closed dreamorosi closed 2 months ago
Thank you so much for opening this issue with so many details @dreamorosi!
I'll work on it until the end of this week.
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
This is now released under 2.41.0 version!
Use case
As a customer, when writing Lambda Authorizer functions for API Gateway, I would like to use the Parser utility to parse and validate the payload received by my function.
Solution/User Experience
Based on my tests, there are 3 models that could be added:
APIGatewayRequestAuthorizerEventSchema
APIGatewayTokenAuthorizerEventSchema
APIGatewayRequestAuthorizerEventV2Schema
The first two are used by API Gateway REST API (v1) when configuring a Lambda authorizer. With this version of API Gateway customers can choose whether the authorizer is looking only at the token or at the entire request and based on this the payload that the function receives changes.
For request authorizers the payload looks like this:
while for token authorizers it looks like this:
The last one is instead related to API Gateway HTTP API (v2) which as far as I can tell only supports one request type with the following payload:
In terms of DX, the model should work the same as the existing ones:
Alternative solutions
No response
Acknowledgment