DefaultSanitizer class
Default, privacy-first sanitizer that masks known sensitive fields by key (e.g., "password", "token", "authorization", etc.) and optionally applies content-based masking for values that look like secrets (JWTs, access keys, long base64 tokens, card numbers).
- Implemented types
- Available extensions
Constructors
- DefaultSanitizer({SensitiveFieldMatcher? matcher, MaskingStrategy? fieldMask, MaskingStrategy? contentMask, bool enableContentBasedDetection = true})
- Creates a default sanitizer with optional overrides for matching and masking.
Properties
- enableContentBasedDetection → bool
-
If true, values that look like secrets are masked even if their keys
are not sensitive (e.g., raw tokens in arrays).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sanitize(
Map< String, dynamic> data) → Map<String, dynamic> -
Returns a new sanitized map. The input is never mutated.
override
-
sanitizeEvent(
ReportEvent event) → ReportEvent -
Available on Sanitizer, provided by the ReportEventSanitizer extension
Returns a copy ofeventwith the sanitized payload embedded. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited