SecretRedactor class final

Holds secret values and replaces them with SecretRedactor.mask in text.

Values shorter than minValueLength are never registered: short strings (like true or 12345) appear in normal output too often and masking them would mangle unrelated text. Only names are ever exposed, never values.

Constructors

SecretRedactor()
Creates an empty redactor; register values with register.
SecretRedactor.fromSecrets(Map<String, String> secrets)
Creates a redactor pre-loaded with secrets (name → value).
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
Whether no secret values are registered.
no setter
names → List<String>
The registered secret names, sorted. Values are never exposed.
no setter
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
redact(String text) → String
Replaces every registered secret value in text with mask.
register(String name, String value) → void
Registers value under name; values shorter than minValueLength are ignored.
registerAll(Map<String, String> secrets) → void
Registers every entry of secrets; see register.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

mask → const String
The replacement text for a masked secret value.
minValueLength → const int
Values shorter than this are ignored (false-positive guard).