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.
This commit is contained in:
Attila Oláh 2025-10-24 08:48:57 +02:00 committed by Stoyan Zlatev
parent 1f06ae2d60
commit e85192e84d

View file

@ -584,13 +584,14 @@ OAUTH_ALLOWED_ROLES = PersistentConfig(
[ [
role.strip() role.strip()
for role in os.environ.get("OAUTH_ALLOWED_ROLES", f"user{SEP}admin").split(SEP) for role in os.environ.get("OAUTH_ALLOWED_ROLES", f"user{SEP}admin").split(SEP)
if role
], ],
) )
OAUTH_ADMIN_ROLES = PersistentConfig( OAUTH_ADMIN_ROLES = PersistentConfig(
"OAUTH_ADMIN_ROLES", "OAUTH_ADMIN_ROLES",
"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( OAUTH_ALLOWED_DOMAINS = PersistentConfig(