Skip to main content

Module daemon

Module daemon 

Source
Expand description

Long-lived SSH agent daemon.

Implements the server side of the SSH agent wire protocol on top of ssh_agent_lib. Keys are held in-memory only, wrapped in types that zeroize on drop; nothing is ever persisted to disk. SIGTERM and SIGINT trigger graceful shutdown — the socket is unlinked, the pid file removed, and every stored key is zeroed before the process exits.

§Signing support (v0.6)

The daemon accepts Add for keys of every algorithm Gitway’s keygen can produce (Ed25519, ECDSA P-256/384/521, RSA 2048..16384). The Sign handler, however, only covers Ed25519 in v0.6; ECDSA and RSA sign requests return an AgentError::Failure with a log::warn! entry so callers see a clear error and operators can see that the unsupported path was hit. Supporting those algorithms is tracked as a follow-up within the v0.6.x series.

§Example

use std::path::PathBuf;
use gitway_lib::agent::daemon::{AgentDaemonConfig, run};

let cfg = AgentDaemonConfig {
    socket_path: PathBuf::from("/tmp/gitway-agent.sock"),
    pid_file: None,
    default_ttl: None,
};
run(cfg).await?;

Structs§

AgentDaemonConfig
Configuration for run.

Functions§

run
Runs the agent daemon until a termination signal arrives.