ValidateSSHConfigOptions validates deployment SSH settings before they are written to users' local SSH configs.
(options map[string]string)
| 764 | // ValidateSSHConfigOptions validates deployment SSH settings before they are |
| 765 | // written to users' local SSH configs. |
| 766 | func ValidateSSHConfigOptions(options map[string]string) error { |
| 767 | // Sort the keys so that, when several options are invalid, the surfaced |
| 768 | // error is deterministic across restarts rather than dependent on map |
| 769 | // iteration order. |
| 770 | keys := make([]string, 0, len(options)) |
| 771 | for key := range options { |
| 772 | keys = append(keys, key) |
| 773 | } |
| 774 | slices.Sort(keys) |
| 775 | for _, key := range keys { |
| 776 | if err := ValidateSSHConfigOption(key, options[key]); err != nil { |
| 777 | return err |
| 778 | } |
| 779 | } |
| 780 | return nil |
| 781 | } |
| 782 | |
| 783 | // ValidateSSHConfigOption validates one deployment SSH option before it is |
| 784 | // written to users' local SSH configs. |