Censors class

A class representing a set of rules to censor elements from requests and responses.

Constructors

Censors({String censorString = "******"})
Creates a new Censors with the given censorString.

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

applyBodyParameterCensors(String body, ContentType contentType) String
Applies the body parameter censors to the given body with the given contentType.
applyHeaderCensors(Map<String, String?>? headers) Map<String, String>
Applies the header censors to the given headers.
applyQueryCensors(String url) String
Applies the query parameter censors to the given url.
censorBodyElements(List<CensorElement> elements) Censors
Add the given element to the list of elements to censor from request bodies.
censorBodyElementsByKeys(List<String> keys, {bool caseSensitive = false}) Censors
Add the given keys to the list of elements to censor from request bodies.
censorHeaderElements(List<CensorElement> elements) Censors
Add the given element to the list of elements to censor from request headers.
censorHeaderElementsByKeys(List<String> keys, {bool caseSensitive = false}) Censors
Add the given keys to the list of elements to censor from request headers.
censorQueryElements(List<CensorElement> elements) Censors
Add the given element to the list of elements to censor from request query parameters.
censorQueryElementsByKeys(List<String> keys, {bool caseSensitive = false}) Censors
Add the given keys to the list of elements to censor from request query parameters.
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

defaultCensors Censors
A pre-configured instance of Censors that censors nothing.
no setter
defaultCredentialCensors Censors
A pre-configured instance of Censors that censors common credential data.
no setter

Static Methods

censorJsonData(String body, String censorString, List<CensorElement> elementsToCensor) String
Censors the given elementsToCensor in the given body with the given censorString.
censorList(List list, String censorString, List<CensorElement> elementsToCensor) List
Censors the given elementsToCensor in the given list with the given censorString.
censorMap(Map<String, dynamic> map, String censorString, List<CensorElement> elementsToCensor) Map<String, dynamic>
Censors the given elementsToCensor in the given map with the given censorString.
elementShouldBeCensored(String foundKey, List<CensorElement> elementsToCensor) bool
Returns true if the given foundKey exists in the given elementsToCensor list.