From e85192e84d5e36ad01fb705bd6483811678c339c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Ol=C3=A1h?= Date: Fri, 24 Oct 2025 08:48:57 +0200 Subject: [PATCH] fix: exclude empty roles This is a minor tweak that allows using whitespace as a separator, without it having to be exactly one space. Convenient for using YAML text fold syntax in Helm charts when providing long lists of roles. --- backend/open_webui/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 466adc4f1b..ae174a65ab 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -584,13 +584,14 @@ OAUTH_ALLOWED_ROLES = PersistentConfig( [ role.strip() for role in os.environ.get("OAUTH_ALLOWED_ROLES", f"user{SEP}admin").split(SEP) + if role ], ) OAUTH_ADMIN_ROLES = PersistentConfig( "OAUTH_ADMIN_ROLES", "oauth.admin_roles", - [role.strip() for role in os.environ.get("OAUTH_ADMIN_ROLES", "admin").split(SEP)], + [role.strip() for role in os.environ.get("OAUTH_ADMIN_ROLES", "admin").split(SEP) if role], ) OAUTH_ALLOWED_DOMAINS = PersistentConfig(