Table of Contents

Class TenantIdentityOptions

Namespace
Excalibur.Dispatch.Options.Middleware
Assembly
Excalibur.Dispatch.dll

Configuration options for tenant identity processing.

public sealed class TenantIdentityOptions
Inheritance
TenantIdentityOptions
Inherited Members
Extension Methods

Properties

DefaultTenantId

Gets or sets the default tenant ID to use when none is specified.

public string? DefaultTenantId { get; set; }

Property Value

string

Default is DefaultTenantId. Single-tenant applications use this value automatically without any tenant configuration.

Enabled

Gets or sets a value indicating whether tenant identity processing is enabled.

public bool Enabled { get; set; }

Property Value

bool

Default is true.

MaxTenantIdLength

Gets or sets the maximum length for tenant identifiers.

[Range(1, 64)]
public int MaxTenantIdLength { get; set; }

Property Value

int

Default is MaxLength.

Remarks

This bound may be lowered to tighten what a deployment accepts, but it cannot be raised above MaxLength — the narrowest tenant column any shipped provider declares. Accepting a longer identifier at the boundary would not make it storable; it would defer the failure to the store, where the caller that supplied the value is no longer in scope, and where the outcome on a provider that truncates rather than rejects is a tenant identifier that silently collides with another tenant's.

The same ceiling is enforced without a configuration knob by the tenant identifier and scope types themselves, so a value above it would advertise an acceptance this framework does not have.

MinTenantIdLength

Gets or sets the minimum length for tenant identifiers.

[Range(1, 64)]
public int MinTenantIdLength { get; set; }

Property Value

int

Default is 1.

Remarks

Bounded above by MaxLength for the same reason MaxTenantIdLength is: a minimum longer than any storable identifier would reject every tenant the framework can persist, so the configuration would be unsatisfiable rather than strict.

TenantIdHeader

Gets or sets the header name used for tenant ID propagation.

public string? TenantIdHeader { get; set; }

Property Value

string

Default is "X-Tenant-ID".

TenantIdPattern

Gets or sets a regex pattern for validating tenant ID format.

public string? TenantIdPattern { get; set; }

Property Value

string

Default is null (no pattern validation).

TenantNameHeader

Gets or sets the header name used for tenant name propagation.

public string? TenantNameHeader { get; set; }

Property Value

string

Default is "X-Tenant-Name".

TenantRegionHeader

Gets or sets the header name used for tenant region propagation.

public string? TenantRegionHeader { get; set; }

Property Value

string

Default is "X-Tenant-Region".

ValidateTenantAccess

Gets or sets a value indicating whether to validate tenant access permissions.

public bool ValidateTenantAccess { get; set; }

Property Value

bool

Default is true.