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.

concourse#23

Signed-off-by: Vlad Safronov <[email protected]>
  • Loading branch information
vladsf authored and elffjs committed Jun 27, 2022
1 parent 4ad5443 commit e1d1e85
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 e1d1e85

Please sign in to comment.