skymarshal: behaviour: Handle groups as maps

There are cases when groups are represented as a list
of maps, not strings e.g. "groups":[{"id":"1",
"name":"gr1"},{"id": "2", "name":"gr2"}]. Handle groups
represented as a list of maps.

concourse/dex#23

Signed-off-by: Vlad Safronov <vladislav.safronov@oracle.com>
This commit is contained in:
Vlad Safronov 2021-10-25 21:42:05 +03:00 committed by Rui Yang
parent f980d3e0a7
commit 45932bd38a

View file

@ -247,6 +247,9 @@ func (c *oauthConnector) addGroupsFromMap(groups map[string]struct{}, result map
if groupString, ok := group.(string); ok { if groupString, ok := group.(string); ok {
groups[groupString] = struct{}{} groups[groupString] = struct{}{}
} }
if groupMap, ok := group.(map[string]interface{}); ok {
groups[groupMap["name"]] = true
}
} }
return nil return nil