Azure / AppConfiguration-JavaScriptProvider

The configuration provider for consuming data in Azure App Configuration from JavaScript applications like Node or browser apps.
https://github.com/Azure/AppConfiguration
MIT License
9 stars 2 forks source link

Custom secretResolver should return unknown/any type? #89

Open Eskibear opened 3 months ago

Eskibear commented 3 months ago

Use KeyVaultOptions.secretResolver to resolve the secret reference with customized logic, e.g. parse JSON string into an object.

    /**
     * Specifies the callback used to resolve key vault references that have no applied SecretClient.
     * @param keyVaultReference The Key Vault reference to resolve.
     * @returns The secret value.
     */
    secretResolver?: (keyVaultReference: URL) => string | Promise<string>;

Note: Here I think secretResolver should return known type instead of string, as we allow values of the config map to be any type.

Originally posted by @Eskibear in https://github.com/Azure/AppConfiguration-JavaScriptProvider/issues/78#issuecomment-2287726906