-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Public API IP rate limiting #4764
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.
LGTM! Really nice that we can just plug this library into existing redis infra. Saw that koa2-ratelimit
supports other backends too - seems like a nice library 👌
…ypes didn't work correctly.
Codecov Report
@@ Coverage Diff @@
## develop #4764 +/- ##
===========================================
+ Coverage 67.91% 69.51% +1.59%
===========================================
Files 144 145 +1
Lines 4922 4979 +57
Branches 761 765 +4
===========================================
+ Hits 3343 3461 +118
+ Misses 1105 1066 -39
+ Partials 474 452 -22
Continue to review full report at Codecov.
|
Description
Adding public API rate limiting, with env variable option, defaults to 120 requests per minute. The environment variable
API_RATE_LIMITING
can be set to any number to set the limit of requests per minute. For now this is entirely limited to the public API.This is achieved with the use of koa2-ratelimit - this allows rate limiting per IP and use of a Redis store for managing the limits across a cluster of services.