-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: LambdaFunctionUrlSchema fails with CloudFront Origin Access Control (OAC) #2427
Comments
Temporary "user-land" workaround is to ignore the const TempSchema = LambdaFunctionUrlSchema.merge(
z.object({
requestContext: z.unknown(),
}),
); |
Hi @aripalo, thank you for trying the Parser utility and taking the time to open an issue, as well as providing a temporary workaround. I'll add this to the backlog so we can take a look at fixing it. |
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 v2.1.1 version! |
Expected Behaviour
Using
.use(parser({ schema: LambdaFunctionUrlSchema }))
middleware should work with Lambda Function URLs protected by the newly launched CloudFront OACs.Current Behaviour
The parser throws an error:
This is because when CloudFront OAC is calling the Lambda Function URL, the
principalOrgId
andcognitoIdentity
are actual set tonull
:Code snippet
.use(parser({ schema: LambdaFunctionUrlSchema }))
with Lambda Function URL + CloudFront OACSteps to Reproduce
Creating a full example is a bit too much work for right now, but you can take my minimal Lambda Function URL + CloudFront OAC example from aws/aws-cdk#21771 (comment) and replace the Lambda function with a TS one using
.use(parser({ schema: LambdaFunctionUrlSchema }))
middleware.Possible Solution
principalOrgId
nullablecognitoIdentity
nullablePowertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
20.x
Packaging format used
npm
Execution logs
No response
The text was updated successfully, but these errors were encountered: