Skip to content

Commit

Permalink
skymarshal: behaviour: Handle groups as maps
Browse files Browse the repository at this point in the history
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.

#23

Signed-off-by: Vlad Safronov <[email protected]>
  • Loading branch information
vladsf authored and Rui Yang committed Nov 17, 2021
1 parent f980d3e commit 45932bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions connector/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 45932bd

Please sign in to comment.