Skip to main content

Module validation

Module validation 

Source
Expand description

Shared parse→validate pipeline for external config/import (G-SERDE-07). Shared validation pipeline for external input (G-SERDE-07).

Canonical order: parse → serde → validator → domain. No product telemetry (local tracing only).

Constants§

MAX_CHAR_LIMIT
Hard ceiling for command/output char limits (0 = unlimited still allowed) — G-SERDE-11.
MAX_FIELD_LEN
Max length for VPS name / host / username string fields.
MAX_TAGS
Max number of tags per host.
MAX_TAG_LEN
Max length for a single host tag.
MAX_TIMEOUT_MS
Hard ceiling for timeout_ms (1 hour) — G-SERDE-11.

Functions§

format_validation_errors
Formats ValidationErrors into a single agent-readable message (no secrets).
from_json_str
Deserialize JSON with path-aware errors (G-SERDE-08).
from_json_str_warn_unused
JSON deserialize that warns on unknown fields (Must-Ignore + G-SERDE-14).
from_toml_str
Deserialize TOML with path-aware errors (G-SERDE-08).
validate_nonempty_trimmed
Custom validator: non-empty after trim.
validate_or_err
Convenience: run Validate and map errors.
validate_port_nonzero
Custom validator: SSH port must be 1..=65535 (u16 already caps 65535).
validate_tags
Validates host tags (length + cardinality).
validation_to_error
Maps validation failures to SshCliError::InvalidArgument and logs locally.