Class HttpExchangeRequestSnapshotOptions

Namespace
XBullet.EasyTesting.Snapshots
Assembly
XBullet.EasyTesting.Snapshots.Core.dll

Controls which HTTP request details are included in an exchange snapshot.

public sealed class HttpExchangeRequestSnapshotOptions
Inheritance
HttpExchangeRequestSnapshotOptions
Inherited Members

Properties

IgnoredHeaders

Gets request headers excluded from snapshots.

public ISet<string> IgnoredHeaders { get; }

Property Value

ISet<string>

A live case-insensitive set prepopulated with volatile and credential-bearing headers.

IncludeBody

Gets or sets whether request content is included.

public bool IncludeBody { get; set; }

Property Value

bool

true by default; false omits the request body.

IncludeHeaders

Gets or sets whether request headers are included.

public bool IncludeHeaders { get; set; }

Property Value

bool

true by default; false omits all request headers.

RedactedHeaders

Gets request headers whose values are replaced with {Redacted}.

public ISet<string> RedactedHeaders { get; }

Property Value

ISet<string>

A live case-insensitive set. Redaction preserves header presence and overrides inclusion.

RedactedQueryParameters

Gets query parameters whose values are replaced with {Redacted}.

public ISet<string> RedactedQueryParameters { get; }

Property Value

ISet<string>

A live case-insensitive set prepopulated with common credential parameter names.

ScrubbedQueryParameters

Gets query parameters whose values are replaced with {Scrubbed}. Security redaction takes precedence when a name appears in both query-parameter sets.

public ISet<string> ScrubbedQueryParameters { get; }

Property Value

ISet<string>

A live case-insensitive set for volatile, non-secret values.

Methods

IgnoringHeaders(params string[])

Excludes request headers and returns this instance.

public HttpExchangeRequestSnapshotOptions IgnoringHeaders(params string[] headerNames)

Parameters

headerNames string[]

A non-null array of non-empty names, matched case-insensitively.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining. Exclusion removes any redaction decision.

IncludingHeader(string)

Includes a request header that was excluded by default.

public HttpExchangeRequestSnapshotOptions IncludingHeader(string headerName)

Parameters

headerName string

The non-empty case-insensitive name to include with its original values.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining, clearing ignore and redaction decisions.

IncludingQueryParameter(string)

Includes the original value of a query parameter.

public HttpExchangeRequestSnapshotOptions IncludingQueryParameter(string parameterName)

Parameters

parameterName string

The non-empty case-insensitive name whose original value is safe to expose.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining, clearing redaction and scrubbing for the name.

RedactingHeader(string)

Redacts a request header value while preserving the header.

public HttpExchangeRequestSnapshotOptions RedactingHeader(string headerName)

Parameters

headerName string

The non-empty case-insensitive name to preserve with a redacted value.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining.

RedactingHeaders(params string[])

Redacts request header values while preserving the headers.

public HttpExchangeRequestSnapshotOptions RedactingHeaders(params string[] headerNames)

Parameters

headerNames string[]

A non-null array of non-empty names, matched case-insensitively.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining, removing those names from ignored headers.

RedactingQueryParameter(string)

Redacts one query-parameter value and returns this instance.

public HttpExchangeRequestSnapshotOptions RedactingQueryParameter(string parameterName)

Parameters

parameterName string

The non-empty case-insensitive parameter name.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining.

RedactingQueryParameters(params string[])

Redacts query-parameter values and returns this instance.

public HttpExchangeRequestSnapshotOptions RedactingQueryParameters(params string[] parameterNames)

Parameters

parameterNames string[]

A non-null array of non-empty names, matched case-insensitively.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining. Security redaction removes ordinary scrubbing.

ScrubbingQueryParameter(string)

Scrubs one volatile query-parameter value and returns this instance.

public HttpExchangeRequestSnapshotOptions ScrubbingQueryParameter(string parameterName)

Parameters

parameterName string

The non-empty case-insensitive parameter name.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining; existing security redaction remains authoritative.

ScrubbingQueryParameters(params string[])

Scrubs volatile query-parameter values and returns this instance.

public HttpExchangeRequestSnapshotOptions ScrubbingQueryParameters(params string[] parameterNames)

Parameters

parameterNames string[]

A non-null array of non-empty names, matched case-insensitively.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining; redacted names are not downgraded to scrubbing.

ScrubbingUrlPath(Func<string, string>)

Adds a transformation applied to the request URL path before it is snapshotted.

public HttpExchangeRequestSnapshotOptions ScrubbingUrlPath(Func<string, string> scrubber)

Parameters

scrubber Func<string, string>

A non-null transformation retained and applied in registration order to the path only.

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining.

ScrubbingUrlPathGuids()

Replaces complete GUID request-path segments with {Guid}.

public HttpExchangeRequestSnapshotOptions ScrubbingUrlPathGuids()

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining.

WithoutBody()

Excludes request content and returns this instance.

public HttpExchangeRequestSnapshotOptions WithoutBody()

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining.

WithoutHeaders()

Excludes request headers and returns this instance.

public HttpExchangeRequestSnapshotOptions WithoutHeaders()

Returns

HttpExchangeRequestSnapshotOptions

This options instance, for chaining.