Table of Contents

Method CreateAsync

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

CreateAsync(Guid, UserId, UserCredentialMethod, UserCredentialLookup, string?, IReadOnlyList<MailFathomPermission>?, UserCredentialReach, CancellationToken)

Provisions a new credential for one user.

Task<UserCredentialWriteOutcome> CreateAsync(Guid credentialId, UserId user, UserCredentialMethod method, UserCredentialLookup lookup, string? material, IReadOnlyList<MailFathomPermission>? permissions, UserCredentialReach reach, CancellationToken cancellationToken)

Parameters

credentialId Guid

The identifier the new credential is to carry.

user UserId

The user the credential authenticates.

method UserCredentialMethod

How the credential will be presented.

lookup UserCredentialLookup

The value it is resolved by.

material string

The stored representation of what is judged, or null for a method that keeps none.

permissions IReadOnlyList<MailFathomPermission>

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

reach UserCredentialReach

On which endpoints, and from which networks, the credential may be presented.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<UserCredentialWriteOutcome>

What the act did, or why it did nothing.

Exceptions

ArgumentNullException

Thrown when reach is null.

ArgumentException

Thrown when user names nobody, method or lookup is the unspecified struct default, credentialId is the empty identifier, material disagrees with what method stores, or reach names no surface.