fix: Apply SSH config ProxyJump directive when -J option not specified (issue #117) #119
+445
−14
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.
Summary
Fixes #117
The
get_proxy_jump()function existed in the SSH config parser but was never called during connection establishment. This PR implements automatic ProxyJump directive resolution from~/.ssh/configwhen the CLI-Joption is not specified.Changes
Core Implementation
src/executor/connection_manager.rs: Updatedexecute_on_node_with_jump_hosts()to resolve effective jump hosts by checking CLI option first, then falling back to SSH config ProxyJumpsrc/executor/parallel.rs: Addedssh_configfield toParallelExecutorand updated all constructorssrc/commands/exec.rs: Addedssh_configfield toExecuteCommandParamsand passed it to the executorsrc/app/dispatcher.rs: Updated to pass SSH config through to execution commandssrc/app/initialization.rs: Addeddetermine_effective_jump_hosts()helper function with comprehensive unit testsDocumentation
docs/architecture/ssh-jump-hosts.md: Added new section documenting SSH config ProxyJump integration with examples and usage patternsPriority Order
Jump host resolution now follows this priority:
-Joption (highest priority) - Explicitly specified jump hostsProxyJumpdirective - Per-host configuration from~/.ssh/configExample Usage
Given this SSH config:
Now works automatically:
Testing
src/app/initialization.rs::tests:test_determine_effective_jump_hosts_cli_takes_precedencetest_determine_effective_jump_hosts_falls_back_to_ssh_configtest_determine_effective_jump_hosts_no_jump_hosttest_determine_effective_jump_hosts_wildcard_patternBenefits
-Jfor frequently accessed internal hosts