Skip to content

Make DNs fully case insensitive #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,12 @@ func LookupDN(conn *ldap.Conn, dn string, attrs []string) (*DNSearchResult, erro
}

// NormalizeDN normalizes the DN. The ldap library here mainly lowercases the
// attribute type names in the DN.
// attribute type names in the DN. However, since MinIO is going to be
// case-insenstive, we lowercase the whole string.
func NormalizeDN(dn string) (string, error) {
parsedDN, err := ldap.ParseDN(dn)
if err != nil {
return "", fmt.Errorf("DN (%s) parse failure: %w", dn, err)
}
return parsedDN.String(), nil
return strings.ToLower(parsedDN.String()), nil
}
2 changes: 1 addition & 1 deletion policy/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const (
// PutObjectFanOutAction - PutObject like API action but allows PostUpload() fan-out.
PutObjectFanOutAction = "s3:PutObjectFanOut"

// S3Express CreateSession action
// CreateSessionAction - S3Express action
CreateSessionAction = "s3express:CreateSession"

// AllActions - all API actions
Expand Down
Loading