Skip to content
Tracon

TenantProviderBinding

Namespace Tracon · Assembly Tracon.Abstractions.dll

Binds a tenant to a model provider’s credential, by name only.

public sealed record TenantProviderBinding : IEquatable<TenantProviderBinding>

objectTenantProviderBinding

IEquatable<TenantProviderBinding>

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

This record carries no secret value, only the name of the configuration key the value is read from at call time. applies to this store the same way it applies to MCP server credentials: the database backup, the audit trail, and every HTTP response built from this type never carry a secret.

public TenantProviderBinding()

Gets the configuration key name the credential value is read from. Never the value itself.

public required string ApiKeyConfigurationName { get; init; }

string

Must start with TraconTenantProviderOptions.AllowedConfigurationPrefix; resolution is rejected otherwise.

Gets the optional provider endpoint override for this tenant.

public string? Endpoint { get; init; }

string?

Gets the provider name. Matches ModelBinding.Provider.

public required string ProviderName { get; init; }

string

Compared case-insensitively, like every other place a provider name is matched (the provider registry, the tenant egress policy, the admin endpoint). A store persists the value TenantProviderBinding.NormalizeProviderName returns, so "OpenAI" and "openai" are one binding and never two.

Gets the tenant this binding belongs to.

public required string TenantId { get; init; }

string

Gets the time this binding was last written.

public required DateTimeOffset UpdatedAt { get; init; }

DateTimeOffset

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(TenantProviderBinding? other)

other TenantProviderBinding?

bool

public override int GetHashCode()

int

Returns the canonical form a store persists and looks a provider name up by.

public static string NormalizeProviderName(string providerName)

providerName string

The provider name as written by the caller.

string

The canonical (invariant lower-case) form.

An ITenantProviderBindingStore implementation must apply this to the name it writes and to the name it is queried with. A store that skips it is case-sensitive while the rest of the system is not, and a tenant whose binding was saved under a different letter case silently falls through to the global setup credential — the wrong tenant gets billed and no error is raised.

Normalizing the stored value (rather than comparing case-insensitively at query time) is deliberate: a bare = predicate then behaves identically on PostgreSQL, SQLite and SQL Server whatever their collation, the primary key keeps rejecting duplicates on all three, and the index stays usable.

ArgumentException

providerName is null or blank.

public override string ToString()

string

operator ==(TenantProviderBinding?, TenantProviderBinding?)

Section titled “ operator ==(TenantProviderBinding?, TenantProviderBinding?)”
public static bool operator ==(TenantProviderBinding? left, TenantProviderBinding? right)

left TenantProviderBinding?

right TenantProviderBinding?

bool

operator !=(TenantProviderBinding?, TenantProviderBinding?)

Section titled “ operator !=(TenantProviderBinding?, TenantProviderBinding?)”
public static bool operator !=(TenantProviderBinding? left, TenantProviderBinding? right)

left TenantProviderBinding?

right TenantProviderBinding?

bool