From 363aed2a474b212e63b3d08426761a16f8c1e749 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 25 Nov 2021 18:05:36 +0100 Subject: [PATCH] root: url quote redis passwords for connection string closes https://github.com/goauthentik/helm/issues/39 Signed-off-by: Jens Langhammer --- authentik/root/settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authentik/root/settings.py b/authentik/root/settings.py index d925c8e62..3d015824a 100644 --- a/authentik/root/settings.py +++ b/authentik/root/settings.py @@ -18,6 +18,7 @@ from hashlib import sha512 from json import dumps from tempfile import gettempdir from time import time +from urllib.parse import quote import structlog from celery.schedules import crontab @@ -223,7 +224,7 @@ CACHES = { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": ( f"{REDIS_PROTOCOL_PREFIX}:" - f"{CONFIG.y('redis.password')}@{CONFIG.y('redis.host')}:" + f"{quote(CONFIG.y('redis.password'))}@{quote(CONFIG.y('redis.host'))}:" f"{int(CONFIG.y('redis.port'))}/{CONFIG.y('redis.cache_db')}" ), "TIMEOUT": int(CONFIG.y("redis.cache_timeout", 300)),