pub struct VpsRecord {Show 22 fields
pub name: VpsName,
pub host: SshHost,
pub port: SshPort,
pub username: SshUser,
pub password: SecretString,
pub key_path: Option<KeyPath>,
pub key_passphrase: Option<SecretString>,
pub use_agent: bool,
pub agent_socket: Option<String>,
pub timeout_ms: TimeoutMs,
pub max_command_chars: CharLimit,
pub max_output_chars: CharLimit,
pub sudo_password: Option<SecretString>,
pub su_password: Option<SecretString>,
pub disable_sudo: bool,
pub schema_version: u32,
pub added_at: Rfc3339Utc,
pub tags: Vec<HostTag>,
pub tls: bool,
pub tls_sni: Option<String>,
pub tls_client_cert: Option<String>,
pub tls_client_key: Option<String>,
}Expand description
VPS host record in the configuration file.
Wire format (serialize): English field names. Legacy Portuguese keys remain
readable via serde(alias = …).
Field types are domain newtypes — invalid host/port/user/name cannot be
constructed after a successful deserialize or Self::try_new.
Fields§
§name: VpsNameLogical unique VPS name.
host: SshHostServer hostname or IP.
port: SshPortSSH port.
username: SshUserSSH username.
password: SecretStringSSH password (empty when key-only auth).
key_path: Option<KeyPath>Absolute or expandable OpenSSH private key path.
key_passphrase: Option<SecretString>Private key passphrase (optional).
use_agent: boolUse ssh-agent for publickey auth (G-SSH-04). Socket from agent_socket / CLI.
agent_socket: Option<String>Agent Unix socket or Windows named pipe path (XDG; never env-as-store).
timeout_ms: TimeoutMsTimeout in milliseconds.
max_command_chars: CharLimitCommand character limit (input). 0 = unlimited at runtime.
max_output_chars: CharLimitStdout/stderr character limit. Accepts legacy alias max_chars.
sudo_password: Option<SecretString>Password for sudo (optional).
su_password: Option<SecretString>Password for su - (optional).
disable_sudo: boolIf true, sudo-exec and su-exec are rejected for this host.
schema_version: u32Schema version for this record.
added_at: Rfc3339UtcRFC 3339 inclusion timestamp (DateTime<Utc> newtype).
Optional host tags for fleet selection (G-O2). Empty on legacy records.
tls: boolWhen true, wrap SSH in TLS (SSH-over-TLS via rustls) before the SSH handshake.
tls_sni: Option<String>SNI / certificate name for TLS (defaults to host when empty/None).
tls_client_cert: Option<String>Client certificate PEM path for mTLS (optional).
tls_client_key: Option<String>Client private key PEM path for mTLS (optional; required with cert).
Implementations§
Source§impl VpsRecord
impl VpsRecord
Sourcepub fn try_new(
name: impl AsRef<str>,
host: impl AsRef<str>,
port: u16,
username: impl AsRef<str>,
password: SecretString,
key_path: Option<impl AsRef<str>>,
key_passphrase: Option<SecretString>,
timeout_ms: Option<u64>,
max_command_chars: Option<usize>,
max_output_chars: Option<usize>,
sudo_password: Option<SecretString>,
su_password: Option<SecretString>,
disable_sudo: bool,
) -> Result<Self, String>
pub fn try_new( name: impl AsRef<str>, host: impl AsRef<str>, port: u16, username: impl AsRef<str>, password: SecretString, key_path: Option<impl AsRef<str>>, key_passphrase: Option<SecretString>, timeout_ms: Option<u64>, max_command_chars: Option<usize>, max_output_chars: Option<usize>, sudo_password: Option<SecretString>, su_password: Option<SecretString>, disable_sudo: bool, ) -> Result<Self, String>
Creates a new record applying defaults (validated — G-TYPE-06).
§Errors
Returns a message when any field fails domain parse.
Sourcepub fn has_any_tag(&self, wanted: &[HostTag]) -> bool
pub fn has_any_tag(&self, wanted: &[HostTag]) -> bool
Returns true if this host has any of the requested tags (OR match, G-O2).
Sourcepub fn has_password(&self) -> bool
pub fn has_password(&self) -> bool
Returns true if there is a non-empty password (G-TYPE-12).
Sourcepub fn validate_credentials(&self) -> Result<(), DomainError>
pub fn validate_credentials(&self) -> Result<(), DomainError>
Validates primary authentication: exactly one of password / key / agent (G-AUD-07).
§Errors
[DomainError] when zero or more than one primary method is set.
Sourcepub fn validate_structure(&self) -> Result<(), DomainError>
pub fn validate_structure(&self) -> Result<(), DomainError>
Structural validation (G-SERDE-04 / G-TYPE): tags cardinality + field proofs already in types.
§Errors
[DomainError] when tag cardinality exceeds the limit.
Sourcepub fn validate(&self) -> Result<(), DomainError>
pub fn validate(&self) -> Result<(), DomainError>
Full record validation at the write boundary (add/edit/import).
§Errors
Propagates [DomainError] from structure or credentials checks.
Sourcepub fn normalize_schema(&mut self)
pub fn normalize_schema(&mut self)
Normalizes schema after deserialization (v1 → v2 migration).
Sets tags from raw strings (validated).