models.options

Boundary specs for the per-protocol *_options tables.

Each *OptionsSpec validates the JSON-serializable curated fields of its protocol and builds the matching runtime dataclass from otto.host.options via to_runtime(). The runtime dataclasses (which carry the library adapters, callables, and open extra dicts) are never modified here.

class otto.models.options.SshOptionsSpec(*, port: int = 22, known_hosts: ~typing.Any = None, connect_timeout: float | None = None, keepalive_interval: float | None = None, keepalive_count_max: int | None = None, client_keys: list[str] | None = None, client_host_keys: list[str] | None = None, agent_forwarding: bool = False, preferred_auth: str | list[str] | None = None, encryption_algs: list[str] | None = None, server_host_key_algs: list[str] | None = None, compression_algs: list[str] | None = None, local_forwards: list[~otto.host.options.LocalPortForward] = <factory>, remote_forwards: list[~otto.host.options.RemotePortForward] = <factory>, socks_forwards: list[~otto.host.options.SocksForward] = <factory>, extra: dict[str, ~typing.Any] = <factory>)

Bases: OttoModel

Boundary spec for the SSH connection options table ([ssh_options] in lab data).

Validates the asyncssh-facing tunables: port, authentication settings, cipher/host-key/compression algorithm lists, keepalive, local/remote/SOCKS port forwards, and an open extra dict for pass-through kwargs. Builds a SshOptions runtime dataclass via to_runtime().

port : int
known_hosts : Any
connect_timeout : float | None
keepalive_interval : float | None
keepalive_count_max : int | None
client_keys : list[str] | None
client_host_keys : list[str] | None
agent_forwarding : bool
preferred_auth : str | list[str] | None
encryption_algs : list[str] | None
server_host_key_algs : list[str] | None
compression_algs : list[str] | None
local_forwards : list[rt.LocalPortForward]
remote_forwards : list[rt.RemotePortForward]
socks_forwards : list[rt.SocksForward]
extra : dict[str, Any]
to_runtime() SshOptions

Build the SshOptions runtime dataclass from the validated spec fields.

class otto.models.options.FtpOptionsSpec(*, port: int = 21, encoding: str = 'utf-8', socket_timeout: float | None = None, connection_timeout: float | None = None, path_timeout: float | None = None, read_speed_limit: int | None = None, write_speed_limit: int | None = None, ssl: ~typing.Any = None, passive_commands: tuple[str, ...] = ('epsv', 'pasv'), extra: dict[str, ~typing.Any] = <factory>)

Bases: OttoModel

Boundary spec for the FTP transfer options table ([ftp_options] in lab data).

Validates port, encoding, timeout tunables, optional SSL config, speed limits, and passive-mode command order. Builds a FtpOptions runtime dataclass via to_runtime().

port : int
encoding : str
socket_timeout : float | None
connection_timeout : float | None
path_timeout : float | None
read_speed_limit : int | None
write_speed_limit : int | None
ssl : Any
passive_commands : tuple[str, ...]
extra : dict[str, Any]
to_runtime() FtpOptions

Build the FtpOptions runtime dataclass from the validated spec fields.

class otto.models.options.SftpOptionsSpec(*, env: dict[str, str] | None = None, send_env: list[str] | None = None, extra: dict[str, ~typing.Any] = <factory>)

Bases: OttoModel

Boundary spec for the SFTP transfer options table ([sftp_options] in lab data).

Validates environment variables to set on the remote SFTP session and an open extra dict for pass-through kwargs. Builds a SftpOptions runtime dataclass via to_runtime().

env : dict[str, str] | None
send_env : list[str] | None
extra : dict[str, Any]
to_runtime() SftpOptions

Build the SftpOptions runtime dataclass from the validated spec fields.

class otto.models.options.ScpOptionsSpec(*, preserve: bool = False, recurse: bool = True, block_size: int = 16384, extra: dict[str, ~typing.Any] = <factory>)

Bases: OttoModel

Boundary spec for the SCP transfer options table ([scp_options] in lab data).

