Skip to main content

auths_storage/
lib.rs

1// crate-level allow during curve-agnostic refactor.
2#![allow(clippy::disallowed_methods)]
3
4//! Storage adapters for auths-id ports.
5//!
6//! This crate provides concrete implementations of the storage port traits
7//! defined in `auths-id::ports`. Each backend is gated behind a feature flag
8//! so consumers only pull in the dependencies they need.
9//!
10//! ## Features
11//!
12//! - `backend-git` — Git-backed storage via `libgit2` (enables `GitRegistryBackend`)
13//! - `backend-postgres` — PostgreSQL-backed storage via `sqlx` (stub, not yet implemented)
14//!
15//! ## Usage
16//!
17//! ```toml
18//! [dependencies]
19//! auths-storage = { path = "...", features = ["backend-git"] }
20//! ```
21//!
22//! Instantiate the backend and inject it at the composition root:
23//!
24//! ```rust,ignore
25//! use std::sync::Arc;
26//! use auths_id::ports::RegistryBackend;
27//! use auths_storage::git::GitRegistryBackend;
28//!
29//! let backend: Arc<dyn RegistryBackend + Send + Sync> =
30//!     Arc::new(GitRegistryBackend::new(config));
31//! ```
32
33#[cfg(feature = "backend-git")]
34pub mod git;
35
36#[cfg(feature = "backend-postgres")]
37pub mod postgres;