gitway-lib
Core SSH transport library for Git operations against GitHub and GitHub Enterprise Server (GHE). Written in pure Rust on top of russh v0.59.
Part of the Gitway project.
Add to your project
[]
= "0.1"
= { = "1", = ["rt-multi-thread", "macros"] }
Quick start
use ;
async
Key discovery order
authenticate_best searches for an identity in this fixed priority order:
config.identity_file— explicit path from the caller~/.ssh/id_ed25519~/.ssh/id_ecdsa~/.ssh/id_rsa- SSH agent via
$SSH_AUTH_SOCK(Unix only)
GitHub Enterprise Server
use GitwayConfig;
use PathBuf;
let config = builder
.port
.identity_file
.custom_known_hosts
.build;
The custom known_hosts file must contain lines in the form:
ghe.corp.example.com SHA256:<base64-fingerprint>
Error handling
use GitwayError;
Security
GitHub's SHA-256 host-key fingerprints are embedded in the binary. On every
connection the server's presented key is hashed and compared; a mismatch aborts
immediately with GitwayError::is_host_key_mismatch() == true.
Private key material is managed by russh's CryptoVec, which zeroes its buffer
on drop.
License
GPL-3.0-or-later. See LICENSE.