Skip to content

Add events pass-through feature in lambda-http crate #775

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

Merged
merged 3 commits into from
Jan 15, 2024

Conversation

bnusunny
Copy link
Contributor

@bnusunny bnusunny commented Jan 14, 2024

Issue #, if available:

Related to awslabs/aws-lambda-web-adapter#216 and awslabs/aws-lambda-web-adapter#317

Description of changes:

To support addtional event triggers in lambda web adapter, such as SQS or Bedrock Agents, we need to pass-through events from those triggers. This PR adds a pass_through feature to lambda-http crate. When enabled, the events payloads will be translated to a HTTP post request (event payloads in the request body).

This PR also improves the deserializer.rs. It uses RawValue to get the data from deserializer, not relaying on private serde functions.

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

@bnusunny bnusunny requested a review from calavera January 14, 2024 09:16
Copy link

👋 It looks like your code has some linting issues.

Please run cargo clippy --fix and push the code again.

This test won't fail when `pass-through` feature is enabled.
Copy link
Contributor

@calavera calavera left a comment

Choose a reason for hiding this comment

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

I really don't understand why people prefer these kind of hacks to separated functions that do one thing, but I'll disagree and commit.

@calavera calavera merged commit 3566f42 into main Jan 15, 2024
@calavera calavera deleted the pass-through-events branch January 15, 2024 18:39
@bnusunny
Copy link
Contributor Author

Thanks!

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.

2 participants