Skip to main content

connect_agent

Function connect_agent 

Source
pub async fn connect_agent() -> Result<Option<AgentConnection>, GitwayError>
Expand description

Attempts to connect to the SSH agent via $SSH_AUTH_SOCK and retrieve its advertised identities (FR-9, priority 3).

Returns Ok(None) when:

  • SSH_AUTH_SOCK is not set in the environment.
  • The socket file does not exist (agent not running).
  • The agent holds no identities.

Returns Err only for unexpected I/O or protocol failures.

ยงErrors

Returns an error on socket read/write failures after a connection has been established.