Skip to content
Snippets Groups Projects
Unverified Commit 033717a0 authored by Oded Ben Ozer's avatar Oded Ben Ozer Committed by GitHub
Browse files

Apply suggestions from code review

parent 6875b64c
No related branches found
No related tags found
No related merge requests found
...@@ -94,7 +94,7 @@ type Config struct { ...@@ -94,7 +94,7 @@ type Config struct {
} `json:"claimModifications"` } `json:"claimModifications"`
} }
// List of groups claim elements to create by concatenating other claims // NewGroupFromClaims creates a new group from a list of claims and appends it to the list of existing groups.
type NewGroupsFromClaims struct { type NewGroupsFromClaims struct {
// List of claim to join together // List of claim to join together
ClaimList []string `json:"claimList"` ClaimList []string `json:"claimList"`
...@@ -456,15 +456,16 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I ...@@ -456,15 +456,16 @@ func (c *oidcConnector) createIdentity(ctx context.Context, identity connector.I
} }
for _, claimName := range config.ClaimList { for _, claimName := range config.ClaimList {
claimValue, ok := claims[claimName].(string) claimValue, ok := claims[claimName].(string)
// Non string claim value are ignored, concatenating them doesn't really make any sense if !ok { // Non string claim value are ignored, concatenating them doesn't really make any sense
if !ok {
continue continue
} }
if config.ClearDelimiter { if config.ClearDelimiter {
// Removing the delimiter string from the concatenated claim to ensure resulting claim structure // Removing the delimiter string from the concatenated claim to ensure resulting claim structure
// is in full control of Dex operator // is in full control of Dex operator
claimValue = strings.ReplaceAll(claimValue, config.Delimiter, "") claimValue = strings.ReplaceAll(claimValue, config.Delimiter, "")
} }
newGroupSegments = append(newGroupSegments, claimValue) newGroupSegments = append(newGroupSegments, claimValue)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment