feat(legacy): add config option for group separator in header auth (#3181)

### Description

Not all forward auth solutions use a comma for group seperator.

**This is a new feature**:

Yes

**I have updated the documentation to reflect these changes**:

Yes

### **Links**

[Authentik uses `|` so may as well make the group separator
configurable](https://docs.goauthentik.io/docs/add-secure-apps/providers/proxy/)
This commit is contained in:
dakriy 2025-07-16 11:32:34 -07:00 committed by GitHub
parent 107bacf296
commit f780994996
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 1 deletions

View File

@ -149,6 +149,7 @@ header_auth:
groups_header: Remote-Groups # This is the default and could be omitted
email_header: Remote-Email # This is the default and could be omitted
name_header: Remote-Name # This is the default and could be omitted
group_separator: "," # This is the default and could be omitted
proxy_ip: 10.0.0.34
group_map:
host: lt-host

View File

@ -54,7 +54,9 @@ class LibreTime_Auth_Adaptor_Header implements Zend_Auth_Adapter_Interface
return UTYPE_GUEST;
}
$groups = array_map(fn ($group) => trim($group), explode(',', $groups));
$separator = Config::get('header_auth.group_separator');
$groups = array_map(fn ($group) => trim($group), explode($separator, $groups));
$superAdminGroup = Config::get('header_auth.group_map.superadmin');
if (in_array($superAdminGroup, $groups)) {

View File

@ -105,6 +105,7 @@ class Schema implements ConfigurationInterface
/**/->scalarNode('groups_header')->defaultValue('Remote-Groups')->end()
/**/->scalarNode('email_header')->defaultValue('Remote-Email')->end()
/**/->scalarNode('name_header')->defaultValue('Remote-Name')->end()
/**/->scalarNode('group_separator')->defaultValue(',')->end()
/**/->scalarNode('proxy_ip')->end()
/**/->scalarNode('locale')->defaultValue('en-US')->end()
/**/->arrayNode('group_map')->children()