Expand description
Relational UserStore on the shared #1351 embedded PostgreSQL handle.
§Architecture
PgliteUserStore is the embedded backend; the SQL in
USERSTORE_SCHEMA is the authoritative, PostgreSQL-compatible DDL that a
future PostgresUserStore (server / metal deployment, #1378) consumes
against its own connection pool. PGlite and Postgres share one schema so
relational identities are portable between local and server deployments.
The store owns one shared Arc<PGlite> handle. Opening a second PGlite
handle against the same directory is unsafe — there is exactly one
connection owner.
§#1370 R4 hardening preserved
Cold-signup staging (provision_hosted_account) and activation
(activate_hosted_account) implement the exact #1370 R4 contract also
implemented by RocksDbUserStore and
ValkeyUserStore: orphan-genesis
ordering (inactive stage → PDS genesis → exact activation), exact
fingerprint recompute, full PQ-metadata validation, and the trustworthy
resume-vs-409 classification. Partial/corrupt state is a backend error
and fails closed; only a complete, usable, active hosted binding yields
AccountAlreadyExists / KeyAlreadyBound.
Structs§
Constants§
- USERSTORE_
SCHEMA - Re-exported from
super::cipher_glue::USERSTORE_SCHEMAso PGlite and Postgres apply the same encrypted-storage constraints. PostgreSQL-compatible schema shared by embedded PGlite and server Postgres.