Table of Contents

Class SensitiveContentRedactor

Namespace
MailFathom.Application.SensitiveContent.Redaction
Assembly
MailFathom.Application.dll

Runs every switched-on scanner over a text and replaces what they found, once, for every consumer of one posture.

public sealed class SensitiveContentRedactor
Inheritance
SensitiveContentRedactor
Inherited Members

Remarks

This is the single implementation the whole feature turns on. The derived path and the read path both redact through it, so a citation drawn from a redacted chunk lands on the same redacted text when a reader opens the message; two implementations would drift the moment either one gained a rule about ordering, overlap, or truncation. One instance answers for one posture, and a deployment serving users with different postures holds one per distinct posture — all of them sharing the single SensitiveContentScanConcurrency the process budgets scans by.

The result is reproducible. For a given text, plan, and set of detector revisions, the redacted text is byte-identical on repeat: scanners run in a fixed order, findings are sorted before they are applied rather than applied in the order they arrived, and overlapping regions merge under a rule that does not depend on which detector answered first.

It fails closed. A detector that is absent, slow past the configured budget, broken, or reporting a region outside the text it was handed refuses the operation rather than returning the text unredacted. The one thing that never raises a failure is the analyzed ceiling: text beyond it is dropped from the result rather than passed on, so an over-long input costs the remainder instead of the whole operation.

Constructors

SensitiveContentRedactor(SensitiveContentPlan, IEnumerable<ISensitiveContentScanner>, TimeProvider, SensitiveContentScanConcurrency)

Initializes the redaction one posture with at least one scanner switched on is read under.

Methods

RedactAsync(string, CancellationToken)

Scans a text and returns it with every detected region replaced by a placeholder.