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

Function ValidateWorkspaceHostnamePrefix

codersdk/deployment.go:757–762  ·  view source on GitHub ↗

ValidateWorkspaceHostnamePrefix validates a deployment-provided SSH hostname prefix before it is made available to clients. Unlike the suffix, a prefix may legitimately contain a trailing dot (the default is "coder."), so only the single-token requirement is enforced.

(prefix string)

Source from the content-addressed store, hash-verified

755// may legitimately contain a trailing dot (the default is "coder."), so only
756// the single-token requirement is enforced.
757func ValidateWorkspaceHostnamePrefix(prefix string) error {
758 if !isSingleHostPatternToken(prefix) {
759 return xerrors.Errorf("workspace hostname prefix %q must not contain whitespace or control characters", prefix)
760 }
761 return nil
762}
763
764// ValidateSSHConfigOptions validates deployment SSH settings before they are
765// written to users' local SSH configs.

Callers 2

ValidateMethod · 0.85

Calls 2

isSingleHostPatternTokenFunction · 0.85
ErrorfMethod · 0.45

Tested by 1