Repository navigation
[v0.2] Use saved profiles as jump hosts - #28
Merged
Merged
Conversation
A jump hop can now reference another saved profile instead of spelling out an endpoint. The reference is resolved when connecting: it brings its own endpoint and key, is not expanded recursively, and fails with a named error when it is stale, self-referential, or password-backed. Refs #12 Signed-off-by: Xingqiu Xu <hilbertanjou83@gmail.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parent: #1
Closes #12
What changed
JumpHopis now a two-form enum:Endpoint(EndpointHop)(user/host/port) andProfile(ProfileHop)(a profile id). It is#[serde(untagged)], so existing saved chains deserialize unchanged — there is a test locking that in.SshRunner::resolve_jump_chainresolves references before OpenSSH starts:ssh -Jbehaviour and unchanged from [v0.2] Support multi-hop ProxyJump chains #11;sshprocess runs, each naming the problem:this connection uses saved connection <id> as a jump host, but that connection no longer exists; edit the chain to repair it;a jump host cannot reference the connection it belongs to;saved connection "<name>" is used as a jump host but stores a password; jump hosts must authenticate with a key.jump i/n <authority> unreachablefor endpoint hops andjump i/n <name> (saved connection) unreachablefor profile hops.Why passwords are refused for jump hops
Every hop in a chain is a separate
sshprocess spawned by the previous one. Line hands a saved password to its own askpass child through the environment of the connection it launches, and that environment is shared by the whole nested process tree — there is no per-hop channel today. Silently borrowing the target's password for a hop would be worse than refusing, so the refusal is explicit and the constraint is documented. Per-hop askpass is a separate design if it is ever wanted.Verification
cargo test --all-targets --locked(112 lib tests plus every integration suite, including the two-hop containerized chain),cargo clippy --all-targets --all-features --locked -- -D warnings,cargo +1.88.0 check --all-targets --locked,cargo fmt --check.