-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add database ratelimiting backend #28728
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
Conversation
In case no distributed memory cache is specified this adds a database backend for ratelimit purposes. Signed-off-by: Lukas Reschke <[email protected]>
Signed-off-by: Lukas Reschke <[email protected]>
Signed-off-by: Lukas Reschke <[email protected]>
Signed-off-by: Lukas Reschke <[email protected]>
Signed-off-by: Lukas Reschke <[email protected]>
|
@skjnldsv This needs quite a careful review as it is quite a big change to backport 🙈 |
Signed-off-by: Lukas Reschke <[email protected]>
|
/backport to stable22 |
|
/backport to stable21 |
|
/backport to stable20 |
|
/backport to stable19 |
|
Looks good in general, just some minor changes |
Signed-off-by: Lukas Reschke <[email protected]> Co-authored-by: Joas Schilling <[email protected]>
|
Will run php-cs. Applied @nickvergessen suggestion and tested locally. |
|
Missed to set the remote. Retesting. |
Signed-off-by: Lukas Reschke <[email protected]>
|
The backport to stable21 failed. Please do this backport manually. |
|
The backport to stable20 failed. Please do this backport manually. |
|
The backport to stable19 failed. Please do this backport manually. |
In case no distributed memory cache is specified this adds a database backend for ratelimiting purposes. Previously the ratelimit check was just skipped.
This also fixes an issue where we passed always the current time instead of the storage period to the backend. And simplified the API to not pass
$periodwhere not necessary.This doesn't aim to be a high performance solution, but just a fallback for instances without any kind of memory cache configured.
Test plan
config.php/index.php/apps/testing/userAndAnonProtectedand click a few times. Verify that the requests fails due to hitting the ratelimit.TODO