-
Notifications
You must be signed in to change notification settings - Fork 310
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
Improve HTTP rate limiting classes and keys #6714
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beat me to it. Good stuff!
@adriansmares: Shall we try to get this into |
Yep that's definitely reasonable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codeowned LGTM
58989ac
to
e1da170
Compare
I don't consider that we need these fine grained controls in the release. We'll add however some generic limits to our deployment templates. |
Summary
This PR allows more fine grained control of HTTP endpoint rate limiting, by adding a class which includes the path template. This allows rate limiting individual HTTP endpoints (like
http:account:/oauth/api/auth/login
) next to the full class (likehttp:account
).Paths which contain a template (containing a gateway ID for example) will maintain their template form (like
http:gcs:/api/v3/gcs/gateways/{gateway_id}/semtechudp/global_conf.json
).Changes
Testing
Add the following rate limiting configuration to your stack configuration file:
Then try to login with a wrong password 5 times - you should get a rate limiting error.
Regressions
There is a behavioral change regarding the caller identity - using different API keys with the same caller IP will now have individual rate limits, which can allow more calls for a single source IP. This should allow better cloud-to-cloud connectivity via HTTP APIs (of which there aren't many, but still), and I consider it to be a reasonable change.
Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.