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

feat(api): Add evaluate api rate limit use case #4844

Merged
merged 120 commits into from
Nov 28, 2023

Conversation

rifont
Copy link
Contributor

@rifont rifont commented Nov 14, 2023

What change does this PR introduce?

  • Adds evaluate-api-rate-limit use-case to determine if a request should be rate-limited for a given environmentId, service category, and cost category.
  • Adds evaluate-token-bucket-rate-limit use-case to encapsulate the token bucket algorithm. The use-case uses the @upstash/ratelimit library to implement the token bucket rate limit algorithm.

Why was this change needed?

  • The evaluate-api-rate-limit use-case will be used in the Rate Limiting guard to determine if a request will be accepted or rejected

Other information (Screenshots)

N/A

…vuhq/novu into nv-3059-get-rate-limit-use-case
…ithub.com/novuhq/novu into nv-3060-token-bucket-rate-limiting-use-case
Copy link
Contributor

@LetItRock LetItRock left a comment

Choose a reason for hiding this comment

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

looks perfect to me! 💎

@rifont rifont merged commit ccd52a2 into next Nov 28, 2023
25 of 26 checks passed
@rifont rifont deleted the nv-3060-token-bucket-rate-limiting-use-case branch November 28, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants