Skip to content

Commit c6e4423

Browse files
Merge branch 'main' of https://github.com/Azure/AppConfiguration-JavaScriptProvider into zhiyuanliang/secret-refresh
2 parents e11cbd0 + 1e2f74d commit c6e4423

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/keyvault/AzureKeyVaultSecretProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class AzureKeyVaultSecretProvider {
8686
return client;
8787
}
8888
if (this.#keyVaultOptions?.credential) {
89-
client = new SecretClient(vaultUrl.toString(), this.#keyVaultOptions.credential);
89+
client = new SecretClient(vaultUrl.toString(), this.#keyVaultOptions.credential, this.#keyVaultOptions.clientOptions);
9090
this.#secretClients.set(vaultUrl.host, client);
9191
return client;
9292
}

src/keyvault/KeyVaultOptions.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT license.
33

44
import { TokenCredential } from "@azure/identity";
5-
import { SecretClient } from "@azure/keyvault-secrets";
5+
import { SecretClient, SecretClientOptions } from "@azure/keyvault-secrets";
66

77
export const MIN_SECRET_REFRESH_INTERVAL_IN_MS = 60_000;
88

@@ -21,16 +21,25 @@ export interface KeyVaultOptions {
2121
credential?: TokenCredential;
2222

2323
/**
24-
* Specifies the refresh interval in milliseconds for periodically reloading secret from Key Vault.
24+
* * Configures the client options used when connecting to key vaults that have no registered SecretClient.
25+
*
2526
* @remarks
26-
* If specified, the value must be greater than 60 seconds.
27+
* The client options will not affect the registered SecretClient instances.
2728
*/
28-
secretRefreshIntervalInMs?: number;
29+
clientOptions?: SecretClientOptions;
2930

3031
/**
3132
* Specifies the callback used to resolve key vault references that have no applied SecretClient.
3233
* @param keyVaultReference The Key Vault reference to resolve.
3334
* @returns The secret value.
3435
*/
3536
secretResolver?: (keyVaultReference: URL) => string | Promise<string>;
37+
38+
/**
39+
* Specifies the refresh interval in milliseconds for periodically reloading secret from Key Vault.
40+
*
41+
* @remarks
42+
* If specified, the value must be greater than 60 seconds.
43+
*/
44+
secretRefreshIntervalInMs?: number;
3645
}

0 commit comments

Comments
 (0)