1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-License-Identifier: GPL-3.0-or-later
// Rust guideline compliant 2026-04-05
// S3: enforce zero unsafe in all project-owned code at compile time.
//! # 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`](https://docs.rs/russh) v0.59, it
//! replaces the general-purpose `ssh` binary in the Git transport pipeline.
//!
//! ## Quick start
//!
//! ```no_run
//! use gitway_lib::{GitwayConfig, GitwaySession};
//!
//! # async fn doc() -> Result<(), gitway_lib::GitwayError> {
//! // 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?;
//! # Ok(())
//! # }
//! ```
//!
//! ## 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-rs` for cryptography.
//! - **Metric / SI / ISO 8601** throughout all timestamps and measurements.
// ── Flat re-exports (FR-23) ───────────────────────────────────────────────────
pub use GitwayConfig;
pub use GitwayError;
pub use GitwaySession;