MCPcopy Index your code
hub / github.com/coder/coder / NormalizeRealUsername

Function NormalizeRealUsername

codersdk/name.go:124–130  ·  view source on GitHub ↗

NormalizeUserRealName normalizes a user name such that it will pass validation by UserRealNameValid. This is done to avoid blocking little Bobby Whitespace from using Coder.

(str string)

Source from the content-addressed store, hash-verified

122// validation by UserRealNameValid. This is done to avoid blocking
123// little Bobby Whitespace from using Coder.
124func NormalizeRealUsername(str string) string {
125 s := strings.TrimSpace(str)
126 if len(s) > 128 {
127 s = s[:128]
128 }
129 return s
130}

Callers 5

CreateUserMethod · 0.92
userOAuth2GithubMethod · 0.92
userOIDCMethod · 0.92
TestUserRealNameValidFunction · 0.92
userCreateMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestUserRealNameValidFunction · 0.74