-
Notifications
You must be signed in to change notification settings - Fork 494
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
NAS-129692 / 24.10 / rate limit methods that have @no_auth_required #13912
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugclerk
changed the title
rate limit methods that have @no_auth_required
NAS-129692 / 24.10 / rate limit methods that have @no_auth_required
Jun 21, 2024
anodos325
reviewed
Jun 21, 2024
anodos325
reviewed
Jun 21, 2024
anodos325
reviewed
Jun 21, 2024
We used to have a |
yocalebo
force-pushed
the
rate-limit
branch
6 times, most recently
from
June 25, 2024 18:32
351af9e
to
4a5be72
Compare
yocalebo
force-pushed
the
rate-limit
branch
3 times, most recently
from
July 3, 2024 13:26
8f2fc6c
to
39a9a62
Compare
yocalebo
force-pushed
the
rate-limit
branch
4 times, most recently
from
July 5, 2024 16:06
28866f9
to
5eeac9c
Compare
anodos325
reviewed
Jul 5, 2024
anodos325
approved these changes
Jul 5, 2024
This PR has been merged and conversations have been locked. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For obvious reasons, we MUST protect public endpoints that are marked with
@no_auth_required
by rate limiting them. This implementation will rate limit all methods that are marked with@no_auth_required
. These rate limits are implemented by hashing them by method name AND the origin IP address that is sending the request to us. This isn't a fool-proof way and won't cover every single scenario but it's significantly better than what we currently have.Implementation details:
After adding this functionality and running it through our CI, I saw test failures for modules that use
make_ws_request
. This is for numerous reasons but the most important one is that it logged in every time it was called. This kicked in our rate limiting mechanism and so tests (specifically the FTP test) started to fail. After kicking the proverbial can down the road, I decided to go ahead and remove all uses ofmake_ws_request
function since it was no longer needed.