Expand description
§gitway-lib
Purpose-built SSH transport library for Git operations against GitHub, GitLab, Codeberg, and self-hosted Git instances.
Written in pure Rust on top of russh v0.59, it
replaces the general-purpose ssh binary in the Git transport pipeline.
§Quick start
use gitway_lib::{GitwayConfig, GitwaySession};
// GitHub
let config = GitwayConfig::github();
// GitLab
let config = GitwayConfig::gitlab();
// Codeberg
let config = GitwayConfig::codeberg();
let mut session = GitwaySession::connect(&config).await?;
session.authenticate_best(&config).await?;
let exit_code = session.exec("git-upload-pack 'user/repo.git'").await?;
session.close().await?;§Design principles
- Pinned host keys — SHA-256 fingerprints for GitHub, GitLab, and Codeberg are embedded; no TOFU (Trust On First Use) for known hosts.
- Narrow scope — only exec channels; no PTY, SFTP, or port forwarding.
- Post-quantum ready — uses
aws-lc-rsfor cryptography. - Metric / SI / ISO 8601 throughout all timestamps and measurements.
Re-exports§
pub use config::GitwayConfig;pub use error::GitwayError;pub use session::GitwaySession;
Modules§
- auth
- Identity resolution (FR-9 through FR-12).
- config
- Configuration builder for a Gitway session.
- error
- Error types for
gitway-lib. - hostkey
- SSH host-key fingerprint pinning for well-known Git hosting services (FR-6, FR-7).
- relay
- Bidirectional stdin/stdout relay over an SSH exec channel (FR-14 through FR-17).
- session
- SSH session management (FR-1 through FR-5, FR-9 through FR-17).