Class ChainedCredentialStore
- Namespace
- JD.AI.Core.Providers.Credentials
- Assembly
- JD.AI.Core.dll
Chains multiple ICredentialStore instances, trying each in order for reads and writing to the first writable store. Enables layered secret resolution (e.g., Vault → env vars → encrypted file).
public sealed class ChainedCredentialStore : ICredentialStore
- Inheritance
-
ChainedCredentialStore
- Implements
- Inherited Members
Constructors
ChainedCredentialStore(params ICredentialStore[])
public ChainedCredentialStore(params ICredentialStore[] stores)
Parameters
storesICredentialStore[]
ChainedCredentialStore(IEnumerable<ICredentialStore>)
public ChainedCredentialStore(IEnumerable<ICredentialStore> stores)
Parameters
storesIEnumerable<ICredentialStore>
Properties
IsAvailable
Whether this store is available on the current platform.
public bool IsAvailable { get; }
Property Value
StoreName
Human-readable name of the backing store.
public string StoreName { get; }
Property Value
Methods
GetAsync(string, CancellationToken)
Gets a stored credential value.
public Task<string?> GetAsync(string key, CancellationToken ct = default)
Parameters
keystringctCancellationToken
Returns
ListKeysAsync(string, CancellationToken)
Lists all keys matching a prefix.
public Task<IReadOnlyList<string>> ListKeysAsync(string prefix, CancellationToken ct = default)
Parameters
prefixstringctCancellationToken
Returns
RemoveAsync(string, CancellationToken)
Removes a stored credential.
public Task RemoveAsync(string key, CancellationToken ct = default)
Parameters
keystringctCancellationToken
Returns
SetAsync(string, string, CancellationToken)
Stores a credential value.
public Task SetAsync(string key, string value, CancellationToken ct = default)
Parameters
keystringvaluestringctCancellationToken