Add database ratelimiting backend#28728
Merged
LukasReschke merged 8 commits intomasterfrom Sep 13, 2021
Merged
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>
Member
Author
|
@skjnldsv This needs quite a careful review as it is quite a big change to backport 🙈 |
ChristophWurst
approved these changes
Sep 7, 2021
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Member
Author
|
/backport to stable22 |
Member
Author
|
/backport to stable21 |
Member
Author
|
/backport to stable20 |
Member
Author
|
/backport to stable19 |
ChristophWurst
approved these changes
Sep 8, 2021
nickvergessen
requested changes
Sep 13, 2021
Member
|
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>
Member
Author
|
Will run php-cs. Applied @nickvergessen suggestion and tested locally. |
Member
Author
|
Missed to set the remote. Retesting. |
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
AndyScherzinger
approved these changes
Sep 13, 2021
|
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
This file contains hidden or 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
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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