From 45932bd38a7a6283d33a4acacfdb73c89ab9058d Mon Sep 17 00:00:00 2001 From: Vlad Safronov Date: Mon, 25 Oct 2021 21:42:05 +0300 Subject: [PATCH] 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 --- connector/oauth/oauth.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/connector/oauth/oauth.go b/connector/oauth/oauth.go index 9ff69510..1bb9b068 100644 --- a/connector/oauth/oauth.go +++ b/connector/oauth/oauth.go @@ -247,6 +247,9 @@ func (c *oauthConnector) addGroupsFromMap(groups map[string]struct{}, result map if groupString, ok := group.(string); ok { groups[groupString] = struct{}{} } + if groupMap, ok := group.(map[string]interface{}); ok { + groups[groupMap["name"]] = true + } } return nil