Table of Contents

Struct SecretName

Namespace
MailFathom.Infrastructure.Secrets
Assembly
MailFathom.Infrastructure.dll

The operator-chosen identity of one configured secret, safe to record wherever the material is not.

public readonly record struct SecretName : IEquatable<SecretName>
Implements
Inherited Members

Remarks

A secret needs an identity that survives everything about it changing. Its position in a configuration array does not: inserting an entry renumbers every one after it, so a log line naming position 2 describes a different credential after the next edit. Its material does not either, and naming a secret by its value is what the rest of this machinery exists to prevent. The name is therefore the one thing a rotation, an expiry, a diagnostic, and an audit record can all agree on.

The accepted characters are narrow so the name is safe to put in a log, a metric label, a header challenge, or an audit record without escaping or truncation deciding what it means. That also keeps a name from carrying the material an operator was tempted to describe it with.

Fields

MaximumLength

The greatest number of characters a name may carry.

Properties

IsSpecified

Gets whether this value names a secret rather than being the unusable struct default.

Value

Gets the name, or null for the struct default, which names nothing.

Methods

ToString()

Returns the name, which carries no secret material.

TryCreate(string?, out SecretName)

Reads a configured name.