Add extracted source directory and README navigation

This commit is contained in:
Shawn Bot
2026-03-31 14:56:06 +00:00
parent 6252bb6eb5
commit 91e01d755b
4757 changed files with 984951 additions and 0 deletions

View File

@@ -0,0 +1,153 @@
/*! @azure/msal-node v3.8.1 2025-10-29 */
'use strict';
import { HttpStatus } from '@azure/msal-common/node';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
// MSI Constants. Docs for MSI are available here https://docs.microsoft.com/azure/app-service/overview-managed-identity
const DEFAULT_MANAGED_IDENTITY_ID = "system_assigned_managed_identity";
const MANAGED_IDENTITY_DEFAULT_TENANT = "managed_identity";
const DEFAULT_AUTHORITY_FOR_MANAGED_IDENTITY = `https://login.microsoftonline.com/${MANAGED_IDENTITY_DEFAULT_TENANT}/`;
/**
* Managed Identity Headers - used in network requests
*/
const ManagedIdentityHeaders = {
AUTHORIZATION_HEADER_NAME: "Authorization",
METADATA_HEADER_NAME: "Metadata",
APP_SERVICE_SECRET_HEADER_NAME: "X-IDENTITY-HEADER",
ML_AND_SF_SECRET_HEADER_NAME: "secret",
};
/**
* Managed Identity Query Parameters - used in network requests
*/
const ManagedIdentityQueryParameters = {
API_VERSION: "api-version",
RESOURCE: "resource",
SHA256_TOKEN_TO_REFRESH: "token_sha256_to_refresh",
XMS_CC: "xms_cc",
};
/**
* Managed Identity Environment Variable Names
*/
const ManagedIdentityEnvironmentVariableNames = {
AZURE_POD_IDENTITY_AUTHORITY_HOST: "AZURE_POD_IDENTITY_AUTHORITY_HOST",
DEFAULT_IDENTITY_CLIENT_ID: "DEFAULT_IDENTITY_CLIENT_ID",
IDENTITY_ENDPOINT: "IDENTITY_ENDPOINT",
IDENTITY_HEADER: "IDENTITY_HEADER",
IDENTITY_SERVER_THUMBPRINT: "IDENTITY_SERVER_THUMBPRINT",
IMDS_ENDPOINT: "IMDS_ENDPOINT",
MSI_ENDPOINT: "MSI_ENDPOINT",
MSI_SECRET: "MSI_SECRET",
};
/**
* Managed Identity Source Names
* @public
*/
const ManagedIdentitySourceNames = {
APP_SERVICE: "AppService",
AZURE_ARC: "AzureArc",
CLOUD_SHELL: "CloudShell",
DEFAULT_TO_IMDS: "DefaultToImds",
IMDS: "Imds",
MACHINE_LEARNING: "MachineLearning",
SERVICE_FABRIC: "ServiceFabric",
};
/**
* Managed Identity Ids
*/
const ManagedIdentityIdType = {
SYSTEM_ASSIGNED: "system-assigned",
USER_ASSIGNED_CLIENT_ID: "user-assigned-client-id",
USER_ASSIGNED_RESOURCE_ID: "user-assigned-resource-id",
USER_ASSIGNED_OBJECT_ID: "user-assigned-object-id",
};
/**
* http methods
*/
const HttpMethod = {
GET: "get",
POST: "post",
};
const ProxyStatus = {
SUCCESS_RANGE_START: HttpStatus.SUCCESS_RANGE_START,
SUCCESS_RANGE_END: HttpStatus.SUCCESS_RANGE_END,
SERVER_ERROR: HttpStatus.SERVER_ERROR,
};
/**
* Constants used for region discovery
*/
const REGION_ENVIRONMENT_VARIABLE = "REGION_NAME";
const MSAL_FORCE_REGION = "MSAL_FORCE_REGION";
/**
* Constant used for PKCE
*/
const RANDOM_OCTET_SIZE = 32;
/**
* Constants used in PKCE
*/
const Hash = {
SHA256: "sha256",
};
/**
* Constants for encoding schemes
*/
const CharSet = {
CV_CHARSET: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",
};
/**
* Cache Constants
*/
const CACHE = {
KEY_SEPARATOR: "-",
};
/**
* Constants
*/
const Constants = {
MSAL_SKU: "msal.js.node",
JWT_BEARER_ASSERTION_TYPE: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
AUTHORIZATION_PENDING: "authorization_pending",
HTTP_PROTOCOL: "http://",
LOCALHOST: "localhost",
};
/**
* API Codes for Telemetry purposes.
* Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
* 0-99 Silent Flow
* 600-699 Device Code Flow
* 800-899 Auth Code Flow
*/
const ApiId = {
acquireTokenSilent: 62,
acquireTokenByUsernamePassword: 371,
acquireTokenByDeviceCode: 671,
acquireTokenByClientCredential: 771,
acquireTokenByCode: 871,
acquireTokenByRefreshToken: 872,
};
/**
* JWT constants
*/
const JwtConstants = {
RSA_256: "RS256",
PSS_256: "PS256",
X5T_256: "x5t#S256",
X5T: "x5t",
X5C: "x5c",
AUDIENCE: "aud",
EXPIRATION_TIME: "exp",
ISSUER: "iss",
SUBJECT: "sub",
NOT_BEFORE: "nbf",
JWT_ID: "jti",
};
const LOOPBACK_SERVER_CONSTANTS = {
INTERVAL_MS: 100,
TIMEOUT_MS: 5000,
};
const AZURE_ARC_SECRET_FILE_MAX_SIZE_BYTES = 4096; // 4 KB
export { AZURE_ARC_SECRET_FILE_MAX_SIZE_BYTES, ApiId, CACHE, CharSet, Constants, DEFAULT_AUTHORITY_FOR_MANAGED_IDENTITY, DEFAULT_MANAGED_IDENTITY_ID, Hash, HttpMethod, JwtConstants, LOOPBACK_SERVER_CONSTANTS, MANAGED_IDENTITY_DEFAULT_TENANT, MSAL_FORCE_REGION, ManagedIdentityEnvironmentVariableNames, ManagedIdentityHeaders, ManagedIdentityIdType, ManagedIdentityQueryParameters, ManagedIdentitySourceNames, ProxyStatus, RANDOM_OCTET_SIZE, REGION_ENVIRONMENT_VARIABLE };
//# sourceMappingURL=Constants.mjs.map

