-
Notifications
You must be signed in to change notification settings - Fork 170
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
Rate Limit headers #1166
Merged
Merged
Rate Limit headers #1166
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
bc875ba
to
6bf516c
Compare
FYI @ioggstream |
1cc3b58
to
fbd341d
Compare
@davidor out for review |
@unleashed as you are one of the authors of the RFC, it would be good if you could take a look at this PR. In particular, it would be great if you could review the documentation and the examples in the integration tests. |
davidor
reviewed
Mar 16, 2020
gateway/src/apicast/policy/rate_limit_headers/countdown_counter.lua
Outdated
Show resolved
Hide resolved
usage:encode_format: To return an string with the format encoded url-encoded. It's used to communicate with backend and for caching pourposes. usage:get_max_delta: This method return the max number of deltas, it's used to predict the number of hits in a metric in rate_limit_headers policy. Signed-off-by: Eloy Coto <[email protected]>
This commit add a single counter class, this class makes sure that a counter is correctly set, and adds a simple methods increment/decrement. The main purpose: - Be able to write code and be descriptive. - Have a custom methods on tostring, etc.. - Always check that it's a number, etc.. Not a lot of value added, but code is much clean to read when it's used. Signed-off-by: Eloy Coto <[email protected]>
At the moment is quite difficult to subscribe to a backend event, so getting information about apisonator responses in any policy is quite challenging. This commit adds two new methods in the request context: `add_backend_auth_subscriber` and `publish_backend_auth`. When a policy subscribes to a auth event, each time that publish_backend_auth is called will execute the callback and policy can retrieve the information. Signed-off-by: Eloy Coto <[email protected]>
This policy adds rate limit headers into responses Signed-off-by: Eloy Coto <[email protected]>
Signed-off-by: Eloy Coto <[email protected]>
Signed-off-by: Eloy Coto <[email protected]>
Signed-off-by: Eloy Coto <[email protected]>
davidor
approved these changes
Mar 31, 2020
Signed-off-by: Eloy Coto <[email protected]>
2 tasks
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.
This PR adds a policy that enables rate-limits headers per service.
All changes explained in the commit messages.