Skip to main content

Module client

Module client 

Source
Expand description

Blocking SSH-agent client.

Wraps ssh_agent_lib::blocking::Client with a Gitway-native error surface and a small convenience API: connect, add, list, remove, remove_all, lock, unlock.

The blocking API is chosen deliberately — an ssh-add-style binary has no use for async concurrency, and avoiding tokio here keeps the dependency graph small.

§Examples

use std::path::Path;
use gitway_lib::agent::client::Agent;

let mut agent = Agent::from_env()?;
agent.list()?.iter().for_each(|id| println!("{}", id.fingerprint));

§Errors

Every operation returns GitwayError. Agent-protocol failures and I/O failures are both folded into the Io variant with a descriptive message; callers that care can match via GitwayError::is_io.

§Zeroization

ssh-agent-lib 0.5.2’s lock / unlock take a plain String by value, so the passphrase copy inside the library cannot be cleared on our behalf. Callers supply a Zeroizing<String> and this module clones only the byte contents into the library’s expected String argument; the caller’s original buffer remains zeroizable.

Structs§

Agent
Handle to a running SSH agent.
Identity
One identity loaded into the agent.