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)
| 755 | // may legitimately contain a trailing dot (the default is "coder."), so only |
| 756 | // the single-token requirement is enforced. |
| 757 | func 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. |