Table of Contents

Method FindDeclarationErrors

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

FindDeclarationErrors()

Reports every secret whose declared identity or lifetime the host cannot use.

public IReadOnlyList<SecretDeclarationError> FindDeclarationErrors()

Returns

IReadOnlyList<SecretDeclarationError>

One error per faulty declaration, empty when every discovered block declares both usably.

Remarks

The check belongs to the walk's result rather than to a consumer, because uniqueness is a property of the whole set and no single block can answer it. The scope of that uniqueness is one walk, which is one bound configuration root: names identify secrets to an operator reading one section, and requiring them to be unique across sections would make adding a section to a working deployment a source of collisions it cannot see.

Names are compared ignoring case. Two names differing only in case are one identity to everybody who reads them, and accepting both would leave a rotation instruction ambiguous at the moment it matters.

A name repeated by a declaration identical to the one that claimed it is accepted, because one provider key used by two settings is one credential and naming it twice says so. What the rule refuses is a name that would mean two credentials: two declarations agree only when they name the same reference, state the same lifetime, and name the same bundle password — which this same rule then holds to the same agreement, that password being a discovered block of its own.