Table of Contents

Method AddSecretContentScanning

Namespace
MailFathom.Infrastructure
Assembly
MailFathom.Infrastructure.dll

AddSecretContentScanning(IServiceCollection)

Registers the in-process detector of credentials in mail text, and what it declares it can find.

public static IServiceCollection AddSecretContentScanning(this IServiceCollection services)

Parameters

services IServiceCollection

The service collection.

Returns

IServiceCollection

The service collection, for chaining.

Remarks

Called only where the Secrets switch is on, which is what makes an opt-in nobody took cost nothing: with it off no corpus is assembled, no expression is compiled, and neither descriptor exists.

The catalog is registered beside the scanner rather than always, because startup refuses a switch that is on with nothing behind it, and a catalog present without a detector would turn that refusal into a scanner that runs and finds nothing. Both are singletons: the corpus is compiled once and the scanner holds it.

Exceptions

ArgumentNullException

Thrown when services is null.