Struct UserCredentialMethod
- Namespace
- MailFathom.Domain.Access
- Assembly
- MailFathom.Domain.dll
How one user-facing credential is presented, and therefore what a request is resolved to a user by.
[JsonConverter(typeof(UserCredentialMethodJsonConverter))]
public readonly record struct UserCredentialMethod : IEquatable<UserCredentialMethod>
- Implements
- Inherited Members
Remarks
The type is a closed enumeration of values rather than a C# enum, because the name is the
identity and it travels outside this process: an administrator writes it as an argument to mfctl, the
administrative surface publishes it in a credential listing, an endpoint section names it to say which methods it
accepts, and a row records it in a column that outlives every rename this assembly may take. A member's ordinal
would mean nothing to any of the four.
The set is closed because a credential MailFathom cannot resolve to a user is not a credential it may admit. A name nothing declares here is unknown rather than new, which is what lets an endpoint section refuse a misspelled method at startup and a stored row refuse to materialize as a method the process cannot judge.
The identity is lower-case and hyphenated, so it is one word an operator can type and one value a URL segment or a command-line argument carries unquoted. A member is allocated once and never renamed: a name written into a row is the row's meaning rather than a label over it.
Being a struct, default is reachable and is not a method. It reports itself through IsSpecified, and it is rejected where the invariant matters: the JSON converter below, the persisted credential's own conversion, and every store operation that names a method.
Properties
- All
Gets every method this repository publishes.
- ApiKey
Gets the method by which a client presents an opaque key this deployment minted.
- IsSpecified
Gets whether this value names a published method rather than the unusable struct default.
- LookupIsDerivedFromTheSecret
Gets whether the value a credential of this method is resolved by is derived from the secret it resolves.
- LookupMovesWithTheMaterial
Gets whether replacing a credential's material also replaces the value it is resolved by.
- MaterialIsReplaceable
Gets whether what a credential is presented as can be replaced without provisioning a second one.
- Name
Gets the published name of the method, which is what an operator writes and a row records.
- OAuthSubject
Gets the method by which an authorization server's validated subject names the user it stands for.
- Password
Gets the method by which a user presents a username and a password over HTTP Basic.
- PublicKey
Gets the method by which a client presents an assertion signed by a key pair it holds.
- StoresMaterial
Gets whether a credential of this method carries material beside the value it is resolved by.
Methods
- ToString()
Returns the fully qualified type name of this instance.
- TryParse(string?, out UserCredentialMethod)
Parses a name written outside this process.