From 2112b5b26b9abb16bab85af1e4e8cb8e8a66de06 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 15 Oct 2022 23:51:36 +0200 Subject: [PATCH] root: add global fallback throttle Signed-off-by: Jens Langhammer --- authentik/lib/default.yml | 1 + authentik/root/settings.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/authentik/lib/default.yml b/authentik/lib/default.yml index 44925bf5a..547a81768 100644 --- a/authentik/lib/default.yml +++ b/authentik/lib/default.yml @@ -55,6 +55,7 @@ throttle: providers: oauth2: device: 20/hour + default: 1000/second outposts: # Placeholders: diff --git a/authentik/root/settings.py b/authentik/root/settings.py index ee2a52c84..c1d06c17a 100644 --- a/authentik/root/settings.py +++ b/authentik/root/settings.py @@ -174,6 +174,10 @@ REST_FRAMEWORK = { ], "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", "TEST_REQUEST_DEFAULT_FORMAT": "json", + "DEFAULT_THROTTLE_CLASSES": ["rest_framework.throttling.AnonRateThrottle"], + "DEFAULT_THROTTLE_RATES": { + "anon": CONFIG.y("throttle.default"), + }, } REDIS_PROTOCOL_PREFIX = "redis://"