Expand description
Storage backend abstraction for the audit log.
Two backends ship in the box:
SqliteStore—rusqlite-backed, single-file local database. The default for dev/test; explicitly not recommended for production because the audit log dies with the host (no off-box durability, nothing to forward to a SOC).PostgresStore—sqlx-backed, native async, TLS via rustls + webpki-roots. Wire-compatible with AWS RDS / Aurora, GCP Cloud SQL + AlloyDB, Azure Database for PostgreSQL Flexible Server, Supabase, Neon, and self-hosted PostgreSQL.
The dispatcher does not know which backend is active. It calls into
AuditStore (an async trait) and the runtime resolves to the configured
impl through state.audit: Arc<dyn AuditStore + Send + Sync>.
§Cloud provider quick reference
See docs/storage-cloud.md for the full table. Summary:
These three rows said require until they were checked against the code.
pg_tls::require_tls_for_remote REFUSES sslmode=require on any connection
that crosses the network, because require completes TLS against any
certificate and so authenticates nothing. An operator following the old table
got a hard startup refusal, and the obvious way to “fix” that is to loosen the
check — which reopens the MITM hole the check exists to close. Supabase and
Neon both publish CA chains, so verify-full is what they support and what
this daemon accepts.
| Provider | URL hint | TLS mode | Statement cache |
|---|---|---|---|
| AWS RDS / Aurora | *.rds.amazonaws.com:5432 | verify-full | default |
| GCP Cloud SQL | via Cloud SQL Auth Proxy on 127.0.0.1 | disable | default |
| Azure Flexible | *.postgres.database.azure.com:5432 | verify-full | default |
| Supabase (5432) | db.<ref>.supabase.co:5432 | verify-full | default |
| Supabase (pooler) | *.pooler.supabase.com:6543 | verify-full | 0 |
| Neon | ep-*.neon.tech | verify-full | default |
| Self-hosted | (operator chooses) | as needed | default |
Re-exports§
pub use postgres::PostgresStore;
Modules§
- postgres
- Postgres backend for the audit log.
Structs§
- Sqlite
Store - Adapter that exposes the existing rusqlite-backed
TransactionStorethrough the asyncAuditStoretrait. Each method runs the underlying blocking work ontokio::task::spawn_blockingso the executor stays responsive even when the SQLite write takes a millisecond on a slow disk.
Traits§
- Audit
Store - Async, polymorphic interface to the audit log. Implemented by
SqliteStore(rusqlite, blocking under the hood) andpostgres::PostgresStore(sqlx, native async).