discontinuedPackage fluttersdk_telescope has been discontinued and replaced by crumbs.

TelescopeRedaction class final

Masks credentials in HTTP records before TelescopeStore.recordHttp buffers them.

The HTTP ring buffer is served verbatim to AI agents over ext.telescope.requests and MCP, so a bearer header or a login body stored as captured leaks the credential into an agent transcript. The model mirrors Laravel Telescope: three name lists (request headers, request parameters, response parameters), matched case-insensitively, extended through the hide* methods (additions merge with the defaults, they never replace them), and every matching value replaced with mask.

The store only understands JSON and form-encoded bodies. An adapter that holds a body as structured data (a Dart Map whose toString() is not JSON) must run it through redactParameters before stringifying it.

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

hiddenRequestHeaders → Set<String>
Lowercased request header names whose values are masked.
no setter
hiddenRequestParameters → Set<String>
Lowercased request body keys whose values are masked.
no setter
hiddenResponseParameters → Set<String>
Lowercased response body keys whose values are masked.
no setter
redactor ↔ String Function(String)?
The host's text redactor, or null while none is registered.
getter/setter pair

Static Methods

hideRequestHeaders(Iterable<String> names) → void
Hide the given request headers in addition to the defaults.
hideRequestParameters(Iterable<String> names) → void
Hide the given request body keys in addition to the defaults.
hideResponseParameters(Iterable<String> names) → void
Hide the given response body keys in addition to the defaults.
redactBody(String? body, Set<String> keys) → String?
Return body with the value under every key in keys masked, when it parses as a JSON object or array, or reads as a form-encoded body (key=value&key=value, an OAuth token call or a form login).
redactEventRecord(EventRecord record) → EventRecord?
Return record with a JSON-safe payload, and with every text field run through the redactor and redacted set when one is registered.
redactExceptionRecord(ExceptionRecord record) → ExceptionRecord?
Return record with every text field run through the redactor and redacted set, or record itself when none is registered. Returns null, the record dropped, when the redactor throws.
redactHttpRecord(HttpRequestRecord record) → HttpRequestRecord?
Return record with its hidden request headers masked and the hidden keys of a JSON or form-encoded request or response body masked, then, when a redactor is registered, every text field run through it.
redactLogRecord(LogRecordEntry record) → LogRecordEntry?
Return record with every text field run through the redactor and redacted set, or record itself when none is registered. Returns null, the record dropped, when the redactor throws.
redactParameters(Object? data, Set<String> keys) → Object?
Return a copy of data with the value under every key in keys replaced by mask, at any depth of nested Maps and Lists.
resetForTesting() → void
Restore the three lists to their defaults and unregister the redactor.

Constants

mask → const String
The value a hidden entry is replaced with; Laravel Telescope's mask.