Documentation
¶
Overview ¶
Package ssh provides SSH authentication utilities for Git operations.
Index ¶
Constants ¶
const InsecureAllowMissingKnownHostsFlag = "--insecure-allow-missing-known-hosts"
InsecureAllowMissingKnownHostsFlag is the controller flag, surfaced in error text, that opts out of SSH host key verification when no host-key source produced any known_hosts at all.
Variables ¶
This section is empty.
Functions ¶
func GetAuthMethod ¶
func GetAuthMethod(privateKey, password, knownHosts string, allowMissingKnownHosts bool) (transport.AuthMethod, error)
GetAuthMethod returns an SSH public key authentication method from a private key.
Host key verification fails closed: a known_hosts source is required. A known_hosts value that is present but cannot be parsed is always a hard error — if a host key is declared it must be valid. When no known_hosts is available at all, GetAuthMethod returns an error unless allowMissingKnownHosts is set (the controller's --insecure-allow-missing-known-hosts flag), which disables host key verification and is intended for throwaway/dev clusters only.
Types ¶
This section is empty.