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.
Just to test if it works for Cypress.
| 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.
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.
arikfr
left a comment
There was a problem hiding this comment.
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_LIMITenv 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)