Table of Contents

Class ClientSessionGrant

Namespace
MailFathom.Application.Access.Sessions
Assembly
MailFathom.Application.dll

What a signed-in client's session admits, which is what the exchange that minted it established.

public sealed record ClientSessionGrant : IEquatable<ClientSessionGrant>
Inheritance
ClientSessionGrant
Implements
Inherited Members

Remarks

The three facts travel together because a renewal carries all three forward unchanged. What a request holds is its user's grant, read from the user's roles on every request and kept to these names, so a role assigned or revoked reaches an open session at its next request rather than at its next sign-in.

The credential is absent rather than a sentinel, because the column holding it is a foreign key: a client endpoint requiring no credential still answers the exchange, and a magic identifier matching no row cannot survive that constraint. The user is never absent, which is what lets an erasure remove such a session by cascade when no credential stands behind it to cascade through.

Constructors

ClientSessionGrant(UserId, Guid?, IReadOnlyList<MailFathomPermission>)

What a signed-in client's session admits, which is what the exchange that minted it established.

Properties

CredentialId

The credential the exchange authenticated, or null where a client endpoint requiring no credential answered it.

Permissions

The names the session's requests are kept to, in the published order: the narrowing of the credential the exchange authenticated, never the grant itself.

User

The user the request acts for, which is never absent and is what an erasure reaches the session through.