Skip to content

AgentPrismTenancyOptions

Namespace AgentPrism · Assembly AgentPrism.AspNetCore.dll

Settings that determine how the tenant is resolved from the request.

public sealed class AgentPrismTenancyOptions

objectAgentPrismTenancyOptions

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Off by default. A single-tenant setup needs no extra configuration, and every request falls to the AgentPrismOptions.DefaultTenantId tenant.

A header can be spoofed. An HTTP header is not proof of identity; the client can write any value it wants. Therefore:

This type is deliberately not a record; settings classes’ generated ToString method could leak values.

public AgentPrismTenancyOptions()

Whether the tenant can be resolved from the header. Off by default — a header can be spoofed.

public bool AllowHeaderResolution { get; set; }

bool

The accepted tenant ids. If left empty, any value matching the format is accepted.

public IList<string> AllowedTenants { get; }

IList<string>

The claim type the tenant is read from. Example: tenant_id. If set and the request passed authentication, it takes precedence over the header.

public string? ClaimType { get; set; }

string?

Whether multi-tenancy is enabled. When disabled, every request falls to the default tenant.

public bool Enabled { get; set; }

bool

The HTTP header the tenant is read from.

public string HeaderName { get; set; }

string