Repository navigation
[M2.2b2] Persist users and bounded identity credentials - #42
Merged
Merged
Conversation
samuelmbabhazi
force-pushed
the
feat/m2.2b1-transactional-audit
branch
from
November 5, 2026 12:10
f467fd5 to
b791e52
Compare
samuelmbabhazi
force-pushed
the
feat/m2.2b2-identity-schema
branch
from
November 5, 2026 12:11
035182a to
2090cbd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
M2.2b2, part of #21. Depends on #41; base
feat/m2.2b1-transactional-audit.What changed and why
Add PostgreSQL users, browser sessions and single-use identity credentials.
citextenforces case-insensitive email uniqueness; foreign keys bind credentials to their user. Database constraints prevent unknown account states/purposes, active unverified accounts, negative security versions, plaintext-shaped credential hashes and lifetimes beyond the specification. Indexes support credential lookup, revocation and expiry cleanup.No account endpoint is exposed yet. The next PR adds repositories and command behavior on this schema.
Validation
Security considerations
Only token hashes are stored. Session and identity credentials carry the user's security version so later commands can invalidate stale credentials on password or privilege changes. Runtime database mutations arrive in the following PR and will use the transaction/audit mechanism from #41. The migration adds tables without altering existing fleet or audit records.
Checklist