pub struct AnvilConfig {Show 14 fields
pub host: String,
pub port: u16,
pub username: String,
pub identity_files: Vec<PathBuf>,
pub cert_file: Option<PathBuf>,
pub strict_host_key_checking: StrictHostKeyChecking,
pub inactivity_timeout: Duration,
pub custom_known_hosts: Option<PathBuf>,
pub verbose: bool,
pub fallback: Option<(String, u16)>,
pub kex_algorithms: Option<Vec<String>>,
pub ciphers: Option<Vec<String>>,
pub macs: Option<Vec<String>>,
pub host_key_algorithms: Option<Vec<String>>,
}Expand description
Immutable configuration for an AnvilSession.
Construct via AnvilConfig::builder, or use one of the convenience
constructors (github, gitlab,
codeberg) for the most common targets.
Fields§
§host: StringPrimary SSH host (e.g. github.com, gitlab.com, codeberg.org).
port: u16Primary SSH port (default: 22).
username: StringRemote username (always git for hosted services; FR-13).
identity_files: Vec<PathBuf>Ordered list of identity-file paths. Tried in source order during
authentication; an empty list falls through to the default search
path (~/.ssh/id_ed25519, id_ecdsa, id_rsa). Populated by
IdentityFile directives from ssh_config, by the
AnvilConfigBuilder::add_identity_file /
AnvilConfigBuilder::identity_files builder methods, and (for
0.2.x compatibility) by the deprecated
AnvilConfigBuilder::identity_file method.
cert_file: Option<PathBuf>OpenSSH certificate path supplied via --cert (FR-12).
strict_host_key_checking: StrictHostKeyCheckingHost-key verification policy. Defaults to
StrictHostKeyChecking::Yes.
inactivity_timeout: DurationInactivity timeout for the SSH session (FR-5).
GitHub’s idle threshold is around 60 s; this is the configured client-side inactivity timeout, not a per-packet deadline.
custom_known_hosts: Option<PathBuf>Path to a known_hosts-style file for custom or self-hosted instances
(FR-7). Format: one hostname SHA256:<fp> entry per line.
verbose: boolEnable verbose debug logging when true.
fallback: Option<(String, u16)>Optional fallback host when port 22 is unavailable (FR-1).
GitHub: ssh.github.com:443. GitLab: altssh.gitlab.com:443.
Codeberg has no published port-443 fallback.
kex_algorithms: Option<Vec<String>>Key-exchange algorithm preference (PRD §5.8.6 FR-76).
None selects crate::algorithms::anvil_default_kex — the
curated default. Some(list) overrides; the list has
already passed through
crate::algorithms::apply_overrides (so any +/-/^
prefix has been resolved and the FR-78 denylist applied).
ciphers: Option<Vec<String>>Cipher preference (PRD §5.8.6 FR-76). None → curated default.
macs: Option<Vec<String>>MAC preference (PRD §5.8.6 FR-76). None → curated default.
Mostly cosmetic for AEAD ciphers (chacha20-poly1305, AES-GCM)
since they carry their own auth tag.
host_key_algorithms: Option<Vec<String>>Host-key algorithm preference (PRD §5.8.6 FR-76). None →
curated default.
Implementations§
Source§impl AnvilConfig
impl AnvilConfig
Sourcepub fn builder(host: impl Into<String>) -> AnvilConfigBuilder
pub fn builder(host: impl Into<String>) -> AnvilConfigBuilder
Sourcepub fn github() -> Self
pub fn github() -> Self
Convenience constructor for the default GitHub target (github.com:22).
Includes the ssh.github.com:443 fallback pre-configured.
Sourcepub fn gitlab() -> Self
pub fn gitlab() -> Self
Convenience constructor for the default GitLab target (gitlab.com:22).
Includes the altssh.gitlab.com:443 fallback pre-configured.
Sourcepub fn codeberg() -> Self
pub fn codeberg() -> Self
Convenience constructor for Codeberg (codeberg.org:22).
Codeberg has no published port-443 SSH fallback; no fallback is set.
Sourcepub fn identity_file(&self) -> Option<&Path>
👎Deprecated since 0.3.0: read identity_files directly
pub fn identity_file(&self) -> Option<&Path>
read identity_files directly
First identity-file path, or None if Self::identity_files is
empty. Provided as a 0.2.x compatibility shim — new code should
read Self::identity_files directly.
Sourcepub fn skip_host_check(&self) -> bool
👎Deprecated since 0.3.0: read strict_host_key_checking directly
pub fn skip_host_check(&self) -> bool
read strict_host_key_checking directly
true when Self::strict_host_key_checking is
StrictHostKeyChecking::No. Provided as a 0.2.x compatibility
shim — new code should read Self::strict_host_key_checking
directly.
Trait Implementations§
Source§impl Clone for AnvilConfig
impl Clone for AnvilConfig
Source§fn clone(&self) -> AnvilConfig
fn clone(&self) -> AnvilConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more