Skip to main content

Module jump

Module jump 

Source
Expand description

ProxyJump chain parser + per-hop type.

M13.3 adds the parser and the JumpHost type; M13.4 wires both into crate::session::AnvilSession::connect_via_jump_hosts (which drives russh’s direct-tcpip channel for each chained hop).

§Jump-string grammar

OpenSSH’s ProxyJump directive (and -J flag) accepts a comma- separated list of hops, each in the form:

[user@]host[:port]

Whitespace around commas is ignored. Trailing commas and empty entries are rejected with AnvilError::invalid_config. The chain length is capped at MAX_JUMP_HOPS = 8 (matches OpenSSH’s READCONF_MAX_DEPTH for ProxyJump chains).

Per-hop IdentityFile selection is not done here — that requires re-running crate::ssh_config::resolve against each hop’s hostname, which the chain manager (M13.4) does because it has access to the SshConfigPaths. This module’s job is purely syntactic: turn the raw string into a structured list of hops.

Structs§

JumpHost
One hop in a [ProxyJump] chain.

Constants§

MAX_JUMP_HOPS
Hard cap on chain length, matching OpenSSH. Any chain longer than this is refused at parse time with a clear error.

Functions§

parse_jump_chain
Parses a comma-separated ProxyJump chain into ordered JumpHosts.