Skip to content

fix(aws-lambda): add missing lambda authorizer context type#4908

Open
lihan3238 wants to merge 1 commit into
honojs:mainfrom
lihan3238:fix/aws-lambda-authorizer-type
Open

fix(aws-lambda): add missing lambda authorizer context type#4908
lihan3238 wants to merge 1 commit into
honojs:mainfrom
lihan3238:fix/aws-lambda-authorizer-type

Conversation

@lihan3238

Copy link
Copy Markdown

Summary

  • Add lambda?: Record<string, unknown> to the Authorizer interface in src/adapter/aws-lambda/types.ts
  • This allows TypeScript users to access requestContext.authorizer.lambda when using custom Lambda authorizers with AWS HTTP API Gateway v2

Background

The Authorizer interface used by ApiGatewayRequestContextV2 only had the iam field for IAM-based authorization. Custom Lambda authorizers return their context under requestContext.authorizer.lambda, but this field was missing from the type definition, causing TypeScript errors.

Fixes #3281

Test plan

  • Existing tests continue to pass
  • Type change is backward compatible (adds an optional field)

The Authorizer interface in ApiGatewayRequestContextV2 only included
the iam field, missing the lambda field used by custom Lambda
authorizers on AWS HTTP API Gateway v2.

Fixes honojs#3281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Types: LambdaEvent type is missing authorizer context for lambda auth

1 participant