@azure/identity 3.2.0-alpha.20230421.2 → 3.2.0-alpha.20230425.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @azure/identity might be problematic. Click here for more details.

package/README.md CHANGED
@@ -298,6 +298,14 @@ Not all credentials require this configuration. Credentials that authenticate th
298
298
 
299
299
  Configuration is attempted in the above order. For example, if values for a client secret and certificate are both present, the client secret will be used.
300
300
 
301
+ ## Token caching
302
+ Token caching is a feature provided by the Azure Identity library that allows apps to:
303
+ - Cache tokens in memory (default) and on disk (opt-in).
304
+ - Improve resilience and performance.
305
+ - Reduce the number of requests made to Azure AD to obtain access tokens.
306
+
307
+ The Azure Identity library offers both in-memory and persistent disk caching. For more details, see the [token caching documentation](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/TOKEN_CACHING.md).
308
+
301
309
  ## Troubleshooting
302
310
 
303
311
  ### Error handling
package/dist/index.js CHANGED
@@ -1999,8 +1999,7 @@ class WorkloadIdentityCredential {
1999
1999
  const tenantId = workloadIdentityCredentialOptions.tenantId || process.env.AZURE_TENANT_ID;
2000
2000
  const clientId = workloadIdentityCredentialOptions.clientId || process.env.AZURE_CLIENT_ID;
2001
2001
  this.federatedTokenFilePath =
2002
- workloadIdentityCredentialOptions.federatedTokenFilePath ||
2003
- process.env.AZURE_FEDERATED_TOKEN_FILE;
2002
+ workloadIdentityCredentialOptions.tokenFilePath || process.env.AZURE_FEDERATED_TOKEN_FILE;
2004
2003
  if (tenantId) {
2005
2004
  checkTenantId(logger$g, tenantId);
2006
2005
  }
@@ -2075,7 +2074,7 @@ function tokenExchangeMsi() {
2075
2074
  async getToken(configuration, getTokenOptions = {}) {
2076
2075
  const { scopes, clientId } = configuration;
2077
2076
  const identityClientTokenCredentialOptions = {};
2078
- const workloadIdentityCredential = new WorkloadIdentityCredential(Object.assign(Object.assign({ clientId, tenantId: process.env.AZURE_TENANT_ID, federatedTokenFilePath: process.env.AZURE_FEDERATED_TOKEN_FILE }, identityClientTokenCredentialOptions), { disableInstanceDiscovery: true }));
2077
+ const workloadIdentityCredential = new WorkloadIdentityCredential(Object.assign(Object.assign({ clientId, tenantId: process.env.AZURE_TENANT_ID, tokenFilePath: process.env.AZURE_FEDERATED_TOKEN_FILE }, identityClientTokenCredentialOptions), { disableAuthorityValidationAndInstanceDiscovery: true }));
2079
2078
  const token = await workloadIdentityCredential.getToken(scopes, getTokenOptions);
2080
2079
  return token;
2081
2080
  },
@@ -3579,7 +3578,7 @@ class DefaultWorkloadIdentityCredential extends WorkloadIdentityCredential {
3579
3578
  const workloadFile = process.env.AZURE_FEDERATED_TOKEN_FILE;
3580
3579
  const tenantId = (_c = options === null || options === void 0 ? void 0 : options.tenantId) !== null && _c !== void 0 ? _c : process.env.AZURE_TENANT_ID;
3581
3580
  if (workloadFile && workloadIdentityClientId) {
3582
- const workloadIdentityCredentialOptions = Object.assign(Object.assign({}, options), { tenantId, clientId: workloadIdentityClientId, federatedTokenFilePath: workloadFile });
3581
+ const workloadIdentityCredentialOptions = Object.assign(Object.assign({}, options), { tenantId, clientId: workloadIdentityClientId, tokenFilePath: workloadFile });
3583
3582
  super(workloadIdentityCredentialOptions);
3584
3583
  }
3585
3584
  else if (tenantId) {
@@ -3593,17 +3592,17 @@ class DefaultWorkloadIdentityCredential extends WorkloadIdentityCredential {
3593
3592
  }
3594
3593
  class DefaultAzureDeveloperCliCredential extends AzureDeveloperCliCredential {
3595
3594
  constructor(options) {
3596
- super(Object.assign({ processTimeoutInMs: options === null || options === void 0 ? void 0 : options.developerCredentialTimeOutInMs }, options));
3595
+ super(Object.assign({ processTimeoutInMs: options === null || options === void 0 ? void 0 : options.credentialProcessTimeoutInMs }, options));
3597
3596
  }
3598
3597
  }
3599
3598
  class DefaultAzureCliCredential extends AzureCliCredential {
3600
3599
  constructor(options) {
3601
- super(Object.assign({ processTimeoutInMs: options === null || options === void 0 ? void 0 : options.developerCredentialTimeOutInMs }, options));
3600
+ super(Object.assign({ processTimeoutInMs: options === null || options === void 0 ? void 0 : options.credentialProcessTimeoutInMs }, options));
3602
3601
  }
3603
3602
  }
3604
3603
  class DefaultAzurePowershellCredential extends AzurePowerShellCredential {
3605
3604
  constructor(options) {
3606
- super(Object.assign({ processTimeoutInMs: options === null || options === void 0 ? void 0 : options.developerCredentialTimeOutInMs }, options));
3605
+ super(Object.assign({ processTimeoutInMs: options === null || options === void 0 ? void 0 : options.credentialProcessTimeoutInMs }, options));
3607
3606
  }
3608
3607
  }
3609
3608
  const defaultCredentials = [