Method NormalizeMechanisms
- Namespace
- MailFathom.Domain.Transport
- Assembly
- MailFathom.Domain.dll
NormalizeMechanisms(IEnumerable<MailAuthenticationMechanism>)
Removes duplicates while keeping the configured order.
public static IReadOnlyList<MailAuthenticationMechanism> NormalizeMechanisms(IEnumerable<MailAuthenticationMechanism> permittedMechanisms)
Parameters
permittedMechanismsIEnumerable<MailAuthenticationMechanism>The configured mechanisms.
Returns
- IReadOnlyList<MailAuthenticationMechanism>
A read-only view that cannot be cast back to a mutable collection.
Remarks
The result is wrapped rather than returned as an array, because a caller could otherwise cast the advertised IReadOnlyList<T> back to the array and replace a validated mechanism with a clear-text one after the policy accepted it.
Exceptions
- ArgumentNullException
Thrown when
permittedMechanismsis null.