Table of Contents

Constructor UserCredential

Namespace
MailFathom.Application.Access.Credentials
Assembly
MailFathom.Application.dll

UserCredential(Guid, UserId, UserCredentialMethod, UserCredentialLookup, IReadOnlyList<MailFathomPermission>?, bool, long, DateTimeOffset, DateTimeOffset, OrganizationShortName)

One credential a user is admitted by, as an administrator reads it back.

public UserCredential(Guid Id, UserId User, UserCredentialMethod Method, UserCredentialLookup Lookup, IReadOnlyList<MailFathomPermission>? Permissions, bool Enabled, long Version, DateTimeOffset CreatedAt, DateTimeOffset MaterialChangedAt, OrganizationShortName Organization = default)

Parameters

Id Guid

The stable identifier every later act on this credential names.

User UserId

The user a request authenticated by this credential acts for.

Method UserCredentialMethod

How the credential is presented, and therefore what Lookup holds.

Lookup UserCredentialLookup

The value a presented credential is resolved by.

Permissions IReadOnlyList<MailFathomPermission>

The names the credential narrows its user's grant to, in the published order, or null where it names none and holds what its user holds.

Enabled bool

Whether the credential currently authenticates anything.

Version long

How many times the record has been written, counting the act that provisioned it.

CreatedAt DateTimeOffset

When the credential was provisioned.

MaterialChangedAt DateTimeOffset

When what the credential is presented as was last replaced, which is the provisioning instant until it is.

Organization OrganizationShortName

The short name of the organization a password credential is scoped to, or the unspecified default where it is scoped to none — which is every credential of the other three methods.

Remarks

There is no password here, no key, and no stored record of either, and the absence is the point: this is the whole of what the administrative surface publishes about a credential, so no answer it composes can be a way to read stored material back out of the deployment. What an operator needs is which credentials exist, whose they are, what each may do, whether they still work, and how old the material is — each of which is a fact about the record rather than about the secret.

Lookup is published for three of the four methods, which is what lets an operator tell two credentials apart without the identifier being the only handle they have: a username is what a user types, a public key's fingerprint is what that client's assertions have to name, and an issuer and subject are what an administrator wrote. A minted key's is withheld and answered as absent, for the reason LookupIsDerivedFromTheSecret gives — the digest verifies a presented key, so serving it to whoever may read a listing would be serving a verifier for material this deployment never stored.

MaterialChangedAt is carried rather than derived from the row's general update instant, because the two answer different questions the moment a credential is disabled and enabled again: an operator asking how long a password has been in use is not asking when the row was last touched. A rehash the deployment performed on a successful sign-in therefore moves Version and leaves that instant where it was.