pub struct VpsRecord {Show 15 fields
pub name: String,
pub host: String,
pub port: u16,
pub username: String,
pub password: SecretString,
pub key_path: Option<String>,
pub key_passphrase: Option<SecretString>,
pub timeout_ms: u64,
pub max_command_chars: usize,
pub max_output_chars: usize,
pub sudo_password: Option<SecretString>,
pub su_password: Option<SecretString>,
pub disable_sudo: bool,
pub schema_version: u32,
pub added_at: String,
}Expand description
VPS host record in the configuration file.
Wire format (serialize): English field names. Legacy Portuguese keys remain
readable via serde(alias = …) (GAP-AUD-20260717-001/002/021).
Fields§
§name: StringLogical unique VPS name.
host: StringServer hostname or IP.
port: u16SSH port.
username: StringSSH username.
password: SecretStringSSH password (empty when key-only auth).
key_path: Option<String>Absolute or expandable OpenSSH private key path.
key_passphrase: Option<SecretString>Private key passphrase (optional).
timeout_ms: u64Timeout in milliseconds.
max_command_chars: usizeCommand character limit (input). 0 = unlimited at runtime.
max_output_chars: usizeStdout/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: StringRFC 3339 inclusion timestamp.
Implementations§
Source§impl VpsRecord
impl VpsRecord
Sourcepub fn new(
name: String,
host: String,
port: u16,
username: String,
password: SecretString,
key_path: Option<String>,
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,
) -> Self
pub fn new( name: String, host: String, port: u16, username: String, password: SecretString, key_path: Option<String>, 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, ) -> Self
Creates a new record applying defaults.
Sourcepub fn has_password(&self) -> bool
pub fn has_password(&self) -> bool
Returns true if there is a non-empty password.
Sourcepub fn validate_credentials(&self) -> Result<(), String>
pub fn validate_credentials(&self) -> Result<(), String>
Validates that at least one authentication method exists.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Full record validation at the write boundary (add/edit/import).
Ensures port ∈ 1..=65535, non-empty host/user, and credentials present.
Does not check that key_path exists on the filesystem (dispatcher does).
Sourcepub fn normalize_schema(&mut self)
pub fn normalize_schema(&mut self)
Normalizes schema after deserialization (v1 → v2 migration).