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.
()
| 5365 | // write into a user's local SSH config. Validating here ensures a deployment |
| 5366 | // can never serve config that the client would reject. |
| 5367 | func (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. |
no test coverage detected