Files
cloud-code/claude-code-source/node_modules/@azure/identity/dist/esm/util/processMultiTenantRequest.js
janlaywss a192e187e8 fix: keep only source-map extracted node_modules, exclude pnpm artifacts
Restore node_modules to exact state from cli.js.map extraction:
- Move .ignored/ and .ignored_* files back to original package paths
- Remove pnpm symlinks (replaced by real source-map directories)
- Update .gitignore: only exclude /dist/, .pnpm/, .bin/, .ignored* dirs
- All package dist/ folders are now preserved as part of source-map files

After clone, run `pnpm install` to get pnpm-managed symlinks for building.
The committed node_modules contains the original TypeScript/JS source files
as bundled in cli.js.
2026-03-31 21:09:32 +08:00

35 lines
1.8 KiB
JavaScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { CredentialUnavailableError } from "../errors.js";
function createConfigurationErrorMessage(tenantId) {
return `The current credential is not configured to acquire tokens for tenant ${tenantId}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`;
}
/**
* Of getToken contains a tenantId, this functions allows picking this tenantId as the appropriate for authentication,
* unless multitenant authentication has been disabled through the AZURE_IDENTITY_DISABLE_MULTITENANTAUTH (on Node.js),
* or unless the original tenant Id is `adfs`.
* @internal
*/
export function processMultiTenantRequest(tenantId, getTokenOptions, additionallyAllowedTenantIds = [], logger) {
var _a;
let resolvedTenantId;
if (process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH) {
resolvedTenantId = tenantId;
}
else if (tenantId === "adfs") {
resolvedTenantId = tenantId;
}
else {
resolvedTenantId = (_a = getTokenOptions === null || getTokenOptions === void 0 ? void 0 : getTokenOptions.tenantId) !== null && _a !== void 0 ? _a : tenantId;
}
if (tenantId &&
resolvedTenantId !== tenantId &&
!additionallyAllowedTenantIds.includes("*") &&
!additionallyAllowedTenantIds.some((t) => t.localeCompare(resolvedTenantId) === 0)) {
const message = createConfigurationErrorMessage(resolvedTenantId);
logger === null || logger === void 0 ? void 0 : logger.info(message);
throw new CredentialUnavailableError(message);
}
return resolvedTenantId;
}
//# sourceMappingURL=processMultiTenantRequest.js.map