4 releases
Uses new Rust 2024
| new 0.0.1-rc.8 | Mar 8, 2026 |
|---|---|
| 0.0.1-rc.7 | Mar 4, 2026 |
#2481 in Database interfaces
Used in auths-sdk
2MB
37K
SLoC
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 std::sync::Arc;
use auths_id::ports::RegistryBackend;
use auths_storage::git::GitRegistryBackend;
// In main.rs or app startup — the only place that knows the concrete type.
let backend: Arc<dyn RegistryBackend + Send + Sync> =
Arc::new(GitRegistryBackend::new(config));
// Inject into application state — all downstream code sees only the trait.
let state = AppState { registry: backend };
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>")]
Dependencies
~39–63MB
~1M SLoC