.NET API
TraconTenancyOptions
Tracon.AspNetCore.dllSettings that determine how the tenant is resolved from the request.
public sealed class TraconTenancyOptionsInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Off by default. A single-tenant setup needs no extra configuration, and every request falls to the TraconOptions.DefaultTenantId tenant.
A header can be spoofed. An HTTP header is not proof of identity; the client can write any value it wants. Therefore:
- If TraconTenancyOptions.ClaimType is set and the request passed authentication, only the claim is used; the header is ignored.
- The header path must be explicitly opened via TraconTenancyOptions.AllowHeaderResolution and used only inside a trusted network (or only during development).
- If TraconTenancyOptions.AllowedTenants is non-empty, an unresolved tenant is rejected; a value not in the list does not fall back to the default tenant.
This type is deliberately not a record; settings classes’ generated
ToString method could leak values.
Constructors
Section titled “Constructors”TraconTenancyOptions()
Section titled “ TraconTenancyOptions()”public TraconTenancyOptions()Properties
Section titled “Properties”AllowHeaderResolution
Section titled “ AllowHeaderResolution”Whether the tenant can be resolved from the header. Off by default — a header can be spoofed.
public bool AllowHeaderResolution { get; set; }Property Value
Section titled “Property Value”AllowedTenants
Section titled “ AllowedTenants”The accepted tenant ids. If left empty, any value matching the format is accepted.
public IList<string> AllowedTenants { get; }Property Value
Section titled “Property Value”ClaimType
Section titled “ ClaimType”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; }Property Value
Section titled “Property Value”Enabled
Section titled “ Enabled”Whether multi-tenancy is enabled. When disabled, every request falls to the default tenant.
public bool Enabled { get; set; }Property Value
Section titled “Property Value”HeaderName
Section titled “ HeaderName”The HTTP header the tenant is read from.
public string HeaderName { get; set; }