-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 env var to skip Flask rate limits #3622
Conversation
for (let i = 0; i < 200; i++) { | ||
cy.login(); | ||
} | ||
}); |
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.
Just to test if it works for Cypress.
tests/__init__.py
Outdated
@@ -13,6 +13,9 @@ | |||
os.environ['REDASH_GOOGLE_CLIENT_SECRET'] = "dummy" | |||
os.environ['REDASH_MULTI_ORG'] = "true" | |||
|
|||
# Disable login rate limit skip | |||
os.environ['REDASH_THROTTLE_LOGIN_ENABLED'] = "true" |
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.
If the purpose of the current test is to:
a) test the feature, then I think this should be set in/before the test.
b) make sure prod has this feature turned on, then this should not be set at all.
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.
As we might have other rate limits in the future, I think the setting shouldn't be specific but a general kill switch for all limits. It just so happens Flask-Limiter already has one: setting RATELIMIT_ENABLED
in Flask config to False
will disable it.
All you need to do is to add to redash.settings
:
RATELIMIT_ENABLED = parse_boolean(os.environ....)
As we already load all the values from redash.settings
to app.config
. The other change is to override this setting in the rate limit change.
Thanks @arikfr, I've modified this to disable all rate limits instead of only login. Two questions to proceed:
|
@gabrieldutra @Arik plz let's give this one priority as some of my pending PRs depend on it. |
Just resolve conflicts and it's good to go. |
Will do in a min 🙂 |
Done, just review the name (almost sure this is what I did 😅) and once CI is finished it's good to go |
What type of PR is this? (check all applicable)
Description
This was supposed to be a Draft PR, though I pressed the enter key accidentally 😕
Well, the idea here is to suggest a fix to "Too Many Requests" error in Cypress (this).
This adds
REDASH_SKIP_LOGIN_RATE_LIMIT
env var (not sure if this will be the best name here) and uses it in thedocker-compose
's for dev and for cypress.Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings (if there are UI changes)