no edit of oidc users, minimum hostname length (#2393)
* return an error when renaming users from OIDC * set minimum hostname length of 2
This commit is contained in:
parent
9bd143852f
commit
1c7f3bc440
3 changed files with 15 additions and 0 deletions
|
@ -65,6 +65,11 @@ func ValidateUsername(username string) error {
|
|||
}
|
||||
|
||||
func CheckForFQDNRules(name string) error {
|
||||
// Ensure the username meets the minimum length requirement
|
||||
if len(name) < 2 {
|
||||
return errors.New("name must be at least 2 characters long")
|
||||
}
|
||||
|
||||
if len(name) > LabelHostnameLength {
|
||||
return fmt.Errorf(
|
||||
"DNS segment must not be over 63 chars. %v doesn't comply with this rule: %w",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue