Class TestApiKeyInjectionOptions

Namespace
XBullet.EasyTesting.Authentication
Assembly
XBullet.EasyTesting.dll

Configures how real API keys are injected into end-to-end test requests.

public sealed class TestApiKeyInjectionOptions
Inheritance
TestApiKeyInjectionOptions
Inherited Members

Properties

AuthenticationScheme

Gets or sets the application authentication scheme.

public string AuthenticationScheme { get; }

Property Value

string

The non-empty scheme supplied to UseEndToEndApiKey(string, Action<TestApiKeyInjectionOptions>?). External callers can read but cannot replace this value.

HeaderName

Gets or sets the default API-key header name.

public string HeaderName { get; set; }

Property Value

string

The non-empty HTTP header name used by client-side API-key injection. The default is X-Api-Key.

QueryParameterName

Gets or sets the default API-key query parameter name.

public string QueryParameterName { get; set; }

Property Value

string

The non-empty query-string key used by client-side API-key injection. The default is api_key.

UseAsDefaultScheme

Gets or sets whether this scheme becomes the host's default authentication scheme.

public bool UseAsDefaultScheme { get; set; }

Property Value

bool

true to make this API-key scheme the host default; otherwise, false. The default is false.

Methods

AsDefaultScheme()

Makes this API-key scheme the host's default authentication scheme.

public TestApiKeyInjectionOptions AsDefaultScheme()

Returns

TestApiKeyInjectionOptions

This options instance so additional settings can be configured.

WithHeaderName(string)

Sets the default header name.

public TestApiKeyInjectionOptions WithHeaderName(string headerName)

Parameters

headerName string

The non-empty HTTP header name used when a client does not specify an override. Syntax is validated by the HTTP stack when the header is applied.

Returns

TestApiKeyInjectionOptions

This options instance so additional settings can be configured.

WithQueryParameterName(string)

Sets the default query parameter name.

public TestApiKeyInjectionOptions WithQueryParameterName(string parameterName)

Parameters

parameterName string

The non-empty query-string key used when a client does not specify an override.

Returns

TestApiKeyInjectionOptions

This options instance so additional settings can be configured.