You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to implement rate limiting for an API which will be allowed to call only 10 times per minute but if the limit exceeds, it should be blocked for 30 minutes. The API endpoint throws an error if it is called more than 10 times, however, after one minute, I am able to call the API again, instead of the API endpoint getting blocked for 30 minutes.
I have added a sample repo for example in which the error is reproduced.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to implement rate limiting for an API which will be allowed to call only 10 times per minute but if the limit exceeds, it should be blocked for 30 minutes. The API endpoint throws an error if it is called more than 10 times, however, after one minute, I am able to call the API again, instead of the API endpoint getting blocked for 30 minutes.
I have added a sample repo for example in which the error is reproduced.
Repository Link: https://github.com/shahidshahcredilio/rate-limiter-test
In
start/limiter.ts
file, I have defined the rule as follows:In
start/routes.ts
file, I have added the middleware as follows:Can anyone please help verify if the above way of blocking the request is valid? Or Do I need to block the request manually as defined on https://docs.adonisjs.com/guides/rate-limiting#login-endpoint-brute-force-protection?
Beta Was this translation helpful? Give feedback.
All reactions