@azure/identity 3.3.1-alpha.20231012.3 → 3.3.2-alpha.20231013.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/dist/index.js CHANGED
@@ -240,7 +240,7 @@ function credentialLogger(title, log = logger$n) {
240
240
  /**
241
241
  * Current version of the `@azure/identity` package.
242
242
  */
243
- const SDK_VERSION = `3.3.1`;
243
+ const SDK_VERSION = `3.3.2`;
244
244
  /**
245
245
  * The default client ID for authentication
246
246
  * @internal
@@ -2658,7 +2658,10 @@ class AzureCliCredential {
2658
2658
  * @param options - Options, to optionally allow multi-tenant requests.
2659
2659
  */
2660
2660
  constructor(options) {
2661
- this.tenantId = options === null || options === void 0 ? void 0 : options.tenantId;
2661
+ if (options === null || options === void 0 ? void 0 : options.tenantId) {
2662
+ checkTenantId(logger$b, options === null || options === void 0 ? void 0 : options.tenantId);
2663
+ this.tenantId = options === null || options === void 0 ? void 0 : options.tenantId;
2664
+ }
2662
2665
  this.additionallyAllowedTenantIds = resolveAddionallyAllowedTenantIds(options === null || options === void 0 ? void 0 : options.additionallyAllowedTenants);
2663
2666
  this.timeout = options === null || options === void 0 ? void 0 : options.processTimeoutInMs;
2664
2667
  }
@@ -2672,6 +2675,9 @@ class AzureCliCredential {
2672
2675
  */
2673
2676
  async getToken(scopes, options = {}) {
2674
2677
  const tenantId = processMultiTenantRequest(this.tenantId, options, this.additionallyAllowedTenantIds);
2678
+ if (tenantId) {
2679
+ checkTenantId(logger$b, tenantId);
2680
+ }
2675
2681
  const scope = typeof scopes === "string" ? scopes : scopes[0];
2676
2682
  logger$b.getToken.info(`Using the scope ${scope}`);
2677
2683
  return tracingClient.withSpan(`${this.constructor.name}.getToken`, options, async () => {
@@ -2834,7 +2840,10 @@ class AzurePowerShellCredential {
2834
2840
  * @param options - Options, to optionally allow multi-tenant requests.
2835
2841
  */
2836
2842
  constructor(options) {
2837
- this.tenantId = options === null || options === void 0 ? void 0 : options.tenantId;
2843
+ if (options === null || options === void 0 ? void 0 : options.tenantId) {
2844
+ checkTenantId(logger$a, options === null || options === void 0 ? void 0 : options.tenantId);
2845
+ this.tenantId = options === null || options === void 0 ? void 0 : options.tenantId;
2846
+ }
2838
2847
  this.additionallyAllowedTenantIds = resolveAddionallyAllowedTenantIds(options === null || options === void 0 ? void 0 : options.additionallyAllowedTenants);
2839
2848
  this.timeout = options === null || options === void 0 ? void 0 : options.processTimeoutInMs;
2840
2849
  }
@@ -2894,6 +2903,9 @@ class AzurePowerShellCredential {
2894
2903
  return tracingClient.withSpan(`${this.constructor.name}.getToken`, options, async () => {
2895
2904
  const tenantId = processMultiTenantRequest(this.tenantId, options, this.additionallyAllowedTenantIds);
2896
2905
  const scope = typeof scopes === "string" ? scopes : scopes[0];
2906
+ if (tenantId) {
2907
+ checkTenantId(logger$a, tenantId);
2908
+ }
2897
2909
  try {
2898
2910
  ensureValidScopeForDevTimeCreds(scope, logger$a);
2899
2911
  logger$a.getToken.info(`Using the scope ${scope}`);
@@ -3485,7 +3497,6 @@ const developerCliCredentialInternals = {
3485
3497
  ...tenantSection,
3486
3498
  ], {
3487
3499
  cwd: developerCliCredentialInternals.getSafeWorkingDir(),
3488
- shell: true,
3489
3500
  timeout,
3490
3501
  }, (error, stdout, stderr) => {
3491
3502
  resolve({ stdout, stderr, error });
@@ -3533,7 +3544,10 @@ class AzureDeveloperCliCredential {
3533
3544
  * @param options - Options, to optionally allow multi-tenant requests.
3534
3545
  */
3535
3546
  constructor(options) {
3536
- this.tenantId = options === null || options === void 0 ? void 0 : options.tenantId;
3547
+ if (options === null || options === void 0 ? void 0 : options.tenantId) {
3548
+ checkTenantId(logger$4, options === null || options === void 0 ? void 0 : options.tenantId);
3549
+ this.tenantId = options === null || options === void 0 ? void 0 : options.tenantId;
3550
+ }
3537
3551
  this.additionallyAllowedTenantIds = resolveAddionallyAllowedTenantIds(options === null || options === void 0 ? void 0 : options.additionallyAllowedTenants);
3538
3552
  this.timeout = options === null || options === void 0 ? void 0 : options.processTimeoutInMs;
3539
3553
  }
@@ -3547,6 +3561,9 @@ class AzureDeveloperCliCredential {
3547
3561
  */
3548
3562
  async getToken(scopes, options = {}) {
3549
3563
  const tenantId = processMultiTenantRequest(this.tenantId, options, this.additionallyAllowedTenantIds);
3564
+ if (tenantId) {
3565
+ checkTenantId(logger$4, tenantId);
3566
+ }
3550
3567
  let scopeList;
3551
3568
  if (typeof scopes === "string") {
3552
3569
  scopeList = [scopes];
@@ -3558,6 +3575,9 @@ class AzureDeveloperCliCredential {
3558
3575
  return tracingClient.withSpan(`${this.constructor.name}.getToken`, options, async () => {
3559
3576
  var _a, _b, _c, _d;
3560
3577
  try {
3578
+ scopeList.forEach((scope) => {
3579
+ ensureValidScopeForDevTimeCreds(scope, logger$4);
3580
+ });
3561
3581
  const obj = await developerCliCredentialInternals.getAzdAccessToken(scopeList, tenantId, this.timeout);
3562
3582
  const isNotLoggedInError = ((_a = obj.stderr) === null || _a === void 0 ? void 0 : _a.match("not logged in, run `azd login` to login")) ||
3563
3583
  ((_b = obj.stderr) === null || _b === void 0 ? void 0 : _b.match("not logged in, run `azd auth login` to login"));