@azure/identity 2.0.0-alpha.20211007.2 → 2.0.0-alpha.20211008.2

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/CHANGELOG.md CHANGED
@@ -105,6 +105,12 @@ Azure Service Fabric support hasn't been added on the initial version 2 of Ident
105
105
  - Removed the `allowMultiTenantAuthentication` option from all of the credentials. Multi-tenant authentication is now enabled by default. On Node.js, it can be disabled with the `AZURE_IDENTITY_DISABLE_MULTITENANTAUTH` environment variable.
106
106
  - Removed support for specific Azure regions on `ClientSecretCredential` and `ClientCertificateCredential. This feature will be added back on the next beta.
107
107
 
108
+ #### Breaking Changes from 2.0.0-beta.6
109
+
110
+ - Renamed the `ApplicationCredential` to `AzureApplicationCredential`.
111
+ - Removed the `CredentialPersistenceOptions` from `DefaultAzureCredential` and `EnvironmentCredential`.
112
+ - Merged the configuration and the options bag on the `OnBehalfOfCredential` into a single options bag.
113
+
108
114
  ### Bugs Fixed
109
115
 
110
116
  - `ClientSecretCredential`, `ClientCertificateCredential`, and `UsernamePasswordCredential` throw if the required parameters aren't provided (even in JavaScript).
package/dist/index.js CHANGED
@@ -3191,7 +3191,7 @@ class AuthorizationCodeCredential {
3191
3191
  }
3192
3192
 
3193
3193
  // Copyright (c) Microsoft Corporation.
3194
- const ApplicationCredentials = [
3194
+ const AzureApplicationCredentials = [
3195
3195
  EnvironmentCredential,
3196
3196
  DefaultManagedIdentityCredential
3197
3197
  ];
@@ -3199,11 +3199,11 @@ const ApplicationCredentials = [
3199
3199
  * Provides a default {@link ChainedTokenCredential} configuration that should
3200
3200
  * work for most applications that use the Azure SDK.
3201
3201
  */
3202
- class ApplicationCredential extends ChainedTokenCredential {
3202
+ class AzureApplicationCredential extends ChainedTokenCredential {
3203
3203
  /**
3204
- * Creates an instance of the ApplicationCredential class.
3204
+ * Creates an instance of the AzureApplicationCredential class.
3205
3205
  *
3206
- * The ApplicationCredential provides a default {@link ChainedTokenCredential} configuration that should
3206
+ * The AzureApplicationCredential provides a default {@link ChainedTokenCredential} configuration that should
3207
3207
  * work for most applications that use the Azure SDK. The following credential
3208
3208
  * types will be tried, in order:
3209
3209
  *
@@ -3213,10 +3213,10 @@ class ApplicationCredential extends ChainedTokenCredential {
3213
3213
  * Consult the documentation of these credential types for more information
3214
3214
  * on how they attempt authentication.
3215
3215
  *
3216
- * @param options - Optional parameters. See {@link ApplicationCredentialOptions}.
3216
+ * @param options - Optional parameters. See {@link AzureApplicationCredentialOptions}.
3217
3217
  */
3218
3218
  constructor(options) {
3219
- super(...ApplicationCredentials.map((ctor) => new ctor(options)));
3219
+ super(...AzureApplicationCredentials.map((ctor) => new ctor(options)));
3220
3220
  this.UnavailableMessage =
3221
3221
  "ApplicationCredential => failed to retrieve a token from the included credentials";
3222
3222
  }
@@ -3300,22 +3300,17 @@ class OnBehalfOfCredential {
3300
3300
  * await client.getKey("key-name");
3301
3301
  * ```
3302
3302
  *
3303
- * @param configuration - Configuration specific to this credential.
3304
3303
  * @param options - Optional parameters, generally common across credentials.
3305
3304
  */
3306
- constructor(configuration, options = {}) {
3307
- this.configuration = configuration;
3305
+ constructor(options) {
3308
3306
  this.options = options;
3309
- const { tenantId, clientId, userAssertionToken } = configuration;
3310
- const secretConfiguration = configuration;
3311
- const certificateConfiguration = configuration;
3312
- if (!tenantId ||
3313
- !clientId ||
3314
- !(secretConfiguration.clientSecret || certificateConfiguration.certificatePath) ||
3315
- !userAssertionToken) {
3307
+ const { clientSecret } = options;
3308
+ const { certificatePath } = options;
3309
+ const { tenantId, clientId, userAssertionToken } = options;
3310
+ if (!tenantId || !clientId || !(clientSecret || certificatePath) || !userAssertionToken) {
3316
3311
  throw new Error(`${credentialName}: tenantId, clientId, clientSecret (or certificatePath) and userAssertionToken are required parameters.`);
3317
3312
  }
3318
- this.msalFlow = new MsalOnBehalfOf(Object.assign(Object.assign(Object.assign({}, this.options), this.configuration), { logger: logger$i, tokenCredentialOptions: this.options }));
3313
+ this.msalFlow = new MsalOnBehalfOf(Object.assign(Object.assign({}, this.options), { logger: logger$i, tokenCredentialOptions: this.options }));
3319
3314
  }
3320
3315
  /**
3321
3316
  * Authenticates with Azure Active Directory and returns an access token if successful.
@@ -3342,7 +3337,7 @@ function getDefaultAzureCredential() {
3342
3337
 
3343
3338
  exports.AggregateAuthenticationError = AggregateAuthenticationError;
3344
3339
  exports.AggregateAuthenticationErrorName = AggregateAuthenticationErrorName;
3345
- exports.ApplicationCredential = ApplicationCredential;
3340
+ exports.ApplicationCredential = AzureApplicationCredential;
3346
3341
  exports.AuthenticationError = AuthenticationError;
3347
3342
  exports.AuthenticationErrorName = AuthenticationErrorName;
3348
3343
  exports.AuthenticationRequiredError = AuthenticationRequiredError;