feat: expose owner_name in coder_workspace resource (#11639)

This commit is contained in:
Marcin Tojek
2024-01-17 13:20:45 +01:00
committed by GitHub
parent b173195e0d
commit 5eb3e1cdaa
40 changed files with 353 additions and 146 deletions

View File

@ -79,3 +79,15 @@ func TemplateDisplayNameValid(str string) error {
}
return nil
}
// UserRealNameValid returns whether the input string is a valid real user name.
func UserRealNameValid(str string) error {
if len(str) > 128 {
return xerrors.New("must be <= 128 characters")
}
if strings.TrimSpace(str) != str {
return xerrors.New("must not have leading or trailing white spaces")
}
return nil
}