2.3 KiB
2.3 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| client/connect-options | Implement ConnectOptions struct and client session orchestration with graceful shutdown | pending |
|
moderate | medium | component | implementation |
Description
Implement ConnectOptions — the programmatic configuration struct (ADR-011) for the client — and the top-level client session orchestrator that ties together transport, channel manager, SOCKS5 server, and port forwards.
The client session lifecycle:
- Create transport based on
ConnectOptions - Connect transport, authenticate SSH session
- Start SOCKS5 server
- Start port forward listeners
- Run until SIGTERM/SIGINT or fatal error
- Graceful shutdown
Graceful shutdown (SIGTERM/SIGINT):
- Stop accepting new SOCKS5 connections and port forward connections
- Send SSH disconnect message to server
- Wait for in-flight data to drain (~2 second timeout)
- Close transport stream
- Exit
Acceptance Criteria
crates/wraith-core/src/client/mod.rsre-exports all client componentsConnectOptionsstruct with fields matching client.md CLI interface:server,peer,transport_mode,identity,socks5_addr,forwards,remote_forwards,proxy,iroh_relay,tls_server_name,insecureConnectOptions::identityacceptsKeySource(file or in-memory)ClientSession::new(opts: ConnectOptions) -> Result<Self>— creates transport, connects, authenticatesClientSession::run()— starts SOCKS5 server, port forwards, waits for shutdown signal- SOCKS5 is always enabled when running (per constraint)
- Port forwards are optional and started based on
ConnectOptions ClientSession::shutdown()— graceful shutdown: stop accepting, send SSH disconnect, drain timeout, close- SIGTERM/SIGINT handled via tokio signal
- Integration test: full client-to-server session via mock transport, SOCKS5 proxy works, shutdown completes
References
- docs/architecture/client.md — full client spec, CLI interface, graceful shutdown
- docs/architecture/decisions/011-no-ssh-config-programmatic-api.md — ConnectOptions programmatic struct
Notes
To be filled by implementation agent
Summary
To be filled on completion