Skip to main content

Module git

Module git 

Source
Expand description

Git-integrated identity, SSH signing, and collaborator verification.

Links agent-relay authentication to Git’s own infrastructure:

  • Identity from git config user.name + user.email
  • Message signing with SSH keys (same key used for git push)
  • Collaborator verification via GitHub API (gh CLI)

Structs§

Collaborator
GitIdentity
SecureRelay
A relay with Git identity + SSH signing.
SignedMessage
A message with an attached SSH signature.

Functions§

find_ssh_key
Find the user’s SSH private key. Checks: git config user.signingkey, then common paths.
github_collaborators
Fetch collaborators from a GitHub repo using the gh CLI. Returns list of (username, email) pairs.
parse_github_remote
Extract owner/repo from a git remote URL. Handles: git@github.com:owner/repo.git, https://github.com/owner/repo.git
ssh_sign
Sign a message body using the user’s SSH key. Uses ssh-keygen -Y sign which is the same mechanism as git commit -S.
ssh_verify
Verify an SSH signature against the message content. Requires an allowed_signers file listing trusted public keys.
write_allowed_signers
Generate an allowed_signers file from the collaborators’ public keys. Each line: email namespace public-key