Redaction class

Masks secrets (passwords, tokens, keys…) in headers, bodies and URLs.

Used for the console, the log UI, copying and exporting. The UI can show the real values on demand with reveal (the eye icon); it is reset on every app start.

Properties

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
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

extraKeys → Set<String>
Extra keys to mask, e.g. {'national_id', 'iban'}. Matched like the built-in ones (case and separators are ignored).
final
reveal → ValueNotifier<bool>
Whether the log UI shows real values instead of masks.
final

Static Methods

forDisplay(Object? data) → Object?
data masked unless reveal is on. For the log UI.
headers(Map<String, String> headers) → Map<String, String>
Masks headers. Values may be strings or lists.
isSensitive(String key) → bool
Whether a header, body field or query parameter named key is secret.
redact(Object? data, {int depth = 0}) → Object?
Returns a copy of data with secret values masked. JSON strings stay strings, FormData becomes a map. Never throws.
url(String url) → String
Masks secret query parameters in url.
urlForDisplay(String value) → String
url masked unless reveal is on. For the log UI.

Constants

mask → const String