@azure/identity 3.2.4-alpha.20230727.2 → 3.2.4-alpha.20230804.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
@@ -2526,7 +2526,7 @@ function ensureScopes(scopes) {
2526
2526
  * Throws if the received scope is not valid.
2527
2527
  * @internal
2528
2528
  */
2529
- function ensureValidScope(scope, logger) {
2529
+ function ensureValidScopeForDevTimeCreds(scope, logger) {
2530
2530
  if (!scope.match(/^[0-9a-zA-Z-.:/]+$/)) {
2531
2531
  const error = new Error("Invalid scope was specified by the user or calling client");
2532
2532
  logger.getToken.info(formatError(scope, error));
@@ -2624,11 +2624,11 @@ class AzureCliCredential {
2624
2624
  const tenantId = processMultiTenantRequest(this.tenantId, options, this.additionallyAllowedTenantIds);
2625
2625
  const scope = typeof scopes === "string" ? scopes : scopes[0];
2626
2626
  logger$b.getToken.info(`Using the scope ${scope}`);
2627
- ensureValidScope(scope, logger$b);
2628
- const resource = getScopeResource(scope);
2629
2627
  return tracingClient.withSpan(`${this.constructor.name}.getToken`, options, async () => {
2630
2628
  var _a, _b, _c, _d;
2631
2629
  try {
2630
+ ensureValidScopeForDevTimeCreds(scope, logger$b);
2631
+ const resource = getScopeResource(scope);
2632
2632
  const obj = await cliCredentialInternals.getAzureCliAccessToken(resource, tenantId, this.timeout);
2633
2633
  const specificScope = (_a = obj.stderr) === null || _a === void 0 ? void 0 : _a.match("(.*)az login --scope(.*)");
2634
2634
  const isLoginError = ((_b = obj.stderr) === null || _b === void 0 ? void 0 : _b.match("(.*)az login(.*)")) && !specificScope;
@@ -2838,10 +2838,10 @@ class AzurePowerShellCredential {
2838
2838
  return tracingClient.withSpan(`${this.constructor.name}.getToken`, options, async () => {
2839
2839
  const tenantId = processMultiTenantRequest(this.tenantId, options, this.additionallyAllowedTenantIds);
2840
2840
  const scope = typeof scopes === "string" ? scopes : scopes[0];
2841
- ensureValidScope(scope, logger$a);
2842
- logger$a.getToken.info(`Using the scope ${scope}`);
2843
- const resource = getScopeResource(scope);
2844
2841
  try {
2842
+ ensureValidScopeForDevTimeCreds(scope, logger$a);
2843
+ logger$a.getToken.info(`Using the scope ${scope}`);
2844
+ const resource = getScopeResource(scope);
2845
2845
  const response = await this.getAzurePowerShellAccessToken(resource, tenantId, this.timeout);
2846
2846
  logger$a.getToken.info(formatSuccess(scopes));
2847
2847
  return {