Closed
Description
Expected Behavior
The identitySource
field in APIGatewayRequestAuthorizerEventV2
can be null when the Lambda authorizer is not configured with an identity source (see screenshot from the AWS Console below).
Current Behavior
The current definition does not account for this scenario, leading to an error:
Even the @types/aws-lambda
package has invalid type definition:
Code snippet
APIGatewayRequestAuthorizerEventV2Schema.parse(event);
Steps to Reproduce
When creating a Lambda authorizer, do not specify an identity source.
Possible Solution
add .nullable()
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
20.x
Packaging format used
npm
Execution logs
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Shipped
Activity
am29d commentedon Jan 17, 2025
Hey @hibanka , thanks for opening the issue, this makes sense, the docs even says the identity source is optional:
Quick fix incoming...
Дякую!
leandrodamascena commentedon Jan 17, 2025
This is also a bug in Powertools Python - https://github.com/aws-powertools/powertools-lambda-python/blob/develop/aws_lambda_powertools/utilities/parser/models/apigwv2.py#L75.
Thanks for reporting this @hibanka.
am29d commentedon Jan 17, 2025
I just ran a quick test in the console, I can't reproduce an event with
identitySource: null
on API GW V2. @hibanka how did you configure the API GW?Here is an example event I have got:
I called the endpoint from my terminal via public URL.
Edit: nvm, we remove null values with the logger.
github-actions commentedon Jan 17, 2025
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.
github-actions commentedon Jan 28, 2025
This is now released under v2.13.1 version!