e92b18197c
P01 — Load-bearing replacement for v0.8 mTLS transport (R-001). Transport (internal/sshpush/transport.go, REQ-073): - Transport struct with sync.Map connection pool (reuse *ssh.Client per peer). - Exec with context timeout (10s default) + retry (100ms x2 cap 5s max 5 attempts, +/-25% jitter — same backoff as v0.8 transport/retry.go). - ReadFile, WriteFile (atomic heredoc + mv), Close. - sshDialer + sshSession seams for testability. TOFU host-key verification reuses proxmox.TOFUHostKeyCallback. security.Flock for known_hosts. Fan-out (internal/sshpush/fanout.go): - ExecAll, WriteAll with errgroup + SetLimit semaphore (default 8 per I-B-001). Per-peer errors collected, don't cancel the group. Idempotency (internal/sshpush/idempotency.go, C-18): - WriteFileIdempotent: SHA-256 compare via ssh sha256sum; skip if content matches (written=false). Content-addressed idempotency replaces the v0.8 X-Orca-Idempotency-Key header (C-18 capability map). Tests: in-process fake SSH server (ssh.NewServerConn NoClientAuth ed25519) for e2e + interface seams for pure-logic. 93.0% coverage. 20 packages pass. ---ci--- project: orca phase: P01 milestone: v0.9 status: execute ---/ci---
24 lines
1.3 KiB
Go
24 lines
1.3 KiB
Go
// Package sshpush implements the v0.9 SSH-push transport layer (REQ-073,
|
||
// R-001): the CLI on the operator host SSHes to each peer to render files,
|
||
// apply configs, and run commands. It replaces the v0.8
|
||
// internal/transport mTLS HTTP layer.
|
||
//
|
||
// The Transport reuses one *ssh.Client per peer across multiple
|
||
// operations within a single CLI invocation (I-B-001), retries transient
|
||
// failures with exponential backoff (100ms ×2, cap 5s, max 5 attempts —
|
||
// reimplemented from the v0.8 transport/retry.go pattern, since
|
||
// internal/transport is deprecated and not imported), applies per-call
|
||
// timeouts (10s exec, 30s SCP per I-B-001), and fans out to many peers
|
||
// with bounded concurrency (default 8, errgroup + semaphore).
|
||
//
|
||
// Idempotency is content-addressed (C-18): WriteFile / WriteFileIdempotent
|
||
// compare the remote file's SHA-256 to the local content and skip the
|
||
// write on match — the SSH-push equivalent of the v0.8 X-Orca-Idempotency-Key.
|
||
//
|
||
// Host-key verification reuses proxmox.TOFUHostKeyCallback (D-035), which
|
||
// reads/writes the known_hosts file (certpaths.KnownHostsPath during the
|
||
// v0.9 dual-write window; the move to paths.KnownHostsPath happens in
|
||
// v0.10-P14). The known_hosts file is flock-protected inside the TOFU
|
||
// callback, so the Transport does NOT re-lock.
|
||
package sshpush
|