Table of Contents

Method TryParse

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

TryParse(string?, out SecretLifetime)

Reads a configured lifetime.

public static bool TryParse(string? configuredValue, out SecretLifetime lifetime)

Parameters

configuredValue string

The bound value: NoLimitValue or an ISO 8601 instant carrying an explicit offset.

lifetime SecretLifetime

The parsed lifetime when the value is well formed; otherwise NoLimit.

Returns

bool

true when the value is well formed; otherwise false.

Remarks

An instant without an explicit offset is refused rather than read in the host's local time, because the same configuration would then expire at a different moment on every machine that ran it. Absence and an empty value are refused too: the setting has a default, and a blank one is a mistake rather than a way of spelling it.