auths-storage
Storage adapters for the identity and registry ports defined in auths-id.
Role
This crate contains adapters only — no domain logic. It implements the port traits from auths-id::ports (e.g., RegistryBackend, AttestationSource) for specific storage backends. The identity domain in auths-id never imports from this crate.
auths-storage ──depends on──▶ auths-id::ports
auths-id (never imports from auths-storage)
binary crates ──depend on──▶ both
Feature Flags
| Feature | Dependencies enabled | Provides |
|---|---|---|
backend-git |
git2, tempfile |
GitRegistryBackend (production Git adapter) |
backend-postgres |
sqlx, tokio |
PostgresAdapter (stub, not yet implemented) |
No features are enabled by default. Binary crates select the backend they need.
Wiring a Backend (Composition Root)
use Arc;
use RegistryBackend;
use GitRegistryBackend;
// In main.rs or app startup — the only place that knows the concrete type.
let backend: =
new;
// Inject into application state — all downstream code sees only the trait.
let state = AppState ;
Adding a New Backend
- Create
src/<backend>/mod.rsandsrc/<backend>/adapter.rs - Implement
RegistryBackendfromauths_id::ports::registry - Add a feature flag in
Cargo.toml - Export from
src/lib.rsbehind#[cfg(feature = "backend-<name>")]