KemalIdentity::Accounts::Account
The security-relevant facts about an account, and nothing else.
No profile, no roles, no email beyond the login used to find it. This is what the authentication path needs; the application loads its own user object when it needs one.
One identifier
#id is the account identifier. It is what Principal#subject carries and what
auth_sessions.account_id references — there is no second "external subject" to keep in
sync with it. An application wanting the shard's identifier to differ from its own user
id does that mapping inside its Repository, and the shard never learns of it
(docs/01-architecture.md). See
blueprints/0005-one-account-identifier.md.
Constructors
Instance methods
Bumped to invalidate every session for this account at once, without enumerating
rows. The belt to revocation's braces (docs/02-security-model.md).
Canonical identifier, opaque to the shard. A String for the reason given on
Principal#subject: a type parameter here would propagate through every handler,
service and repository in the graph.
Redacts the digest. A digest is not a secret in the sense a password is, but it is
offline-crackable material and docs/02-security-model.md forbids logging it.
The stored, already-normalised login. Never normalise it again on the way out.
nil means this account has no password credential — it authenticates through an
external identity only. It is not the same as "any password will do", and the
authentication path must never treat it as such.
Which Hasher produced password_digest, e.g. bcrypt. Drives needs_rehash? and
so the lazy-rehash migration.