Database Schema
DarkAuth stores configuration, identity state, protocol state, and audit data in PostgreSQL or embedded PGLite through Drizzle.
Core state
Section titled “Core state”settingsstores database-backed runtime settings.jwksstores signing keys and public JWKs.clientsstores OAuth/OIDC client registrations.usersstores regular user accounts.admin_usersstores admin accounts.sessionsstores first-party session state.auth_codesstores authorization codes.pending_authstores in-progress authorization requests.
Password and key state
Section titled “Password and key state”opaque_recordsstores user OPAQUE records.admin_opaque_recordsstores admin OPAQUE records.wrapped_root_keysstores wrapped DRKs.user_encryption_keysstores public and wrapped private encryption keys.
Organizations and authorization
Section titled “Organizations and authorization”organizationsorganization_membersrolesrole_permissionspermissions
These tables support organization-scoped roles and effective permissions.
Security workflows
Section titled “Security workflows”otp_configsotp_backup_codespassword_reset_tokensemail_verification_tokensaudit_logs
Sensitive values are encrypted, hashed, or redacted according to their purpose.