View File

@@ -0,0 +1,51 @@
/*! @azure/msal-node v3.8.1 2025-10-29 */
'use strict';
import { EncodingTypes, Constants } from '@azure/msal-common/node';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class EncodingUtils {
/**
* 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
* 'base64': Base64 encoding.
*
* @param str text
*/
static base64Encode(str, encoding) {
return Buffer.from(str, encoding).toString(EncodingTypes.BASE64);
}
/**
* encode a URL
* @param str
*/
static base64EncodeUrl(str, encoding) {
return EncodingUtils.base64Encode(str, encoding)
.replace(/=/g, Constants.EMPTY_STRING)
.replace(/\+/g, "-")
.replace(/\//g, "_");
}
/**
* 'utf8': Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8.
* 'base64': Base64 encoding.
*
* @param base64Str Base64 encoded text
*/
static base64Decode(base64Str) {
return Buffer.from(base64Str, EncodingTypes.BASE64).toString("utf8");
}
/**
* @param base64Str Base64 encoded Url
*/
static base64DecodeUrl(base64Str) {
let str = base64Str.replace(/-/g, "+").replace(/_/g, "/");
while (str.length % 4) {
str += "=";
}
return EncodingUtils.base64Decode(str);
}
}
export { EncodingUtils };
//# sourceMappingURL=EncodingUtils.mjs.map

View File

@@ -0,0 +1,43 @@
/*! @azure/msal-node v3.8.1 2025-10-29 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class NetworkUtils {
static getNetworkResponse(headers, body, statusCode) {
return {
headers: headers,
body: body,
status: statusCode,
};
}
/*
* Utility function that converts a URL object into an ordinary options object as expected by the
* http.request and https.request APIs.
* https://github.com/nodejs/node/blob/main/lib/internal/url.js#L1090
*/
static urlToHttpOptions(url) {
const options = {
protocol: url.protocol,
hostname: url.hostname && url.hostname.startsWith("[")
? url.hostname.slice(1, -1)
: url.hostname,
hash: url.hash,
search: url.search,
pathname: url.pathname,
path: `${url.pathname || ""}${url.search || ""}`,
href: url.href,
};
if (url.port !== "") {
options.port = Number(url.port);
}
if (url.username || url.password) {
options.auth = `${decodeURIComponent(url.username)}:${decodeURIComponent(url.password)}`;
}
return options;
}
}
export { NetworkUtils };
//# sourceMappingURL=NetworkUtils.mjs.map

View File

@@ -0,0 +1,23 @@
/*! @azure/msal-node v3.8.1 2025-10-29 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* @internal
* Checks if a given date string is in ISO 8601 format.
*
* @param dateString - The date string to be checked.
* @returns boolean - Returns true if the date string is in ISO 8601 format, otherwise false.
*/
function isIso8601(dateString) {
if (typeof dateString !== "string") {
return false;
}
const date = new Date(dateString);
return !isNaN(date.getTime()) && date.toISOString() === dateString;
}
export { isIso8601 };
//# sourceMappingURL=TimeUtils.mjs.map