TenantProviderCredentialResolver
AgentPrism.Core.dllResolves a tenant’s TenantProviderBinding into a ModelProviderCredential by reading the bound configuration key’s value.
public sealed class TenantProviderCredentialResolverInheritance
Section titled “Inheritance”object ← TenantProviderCredentialResolver
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”AgentPrismTenantProviderOptions.AllowedConfigurationPrefix is checked here too, not only where a binding is written. A binding written before the prefix was configured (or through a store the endpoint layer did not validate) must not silently read an out-of-prefix configuration key (defense in two layers).
Constructors
Section titled “Constructors”TenantProviderCredentialResolver(IConfiguration?, IOptionsMonitor<AgentPrismTenantProviderOptions>)
Section titled “ TenantProviderCredentialResolver(IConfiguration?, IOptionsMonitor<AgentPrismTenantProviderOptions>)”Creates a new resolver.
public TenantProviderCredentialResolver(IConfiguration? configuration, IOptionsMonitor<AgentPrismTenantProviderOptions> options)Parameters
Section titled “Parameters”configuration IConfiguration?
The application’s configuration root. When null (a hosting setup with no IConfiguration registered), TenantProviderCredentialResolver.Resolve always returns null.
options IOptionsMonitor<AgentPrismTenantProviderOptions>
The tenant provider options.
Exceptions
Section titled “Exceptions”options is null.
Methods
Section titled “Methods”Resolve(TenantProviderBinding)
Section titled “ Resolve(TenantProviderBinding)”Resolves a binding into a credential by reading its configuration key.
public ModelProviderCredential? Resolve(TenantProviderBinding binding)Parameters
Section titled “Parameters”binding TenantProviderBinding
The binding to resolve.
Returns
Section titled “Returns”The resolved credential; null if the configuration key has no value (the binding exists, but the secret was never set — this must not fall back to the global key silently).
Exceptions
Section titled “Exceptions”TenantProviderBinding.ApiKeyConfigurationName is outside the allowed prefix.
ValidatePrefix(string)
Section titled “ ValidatePrefix(string)”Validates that a configuration key name is under the allowed prefix.
public void ValidatePrefix(string configurationKeyName)Parameters
Section titled “Parameters”configurationKeyName string
The configuration key name to check.
Exceptions
Section titled “Exceptions”The name is empty, or does not start with AgentPrismTenantProviderOptions.AllowedConfigurationPrefix.