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
parent 35504e8486
commit c165a6b6c2
No known key found for this signature in database
GPG key ID: 07E6C0643FD142C3

View file

@ -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(