Skip to content

Commit

Permalink
fixup! Revert to use full DN instead of CN for autorization.
Browse files Browse the repository at this point in the history
  • Loading branch information
evrardjp-cagip committed Jan 13, 2025
1 parent 31ad7c9 commit 2fcde3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/ldap/membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (m *LDAPMemberships) isUserAllowedOnCluster(regexpPatterns []string) (bool,

for _, groupName := range m.NonSpecificGroups {
for _, pattern := range regexpPatterns {
matched, err := regexp.MatchString(pattern, strings.ToUpper(groupName.DN)) // we match on full DN rather than CN because nobody prevents the ppl in the different entities to create a CN identical as the one used for adminGroup. This is purely out of precaution. In the future, we might want to change the regexp to match only the cn of the groups if we have the guarantee the users will not create groups that are duplicate.
matched, err := regexp.MatchString(strings.ToUpper(pattern), strings.ToUpper(groupName.DN)) // we match on full DN rather than CN because nobody prevents the ppl in the different entities to create a CN identical as the one used for adminGroup. This is purely out of precaution. In the future, we might want to change the regexp to match only the cn of the groups if we have the guarantee the users will not create groups that are duplicate.
if err != nil {
return false, fmt.Errorf("error matching pattern %v: %v", pattern, err)
}
Expand Down

0 comments on commit 2fcde3d

Please sign in to comment.