-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
feat(adaptor): Enhance AWS Lambda Event Handling and Interface #1710
Conversation
Hi @watany-dev I'll review this later. It will be merged into a "next" branch because this will be new feature. |
Hi @watany-dev ! Could you fix the conflict? After fixing it, I'll merge this into a "next" branch for the |
@yusukebe |
* Invalid HTTP header error is hidden This error is captured and never shown which may by misleading. This PR suggest to throw this error directly to the reponse. * fixed the linter error * add a test * denoify --------- Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one thing.
This is a breaking change, so concurrently using the old name's copied Type for a certain period might be beneficial.
I think we should do that. Let's make LambdaFunctionUrlRequestContext
available and mark it as deprecated
.
@yusukebe |
After fully supporting the API Gateway V1 event, we found that the traditional support for ALB was no longer possible. Therefore, we have defined a new schema. |
Hi @watany-dev Sorry for the late reply. I am sick in bed right now. Will review when I'm better. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I'm back. This great! Let's go with it. |
Hi @watany-dev I'll release the new version |
@yusukebe |
Thanks! |
fixed #1620
To provide full access to the Event, which is the input for AWS Lambda, the following modifications have been made:
1. Review of the Event
Confirmed that having API Gateway versions 1.0 and 2.0 is sufficient after reviewing the specifications. The official documentation states that the Event for the traditional Lambda URL is same to version 2.0.
Added missing properties in the Event Interface.
Renamed the externally exported
LambdaFunctionUrlRequestContext
toApiGatewayRequestContextV2
for name alignment with Event.2. Access to the Event
export type LambdaEvent = APIGatewayProxyEvent | APIGatewayProxyEventV2
and exported in the index.3. Discontinuation of requestContext (Not Yet Implemented)
With access to the event now available, this can be rewritten simply. Also, the internal unnecessary logic getRequestContext(event) can be removed.
If the removal of requestContext is approved, a comment like "Remove in Hono V4" can be added.
Author should do the followings, if applicable
yarn denoify
to generate files for Deno