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

Create rate limiter middleware #1003

Merged
merged 4 commits into from
Apr 23, 2024
Merged

Conversation

Virgil993
Copy link
Member

@Virgil993 Virgil993 commented Apr 19, 2024

Pull Request Template

Type of change

  • 🍕 New feature
  • 📝 Documentation Update

Description

I added a check on the Lambda handler generator that populates a GenezioContext object with the requestContext and the headrs of the incoming request from AWS. I also added a check in the Ts/Js SdkGenerator to add a new property to a GnzContext object named isGnzContext. this property is added only if the first parameter of a function is a GnzContext. It helps the lambdaHandler to know whether to populate that parameter or not.

Checklist

  • My code follows the contributor guidelines of this project;
  • I have updated the documentation;
  • New and existing unit tests pass locally with my changes;

@@ -238,6 +238,10 @@ if (!genezioClass) {
});
});

if(body.params && body.params.length > 0 && body.params[0].isGnzContext === true ) {
Copy link
Member

Choose a reason for hiding this comment

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

We have a handler for runtime also. Should we put this also there?

Copy link
Member Author

Choose a reason for hiding this comment

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

im not sure how the event coming from runtime looks like and i don't know if it's gonna change in the future so i don't know if we should put it just yet

@Virgil993 Virgil993 merged commit a1908df into dev Apr 23, 2024
5 checks passed
@costinsin costinsin deleted the create-rate-limiter-middleware branch May 10, 2024 14:59
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.

None yet

3 participants