PeekRedactionPolicy class final
Which headers, query parameters and body keys Peek masks before storing a call, so secrets never sit in memory or reach the screen.
Peek masks nothing until it is asked to, through the redaction option;
the default constructor is the policy worth asking for, since it covers
the usual names. Names match case-insensitively and exactly, and your
own go alongside the built-in ones:
PeekRedactionPolicy(
headerNames: {...PeekRedactionPolicy.defaultHeaderNames, 'x-session'},
)
- Annotations
Constructors
Properties
-
bodyKeys
→ Set<
String> -
Keys to mask in JSON bodies, at any depth, and in form fields.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
-
headerNames
→ Set<
String> -
Header names to mask.
cookieandset-cookiekeep their cookie names and attributes; only the values go.final - isEmpty → bool
-
Whether the policy masks nothing at all.
no setter
-
queryKeys
→ Set<
String> -
Query parameter names to mask, in URLs and URL-encoded bodies.
final
- replacement → String
-
The text a masked value becomes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{Set< String> ? headerNames, Set<String> ? queryKeys, Set<String> ? bodyKeys, String? replacement}) → PeekRedactionPolicy - A copy with the given fields replaced.
-
matchesBodyKey(
String name) → bool -
Whether the body key called
nameis masked. -
matchesHeader(
String name) → bool -
Whether the header called
nameis masked. -
matchesQuery(
String name) → bool -
Whether the query parameter called
nameis masked. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
-
defaultBodyKeys
→ const Set<
String> - JSON and form keys masked by default.
-
defaultHeaderNames
→ const Set<
String> - Headers masked by default.
-
defaultQueryKeys
→ const Set<
String> - Query parameters masked by default.
- defaultReplacement → const String
- What masked values are replaced with. ASCII, so it survives a URL.
- none → const PeekRedactionPolicy
- Masks nothing.