struct

KemalIdentity::Accounts::Account

Inherits Struct < Value < Object

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

new(id : String, normalized_login : String, created_at : Time, updated_at : Time, tenant_id : String | Nil = nil, auth_version : Int32 = 1, password_digest : String | Nil = nil, password_scheme : String | Nil = nil, email_verified_at : Time | Nil = nil, disabled_at : Time | Nil = nil)
Source

Instance methods

auth_version

Bumped to invalidate every session for this account at once, without enumerating rows. The belt to revocation's braces (docs/02-security-model.md).

Source
created_at
Source
disabled?
Source
disabled_at
Source
email_verified?
Source
email_verified_at
Source
id

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.

Source
inspect(io : IO) : Nil

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.

Source
normalized_login

The stored, already-normalised login. Never normalise it again on the way out.

Source
password_credential?

Whether this account can be authenticated by password at all.

Source
password_digest

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.

Source
password_scheme

Which Hasher produced password_digest, e.g. bcrypt. Drives needs_rehash? and so the lazy-rehash migration.

Source
tenant_id

Unused in v0.1. Present so that adding tenancy is not a breaking migration.

Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source
updated_at
Source