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

Method Validate

codersdk/deployment.go:5367–5379  ·  view source on GitHub ↗

Validate checks that the deployment-provided SSH configuration is safe to write into a user's local SSH config. Validating here ensures a deployment can never serve config that the client would reject.

()

Source from the content-addressed store, hash-verified

5365// write into a user's local SSH config. Validating here ensures a deployment
5366// can never serve config that the client would reject.
5367func (r SSHConfigResponse) Validate() error {
5368 if r.HostnamePrefix != "" {
5369 if err := ValidateWorkspaceHostnamePrefix(r.HostnamePrefix); err != nil {
5370 return err
5371 }
5372 }
5373 if r.HostnameSuffix != "" {
5374 if err := ValidateWorkspaceHostnameSuffix(r.HostnameSuffix); err != nil {
5375 return err
5376 }
5377 }
5378 return ValidateSSHConfigOptions(r.SSHConfigOptions)
5379}
5380
5381// SSHConfiguration returns information about the SSH configuration for the
5382// Coder instance.

Callers 1

ServerMethod · 0.95

Tested by

no test coverage detected