Class ControllerSnapshotOptions

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

Controls which HTTP response details are included in a controller snapshot.

public sealed class ControllerSnapshotOptions
Inheritance
ControllerSnapshotOptions
Inherited Members

Properties

IgnoredHeaders

Gets headers excluded from snapshots. Volatile infrastructure headers are excluded by default. Header names are matched without regard to case.

public ISet<string> IgnoredHeaders { get; }

Property Value

ISet<string>

A live case-insensitive set prepopulated with volatile and sensitive response headers.

IncludeBody

Gets or sets whether response content is included.

public bool IncludeBody { get; set; }

Property Value

bool

true by default; false omits the response body.

IncludeHeaders

Gets or sets whether response headers are included.

public bool IncludeHeaders { get; set; }

Property Value

bool

true by default; false emits an empty header dictionary.

IncludeRequest

Gets or sets whether the request method and relative URL are included.

public bool IncludeRequest { get; set; }

Property Value

bool

true by default; false omits request context.

RedactedHeaders

Gets headers whose presence is captured while their values are replaced with {Redacted}. Header names are matched without regard to case.

public ISet<string> RedactedHeaders { get; }

Property Value

ISet<string>

A live case-insensitive set. Redaction preserves header presence.

RedactedQueryParameters

Gets request query parameters whose values are replaced with {Redacted}. Names are matched without regard to case.

public ISet<string> RedactedQueryParameters { get; }

Property Value

ISet<string>

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

ScrubbedQueryParameters

Gets request query parameters whose values are replaced with {Scrubbed}. Names are matched without regard to case. 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 request values.

Methods

IgnoringHeaders(params string[])

Excludes response headers and returns this instance.

public ControllerSnapshotOptions IgnoringHeaders(params string[] headerNames)

Parameters

headerNames string[]

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

Returns

ControllerSnapshotOptions

This options instance, for chaining. Exclusion removes redaction for those names.

IncludingHeader(string)

Includes a header that was excluded by default and returns this instance.

public ControllerSnapshotOptions IncludingHeader(string headerName)

Parameters

headerName string

The non-empty case-insensitive name whose original values are safe to expose.

Returns

ControllerSnapshotOptions

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

IncludingQueryParameter(string)

Includes the original value of a query parameter and returns this instance.

public ControllerSnapshotOptions IncludingQueryParameter(string parameterName)

Parameters

parameterName string

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

Returns

ControllerSnapshotOptions

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

RedactingHeader(string)

Redacts response header values while preserving the header and returns this instance.

public ControllerSnapshotOptions RedactingHeader(string headerName)

Parameters

headerName string

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

Returns

ControllerSnapshotOptions

This options instance, for chaining.

RedactingHeaders(params string[])

Redacts response header values while preserving the headers and returns this instance.

public ControllerSnapshotOptions RedactingHeaders(params string[] headerNames)

Parameters

headerNames string[]

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

Returns

ControllerSnapshotOptions

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

RedactingQueryParameter(string)

Redacts one request query-parameter value and returns this instance.

public ControllerSnapshotOptions RedactingQueryParameter(string parameterName)

Parameters

parameterName string

The non-empty case-insensitive request parameter name.

Returns

ControllerSnapshotOptions

This options instance, for chaining.

RedactingQueryParameters(params string[])

Redacts request query-parameter values and returns this instance.

public ControllerSnapshotOptions RedactingQueryParameters(params string[] parameterNames)

Parameters

parameterNames string[]

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

Returns

ControllerSnapshotOptions

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

ScrubbingQueryParameter(string)

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

public ControllerSnapshotOptions ScrubbingQueryParameter(string parameterName)

Parameters

parameterName string

The non-empty case-insensitive request parameter name.

Returns

ControllerSnapshotOptions

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

ScrubbingQueryParameters(params string[])

Scrubs volatile request query-parameter values and returns this instance.

public ControllerSnapshotOptions ScrubbingQueryParameters(params string[] parameterNames)

Parameters

parameterNames string[]

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

Returns

ControllerSnapshotOptions

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

ScrubbingUrlPath(Func<string, string>)

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

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

Parameters

scrubber Func<string, string>

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

Returns

ControllerSnapshotOptions

This options instance, for chaining.

ScrubbingUrlPathGuids()

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

public ControllerSnapshotOptions ScrubbingUrlPathGuids()

Returns

ControllerSnapshotOptions

This options instance, for chaining.

WithoutBody()

Excludes the response body and returns this instance.

public ControllerSnapshotOptions WithoutBody()

Returns

ControllerSnapshotOptions

This options instance, for chaining.

WithoutHeaders()

Excludes all response headers and returns this instance.

public ControllerSnapshotOptions WithoutHeaders()

Returns

ControllerSnapshotOptions

This options instance, for chaining.

WithoutRequest()

Excludes request details and returns this instance.

public ControllerSnapshotOptions WithoutRequest()

Returns

ControllerSnapshotOptions

This options instance, for chaining.