Skip to content

Commit 2ee1145

Browse files
Merge pull request #16190 from enj/enj/i/validate_provider_username
Automatic merge from submit-queue (batch tested with PRs 15994, 16182, 16190, 16174) Correctly validate identity provider username `ValidateIdentityProviderUserName` should be used to validate the provider username, not `ValidateIdentityProviderName`. This makes it so that `~` cannot be used as a provider username. Signed-off-by: Monis Khan <[email protected]> /assign @liggitt @openshift/sig-security
2 parents 52567ea + e4c0ead commit 2ee1145

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/user/apis/user/validation/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func ValidateIdentity(identity *userapi.Identity) field.ErrorList {
139139

140140
if len(identity.ProviderUserName) == 0 {
141141
allErrs = append(allErrs, field.Required(field.NewPath("providerUserName"), ""))
142-
} else if reasons := ValidateIdentityProviderName(identity.ProviderUserName); len(reasons) != 0 {
142+
} else if reasons := ValidateIdentityProviderUserName(identity.ProviderUserName); len(reasons) != 0 {
143143
allErrs = append(allErrs, field.Invalid(field.NewPath("providerUserName"), identity.ProviderUserName, strings.Join(reasons, ", ")))
144144
}
145145

0 commit comments

Comments
 (0)