Add database ratelimiting backend #28728
Merged
+222
−67
Conversation
In case no distributed memory cache is specified this adds a database backend for ratelimit purposes. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
|
@skjnldsv This needs quite a careful review as it is quite a big change to backport |
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
|
/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 <lukas@statuscode.ch> Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
|
Will run php-cs. Applied @nickvergessen suggestion and tested locally. |
|
Missed to set the remote. Retesting. |
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
|
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. |
This was referenced Sep 13, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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