Skip to main content

Module store

Module store 

Source
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.

ProviderURL hintTLS modeStatement cache
AWS RDS / Aurora*.rds.amazonaws.com:5432verify-fulldefault
GCP Cloud SQLvia Cloud SQL Auth Proxy on 127.0.0.1disabledefault
Azure Flexible*.postgres.database.azure.com:5432verify-fulldefault
Supabase (5432)db.<ref>.supabase.co:5432verify-fulldefault
Supabase (pooler)*.pooler.supabase.com:6543verify-full0
Neonep-*.neon.techverify-fulldefault
Self-hosted(operator chooses)as neededdefault

Re-exports§

pub use postgres::PostgresStore;

Modules§

postgres
Postgres backend for the audit log.

Structs§

SqliteStore
Adapter that exposes the existing rusqlite-backed TransactionStore through the async AuditStore trait. Each method runs the underlying blocking work on tokio::task::spawn_blocking so the executor stays responsive even when the SQLite write takes a millisecond on a slow disk.

Traits§

AuditStore
Async, polymorphic interface to the audit log. Implemented by SqliteStore (rusqlite, blocking under the hood) and postgres::PostgresStore (sqlx, native async).