From 5b9e6bed6ce47a4db3fd3fb00e6fbbebde58e7df Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 23 Nov 2021 23:23:09 +0100 Subject: [PATCH] lib: fix custom URL schemes being overwritten Signed-off-by: Jens Langhammer --- authentik/lib/generators.py | 2 +- authentik/lib/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/authentik/lib/generators.py b/authentik/lib/generators.py index 14a7b2f2b..b0f1303d0 100644 --- a/authentik/lib/generators.py +++ b/authentik/lib/generators.py @@ -13,6 +13,6 @@ def generate_key(length=128): """Generate a suitable client secret""" rand = SystemRandom() return "".join( - rand.choice(string.ascii_letters + string.digits + string.punctuation + string.punctuation) + rand.choice(string.ascii_letters + string.digits + string.punctuation) for x in range(length) ) diff --git a/authentik/lib/models.py b/authentik/lib/models.py index 86393e081..795cf8c4b 100644 --- a/authentik/lib/models.py +++ b/authentik/lib/models.py @@ -66,7 +66,7 @@ class DomainlessURLValidator(URLValidator): r"\Z", re.IGNORECASE, ) - self.schemes = ["http", "https", "blank"] + self.schemes = ["http", "https", "blank"] + list(self.schemes) def __call__(self, value): # Check if the scheme is valid.