-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add access rate limit #676
Add access rate limit #676
Conversation
I took the basic script from @truongdd03 and made it a little more general. I felt it was good to have it in the testing directory so others would have access to it. Note this is currently only manual testing but automating at some point might be good, esp. if we limit specific routes.
This is good work and does basic rate limiting. Testing indicates it works as expected. I generalized the test script written by @truongdd03 and put it in the testing directory for future use. I have two thoughts on this PR:
|
- add test for new raw limit. - remove extra echos and commented out code.
Good work. I appreciate the effort to test and get all the details working. This rate limits overall requests (allowing a lot) and raw download (only a few). I updated the test script a little to deal with items. It all tests out fine so ready to merge. |
Description
This PR uses express-rate-limit module to set two access limits. The first one (200 requests/ 5 seconds) limits the rate of overall requests to OED. At the moment, the current limit is high due to issue #681. After resolving it, testings are needed to adjust the rate limit. The second limit is specifically for raw export (5 requests/ 5 seconds).
Fixes #266
Type of change
Checklist
Limitations
Note that the rate limit may make future automatic tests return the value of 429 (too many requests). In that case, the limiters need to be increased.