Skip to content

Commit 4125f57

Browse files
authored
Baton ID: Compare keys and values with strings.EqualFold (#356)
1 parent c9cb24f commit 4125f57

File tree

2 files changed

+12
-29
lines changed

2 files changed

+12
-29
lines changed

flake.lock

Lines changed: 10 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/sync/syncer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ func (s *syncer) processGrantsWithExternalPrincipals(ctx context.Context, princi
19831983
}
19841984
}
19851985
profileVal, ok := resource.GetProfileStringValue(userTrait.Profile, matchExternalResource.Key)
1986-
if ok && profileVal == matchExternalResource.Value {
1986+
if ok && strings.EqualFold(profileVal, matchExternalResource.Value) {
19871987
newGrant := newGrantForExternalPrincipal(grant, userPrincipal)
19881988
expandedGrants = append(expandedGrants, newGrant)
19891989
}
@@ -1996,7 +1996,7 @@ func (s *syncer) processGrantsWithExternalPrincipals(ctx context.Context, princi
19961996
continue
19971997
}
19981998
profileVal, ok := resource.GetProfileStringValue(groupTrait.Profile, matchExternalResource.Key)
1999-
if ok && profileVal == matchExternalResource.Value {
1999+
if ok && strings.EqualFold(profileVal, matchExternalResource.Value) {
20002000
newGrant := newGrantForExternalPrincipal(grant, groupPrincipal)
20012001
newGrantAnnos := annotations.Annotations(newGrant.Annotations)
20022002

0 commit comments

Comments
 (0)