Validates file-preservation, recursion, and transfer block-size tunables, plus an open extra dict for pass-through kwargs. Builds a ScpOptions runtime dataclass via to_runtime().

preserve : bool
recurse : bool
block_size : int
extra : dict[str, Any]
to_runtime() ScpOptions

Build the ScpOptions runtime dataclass from the validated spec fields.

class otto.models.options.TelnetOptionsSpec(*, port: int = 23, write_chunk_size: int = 0, write_chunk_delay: float = 0.0, cols: int = 400, rows: int = 24, encoding: str | bool = False, connect_timeout: float | None = None, echo_negotiation_timeout: float = 3.0, login_prompt: bytes = b':', login: bool = True, single_client_console: bool = False, auto_window_resize: bool = False, extra: dict[str, ~typing.Any] = <factory>)

Bases: OttoModel

Boundary spec for the Telnet terminal options table ([telnet_options] in lab data).

Validates port, character-encoding, terminal dimensions, write-chunking delays, login prompt delimiter, single-client-console mode, and connect/echo-negotiation timeouts. The login_prompt field accepts a string from JSON and encodes it to bytes via _encode_login_prompt. Builds a TelnetOptions runtime dataclass via to_runtime().

port : int
write_chunk_size : int
write_chunk_delay : float
cols : int
rows : int
encoding : str | bool
connect_timeout : float | None
echo_negotiation_timeout : float
login_prompt : bytes
login : bool
single_client_console : bool
auto_window_resize : bool
extra : dict[str, Any]
to_runtime() TelnetOptions

Build the TelnetOptions runtime dataclass from the validated spec fields.

class otto.models.options.NcOptionsSpec(*, exec_name: str = 'nc', port: int = 9000, port_strategy: 'auto' | 'ss' | 'netstat' | 'python' | 'proc' | 'custom' = 'auto', port_cmd: str | None = None, listener_check: 'auto' | 'ss' | 'netstat' | 'proc' | 'custom' = 'auto', listener_cmd: str | None = None, listener_timeout: float = 30.0)

Bases: OttoModel

Boundary spec for the netcat (nc) transfer options table ([nc_options] in lab data).

Validates the nc executable name, port number, port-discovery and listener-detection strategies, optional shell commands for each, and the listener-ready timeout. Builds a NcOptions runtime dataclass via to_runtime().

exec_name : str
port : int
port_strategy : NcPortStrategy
port_cmd : str | None
listener_check : NcListenerCheck
listener_cmd : str | None
listener_timeout : float
to_runtime() NcOptions

Build the NcOptions runtime dataclass from the validated spec fields.

class otto.models.options.SnmpOptionsSpec(*, oids: tuple[str, ...] = (), community: str = 'public', port: int = 161, version: '1' | '2c' = '2c', address: str | None = None)

Bases: OttoModel

Boundary spec for the SNMP monitor options table ([snmp] in lab data).

Validates the OID list, community string, port, SNMP version ("1" or "2c"), and an optional override address. Builds a SnmpOptions runtime dataclass via to_runtime().

oids : tuple[str, ...]
community : str
port : int
version : Literal['1', '2c']
address : str | None
to_runtime() SnmpOptions

Build the SnmpOptions runtime dataclass from the validated spec fields.

class otto.models.options.TftpOptionsSpec(*, port: int = 69, server_ip: str | None = None, block_size: int = 512, timeout: float = 5.0)

Bases: OttoModel

Boundary spec for the TFTP transfer options table ([tftp_options] in lab data).

Validates port, optional server IP override, transfer block size, and per-block timeout. Builds a TftpOptions runtime dataclass via to_runtime().

port : int
server_ip : str | None
block_size : int
timeout : float
to_runtime() TftpOptions

Build the TftpOptions runtime dataclass from the validated spec fields.

otto.models.options.OPTION_SPEC_RUNTIME_PAIRS : list[tuple[type[OttoModel], type]]

Each boundary option spec paired with the runtime dataclass it builds. Drives the drift guard so the duplicated field lists cannot silently diverge.