Table of Contents

Interface IUserApiKeyMinter

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

Draws the keys a user's clients present, and reduces a presented one to the value it is resolved by.

public interface IUserApiKeyMinter

Remarks

The deployment mints the key rather than accepting one an operator wrote, which is the difference between this method and every credential MailFathom used to read out of a configuration file. A key drawn here carries the entropy the deployment decided on, is reported exactly once, and is never stored: what the row holds is Lookup, and a key nobody wrote down is a key nobody can recover.

That is also why the lookup may be a plain digest rather than an adaptive hash. A password is a value a person chose out of a space small enough to search, so its record has to be expensive to try; a key drawn here is indistinguishable from random over a space nothing can enumerate, so a digest of it discloses nothing and can be indexed — which is what lets one request resolve one row rather than compare itself against every key the deployment holds.

Both members are synchronous. Digesting is bounded work over a value the caller already holds, and putting it behind an await would say the material's lifetime extends past the call, which it does not.

Methods

Mint()

Draws a new key and the value it will be resolved by.

TryDigest(ReadOnlySpan<char>, out UserCredentialLookup)

Reduces a presented key to the value a stored credential is resolved by.