throttler icon indicating copy to clipboard operation
throttler copied to clipboard

Add whitelisting feature

Open adminha opened this issue 2 years ago • 1 comments

Is there an existing issue that is already proposing this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe it

Throttling may block requests from frontend nodejs server. I mean, when server (react, next) requests some resources with getServerSideProps it may block even frontend server for sending too many requests. I've also asked a question in stackoverflow.com related to this issue: https://stackoverflow.com/q/72762848/4098788

Describe the solution you'd like

A feature for whitelisting an array of ip addresses. It. Can be something like a decorator, or global configuration in module.

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

Whitelisting personal or company wide ip addresses for developers and team, and also whitelisting for access of specific servers.

adminha avatar Jun 26 '22 17:06 adminha

If your next server has a specific user agent, you could ignore that as described here, or if you want you can extend the ThrottlerGuard#handleRequest, make a check for the IP address, and do an early return true if the IP is an expected one that shouldn't be throttled, otherwise call super.handleRequest. There's also the @SkipThrottle() if this is a route in a controller rather than something like a static file server.

jmcdo29 avatar Jun 26 '22 18:06 jmcdo29