From 1ecb9b28fd7745ab7cf17003965521bfc626c683 Mon Sep 17 00:00:00 2001 From: Robbie Ginsburg Date: Fri, 6 Dec 2024 16:30:05 -0500 Subject: [PATCH 1/3] Fixed file extentions on imports. Added MS license to all files. --- lib/msal-node/test/cache/Storage.spec.ts | 13 ++++--- lib/msal-node/test/cache/TokenCache.spec.ts | 17 +++++---- lib/msal-node/test/cache/cacheConstants.ts | 5 +++ .../DistributedCachePlugin.spec.ts | 5 +++ .../cache/serializer/Deserializer.spec.ts | 11 ++++-- .../test/cache/serializer/Serializer.spec.ts | 13 ++++--- .../test/client/ClientAssertion.spec.ts | 17 +++++---- .../client/ClientCredentialClient.spec.ts | 11 +++--- lib/msal-node/test/client/ClientTestUtils.ts | 6 ++-- .../test/client/DeviceCodeClient.spec.ts | 16 ++++++--- .../ManagedIdentitySources/AppService.spec.ts | 10 +++--- .../ManagedIdentitySources/AzureArc.spec.ts | 14 ++++---- .../ManagedIdentitySources/CloudShell.spec.ts | 12 +++---- .../ManagedIdentitySources/Imds.spec.ts | 18 +++++----- .../ServiceFabric.spec.ts | 10 +++--- .../test/client/OnBehalfOfClient.spec.ts | 10 +++--- .../client/PublicClientApplication.spec.ts | 35 +++++++++++-------- .../client/UsernamePasswordClient.spec.ts | 8 ++--- .../test/config/ClientConfiguration.spec.ts | 15 +++++--- .../test/crypto/CryptoProvider.spec.ts | 9 +++-- .../test/crypto/GuidGenerator.spec.ts | 7 +++- .../test/crypto/PkceGenerator.spec.ts | 7 +++- lib/msal-node/test/network/HttpClient.spec.ts | 11 ++++-- .../test/test_kit/ManagedIdentityTestUtils.ts | 8 ++--- .../test/test_kit/StringConstants.ts | 4 +-- .../test/utils/EncodingUtils.spec.ts | 7 +++- .../test/utils/MockNativeBrokerPlugin.ts | 2 +- lib/msal-node/test/utils/MockUtils.ts | 5 +++ 28 files changed, 197 insertions(+), 109 deletions(-) diff --git a/lib/msal-node/test/cache/Storage.spec.ts b/lib/msal-node/test/cache/Storage.spec.ts index 69faf85b3b..c35f443577 100644 --- a/lib/msal-node/test/cache/Storage.spec.ts +++ b/lib/msal-node/test/cache/Storage.spec.ts @@ -1,3 +1,8 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { LogLevel, Logger, @@ -12,15 +17,15 @@ import { import { JsonCache, InMemoryCache, -} from "./../../src/cache/serializer/SerializerTypes"; -import { Deserializer } from "./../../src/cache/serializer/Deserializer"; -import { NodeStorage } from "../../src/cache/NodeStorage"; +} from "./../../src/cache/serializer/SerializerTypes.js"; +import { Deserializer } from "./../../src/cache/serializer/Deserializer.js"; +import { NodeStorage } from "../../src/cache/NodeStorage.js"; import { version, name } from "../../package.json"; import { DEFAULT_CRYPTO_IMPLEMENTATION, DEFAULT_OPENID_CONFIG_RESPONSE, TEST_CONSTANTS, -} from "../utils/TestConstants"; +} from "../utils/TestConstants.js"; const cacheJson = require("./serializer/cache.json"); const clientId = TEST_CONSTANTS.CLIENT_ID; diff --git a/lib/msal-node/test/cache/TokenCache.spec.ts b/lib/msal-node/test/cache/TokenCache.spec.ts index 2ca8234056..4f9dcdffe5 100644 --- a/lib/msal-node/test/cache/TokenCache.spec.ts +++ b/lib/msal-node/test/cache/TokenCache.spec.ts @@ -1,3 +1,8 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { LogLevel, Logger, @@ -5,17 +10,17 @@ import { ICachePlugin, buildStaticAuthorityOptions, } from "@azure/msal-common"; -import { NodeStorage } from "../../src/cache/NodeStorage"; -import { TokenCache } from "../../src/cache/TokenCache"; +import { NodeStorage } from "../../src/cache/NodeStorage.js"; +import { TokenCache } from "../../src/cache/TokenCache.js"; import { existsSync, watch, promises, FSWatcher } from "fs"; import { version, name } from "../../package.json"; import { DEFAULT_CRYPTO_IMPLEMENTATION, ID_TOKEN_CLAIMS, -} from "../utils/TestConstants"; -import { Deserializer } from "../../src/cache/serializer/Deserializer"; -import { JsonCache } from "../../src"; -import { MSALCommonModule } from "../utils/MockUtils"; +} from "../utils/TestConstants.js"; +import { Deserializer } from "../../src/cache/serializer/Deserializer.js"; +import { JsonCache } from "../../src/index.js"; +import { MSALCommonModule } from "../utils/MockUtils.js"; const msalCommon: MSALCommonModule = jest.requireActual( "@azure/msal-common/node" diff --git a/lib/msal-node/test/cache/cacheConstants.ts b/lib/msal-node/test/cache/cacheConstants.ts index fbf17099d2..44edbdc52b 100644 --- a/lib/msal-node/test/cache/cacheConstants.ts +++ b/lib/msal-node/test/cache/cacheConstants.ts @@ -1,3 +1,8 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { AccessTokenEntity, IdTokenEntity, diff --git a/lib/msal-node/test/cache/distributed/DistributedCachePlugin.spec.ts b/lib/msal-node/test/cache/distributed/DistributedCachePlugin.spec.ts index fc492a494d..e980055c56 100644 --- a/lib/msal-node/test/cache/distributed/DistributedCachePlugin.spec.ts +++ b/lib/msal-node/test/cache/distributed/DistributedCachePlugin.spec.ts @@ -1,3 +1,8 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { DistributedCachePlugin } from "../../../src/cache/distributed/DistributedCachePlugin.js"; import { AccountEntity, diff --git a/lib/msal-node/test/cache/serializer/Deserializer.spec.ts b/lib/msal-node/test/cache/serializer/Deserializer.spec.ts index 0802b87e72..e91d3c6f84 100644 --- a/lib/msal-node/test/cache/serializer/Deserializer.spec.ts +++ b/lib/msal-node/test/cache/serializer/Deserializer.spec.ts @@ -1,9 +1,14 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { JsonCache, InMemoryCache, -} from "../../../src/cache/serializer/SerializerTypes"; -import { Deserializer } from "../../../src/cache/serializer/Deserializer"; -import { MockCache } from "../cacheConstants"; +} from "../../../src/cache/serializer/SerializerTypes.js"; +import { Deserializer } from "../../../src/cache/serializer/Deserializer.js"; +import { MockCache } from "../cacheConstants.js"; const cacheJson = require("./cache.json"); diff --git a/lib/msal-node/test/cache/serializer/Serializer.spec.ts b/lib/msal-node/test/cache/serializer/Serializer.spec.ts index ef66b97eb3..8383bf8419 100644 --- a/lib/msal-node/test/cache/serializer/Serializer.spec.ts +++ b/lib/msal-node/test/cache/serializer/Serializer.spec.ts @@ -1,10 +1,15 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { JsonCache, InMemoryCache, -} from "../../../src/cache/serializer/SerializerTypes"; -import { Serializer } from "../../../src/cache/serializer/Serializer"; -import { Deserializer } from "../../../src/cache/serializer/Deserializer"; -import { MockCache } from "../cacheConstants"; +} from "../../../src/cache/serializer/SerializerTypes.js"; +import { Serializer } from "../../../src/cache/serializer/Serializer.js"; +import { Deserializer } from "../../../src/cache/serializer/Deserializer.js"; +import { MockCache } from "../cacheConstants.js"; const cachedJson = require("./cache.json"); diff --git a/lib/msal-node/test/client/ClientAssertion.spec.ts b/lib/msal-node/test/client/ClientAssertion.spec.ts index 8c86a19b8b..6adf8268a8 100644 --- a/lib/msal-node/test/client/ClientAssertion.spec.ts +++ b/lib/msal-node/test/client/ClientAssertion.spec.ts @@ -1,12 +1,17 @@ -import { ClientAssertion } from "../../src/client/ClientAssertion"; +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import { ClientAssertion } from "../../src/client/ClientAssertion.js"; import { DEFAULT_OPENID_CONFIG_RESPONSE, TEST_CONSTANTS, -} from "../utils/TestConstants"; -import { CryptoProvider } from "../../src/crypto/CryptoProvider"; -import { EncodingUtils } from "../../src/utils/EncodingUtils"; -import { JwtConstants } from "../../src/utils/Constants"; -import { getClientAssertionCallback } from "./ClientTestUtils"; +} from "../utils/TestConstants.js"; +import { CryptoProvider } from "../../src/crypto/CryptoProvider.js"; +import { EncodingUtils } from "../../src/utils/EncodingUtils.js"; +import { JwtConstants } from "../../src/utils/Constants.js"; +import { getClientAssertionCallback } from "./ClientTestUtils.js"; import { getClientAssertion } from "@azure/msal-common"; import jwt from "jsonwebtoken"; diff --git a/lib/msal-node/test/client/ClientCredentialClient.spec.ts b/lib/msal-node/test/client/ClientCredentialClient.spec.ts index ef770409fa..dd0219a61a 100644 --- a/lib/msal-node/test/client/ClientCredentialClient.spec.ts +++ b/lib/msal-node/test/client/ClientCredentialClient.spec.ts @@ -22,7 +22,10 @@ import { CacheHelpers, GrantType, } from "@azure/msal-common"; -import { ClientCredentialClient, UsernamePasswordClient } from "../../src"; +import { + ClientCredentialClient, + UsernamePasswordClient, +} from "../../src/index.js"; import { AUTHENTICATION_RESULT_DEFAULT_SCOPES, CAE_CONSTANTS, @@ -33,14 +36,14 @@ import { DSTS_OPENID_CONFIG_RESPONSE, TEST_CONFIG, TEST_TOKENS, -} from "../test_kit/StringConstants"; +} from "../test_kit/StringConstants.js"; import { checkMockedNetworkRequest, ClientTestUtils, getClientAssertionCallback, mockCrypto, -} from "./ClientTestUtils"; -import { mockNetworkClient } from "../utils/MockNetworkClient"; +} from "./ClientTestUtils.js"; +import { mockNetworkClient } from "../utils/MockNetworkClient.js"; describe("ClientCredentialClient unit tests", () => { let createTokenRequestBodySpy: jest.SpyInstance; diff --git a/lib/msal-node/test/client/ClientTestUtils.ts b/lib/msal-node/test/client/ClientTestUtils.ts index 804571bad4..4c96ebab41 100644 --- a/lib/msal-node/test/client/ClientTestUtils.ts +++ b/lib/msal-node/test/client/ClientTestUtils.ts @@ -43,9 +43,9 @@ import { TEST_DATA_CLIENT_INFO, TEST_POP_VALUES, TEST_TOKENS, -} from "../test_kit/StringConstants"; -import { Configuration } from "../../src/config/Configuration"; -import { TEST_CONSTANTS } from "../utils/TestConstants"; +} from "../test_kit/StringConstants.js"; +import { Configuration } from "../../src/config/Configuration.js"; +import { TEST_CONSTANTS } from "../utils/TestConstants.js"; const ACCOUNT_KEYS = "ACCOUNT_KEYS"; const TOKEN_KEYS = "TOKEN_KEYS"; diff --git a/lib/msal-node/test/client/DeviceCodeClient.spec.ts b/lib/msal-node/test/client/DeviceCodeClient.spec.ts index 2f2b3f7c3b..82502917c2 100644 --- a/lib/msal-node/test/client/DeviceCodeClient.spec.ts +++ b/lib/msal-node/test/client/DeviceCodeClient.spec.ts @@ -1,3 +1,8 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { AuthErrorCodes, BaseClient, @@ -19,10 +24,13 @@ import { CORS_SIMPLE_REQUEST_HEADERS, RANDOM_TEST_GUID, SERVER_UNEXPECTED_ERROR, -} from "../test_kit/StringConstants"; -import { checkMockedNetworkRequest, ClientTestUtils } from "./ClientTestUtils"; -import { DeviceCodeClient } from "../../src"; -import { mockNetworkClient } from "../utils/MockNetworkClient"; +} from "../test_kit/StringConstants.js"; +import { + checkMockedNetworkRequest, + ClientTestUtils, +} from "./ClientTestUtils.js"; +import { DeviceCodeClient } from "../../src/index.js"; +import { mockNetworkClient } from "../utils/MockNetworkClient.js"; describe("DeviceCodeClient unit tests", () => { let createTokenRequestBodySpy: jest.SpyInstance; diff --git a/lib/msal-node/test/client/ManagedIdentitySources/AppService.spec.ts b/lib/msal-node/test/client/ManagedIdentitySources/AppService.spec.ts index a765bfcb37..6fed804be6 100644 --- a/lib/msal-node/test/client/ManagedIdentitySources/AppService.spec.ts +++ b/lib/msal-node/test/client/ManagedIdentitySources/AppService.spec.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. */ -import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication"; +import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication.js"; import { DEFAULT_SYSTEM_ASSIGNED_MANAGED_IDENTITY_AUTHENTICATION_RESULT, DEFAULT_USER_SYSTEM_ASSIGNED_MANAGED_IDENTITY_AUTHENTICATION_RESULT, MANAGED_IDENTITY_APP_SERVICE_NETWORK_REQUEST_400_ERROR, MANAGED_IDENTITY_RESOURCE, -} from "../../test_kit/StringConstants"; +} from "../../test_kit/StringConstants.js"; import { userAssignedClientIdConfig, @@ -17,17 +17,17 @@ import { systemAssignedConfig, networkClient, ManagedIdentityNetworkErrorClient, -} from "../../test_kit/ManagedIdentityTestUtils"; +} from "../../test_kit/ManagedIdentityTestUtils.js"; import { AuthenticationResult, HttpStatus, ServerError, } from "@azure/msal-common"; -import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient"; +import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient.js"; import { ManagedIdentityEnvironmentVariableNames, ManagedIdentitySourceNames, -} from "../../../src/utils/Constants"; +} from "../../../src/utils/Constants.js"; describe("Acquires a token successfully via an App Service Managed Identity", () => { beforeAll(() => { diff --git a/lib/msal-node/test/client/ManagedIdentitySources/AzureArc.spec.ts b/lib/msal-node/test/client/ManagedIdentitySources/AzureArc.spec.ts index 7eb3a69245..117edb861b 100644 --- a/lib/msal-node/test/client/ManagedIdentitySources/AzureArc.spec.ts +++ b/lib/msal-node/test/client/ManagedIdentitySources/AzureArc.spec.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. */ -import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication"; +import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication.js"; import { DEFAULT_SYSTEM_ASSIGNED_MANAGED_IDENTITY_AUTHENTICATION_RESULT, MANAGED_IDENTITY_AZURE_ARC_NETWORK_REQUEST_400_ERROR, @@ -12,7 +12,7 @@ import { MANAGED_IDENTITY_RESOURCE, MANAGED_IDENTITY_RESOURCE_BASE, TEST_TOKENS, -} from "../../test_kit/StringConstants"; +} from "../../test_kit/StringConstants.js"; import { ManagedIdentityNetworkErrorClient, @@ -20,26 +20,26 @@ import { managedIdentityRequestParams, userAssignedClientIdConfig, networkClient, -} from "../../test_kit/ManagedIdentityTestUtils"; +} from "../../test_kit/ManagedIdentityTestUtils.js"; import { AuthenticationResult, HttpStatus, ServerError, } from "@azure/msal-common"; -import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient"; +import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient.js"; import { ManagedIdentityErrorCodes, createManagedIdentityError, -} from "../../../src/error/ManagedIdentityError"; +} from "../../../src/error/ManagedIdentityError.js"; import { ARC_API_VERSION, SUPPORTED_AZURE_ARC_PLATFORMS, -} from "../../../src/client/ManagedIdentitySources/AzureArc"; +} from "../../../src/client/ManagedIdentitySources/AzureArc.js"; import * as fs from "fs"; import { ManagedIdentityEnvironmentVariableNames, ManagedIdentitySourceNames, -} from "../../../src/utils/Constants"; +} from "../../../src/utils/Constants.js"; jest.mock("fs"); diff --git a/lib/msal-node/test/client/ManagedIdentitySources/CloudShell.spec.ts b/lib/msal-node/test/client/ManagedIdentitySources/CloudShell.spec.ts index 64d9b57353..534ae03a01 100644 --- a/lib/msal-node/test/client/ManagedIdentitySources/CloudShell.spec.ts +++ b/lib/msal-node/test/client/ManagedIdentitySources/CloudShell.spec.ts @@ -3,14 +3,14 @@ * Licensed under the MIT License. */ -import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication"; +import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication.js"; import { DEFAULT_SYSTEM_ASSIGNED_MANAGED_IDENTITY_AUTHENTICATION_RESULT, MANAGED_IDENTITY_CLOUD_SHELL_NETWORK_REQUEST_400_ERROR, MANAGED_IDENTITY_RESOURCE, MANAGED_IDENTITY_TOKEN_RETRIEVAL_ERROR, MANAGED_IDENTITY_TOKEN_RETRIEVAL_ERROR_MESSAGE, -} from "../../test_kit/StringConstants"; +} from "../../test_kit/StringConstants.js"; import { userAssignedClientIdConfig, @@ -18,21 +18,21 @@ import { systemAssignedConfig, ManagedIdentityNetworkErrorClient, networkClient, -} from "../../test_kit/ManagedIdentityTestUtils"; +} from "../../test_kit/ManagedIdentityTestUtils.js"; import { AuthenticationResult, HttpStatus, ServerError, } from "@azure/msal-common"; -import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient"; +import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient.js"; import { ManagedIdentityEnvironmentVariableNames, ManagedIdentitySourceNames, -} from "../../../src/utils/Constants"; +} from "../../../src/utils/Constants.js"; import { ManagedIdentityErrorCodes, createManagedIdentityError, -} from "../../../src/error/ManagedIdentityError"; +} from "../../../src/error/ManagedIdentityError.js"; describe("Acquires a token successfully via an App Service Managed Identity", () => { beforeAll(() => { diff --git a/lib/msal-node/test/client/ManagedIdentitySources/Imds.spec.ts b/lib/msal-node/test/client/ManagedIdentitySources/Imds.spec.ts index 2e4318e3eb..5f26efc9cc 100644 --- a/lib/msal-node/test/client/ManagedIdentitySources/Imds.spec.ts +++ b/lib/msal-node/test/client/ManagedIdentitySources/Imds.spec.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. */ -import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication"; -import { ManagedIdentityConfiguration } from "../../../src/config/Configuration"; +import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication.js"; +import { ManagedIdentityConfiguration } from "../../../src/config/Configuration.js"; import { DEFAULT_SYSTEM_ASSIGNED_MANAGED_IDENTITY_AUTHENTICATION_RESULT, DEFAULT_USER_SYSTEM_ASSIGNED_MANAGED_IDENTITY_AUTHENTICATION_RESULT, @@ -17,7 +17,7 @@ import { TEST_CONFIG, THREE_SECONDS_IN_MILLI, getCacheKey, -} from "../../test_kit/StringConstants"; +} from "../../test_kit/StringConstants.js"; import { ManagedIdentityNetworkClient, @@ -26,11 +26,11 @@ import { userAssignedClientIdConfig, managedIdentityRequestParams, systemAssignedConfig, -} from "../../test_kit/ManagedIdentityTestUtils"; +} from "../../test_kit/ManagedIdentityTestUtils.js"; import { DEFAULT_MANAGED_IDENTITY_ID, ManagedIdentitySourceNames, -} from "../../../src/utils/Constants"; +} from "../../../src/utils/Constants.js"; import { AccessTokenEntity, AuthenticationResult, @@ -42,17 +42,17 @@ import { ServerError, TimeUtils, } from "@azure/msal-common"; -import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient"; +import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient.js"; import { ManagedIdentityErrorCodes, createManagedIdentityError, -} from "../../../src/error/ManagedIdentityError"; -import { mockCrypto } from "../ClientTestUtils"; +} from "../../../src/error/ManagedIdentityError.js"; +import { mockCrypto } from "../ClientTestUtils.js"; import { CacheKVStore, ClientCredentialClient, NodeStorage, -} from "../../../src"; +} from "../../../src/index.js"; // NodeJS 16+ provides a built-in version of setTimeout that is promise-based import { setTimeout } from "timers/promises"; diff --git a/lib/msal-node/test/client/ManagedIdentitySources/ServiceFabric.spec.ts b/lib/msal-node/test/client/ManagedIdentitySources/ServiceFabric.spec.ts index 1cc5a0e84f..aa3fee5d71 100644 --- a/lib/msal-node/test/client/ManagedIdentitySources/ServiceFabric.spec.ts +++ b/lib/msal-node/test/client/ManagedIdentitySources/ServiceFabric.spec.ts @@ -3,13 +3,13 @@ * Licensed under the MIT License. */ -import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication"; +import { ManagedIdentityApplication } from "../../../src/client/ManagedIdentityApplication.js"; import { DEFAULT_SYSTEM_ASSIGNED_MANAGED_IDENTITY_AUTHENTICATION_RESULT, DEFAULT_USER_SYSTEM_ASSIGNED_MANAGED_IDENTITY_AUTHENTICATION_RESULT, MANAGED_IDENTITY_RESOURCE, MANAGED_IDENTITY_SERVICE_FABRIC_NETWORK_REQUEST_400_ERROR, -} from "../../test_kit/StringConstants"; +} from "../../test_kit/StringConstants.js"; import { userAssignedClientIdConfig, @@ -17,17 +17,17 @@ import { systemAssignedConfig, ManagedIdentityNetworkErrorClient, networkClient, -} from "../../test_kit/ManagedIdentityTestUtils"; +} from "../../test_kit/ManagedIdentityTestUtils.js"; import { AuthenticationResult, HttpStatus, ServerError, } from "@azure/msal-common"; -import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient"; +import { ManagedIdentityClient } from "../../../src/client/ManagedIdentityClient.js"; import { ManagedIdentityEnvironmentVariableNames, ManagedIdentitySourceNames, -} from "../../../src/utils/Constants"; +} from "../../../src/utils/Constants.js"; describe("Acquires a token successfully via an App Service Managed Identity", () => { beforeAll(() => { diff --git a/lib/msal-node/test/client/OnBehalfOfClient.spec.ts b/lib/msal-node/test/client/OnBehalfOfClient.spec.ts index 33f50a3cdb..f684811d1c 100644 --- a/lib/msal-node/test/client/OnBehalfOfClient.spec.ts +++ b/lib/msal-node/test/client/OnBehalfOfClient.spec.ts @@ -17,21 +17,21 @@ import { ScopeSet, TimeUtils, } from "@azure/msal-common"; -import { AuthenticationResult, OnBehalfOfClient } from "../../src"; +import { AuthenticationResult, OnBehalfOfClient } from "../../src/index.js"; import { AUTHENTICATION_RESULT, CAE_CONSTANTS, DEFAULT_OPENID_CONFIG_RESPONSE, TEST_CONFIG, TEST_TOKENS, -} from "../test_kit/StringConstants"; +} from "../test_kit/StringConstants.js"; import { checkMockedNetworkRequest, ClientTestUtils, getClientAssertionCallback, -} from "./ClientTestUtils"; -import { EncodingUtils } from "../../src/utils/EncodingUtils"; -import { mockNetworkClient } from "../utils/MockNetworkClient"; +} from "./ClientTestUtils.js"; +import { EncodingUtils } from "../../src/utils/EncodingUtils.js"; +import { mockNetworkClient } from "../utils/MockNetworkClient.js"; describe("OnBehalfOf unit tests", () => { let createTokenRequestBodySpy: jest.SpyInstance; diff --git a/lib/msal-node/test/client/PublicClientApplication.spec.ts b/lib/msal-node/test/client/PublicClientApplication.spec.ts index d39bcf7a6c..5cddd3a97f 100644 --- a/lib/msal-node/test/client/PublicClientApplication.spec.ts +++ b/lib/msal-node/test/client/PublicClientApplication.spec.ts @@ -1,3 +1,8 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { ID_TOKEN_CLAIMS, mockNativeAccountInfo, @@ -7,7 +12,7 @@ import { TEST_DATA_CLIENT_INFO, mockAccountInfo, DEFAULT_OPENID_CONFIG_RESPONSE, -} from "../utils/TestConstants"; +} from "../utils/TestConstants.js"; import { AuthenticationResult, AuthorizationCodeClient, @@ -38,23 +43,25 @@ import { AuthorizationUrlRequest, UsernamePasswordRequest, SilentFlowRequest, -} from "../../src"; +} from "../../src/index.js"; import http from "http"; -import * as msalNode from "../../src"; -import { setupServerTelemetryManagerMock } from "./test-fixtures"; -import { getMsalCommonAutoMock, MSALCommonModule } from "../utils/MockUtils"; +import * as msalNode from "../../src/index.js"; +import { setupServerTelemetryManagerMock } from "./test-fixtures.js"; +import { getMsalCommonAutoMock, MSALCommonModule } from "../utils/MockUtils.js"; import { version, name } from "../../package.json"; -import { MockNativeBrokerPlugin } from "../utils/MockNativeBrokerPlugin"; -import { SignOutRequest } from "../../src/request/SignOutRequest"; -import { LoopbackClient } from "../../src/network/LoopbackClient"; -import { createClientAuthError } from "@azure/msal-common/node"; -import { ClientAuthErrorCodes } from "@azure/msal-common/node"; -import { TEST_CONFIG } from "../test_kit/StringConstants"; -import { HttpClient } from "../../src/network/HttpClient"; -import { MockStorageClass } from "./ClientTestUtils"; -import { Constants } from "../../src/utils/Constants"; +import { MockNativeBrokerPlugin } from "../utils/MockNativeBrokerPlugin.js"; +import { SignOutRequest } from "../../src/request/SignOutRequest.js"; +import { LoopbackClient } from "../../src/network/LoopbackClient.js"; +import { + createClientAuthError, + ClientAuthErrorCodes, +} from "@azure/msal-common/node"; +import { TEST_CONFIG } from "../test_kit/StringConstants.js"; +import { HttpClient } from "../../src/network/HttpClient.js"; +import { MockStorageClass } from "./ClientTestUtils.js"; +import { Constants } from "../../src/utils/Constants.js"; const msalCommon: MSALCommonModule = jest.requireActual( "@azure/msal-common/node" diff --git a/lib/msal-node/test/client/UsernamePasswordClient.spec.ts b/lib/msal-node/test/client/UsernamePasswordClient.spec.ts index d4ad46ebef..0f3f0c804b 100644 --- a/lib/msal-node/test/client/UsernamePasswordClient.spec.ts +++ b/lib/msal-node/test/client/UsernamePasswordClient.spec.ts @@ -18,14 +18,14 @@ import { MOCK_USERNAME, RANDOM_TEST_GUID, TEST_CONFIG, -} from "../test_kit/StringConstants"; -import { UsernamePasswordClient } from "../../src"; +} from "../test_kit/StringConstants.js"; +import { UsernamePasswordClient } from "../../src/index.js"; import { ClientTestUtils, checkMockedNetworkRequest, getClientAssertionCallback, -} from "./ClientTestUtils"; -import { mockNetworkClient } from "../utils/MockNetworkClient"; +} from "./ClientTestUtils.js"; +import { mockNetworkClient } from "../utils/MockNetworkClient.js"; describe("Username Password unit tests", () => { let createTokenRequestBodySpy: jest.SpyInstance; diff --git a/lib/msal-node/test/config/ClientConfiguration.spec.ts b/lib/msal-node/test/config/ClientConfiguration.spec.ts index a2bdd85d69..e37cfb5e87 100644 --- a/lib/msal-node/test/config/ClientConfiguration.spec.ts +++ b/lib/msal-node/test/config/ClientConfiguration.spec.ts @@ -1,13 +1,18 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { buildAppConfiguration, Configuration, -} from "../../src/config/Configuration"; -import { HttpClient } from "../../src/network/HttpClient"; +} from "../../src/config/Configuration.js"; +import { HttpClient } from "../../src/network/HttpClient.js"; import { TEST_CONSTANTS, AUTHENTICATION_RESULT, DEFAULT_OPENID_CONFIG_RESPONSE, -} from "../utils/TestConstants"; +} from "../utils/TestConstants.js"; import { LogLevel, NetworkRequestOptions, @@ -16,8 +21,8 @@ import { import { ClientCredentialRequest, ConfidentialClientApplication, -} from "../../src"; -import { OnBehalfOfRequest } from "../../src/request/OnBehalfOfRequest"; +} from "../../src/index.js"; +import { OnBehalfOfRequest } from "../../src/request/OnBehalfOfRequest.js"; import { RANDOM_TEST_GUID } from "../test_kit/StringConstants.js"; describe("ClientConfiguration tests", () => { diff --git a/lib/msal-node/test/crypto/CryptoProvider.spec.ts b/lib/msal-node/test/crypto/CryptoProvider.spec.ts index 4998e5ead3..c3a0606afe 100644 --- a/lib/msal-node/test/crypto/CryptoProvider.spec.ts +++ b/lib/msal-node/test/crypto/CryptoProvider.spec.ts @@ -1,6 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { PkceCodes } from "@azure/msal-common"; -import { CryptoProvider } from "./../../src/index"; -import { GuidGenerator } from "./../../src/crypto/GuidGenerator"; +import { CryptoProvider } from "./../../src/index.js"; +import { GuidGenerator } from "./../../src/crypto/GuidGenerator.js"; describe("CryptoOps", () => { const cryptoOps = new CryptoProvider(); diff --git a/lib/msal-node/test/crypto/GuidGenerator.spec.ts b/lib/msal-node/test/crypto/GuidGenerator.spec.ts index 978dd80540..a1d3272efc 100644 --- a/lib/msal-node/test/crypto/GuidGenerator.spec.ts +++ b/lib/msal-node/test/crypto/GuidGenerator.spec.ts @@ -1,4 +1,9 @@ -import { GuidGenerator } from "./../../src/crypto/GuidGenerator"; +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import { GuidGenerator } from "./../../src/crypto/GuidGenerator.js"; describe("GuidGenerator", () => { // tests correctness of isGuid() diff --git a/lib/msal-node/test/crypto/PkceGenerator.spec.ts b/lib/msal-node/test/crypto/PkceGenerator.spec.ts index 0ab27ddbd7..b2d10f636c 100644 --- a/lib/msal-node/test/crypto/PkceGenerator.spec.ts +++ b/lib/msal-node/test/crypto/PkceGenerator.spec.ts @@ -1,5 +1,10 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import { PkceCodes } from "@azure/msal-common"; -import { PkceGenerator } from "./../../src/crypto/PkceGenerator"; +import { PkceGenerator } from "./../../src/crypto/PkceGenerator.js"; describe("PkceGenerator", () => { const NUM_TESTS = 100; diff --git a/lib/msal-node/test/network/HttpClient.spec.ts b/lib/msal-node/test/network/HttpClient.spec.ts index 1818bbc4aa..537ca68222 100644 --- a/lib/msal-node/test/network/HttpClient.spec.ts +++ b/lib/msal-node/test/network/HttpClient.spec.ts @@ -1,11 +1,16 @@ -import { HttpClient } from "../../src/network/HttpClient"; +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import { HttpClient } from "../../src/network/HttpClient.js"; import { NetworkResponse, NetworkRequestOptions, HttpStatus, } from "@azure/msal-common"; -import { MockedMetadataResponse } from "../utils/TestConstants"; -import { ProxyStatus } from "../../src/utils/Constants"; +import { MockedMetadataResponse } from "../utils/TestConstants.js"; +import { ProxyStatus } from "../../src/utils/Constants.js"; import { UrlToHttpRequestOptions } from "../../src/utils/NetworkUtils.js"; import http from "http"; diff --git a/lib/msal-node/test/test_kit/ManagedIdentityTestUtils.ts b/lib/msal-node/test/test_kit/ManagedIdentityTestUtils.ts index 977b0eae61..4e181c0440 100644 --- a/lib/msal-node/test/test_kit/ManagedIdentityTestUtils.ts +++ b/lib/msal-node/test/test_kit/ManagedIdentityTestUtils.ts @@ -16,10 +16,10 @@ import { MANAGED_IDENTITY_RESOURCE_ID, TEST_TOKENS, TEST_TOKEN_LIFETIMES, -} from "./StringConstants"; -import { ManagedIdentityTokenResponse } from "../../src/response/ManagedIdentityTokenResponse"; -import { ManagedIdentityRequestParams } from "../../src"; -import { ManagedIdentityConfiguration } from "../../src/config/Configuration"; +} from "./StringConstants.js"; +import { ManagedIdentityTokenResponse } from "../../src/response/ManagedIdentityTokenResponse.js"; +import { ManagedIdentityRequestParams } from "../../src/request/ManagedIdentityRequestParams.js"; +import { ManagedIdentityConfiguration } from "../../src/config/Configuration.js"; const EMPTY_HEADERS: Record = {}; diff --git a/lib/msal-node/test/test_kit/StringConstants.ts b/lib/msal-node/test/test_kit/StringConstants.ts index fd9a2b4fda..7c63dfdfa9 100644 --- a/lib/msal-node/test/test_kit/StringConstants.ts +++ b/lib/msal-node/test/test_kit/StringConstants.ts @@ -13,8 +13,8 @@ import { import { DEFAULT_AUTHORITY_FOR_MANAGED_IDENTITY, DEFAULT_MANAGED_IDENTITY_ID, -} from "../../src/utils/Constants"; -import { ManagedIdentityTokenResponse } from "../../src/response/ManagedIdentityTokenResponse"; +} from "../../src/utils/Constants.js"; +import { ManagedIdentityTokenResponse } from "../../src/response/ManagedIdentityTokenResponse.js"; // This file contains the string constants used by the test classes. diff --git a/lib/msal-node/test/utils/EncodingUtils.spec.ts b/lib/msal-node/test/utils/EncodingUtils.spec.ts index 8d4cfdff00..9324b0ef58 100644 --- a/lib/msal-node/test/utils/EncodingUtils.spec.ts +++ b/lib/msal-node/test/utils/EncodingUtils.spec.ts @@ -1,4 +1,9 @@ -import { EncodingUtils } from "../../src/utils/EncodingUtils"; +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + +import { EncodingUtils } from "../../src/utils/EncodingUtils.js"; describe("Base64Decode() tests", () => { describe("test Base64 encode decode", () => { diff --git a/lib/msal-node/test/utils/MockNativeBrokerPlugin.ts b/lib/msal-node/test/utils/MockNativeBrokerPlugin.ts index 4d03f52ae5..95ca48654e 100644 --- a/lib/msal-node/test/utils/MockNativeBrokerPlugin.ts +++ b/lib/msal-node/test/utils/MockNativeBrokerPlugin.ts @@ -11,7 +11,7 @@ import { import { mockNativeAuthenticationResult, mockNativeAccountInfo, -} from "./TestConstants"; +} from "./TestConstants.js"; export class MockNativeBrokerPlugin implements INativeBrokerPlugin { isBrokerAvailable: boolean = true; diff --git a/lib/msal-node/test/utils/MockUtils.ts b/lib/msal-node/test/utils/MockUtils.ts index 25916dd142..c1cd261043 100644 --- a/lib/msal-node/test/utils/MockUtils.ts +++ b/lib/msal-node/test/utils/MockUtils.ts @@ -1,3 +1,8 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */ + import * as msalCommon from "@azure/msal-common"; export type MSALCommonModule = typeof msalCommon; From f70190af83b722f682f171035dd38ee97596c33d Mon Sep 17 00:00:00 2001 From: Robbie Ginsburg Date: Fri, 6 Dec 2024 16:39:52 -0500 Subject: [PATCH 2/3] Change files --- ...ure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@azure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json diff --git a/change/@azure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json b/change/@azure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json new file mode 100644 index 0000000000..86fbbbe47d --- /dev/null +++ b/change/@azure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "Fixed file extentions on imports. Added MS license to all files.", + "packageName": "@azure/msal-node", + "email": "rginsburg@microsoft.com", + "dependentChangeType": "none" +} From ae3800261596a77ab40e8212ac6bff5da450b62d Mon Sep 17 00:00:00 2001 From: Robbie Ginsburg Date: Fri, 6 Dec 2024 16:40:29 -0500 Subject: [PATCH 3/3] beachball --- .../@azure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/change/@azure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json b/change/@azure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json index 86fbbbe47d..0f9f6f3cc6 100644 --- a/change/@azure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json +++ b/change/@azure-msal-node-0b261ae5-3f99-43b5-b087-db1df2648195.json @@ -1,6 +1,6 @@ { "type": "none", - "comment": "Fixed file extentions on imports. Added MS license to all files.", + "comment": "Fixed file extentions on imports. Added MS license to all files. (#7454)", "packageName": "@azure/msal-node", "email": "rginsburg@microsoft.com", "dependentChangeType": "none"