Table of Contents

Class ProviderConfigurationManager

Namespace
JD.AI.Core.Providers.Credentials
Assembly
JD.AI.Core.dll

Resolves provider credentials from multiple sources:

  1. ICredentialStore (secure storage)
  2. IConfiguration (appsettings, user secrets)
  3. Well-known environment variables
public sealed class ProviderConfigurationManager
Inheritance
ProviderConfigurationManager
Inherited Members

Constructors

ProviderConfigurationManager(ICredentialStore, IConfiguration?)

public ProviderConfigurationManager(ICredentialStore store, IConfiguration? configuration = null)

Parameters

store ICredentialStore
configuration IConfiguration

Properties

Store

public ICredentialStore Store { get; }

Property Value

ICredentialStore

Methods

GetCredentialAsync(string, string, CancellationToken)

Resolves a credential for a provider field via the resolution chain.

public Task<string?> GetCredentialAsync(string provider, string field, CancellationToken ct = default)

Parameters

provider string
field string
ct CancellationToken

Returns

Task<string>

ListConfiguredProvidersAsync(CancellationToken)

Lists all configured provider names (those with at least one credential stored).

public Task<IReadOnlyList<string>> ListConfiguredProvidersAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<IReadOnlyList<string>>

RemoveCredentialAsync(string, string, CancellationToken)

Removes a credential from the secure store.

public Task RemoveCredentialAsync(string provider, string field, CancellationToken ct = default)

Parameters

provider string
field string
ct CancellationToken

Returns

Task

RemoveProviderAsync(string, CancellationToken)

Removes all credentials for a provider.

public Task RemoveProviderAsync(string provider, CancellationToken ct = default)

Parameters

provider string
ct CancellationToken

Returns

Task

SetCredentialAsync(string, string, string, CancellationToken)

Stores a credential in the secure store.

public Task SetCredentialAsync(string provider, string field, string value, CancellationToken ct = default)

Parameters

provider string
field string
value string
ct CancellationToken

Returns

Task