Skip to content

M13.6: gitway --proxy-command + -J --jump-host (anvil-ssh 0.4.0)#22

Merged
UnbreakableMJ merged 1 commit into
mainfrom
feature/m13-6-gitway-proxy-flags
May 4, 2026
Merged

M13.6: gitway --proxy-command + -J --jump-host (anvil-ssh 0.4.0)#22
UnbreakableMJ merged 1 commit into
mainfrom
feature/m13-6-gitway-proxy-flags

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

Summary

Picks up anvil-ssh 0.4.0 and wires the new connect_via_proxy_command + connect_via_jump_hosts entry points into the gitway CLI.

Companion Anvil PRs already merged + 0.4.0 published:

What's new

  • --proxy-command <COMMAND> (FR-55) — overrides ProxyCommand from ssh_config(5). Pass none to disable a config-supplied template (FR-59).
  • -J / --jump-host [USER@]HOST[:PORT] (FR-56) — repeatable; matches OpenSSH -J. Builds a chain of up to MAX_JUMP_HOPS = 8. --jump-host=none disables a config-supplied chain.
  • Chain dispatcherconnect_session(config, alias, proxy, jump_hosts) picks the right AnvilSession::connect_via_* based on effective state. Precedence: CLI > ssh_config > direct TCP.
  • gitway config show chain visualization (FR-58) — when proxy_jump is set, the human output emits one proxyjump_hop_<n>_to user@host:port line per hop; JSON gains a proxy_jump_chain: [{host,port,user},...] array.
  • Schema/describe entries advertise the two new flags.

Smoke test

ext $ gitway --no-color config show work --user-config <fixture> hostname work.example.com user worker proxyjump alice@bastion1.example.com:2222,bastion2.example.com proxyjump_hop_1_to alice@bastion1.example.com:2222 proxyjump_hop_2_to bastion2.example.com:22

JSON output (excerpt):

json proxy_jump_chain: [ {host: bastion1.example.com, port: 2222, user: alice}, {host: bastion2.example.com, port: 22, user: null} ]

Tag plan

After merge: tag v1.0.0-rc.4.

Test plan

  • CI passes (Linux/macOS/Windows + MSRV 1.88).
  • cargo fmt / cargo clippy --workspace -- -D warnings clean.
  • cargo test --workspace --locked green.
  • Manual: gitway config show <host> with a ProxyJump chain renders all hops.
  • Manual: gitway -J bastion target ... actually opens a 2-hop session (verified by M13.7 integration harness — separate PR).

Plan: M13.6 of let-us-plan-on-bright-cosmos.md.

🤖 Generated with Claude Code

Picks up anvil-ssh 0.4.0 and wires the new connect_via_proxy_command
+ connect_via_jump_hosts entry points into the gitway CLI.

Cargo.toml: anvil-ssh 0.3.1 -> 0.4.0.
Cargo.lock: cargo update -p anvil-ssh.

cli.rs:
- Two new flags on the global Cli:
    --proxy-command "<COMMAND>"  — overrides ssh_config ProxyCommand
                                   for this connection. Pass `none`
                                   to disable a config-supplied one
                                   (FR-59).
    -J / --jump-host "[USER@]HOST[:PORT]"
                                   — repeatable; matches OpenSSH's
                                   -J. Multiple flags build a chain
                                   of up to MAX_JUMP_HOPS = 8.

main.rs:
- New helper resolve_proxy_directives(&cli, resolved) returns the
  EFFECTIVE (proxy_command, jump_chain) tuple per the precedence
  CLI > ssh_config > none. Single `none` entry clears the chain
  (FR-59).
- New helper connect_session(config, alias, proxy, jump_hosts)
  dispatches to the right AnvilSession constructor:
    1. ProxyCommand (excluding `none`) wins over everything else.
    2. ProxyJump wins over direct TCP when non-empty.
    3. Otherwise plain AnvilSession::connect.
- run() captures the user-typed alias (raw_host, before HostName
  resolution) and threads it into run_test / run_exec for the
  ProxyCommand `%n` token.
- run_test and run_exec route through connect_session instead of
  AnvilSession::connect directly. No behavior change when no proxy is
  set; FR-55 / FR-56 / FR-59 paths fire when configured.

config.rs:
- gitway config show now parses ProxyJump and emits one
  `proxyjump_hop_<n>_to <user@host:port>` line per hop in human
  output (FR-58).
- JSON output gains a `proxy_jump_chain: [{host,port,user}, ...]`
  field. Null when no chain or unparsable.

run_schema / run_describe:
- Advertise --proxy-command and --jump-host as global flags so agent
  tooling can discover them.

Tests: workspace tests still green; 4 + 7 + integration tests pass.
Smoke-tested locally with a Host block declaring
`ProxyJump alice@bastion1:2222,bastion2`; config show emits both
hops in JSON proxy_jump_chain with correct port defaults and user
fallback.

Plan: M13.6 of let-us-plan-on-bright-cosmos.md.
@UnbreakableMJ
UnbreakableMJ merged commit b21deec into main May 4, 2026
9 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the feature/m13-6-gitway-proxy-flags branch May 4, 2026 10:57
@UnbreakableMJ UnbreakableMJ mentioned this pull request May 4, 2026
2 tasks
UnbreakableMJ added a commit that referenced this pull request May 4, 2026
…able (#23)

Mirrors the M11.5/M12 done-style applied in PRs #18 and #21:

- §7.4 release-line table: 0.4.0 shipped 2026-05-04 with §5.8.2
  proxy chapter; 0.5.0+ reserved for M14+.
- §8 milestones table: M13 row now Done with a digest of the seven
  Anvil PRs (#5, #6, #10, #11, #12, #13, #14), the Gitway PR (#22),
  the Gitway tag (v1.0.0-rc.4), and the explicit NFR-17 + NFR-16
  call-outs (independent per-hop verification, loopback ratio gate,
  real-RTT manual).

Plan: M13.X of let-us-plan-on-bright-cosmos.md.
UnbreakableMJ added a commit that referenced this pull request May 4, 2026
…ease-line table (#31)

Updates the canonical PRD to reflect the M19 release shipped as
anvil-ssh 0.7.0 (Anvil PRs #22, #23, #24) + Gitway PRs #29, #30 +
Gitway tag v1.0.0-rc.7.

Two changes:

1. §7.4 release-line table — splits the prior `0.7.0–0.9.0 ⏳` row
   into a `0.7.0 ✅ Shipped` row covering the M19 release and a
   narrower `0.8.0–0.9.0 ⏳ In progress (M16–M18)` row.  The
   0.7.0 row records the new HashedHost parser+matcher, the
   write-side helpers (append_known_host_hashed / prepend_revoked /
   all_embedded / HashMode + detect_hash_mode), the visibility
   promotions, and the new direct deps (hmac/sha1/base64).

2. §8 milestone table — flips the M19 row from ⏳ Planned to ✅
   Done 2026-05-04.  Records the full FR-84..FR-87 deliverable:
   - Anvil-side parser + writer surface
   - Gitway-side three-verb hosts subcommand
   - HMAC-SHA1 privacy-only documentation
   - Three Anvil PRs and two Gitway PRs
   - v1.0.0-rc.7 tag

§10 risks unchanged — M19 introduced no new risks.

Plan: M19.X of anvil-gitway-milestone-plan.md.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant