#[non_exhaustive]pub enum SshAuth {
Agent,
Key(PathBuf),
Command(String),
}Expand description
How the ssh program should be run.
SSH is not a Rust library here. gix carries an SSH stream by spawning the
system ssh, exactly as git does, so the ssh binary must be on the
host for any of these — and in exchange, everything already configured for
it works: ~/.ssh/config, known_hosts, a ProxyJump, a hardware key.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Agent
Whatever ssh would do unaided: the agent in SSH_AUTH_SOCK, the keys
~/.ssh/config names, the defaults.
The right choice for a passphrase-protected key, because the agent is the only place a passphrase can be entered once and used many times.
Key(PathBuf)
One private key file, and only that one.
Adds -o IdentitiesOnly=yes, so an agent holding other keys cannot
quietly offer them first and exhaust the server’s MaxAuthTries before
the intended key is tried. The path is a path; the key’s contents are
never read by this crate and never printed.
Command(String)
Run this instead of ssh.
The escape hatch, and an explicit one — never a silent fallback. For a
jump host, a vendored client, -o options this crate has no opinion
about, or a test double. It becomes core.sshCommand for one fetch and
is never written to the working directory’s config.