Table of Contents

Method ResolveClientMaterialAsync

Namespace
MailFathom.Infrastructure.Mail.OAuth
Assembly
MailFathom.Infrastructure.dll

ResolveClientMaterialAsync(ISecretReferenceResolver, CancellationToken)

Resolves the client secret and, when the grant needs one, the refresh token.

public Task<MailOAuthClientMaterial> ResolveClientMaterialAsync(ISecretReferenceResolver resolver, CancellationToken cancellationToken)

Parameters

resolver ISecretReferenceResolver

The resolver that turns references into material.

cancellationToken CancellationToken

Cancels the secret resolution.

Returns

Task<MailOAuthClientMaterial>

The owned material, which the caller must dispose when its operation ends.

Remarks

The exception is a fail-closed path rather than an ordinary branch: startup already proved each reference resolves, so a failure here means the material disappeared underneath a running deployment.

Exceptions

ArgumentNullException

Thrown when resolver is null.

InvalidOperationException

Thrown when a reference that passed startup validation no longer resolves.