-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Merge to develop for final release #9
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
refactor: migrate limiter to v6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adonis/Addons/Limiter
in favor of container services andlimiter.manager
binding.HttpLimiterConfigBuilder
in favor ofHttpLimiter
. The API is still the same.Throttle
middleware, sincelimiterManager.define
method now returns a middleware function that can be applied to routes directly.LimiterResponse.retryAfter
in favor ofLimiterResponse.availableIn
.Breaking change in HTTP limiters
The HTTP limiters defined using the
Limiter.define
method have been refactored and now thelimiter.define
method returns a middleware function that can be applied to a route. Following is a brief diff for the same.Earlier
Now
Features
clear
method to stores and limiter manager to clear all the rate limiting data from the store. This could be helpful during testing. See docs for usage information.limiter.attempt
method run a callback if rate limiter requests have not been exhausted.limiter.penalize
method to exhaust requests when the provided callback throws an exception.availableIn
method to get the number of seconds to wait before the key becomes available.Improvements
contracts/limiter.ts
file.