From 0e3602d7eb36ce75b9c8b39b44dbd750ef422c13 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 23 Nov 2021 23:01:30 +0100 Subject: [PATCH] lib: improve probability of symbols in generated key Signed-off-by: Jens Langhammer --- authentik/lib/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentik/lib/generators.py b/authentik/lib/generators.py index b0f1303d0..14a7b2f2b 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) + rand.choice(string.ascii_letters + string.digits + string.punctuation + string.punctuation) for x in range(length) )