Documentation
¶
Index ¶
- Constants
- func ClassifyConnError(err error) (string, string)
- func ClassifyDialErrorSubCode(err error) string
- func CloseClientChain(client *ssh.Client) error
- func ConnectToClient(connCtx context.Context, opts *SSHOpts, currentClient *ssh.Client, ...) (*ssh.Client, int32, error)
- func ContextWithNoUserInput(ctx context.Context) context.Context
- func CpWshToRemote(ctx context.Context, client *ssh.Client, clientOs string, clientArch string, ...) error
- func GetClientPlatform(ctx context.Context, shell genconn.ShellClient) (string, string, error)
- func GetClientPlatformFromOsArchStr(ctx context.Context, osArchStr string) (string, string, error)
- func IsNoUserInputContext(ctx context.Context) bool
- func IsPowershell(shellPath string) bool
- func NormalizeConfigPattern(pattern string) string
- func SimpleMessageFromPossibleConnectionError(err error) string
- func WaveSshConfigUserSettings() *ssh_config.UserSettings
- type ConnectionDebugInfo
- type ConnectionError
- type HostKeyAlgorithms
- type InstallProgressFunc
- type KeepAliveSettings
- type SSHOpts
- type UserInputCancelError
Constants ¶
const ( ConnErrCode_ConfigParse = "config-parse" ConnErrCode_ConfigDefault = "config-default" ConnErrCode_ProxyDepth = "proxy-depth" ConnErrCode_ProxyParse = "proxy-parse" ConnErrCode_SecretStore = "secret-error" ConnErrCode_SecretNotFound = "secret-notfound" ConnErrCode_KnownHostsNone = "knownhosts-none" ConnErrCode_KnownHostsFmt = "knownhosts-format" ConnErrCode_Dial = "dial-error" ConnErrCode_ProxyJumpDial = "dial-proxy-jump" ConnErrCode_HostKeyRevoked = "hostkey-revoked" ConnErrCode_HostKeyChanged = "hostkey-changed" ConnErrCode_HostKeyVerify = "hostkey-verify" ConnErrCode_UserCancelled = "user-cancelled" ConnErrCode_UserTimeout = "user-timeout" ConnErrCode_AuthFailed = "auth-failed" ConnErrCode_UserInputReq = "userinput-required" ConnErrCode_ProxyCommand = "proxycommand-unsupported" ConnErrCode_Unknown = "unknown" )
const ( DialSubCode_DNS = "dns" DialSubCode_Refused = "refused" DialSubCode_Timeout = "timeout" DialSubCode_ContextCanceled = "context-canceled" DialSubCode_NoRoute = "no-route" DialSubCode_HostUnreach = "host-unreachable" DialSubCode_NetUnreach = "net-unreachable" DialSubCode_ConnReset = "conn-reset" DialSubCode_PermDenied = "perm-denied" DialSubCode_ProxyJump = "proxy-jump" DialSubCode_Other = "other" )
Dial error subcodes for more granular classification
const ( AuthSubCode_UnableToAuth = "unable-to-auth" AuthSubCode_HandshakeFailed = "handshake-failed" )
Auth error subcodes for more granular classification
const DefaultSshConnectTimeout = 30 * time.Second
const DefaultSshDialKeepAlive = 30 * time.Second
const DefaultSshServerAliveCountMax = 3
const SshProxyJumpMaxDepth = 10
Variables ¶
This section is empty.
Functions ¶
func ClassifyConnError ¶
func ClassifyDialErrorSubCode ¶
ClassifyDialErrorSubCode provides more granular classification of dial errors to help identify root causes (DNS, VPN, timeouts, etc.)
func CloseClientChain ¶ added in v0.5.0
CloseClientChain closes an ssh.Client created by ConnectToClient along with every ProxyJump client it was tunneled through. Closing the final client over a dead jump transport can block, so it is bounded; the jump hops (whose TCP close never blocks) are always closed afterwards, which unblocks anything still waiting on the tunnel.
func ConnectToClient ¶
func ContextWithNoUserInput ¶ added in v0.5.0
ContextWithNoUserInput marks a connect attempt as unattended (e.g. an automatic reconnect). Any step that would prompt the user fails with ConnErrCode_UserInputReq instead, so background retries never pop password/passphrase/host-key dialogs.
func CpWshToRemote ¶
func GetClientPlatform ¶
returns (os, arch, error) guaranteed to return a supported platform
func IsNoUserInputContext ¶ added in v0.5.0
func IsPowershell ¶
func NormalizeConfigPattern ¶
func WaveSshConfigUserSettings ¶
func WaveSshConfigUserSettings() *ssh_config.UserSettings
Types ¶
type ConnectionDebugInfo ¶
type ConnectionError ¶
type ConnectionError struct {
*ConnectionDebugInfo
Err error
}
func (ConnectionError) Error ¶
func (ce ConnectionError) Error() string
func (ConnectionError) Unwrap ¶
func (ce ConnectionError) Unwrap() error
type HostKeyAlgorithms ¶
type InstallProgressFunc ¶ added in v1.0.1
remotePath must be the same path the connserver is launched from (conn:wshpath or the default helper path); "" means the default. InstallProgressFunc reports how much of the helper binary has been sent, in uncompressed bytes.
type KeepAliveSettings ¶ added in v0.5.0
KeepAliveSettings mirrors ssh_config ServerAliveInterval/ServerAliveCountMax. A zero Interval means "not configured" (callers use their own defaults).
func GetClientKeepAliveSettings ¶ added in v0.5.0
func GetClientKeepAliveSettings(client *ssh.Client) KeepAliveSettings
GetClientKeepAliveSettings returns the ServerAlive* settings resolved when the client was created.
type SSHOpts ¶
type UserInputCancelError ¶
type UserInputCancelError struct {
Err error
}
func (UserInputCancelError) Error ¶
func (uice UserInputCancelError) Error() string
func (UserInputCancelError) Unwrap ¶
func (uice UserInputCancelError) Unwrap() error