Skip to content
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

Bolt v4 addendum: stricter typing of AWS API Gateway payloads #2277

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

filmaj
Copy link
Contributor

@filmaj filmaj commented Oct 1, 2024

Summary

This PR is an addendum / expansion on a proposed change in bolt v4: better typing of the AWS payload interfaces. This is applicable to consumers using the AwsLambdaReceiver. This PR would fix #2272.

Background

In my initial bolt-v4 PR, @seratch observed that some of the typing adjustments I was making to AWS payloads was simplistic and could be enhanced. He also pointed me to #2272 as a potential issue that could be resolved by doing a bit more work in properly typing both V1 and V2 AWS API Gateway payloads.

This PR attempts to improve these AWS payload types to support both V1 and V2 APIG payloads. A side benefit is it requires bolt code to be a bit more strict and correct when retrieving the URL path from this payload (by requiring to account for the difference in what the relevant property for this is in V1 vs. V2).

If approved, these changes, and how to migrate from bolt v3 to v4 app code to take into account these interface changes - particularly for apps setting customPropertiesExtractor or invalidSignatureHandler methods - would need to be documented in a bolt v3 -> v4 migration guide.

@filmaj filmaj added enhancement M-T: A feature request for new functionality semver:major TypeScript-specific labels Oct 1, 2024
@filmaj filmaj added this to the 4.0.0 milestone Oct 1, 2024
@filmaj filmaj requested a review from seratch October 1, 2024 16:06
@filmaj filmaj self-assigned this Oct 1, 2024
@filmaj filmaj changed the title Bolt v4 addendum: Bolt v4 addendum: stricter typing of AWS API Gateway payloads Oct 1, 2024
@filmaj filmaj mentioned this pull request Oct 1, 2024
7 tasks
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for quickly making this change! All look good to me. Also, mentioning the potential change to the receiver in the migration guide is a great catch!

@seratch
Copy link
Member

seratch commented Oct 2, 2024

Once the lint error is resolved and the main branch is ready for v4 changes, we can merge this PR

@filmaj
Copy link
Contributor Author

filmaj commented Oct 2, 2024

The lint and test errors will be resolved by #2259; I will merge this into the v4 PR in the mean time.

@filmaj filmaj marked this pull request as ready for review October 2, 2024 12:02
@filmaj filmaj merged commit 4820052 into bolt-four Oct 2, 2024
7 of 13 checks passed
@filmaj filmaj deleted the bolt-four-awsevent-type branch October 2, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality semver:major TypeScript-specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants