@@ -33,11 +33,7 @@ export class AzureKeyVaultSecretProvider {
3333 }
3434 }
3535
36- /**
37- * Fetches the given unique secrets ahead of resolution to warm the cache. Honors the secret refresh
38- * timer and the parallel resolution option. This is best-effort: per-secret failures are swallowed so
39- * that the error is surfaced with full context later by getSecretValue during resolution.
40- */
36+ // Fetches the given unique secrets to warm the cache.
4137 async preloadSecrets ( secretIdentifiers : KeyVaultSecretIdentifier [ ] ) : Promise < void > {
4238 const loadSecret = async ( secretIdentifier : KeyVaultSecretIdentifier ) => {
4339 try {
@@ -56,10 +52,6 @@ export class AzureKeyVaultSecretProvider {
5652 }
5753 }
5854
59- /**
60- * Fetches a secret value into the cache if it is not cached yet, or if the secret refresh interval has
61- * expired. This is the only place the refresh timer gates a fetch.
62- */
6355 async #loadSecretValue( secretIdentifier : KeyVaultSecretIdentifier ) : Promise < void > {
6456 const identifierKey = secretIdentifier . sourceId ;
6557 const shouldRefresh = this . #secretRefreshTimer?. canRefresh ( ) ?? false ;
@@ -71,15 +63,11 @@ export class AzureKeyVaultSecretProvider {
7163
7264 async getSecretValue ( secretIdentifier : KeyVaultSecretIdentifier ) : Promise < unknown > {
7365 const identifierKey = secretIdentifier . sourceId ;
74-
75- // Return the cached value if available. Freshness is handled by preloadSecrets, which warms the
76- // cache before resolution.
7766 if ( this . #cachedSecretValues. has ( identifierKey ) ) {
7867 return this . #cachedSecretValues. get ( identifierKey ) ;
7968 }
8069
81- // Fallback for secrets that preload skipped or failed to fetch. Failures are not cached, so a
82- // subsequent call will retry.
70+ // Fallback for secrets that preload skipped or failed to fetch.
8371 const secretValue = await this . #getSecretValueFromKeyVault( secretIdentifier ) ;
8472 this . #cachedSecretValues. set ( identifierKey , secretValue ) ;
8573 return secretValue ;
0 commit comments