-
Notifications
You must be signed in to change notification settings - Fork 18
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
Rate limiter whitelist of IP address #997
Conversation
config/app.php
Outdated
'whitelisted_ip_addresses' => env('RATE_LIMITER_WHITELISTED_IP_ADDRESSES') | ||
? explode(',', env('RATE_LIMITER_WHITELISTED_IP_ADDRESSES')) | ||
: [], |
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.
Is there an actual need for the configurability? Could we just list the IPs here?
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.
It would be handy to be able to add our own IP addresses.
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.
Do you mean for development? Maybe we could disable it based on app environment then?
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.
I don't have any issues with the implementation, but I'm a little concerned that the whitelisting is potentially needed for development. In my opinion, the rate limiter should be a safety net, not a mode of operation.
My guess is that either
- the rate limiter is too strict, or
- the client implementation is not optimal, or
- the API needs a design adjustment
In any case, from an architecture perspective, I don't think the assumption that "nobody should call this so often, except for us" is 100% sound. The "whitelisted" calls are ultimately being triggered by visitors, so still outside of our control. In fact, for those apps -- that might potentially generate lots of requests -- we're losing that safety mechanism altogether.
My suggestion would be to increase the rate limit for everyone to a level we're comfortable with.
When using SSR frontends the requests will come from our own server, that's why we need to make a whitelist here. And if high rates are an issue we should implement rate limiter on the caller side. |
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.
for now just turn it off. in case of troubles, we can back to it
As suggested in #792