mirror of
https://github.com/lukaszraczylo/traefikoidc.git
synced 2026-10-17 04:37:48 +00:00
R60: accept single-string groups/roles; fix mem over-evict
This commit is contained in:
+11
-1
@@ -2299,10 +2299,20 @@ func TestExtractGroupsAndRoles(t *testing.T) {
|
||||
expectRoles: []string{},
|
||||
expectError: false,
|
||||
},
|
||||
{
|
||||
name: "Single string groups and roles",
|
||||
claims: map[string]interface{}{
|
||||
"groups": "domain_users", // single string (not array)
|
||||
"roles": []interface{}{"role1"},
|
||||
},
|
||||
expectGroups: []string{"domain_users"},
|
||||
expectRoles: []string{"role1"},
|
||||
expectError: false,
|
||||
},
|
||||
{
|
||||
name: "Invalid groups format",
|
||||
claims: map[string]interface{}{
|
||||
"groups": "not-an-array",
|
||||
"groups": 12345, // non-string, non-array scalar
|
||||
"roles": []interface{}{"role1"},
|
||||
},
|
||||
expectError: true,
|
||||
|
||||
Reference in New Issue
Block a user