@azure/msal-node 5.0.0-alpha.0 → 5.0.0-beta.0

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.
Files changed (252) hide show
  1. package/dist/cache/CacheHelpers.mjs +1 -1
  2. package/dist/cache/NodeStorage.mjs +1 -1
  3. package/dist/cache/NodeStorage.mjs.map +1 -1
  4. package/dist/cache/TokenCache.mjs +1 -1
  5. package/dist/cache/TokenCache.mjs.map +1 -1
  6. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  7. package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
  8. package/dist/cache/serializer/Deserializer.mjs +1 -1
  9. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  10. package/dist/cache/serializer/Serializer.mjs +1 -1
  11. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  12. package/dist/client/BaseClient.d.ts +42 -0
  13. package/dist/client/BaseClient.d.ts.map +1 -0
  14. package/dist/client/BaseClient.mjs +68 -0
  15. package/dist/client/BaseClient.mjs.map +1 -0
  16. package/dist/client/ClientApplication.mjs +1 -1
  17. package/dist/client/ClientApplication.mjs.map +1 -1
  18. package/dist/client/ClientAssertion.mjs +1 -1
  19. package/dist/client/ClientAssertion.mjs.map +1 -1
  20. package/dist/client/ClientCredentialClient.d.ts +2 -1
  21. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  22. package/dist/client/ClientCredentialClient.mjs +4 -3
  23. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  24. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  25. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  26. package/dist/client/DeviceCodeClient.d.ts +2 -1
  27. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  28. package/dist/client/DeviceCodeClient.mjs +6 -5
  29. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  30. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  31. package/dist/client/ManagedIdentityApplication.mjs.map +1 -1
  32. package/dist/client/ManagedIdentityClient.mjs +1 -1
  33. package/dist/client/ManagedIdentityClient.mjs.map +1 -1
  34. package/dist/client/ManagedIdentitySources/AppService.d.ts +54 -0
  35. package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
  36. package/dist/client/ManagedIdentitySources/AppService.mjs +55 -1
  37. package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -1
  38. package/dist/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
  39. package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
  40. package/dist/client/ManagedIdentitySources/AzureArc.mjs +82 -1
  41. package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -1
  42. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
  43. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
  44. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +81 -1
  45. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
  46. package/dist/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
  47. package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
  48. package/dist/client/ManagedIdentitySources/CloudShell.mjs +55 -1
  49. package/dist/client/ManagedIdentitySources/CloudShell.mjs.map +1 -1
  50. package/dist/client/ManagedIdentitySources/Imds.d.ts +44 -22
  51. package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
  52. package/dist/client/ManagedIdentitySources/Imds.mjs +44 -22
  53. package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
  54. package/dist/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
  55. package/dist/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
  56. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +66 -1
  57. package/dist/client/ManagedIdentitySources/MachineLearning.mjs.map +1 -1
  58. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
  59. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
  60. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +57 -23
  61. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs.map +1 -1
  62. package/dist/client/OnBehalfOfClient.d.ts +2 -1
  63. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  64. package/dist/client/OnBehalfOfClient.mjs +4 -3
  65. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  66. package/dist/client/PublicClientApplication.d.ts.map +1 -1
  67. package/dist/client/PublicClientApplication.mjs +21 -5
  68. package/dist/client/PublicClientApplication.mjs.map +1 -1
  69. package/dist/client/UsernamePasswordClient.d.ts +2 -1
  70. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  71. package/dist/client/UsernamePasswordClient.mjs +4 -3
  72. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  73. package/dist/config/Configuration.d.ts +0 -6
  74. package/dist/config/Configuration.d.ts.map +1 -1
  75. package/dist/config/Configuration.mjs +3 -5
  76. package/dist/config/Configuration.mjs.map +1 -1
  77. package/dist/config/ManagedIdentityId.mjs +1 -1
  78. package/dist/config/ManagedIdentityId.mjs.map +1 -1
  79. package/dist/config/ManagedIdentityRequestParameters.mjs +3 -3
  80. package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
  81. package/dist/crypto/CryptoProvider.mjs +1 -1
  82. package/dist/crypto/CryptoProvider.mjs.map +1 -1
  83. package/dist/crypto/GuidGenerator.mjs +1 -1
  84. package/dist/crypto/GuidGenerator.mjs.map +1 -1
  85. package/dist/crypto/HashUtils.mjs +1 -1
  86. package/dist/crypto/HashUtils.mjs.map +1 -1
  87. package/dist/crypto/PkceGenerator.mjs +1 -1
  88. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  89. package/dist/error/ClientAuthErrorCodes.mjs +1 -1
  90. package/dist/error/ManagedIdentityError.mjs +1 -1
  91. package/dist/error/ManagedIdentityError.mjs.map +1 -1
  92. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  93. package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -1
  94. package/dist/error/NodeAuthError.d.ts +8 -0
  95. package/dist/error/NodeAuthError.d.ts.map +1 -1
  96. package/dist/error/NodeAuthError.mjs +11 -1
  97. package/dist/error/NodeAuthError.mjs.map +1 -1
  98. package/dist/index.d.ts +0 -6
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.mjs +1 -7
  101. package/dist/index.mjs.map +1 -1
  102. package/dist/internals.mjs +1 -1
  103. package/dist/network/HttpClient.d.ts +54 -14
  104. package/dist/network/HttpClient.d.ts.map +1 -1
  105. package/dist/network/HttpClient.mjs +140 -262
  106. package/dist/network/HttpClient.mjs.map +1 -1
  107. package/dist/network/HttpClientWithRetries.mjs +1 -1
  108. package/dist/network/HttpClientWithRetries.mjs.map +1 -1
  109. package/dist/network/LoopbackClient.mjs +1 -1
  110. package/dist/network/LoopbackClient.mjs.map +1 -1
  111. package/dist/packageMetadata.d.ts +1 -1
  112. package/dist/packageMetadata.d.ts.map +1 -1
  113. package/dist/packageMetadata.mjs +2 -2
  114. package/dist/protocol/Authorize.mjs +2 -2
  115. package/dist/protocol/Authorize.mjs.map +1 -1
  116. package/dist/request/AuthorizationCodeRequest.d.ts +2 -1
  117. package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
  118. package/dist/request/AuthorizationUrlRequest.d.ts +2 -2
  119. package/dist/request/ClientCredentialRequest.d.ts +0 -1
  120. package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
  121. package/dist/request/CommonClientCredentialRequest.d.ts +3 -2
  122. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  123. package/dist/request/CommonDeviceCodeRequest.d.ts +3 -2
  124. package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  125. package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -2
  126. package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  127. package/dist/request/CommonUsernamePasswordRequest.d.ts +2 -1
  128. package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  129. package/dist/request/InteractiveRequest.d.ts +1 -1
  130. package/dist/request/InteractiveRequest.d.ts.map +1 -1
  131. package/dist/request/OnBehalfOfRequest.d.ts +0 -1
  132. package/dist/request/OnBehalfOfRequest.d.ts.map +1 -1
  133. package/dist/request/RefreshTokenRequest.d.ts +2 -1
  134. package/dist/request/RefreshTokenRequest.d.ts.map +1 -1
  135. package/dist/request/SilentFlowRequest.d.ts +2 -1
  136. package/dist/request/SilentFlowRequest.d.ts.map +1 -1
  137. package/dist/request/UsernamePasswordRequest.d.ts +2 -1
  138. package/dist/request/UsernamePasswordRequest.d.ts.map +1 -1
  139. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
  140. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs.map +1 -1
  141. package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
  142. package/dist/retry/ExponentialRetryStrategy.mjs.map +1 -1
  143. package/dist/retry/ImdsRetryPolicy.mjs +1 -1
  144. package/dist/retry/ImdsRetryPolicy.mjs.map +1 -1
  145. package/dist/retry/LinearRetryStrategy.mjs +1 -1
  146. package/dist/retry/LinearRetryStrategy.mjs.map +1 -1
  147. package/dist/utils/Constants.d.ts +2 -9
  148. package/dist/utils/Constants.d.ts.map +1 -1
  149. package/dist/utils/Constants.mjs +4 -12
  150. package/dist/utils/Constants.mjs.map +1 -1
  151. package/dist/utils/EncodingUtils.mjs +1 -1
  152. package/dist/utils/EncodingUtils.mjs.map +1 -1
  153. package/dist/utils/TimeUtils.mjs +1 -1
  154. package/dist/utils/TimeUtils.mjs.map +1 -1
  155. package/lib/msal-node.cjs +5747 -5335
  156. package/lib/msal-node.cjs.map +1 -1
  157. package/lib/types/client/BaseClient.d.ts +42 -0
  158. package/lib/types/client/BaseClient.d.ts.map +1 -0
  159. package/lib/types/client/ClientCredentialClient.d.ts +2 -1
  160. package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
  161. package/lib/types/client/DeviceCodeClient.d.ts +2 -1
  162. package/lib/types/client/DeviceCodeClient.d.ts.map +1 -1
  163. package/lib/types/client/ManagedIdentitySources/AppService.d.ts +54 -0
  164. package/lib/types/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
  165. package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
  166. package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
  167. package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
  168. package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
  169. package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
  170. package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
  171. package/lib/types/client/ManagedIdentitySources/Imds.d.ts +44 -22
  172. package/lib/types/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
  173. package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
  174. package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
  175. package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
  176. package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
  177. package/lib/types/client/OnBehalfOfClient.d.ts +2 -1
  178. package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -1
  179. package/lib/types/client/PublicClientApplication.d.ts.map +1 -1
  180. package/lib/types/client/UsernamePasswordClient.d.ts +2 -1
  181. package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
  182. package/lib/types/config/Configuration.d.ts +0 -6
  183. package/lib/types/config/Configuration.d.ts.map +1 -1
  184. package/lib/types/error/NodeAuthError.d.ts +8 -0
  185. package/lib/types/error/NodeAuthError.d.ts.map +1 -1
  186. package/lib/types/index.d.ts +0 -6
  187. package/lib/types/index.d.ts.map +1 -1
  188. package/lib/types/network/HttpClient.d.ts +54 -14
  189. package/lib/types/network/HttpClient.d.ts.map +1 -1
  190. package/lib/types/packageMetadata.d.ts +1 -1
  191. package/lib/types/packageMetadata.d.ts.map +1 -1
  192. package/lib/types/request/AuthorizationCodeRequest.d.ts +2 -1
  193. package/lib/types/request/AuthorizationCodeRequest.d.ts.map +1 -1
  194. package/lib/types/request/AuthorizationUrlRequest.d.ts +2 -2
  195. package/lib/types/request/ClientCredentialRequest.d.ts +0 -1
  196. package/lib/types/request/ClientCredentialRequest.d.ts.map +1 -1
  197. package/lib/types/request/CommonClientCredentialRequest.d.ts +3 -2
  198. package/lib/types/request/CommonClientCredentialRequest.d.ts.map +1 -1
  199. package/lib/types/request/CommonDeviceCodeRequest.d.ts +3 -2
  200. package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  201. package/lib/types/request/CommonOnBehalfOfRequest.d.ts +1 -2
  202. package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  203. package/lib/types/request/CommonUsernamePasswordRequest.d.ts +2 -1
  204. package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  205. package/lib/types/request/InteractiveRequest.d.ts +1 -1
  206. package/lib/types/request/InteractiveRequest.d.ts.map +1 -1
  207. package/lib/types/request/OnBehalfOfRequest.d.ts +0 -1
  208. package/lib/types/request/OnBehalfOfRequest.d.ts.map +1 -1
  209. package/lib/types/request/RefreshTokenRequest.d.ts +2 -1
  210. package/lib/types/request/RefreshTokenRequest.d.ts.map +1 -1
  211. package/lib/types/request/SilentFlowRequest.d.ts +2 -1
  212. package/lib/types/request/SilentFlowRequest.d.ts.map +1 -1
  213. package/lib/types/request/UsernamePasswordRequest.d.ts +2 -1
  214. package/lib/types/request/UsernamePasswordRequest.d.ts.map +1 -1
  215. package/lib/types/utils/Constants.d.ts +2 -9
  216. package/lib/types/utils/Constants.d.ts.map +1 -1
  217. package/package.json +88 -88
  218. package/src/client/BaseClient.ts +158 -0
  219. package/src/client/ClientCredentialClient.ts +2 -3
  220. package/src/client/DeviceCodeClient.ts +4 -5
  221. package/src/client/ManagedIdentitySources/AppService.ts +54 -0
  222. package/src/client/ManagedIdentitySources/AzureArc.ts +81 -0
  223. package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +92 -2
  224. package/src/client/ManagedIdentitySources/CloudShell.ts +54 -0
  225. package/src/client/ManagedIdentitySources/Imds.ts +43 -21
  226. package/src/client/ManagedIdentitySources/MachineLearning.ts +65 -0
  227. package/src/client/ManagedIdentitySources/ServiceFabric.ts +56 -22
  228. package/src/client/OnBehalfOfClient.ts +2 -3
  229. package/src/client/PublicClientApplication.ts +22 -4
  230. package/src/client/UsernamePasswordClient.ts +2 -3
  231. package/src/config/Configuration.ts +2 -14
  232. package/src/config/ManagedIdentityRequestParameters.ts +2 -2
  233. package/src/error/NodeAuthError.ts +14 -0
  234. package/src/index.ts +0 -8
  235. package/src/network/HttpClient.ts +166 -372
  236. package/src/packageMetadata.ts +1 -1
  237. package/src/protocol/Authorize.ts +1 -1
  238. package/src/request/AuthorizationCodeRequest.ts +2 -1
  239. package/src/request/AuthorizationUrlRequest.ts +2 -2
  240. package/src/request/ClientCredentialRequest.ts +0 -1
  241. package/src/request/CommonClientCredentialRequest.ts +6 -2
  242. package/src/request/CommonDeviceCodeRequest.ts +3 -6
  243. package/src/request/CommonOnBehalfOfRequest.ts +4 -2
  244. package/src/request/CommonUsernamePasswordRequest.ts +2 -1
  245. package/src/request/InteractiveRequest.ts +1 -4
  246. package/src/request/OnBehalfOfRequest.ts +0 -1
  247. package/src/request/RefreshTokenRequest.ts +2 -1
  248. package/src/request/SilentFlowRequest.ts +2 -1
  249. package/src/request/UsernamePasswordRequest.ts +2 -1
  250. package/src/utils/Constants.ts +2 -11
  251. package/dist/utils/NetworkUtils.mjs +0 -43
  252. package/dist/utils/NetworkUtils.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v5.0.0-alpha.0 2025-10-02 */
1
+ /*! @azure/msal-node v5.0.0-beta.0 2025-12-05 */
2
2
  'use strict';
3
3
  import { ManagedIdentityRequestParameters } from '../../config/ManagedIdentityRequestParameters.mjs';
4
4
  import { BaseManagedIdentitySource } from './BaseManagedIdentitySource.mjs';
@@ -14,33 +14,44 @@ const IMDS_TOKEN_PATH = "/metadata/identity/oauth2/token";
14
14
  const DEFAULT_IMDS_ENDPOINT = `http://169.254.169.254${IMDS_TOKEN_PATH}`;
15
15
  const IMDS_API_VERSION = "2018-02-01";
16
16
  /**
17
+ * Managed Identity source implementation for Azure Instance Metadata Service (IMDS).
18
+ *
19
+ * IMDS is available on Azure Virtual Machines and Virtual Machine Scale Sets and provides
20
+ * a REST endpoint to obtain OAuth tokens for managed identities. This implementation
21
+ * handles both system-assigned and user-assigned managed identities.
22
+ *
17
23
  * Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/ImdsManagedIdentitySource.cs
18
24
  */
19
25
  class Imds extends BaseManagedIdentitySource {
20
26
  /**
21
- * Constructs an Imds instance.
22
- * @param logger - Logger instance for logging.
23
- * @param nodeStorage - NodeStorage instance for caching.
24
- * @param networkClient - Network client for HTTP requests.
25
- * @param cryptoProvider - CryptoProvider for cryptographic operations.
26
- * @param disableInternalRetries - Whether to disable internal retry logic.
27
- * @param identityEndpoint - The IMDS endpoint to use.
27
+ * Constructs an Imds instance with the specified configuration.
28
+ *
29
+ * @param logger - Logger instance for recording debug information and errors
30
+ * @param nodeStorage - NodeStorage instance used for token caching operations
31
+ * @param networkClient - Network client implementation for making HTTP requests to IMDS
32
+ * @param cryptoProvider - CryptoProvider for generating correlation IDs and other cryptographic operations
33
+ * @param disableInternalRetries - When true, disables the built-in retry logic for IMDS requests
34
+ * @param identityEndpoint - The complete IMDS endpoint URL including the token path
28
35
  */
29
36
  constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint) {
30
37
  super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
31
38
  this.identityEndpoint = identityEndpoint;
32
39
  }
33
40
  /**
34
- * Attempts to create an Imds instance by determining the correct endpoint.
35
- * If the AZURE_POD_IDENTITY_AUTHORITY_HOST environment variable is set, it uses that as the endpoint.
36
- * Otherwise, it falls back to the default IMDS endpoint.
41
+ * Creates an Imds instance with the appropriate endpoint configuration.
42
+ *
43
+ * This method checks for the presence of the AZURE_POD_IDENTITY_AUTHORITY_HOST environment
44
+ * variable, which is used in Azure Kubernetes Service (AKS) environments with Azure AD
45
+ * Pod Identity. If found, it uses that endpoint; otherwise, it falls back to the standard
46
+ * IMDS endpoint (169.254.169.254).
47
+ *
48
+ * @param logger - Logger instance for recording endpoint discovery and validation
49
+ * @param nodeStorage - NodeStorage instance for token caching
50
+ * @param networkClient - Network client for HTTP requests
51
+ * @param cryptoProvider - CryptoProvider for cryptographic operations
52
+ * @param disableInternalRetries - Whether to disable built-in retry logic
37
53
  *
38
- * @param logger - Logger instance for logging.
39
- * @param nodeStorage - NodeStorage instance for caching.
40
- * @param networkClient - Network client for HTTP requests.
41
- * @param cryptoProvider - CryptoProvider for cryptographic operations.
42
- * @param disableInternalRetries - Whether to disable internal retry logic.
43
- * @returns An instance of Imds configured with the appropriate endpoint.
54
+ * @returns A configured Imds instance ready to make token requests
44
55
  */
45
56
  static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries) {
46
57
  let validatedIdentityEndpoint;
@@ -58,12 +69,23 @@ class Imds extends BaseManagedIdentitySource {
58
69
  return new Imds(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, validatedIdentityEndpoint);
59
70
  }
60
71
  /**
61
- * Creates a ManagedIdentityRequestParameters object for acquiring a token from IMDS.
62
- * Sets the required headers and query parameters for the IMDS token request.
72
+ * Creates a properly configured HTTP request for acquiring an access token from IMDS.
73
+ *
74
+ * This method builds a complete request object with all necessary headers, query parameters,
75
+ * and retry policies required by the Azure Instance Metadata Service.
76
+ *
77
+ * Key request components:
78
+ * - HTTP GET method to the IMDS token endpoint
79
+ * - Metadata header set to "true" (required by IMDS)
80
+ * - API version parameter (currently "2018-02-01")
81
+ * - Resource parameter specifying the target audience
82
+ * - Identity-specific parameters for user-assigned managed identities
83
+ * - IMDS-specific retry policy
84
+ *
85
+ * @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
86
+ * @param managedIdentityId - The managed identity configuration specifying whether to use system-assigned or user-assigned identity
63
87
  *
64
- * @param resource - The resource URI for which the token is requested.
65
- * @param managedIdentityId - The managed identity ID (system-assigned or user-assigned).
66
- * @returns A ManagedIdentityRequestParameters object configured for IMDS.
88
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
67
89
  */
68
90
  createRequest(resource, managedIdentityId) {
69
91
  const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.identityEndpoint);
@@ -1 +1 @@
1
- {"version":3,"file":"Imds.mjs","sources":["../../../src/client/ManagedIdentitySources/Imds.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AAkBH;AAEA,MAAM,eAAe,GAAW,iCAAiC,CAAC;AAClE,MAAM,qBAAqB,GAAW,CAAA,sBAAA,EAAyB,eAAe,EAAE,CAAC;AACjF,MAAM,gBAAgB,GAAW,YAAY,CAAC;AAE9C;;AAEG;AACG,MAAO,IAAK,SAAQ,yBAAyB,CAAA;AAG/C;;;;;;;;AAQG;IACH,WAAA,CACI,MAAc,EACd,WAAwB,EACxB,aAA6B,EAC7B,cAA8B,EAC9B,sBAA+B,EAC/B,gBAAwB,EAAA;QAExB,KAAK,CACD,MAAM,EACN,WAAW,EACX,aAAa,EACb,cAAc,EACd,sBAAsB,CACzB,CAAC;AAEF,QAAA,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC7C,CAAC;AAED;;;;;;;;;;;AAWG;IACI,OAAO,SAAS,CACnB,MAAc,EACd,WAAwB,EACxB,aAA6B,EAC7B,cAA8B,EAC9B,sBAA+B,EAAA;AAE/B,QAAA,IAAI,yBAAiC,CAAC;AAEtC,QAAA,I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AA,OAAO,CAAC,eAAe,CAAC,8BAA8B,CAAC,QAAQ,CAAC;AAC5D,YAAA,QAAQ,CAAC;AAEb,QAAA,IACI,iBAAiB,CAAC,MAAM,KAAK,qBAAqB,CAAC,eAAe,EACpE;AACE,YAAA,OAAO,CAAC,eAAe,CACnB,IAAI,CAAC,iDAAiD,CAClD,iBAAiB,CAAC,MAAM,EACxB,IAAI;AACP,aAAA,CACJ,GAAG,iBAAiB,CAAC,EAAE,CAAC;AAC5B,QAAA,CAAA;;AAID,QAAA,OAAO,CAAC,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;AAE5C,QAAA,OAAO,OAAO,CAAC;IACnB,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"Imds.mjs","sources":["../../../src/client/ManagedIdentitySources/Imds.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AAkBH;AAEA,MAAM,eAAe,GAAW,iCAAiC,CAAC;AAClE,MAAM,qBAAqB,GAAW,CAAyB,sBAAA,EAAA,eAAe,EAAE,CAAC;AACjF,MAAM,gBAAgB,GAAW,YAAY,CAAC;AAE9C;;;;;;;;AAQG;AACG,MAAO,IAAK,SAAQ,yBAAyB,CAAA;AAG/C;;;;;;;;;AASG;IACH,WACI,CAAA,MAAc,EACd,WAAwB,EACxB,aAA6B,EAC7B,cAA8B,EAC9B,sBAA+B,EAC/B,gBAAwB,EAAA;QAExB,KAAK,CACD,MAAM,EACN,WAAW,EACX,aAAa,EACb,cAAc,EACd,sBAAsB,CACzB,CAAC;AAEF,QAAA,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;KAC5C;AAED;;;;;;;;;;;;;;;AAeG;IACI,OAAO,SAAS,CACnB,MAAc,EACd,WAAwB,EACxB,aAA6B,EAC7B,cAA8B,EAC9B,sBAA+B,EAAA;AAE/B,QAAA,IAAI,yBAAiC,CAAC;AAEtC,QAAA,IACI,OAAO,CAAC,GAAG,CACP,uCAAuC;AAClC,aAAA,iCAAiC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C5D,YAAA,QAAQ,CAAC;AAEb,QAAA,IACI,iBAAiB,CAAC,MAAM,KAAK,qBAAqB,CAAC,eAAe,EACpE;AACE,YAAA,OAAO,CAAC,eAAe,CACnB,IAAI,CAAC,iDAAiD,CAClD,iBAAiB,CAAC,MAAM,EACxB,IAAI;AACP,aAAA,CACJ,GAAG,iBAAiB,CAAC,EAAE,CAAC;AAC5B,SAAA;;AAID,QAAA,OAAO,CAAC,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;AAE5C,QAAA,OAAO,OAAO,CAAC;KAClB;AACJ;;;;"}
@@ -5,12 +5,77 @@ import { ManagedIdentityRequestParameters } from "../../config/ManagedIdentityRe
5
5
  import { ManagedIdentityId } from "../../config/ManagedIdentityId.js";
6
6
  import { NodeStorage } from "../../cache/NodeStorage.js";
7
7
  export declare const MANAGED_IDENTITY_MACHINE_LEARNING_UNSUPPORTED_ID_TYPE_ERROR: string;
8
+ /**
9
+ * Machine Learning Managed Identity Source implementation for Azure Machine Learning environments.
10
+ *
11
+ * This class handles managed identity authentication specifically for Azure Machine Learning services.
12
+ * It supports both system-assigned and user-assigned managed identities, using the MSI_ENDPOINT
13
+ * and MSI_SECRET environment variables that are automatically provided in Azure ML environments.
14
+ */
8
15
  export declare class MachineLearning extends BaseManagedIdentitySource {
9
16
  private msiEndpoint;
10
17
  private secret;
18
+ /**
19
+ * Creates a new MachineLearning managed identity source instance.
20
+ *
21
+ * @param logger - Logger instance for diagnostic information
22
+ * @param nodeStorage - Node storage implementation for caching
23
+ * @param networkClient - Network client for making HTTP requests
24
+ * @param cryptoProvider - Cryptographic operations provider
25
+ * @param disableInternalRetries - Whether to disable automatic request retries
26
+ * @param msiEndpoint - The MSI endpoint URL from environment variables
27
+ * @param secret - The MSI secret from environment variables
28
+ */
11
29
  constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean, msiEndpoint: string, secret: string);
30
+ /**
31
+ * Retrieves the required environment variables for Azure Machine Learning managed identity.
32
+ *
33
+ * This method checks for the presence of MSI_ENDPOINT and MSI_SECRET environment variables
34
+ * that are automatically set by the Azure Machine Learning platform when managed identity
35
+ * is enabled for the compute instance or cluster.
36
+ *
37
+ * @returns An array containing [msiEndpoint, secret] where either value may be undefined
38
+ * if the corresponding environment variable is not set
39
+ */
12
40
  static getEnvironmentVariables(): Array<string | undefined>;
41
+ /**
42
+ * Attempts to create a MachineLearning managed identity source.
43
+ *
44
+ * This method validates the Azure Machine Learning environment by checking for the required
45
+ * MSI_ENDPOINT and MSI_SECRET environment variables. If both are present and valid,
46
+ * it creates and returns a MachineLearning instance. If either is missing or invalid,
47
+ * it returns null, indicating that this managed identity source is not available
48
+ * in the current environment.
49
+ *
50
+ * @param logger - Logger instance for diagnostic information
51
+ * @param nodeStorage - Node storage implementation for caching
52
+ * @param networkClient - Network client for making HTTP requests
53
+ * @param cryptoProvider - Cryptographic operations provider
54
+ * @param disableInternalRetries - Whether to disable automatic request retries
55
+ *
56
+ * @returns A new MachineLearning instance if the environment is valid, null otherwise
57
+ */
13
58
  static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean): MachineLearning | null;
59
+ /**
60
+ * Creates a managed identity token request for Azure Machine Learning environments.
61
+ *
62
+ * This method constructs the HTTP request parameters needed to acquire an access token
63
+ * from the Azure Machine Learning managed identity endpoint. It handles both system-assigned
64
+ * and user-assigned managed identities with specific logic for each type:
65
+ *
66
+ * - System-assigned: Uses the DEFAULT_IDENTITY_CLIENT_ID environment variable
67
+ * - User-assigned: Only supports client ID-based identification (not object ID or resource ID)
68
+ *
69
+ * The request uses the 2017-09-01 API version and includes the required secret header
70
+ * for authentication with the MSI endpoint.
71
+ *
72
+ * @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
73
+ * @param managedIdentityId - The managed identity configuration specifying whether to use system-assigned or user-assigned identity
74
+ *
75
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
76
+ *
77
+ * @throws Error if an unsupported managed identity ID type is specified (only client ID is supported for user-assigned)
78
+ */
14
79
  createRequest(resource: string, managedIdentityId: ManagedIdentityId): ManagedIdentityRequestParameters;
15
80
  }
16
81
  //# sourceMappingURL=MachineLearning.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MachineLearning.d.ts","sourceRoot":"","sources":["../../../src/client/ManagedIdentitySources/MachineLearning.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACH,yBAAyB,EAE5B,MAAM,gCAAgC,CAAC;AASxC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIzD,eAAO,MAAM,2DAA2D,QAAsH,CAAC;AAE/L,qBAAa,eAAgB,SAAQ,yBAAyB;IAC1D,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,MAAM,CAAS;gBAGnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM;WAcJ,uBAAuB,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;WAUpD,SAAS,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,GAChC,eAAe,GAAG,IAAI;IAoClB,aAAa,CAChB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,iBAAiB,GACrC,gCAAgC;CA8CtC"}
1
+ {"version":3,"file":"MachineLearning.d.ts","sourceRoot":"","sources":["../../../src/client/ManagedIdentitySources/MachineLearning.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACH,yBAAyB,EAE5B,MAAM,gCAAgC,CAAC;AASxC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIzD,eAAO,MAAM,2DAA2D,QAAsH,CAAC;AAE/L;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,yBAAyB;IAC1D,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;;;;;;;OAUG;gBAEC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM;IAclB;;;;;;;;;OASG;WACW,uBAAuB,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAUlE;;;;;;;;;;;;;;;;OAgBG;WACW,SAAS,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,GAChC,eAAe,GAAG,IAAI;IAoCzB;;;;;;;;;;;;;;;;;;;OAmBG;IACI,aAAa,CAChB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,iBAAiB,GACrC,gCAAgC;CA8CtC"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v5.0.0-alpha.0 2025-10-02 */
1
+ /*! @azure/msal-node v5.0.0-beta.0 2025-12-05 */
2
2
  'use strict';
3
3
  import { BaseManagedIdentitySource, ManagedIdentityUserAssignedIdQueryParameterNames } from './BaseManagedIdentitySource.mjs';
4
4
  import { ManagedIdentityEnvironmentVariableNames, ManagedIdentitySourceNames, ManagedIdentityHeaders, ManagedIdentityQueryParameters, ManagedIdentityIdType, HttpMethod } from '../../utils/Constants.mjs';
@@ -10,17 +10,62 @@ import { ManagedIdentityRequestParameters } from '../../config/ManagedIdentityRe
10
10
  */
11
11
  const MACHINE_LEARNING_MSI_API_VERSION = "2017-09-01";
12
12
  const MANAGED_IDENTITY_MACHINE_LEARNING_UNSUPPORTED_ID_TYPE_ERROR = `Only client id is supported for user-assigned managed identity in ${ManagedIdentitySourceNames.MACHINE_LEARNING}.`; // referenced in unit test
13
+ /**
14
+ * Machine Learning Managed Identity Source implementation for Azure Machine Learning environments.
15
+ *
16
+ * This class handles managed identity authentication specifically for Azure Machine Learning services.
17
+ * It supports both system-assigned and user-assigned managed identities, using the MSI_ENDPOINT
18
+ * and MSI_SECRET environment variables that are automatically provided in Azure ML environments.
19
+ */
13
20
  class MachineLearning extends BaseManagedIdentitySource {
21
+ /**
22
+ * Creates a new MachineLearning managed identity source instance.
23
+ *
24
+ * @param logger - Logger instance for diagnostic information
25
+ * @param nodeStorage - Node storage implementation for caching
26
+ * @param networkClient - Network client for making HTTP requests
27
+ * @param cryptoProvider - Cryptographic operations provider
28
+ * @param disableInternalRetries - Whether to disable automatic request retries
29
+ * @param msiEndpoint - The MSI endpoint URL from environment variables
30
+ * @param secret - The MSI secret from environment variables
31
+ */
14
32
  constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, msiEndpoint, secret) {
15
33
  super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
16
34
  this.msiEndpoint = msiEndpoint;
17
35
  this.secret = secret;
18
36
  }
37
+ /**
38
+ * Retrieves the required environment variables for Azure Machine Learning managed identity.
39
+ *
40
+ * This method checks for the presence of MSI_ENDPOINT and MSI_SECRET environment variables
41
+ * that are automatically set by the Azure Machine Learning platform when managed identity
42
+ * is enabled for the compute instance or cluster.
43
+ *
44
+ * @returns An array containing [msiEndpoint, secret] where either value may be undefined
45
+ * if the corresponding environment variable is not set
46
+ */
19
47
  static getEnvironmentVariables() {
20
48
  const msiEndpoint = process.env[ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT];
21
49
  const secret = process.env[ManagedIdentityEnvironmentVariableNames.MSI_SECRET];
22
50
  return [msiEndpoint, secret];
23
51
  }
52
+ /**
53
+ * Attempts to create a MachineLearning managed identity source.
54
+ *
55
+ * This method validates the Azure Machine Learning environment by checking for the required
56
+ * MSI_ENDPOINT and MSI_SECRET environment variables. If both are present and valid,
57
+ * it creates and returns a MachineLearning instance. If either is missing or invalid,
58
+ * it returns null, indicating that this managed identity source is not available
59
+ * in the current environment.
60
+ *
61
+ * @param logger - Logger instance for diagnostic information
62
+ * @param nodeStorage - Node storage implementation for caching
63
+ * @param networkClient - Network client for making HTTP requests
64
+ * @param cryptoProvider - Cryptographic operations provider
65
+ * @param disableInternalRetries - Whether to disable automatic request retries
66
+ *
67
+ * @returns A new MachineLearning instance if the environment is valid, null otherwise
68
+ */
24
69
  static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries) {
25
70
  const [msiEndpoint, secret] = MachineLearning.getEnvironmentVariables();
26
71
  // if either of the MSI endpoint or MSI secret variables are undefined, this MSI provider is unavailable.
@@ -32,6 +77,26 @@ class MachineLearning extends BaseManagedIdentitySource {
32
77
  logger.info(`[Managed Identity] Environment variables validation passed for ${ManagedIdentitySourceNames.MACHINE_LEARNING} managed identity. Endpoint URI: ${validatedMsiEndpoint}. Creating ${ManagedIdentitySourceNames.MACHINE_LEARNING} managed identity.`, "");
33
78
  return new MachineLearning(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, msiEndpoint, secret);
34
79
  }
80
+ /**
81
+ * Creates a managed identity token request for Azure Machine Learning environments.
82
+ *
83
+ * This method constructs the HTTP request parameters needed to acquire an access token
84
+ * from the Azure Machine Learning managed identity endpoint. It handles both system-assigned
85
+ * and user-assigned managed identities with specific logic for each type:
86
+ *
87
+ * - System-assigned: Uses the DEFAULT_IDENTITY_CLIENT_ID environment variable
88
+ * - User-assigned: Only supports client ID-based identification (not object ID or resource ID)
89
+ *
90
+ * The request uses the 2017-09-01 API version and includes the required secret header
91
+ * for authentication with the MSI endpoint.
92
+ *
93
+ * @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
94
+ * @param managedIdentityId - The managed identity configuration specifying whether to use system-assigned or user-assigned identity
95
+ *
96
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
97
+ *
98
+ * @throws Error if an unsupported managed identity ID type is specified (only client ID is supported for user-assigned)
99
+ */
35
100
  createRequest(resource, managedIdentityId) {
36
101
  const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.msiEndpoint);
37
102
  request.headers[ManagedIdentityHeaders.METADATA_HEADER_NAME] = "true";
@@ -1 +1 @@
1
- {"version":3,"file":"MachineLearning.mjs","sources":["../../../src/client/ManagedIdentitySources/MachineLearning.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAoBH,MAAM,gCAAgC,GAAW,YAAY,CAAC;AAEvD,MAAM,2DAA2D,GAAG,CAAA,kEAAA,EAAqE,0BAA0B,CAAC,gBAAgB,CAAA,CAAA,EAAI;AAEzL,MAAO,eAAgB,SAAQ,yBAAyB,CAAA;AAI1D,IAAA,WAAA,CACI,MAAc,EACd,WAAwB,EACxB,aAA6B,EAC7B,cAA8B,EAC9B,sBAA+B,EAC/B,WAAmB,EACnB,MAAc,EAAA;QAEd,KAAK,CACD,MAAM,EACN,WAAW,EACX,aAAa,EACb,cAAc,EACd,sBAAsB,CACzB,CAAC;AAEF,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;AAC/B,QA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CAChB,QAAgB,EAChB,iBAAoC,EAAA;AAEpC,QAAA,MAAM,OAAO,GACT,IAAI,gCAAgC,CAChC,UAAU,CAAC,GAAG,EACd,IAAI,CAAC,WAAW,CACnB,CAAC;QAEN,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAAC;AACtE,QAAA,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,4BAA4B,CAAC;YAChE,IAAI,CAAC,MAAM,CAAC;AAEhB,QAAA,OAAO,CAAC,eAAe,CAAC,8BAA8B,CAAC,WAAW,CAAC;AAC/D,YAAA,gCAAgC,CAAC;AACrC,QAAA,OAAO,CAAC,eAAe,CAAC,8BAA8B,CAAC,QAAQ,CAAC;AAC5D,YAAA,QAAQ,CAAC;AAEb,QAAA,IACI,iBAAiB,CAAC,MAAM,KAAK,qBAAqB,CAAC,eAAe,EACpE;AACE,YAAA,OAAO,CAAC,eAAe,CACnB,gDAAgD,CAAC,+BAA+B,CACnF,GAAG,OAAO,CAAC,GAAG,CACX,uCAAuC;iBAClC,0BAA0B,CACxB,CAAC;AACf,QAAA,CAAA;aAAM,IACH,iBAAiB,CAAC,MAAM;YACxB,qBAAqB,CAAC,uBAAuB,EAC/C;AACE,YAAA,OAAO,CAAC,eAAe,CACnB,IAAI,CAAC,iDAAiD,CAClD,iBAAiB,CAAC,MAAM,EACxB,KAAK;AACL,YAAA,IAAI;AACP,aAAA,CACJ,GAAG,iBAAiB,CAAC,EAAE,CAAC;AAC5B,QAAA,CAAA;AAAM,aAAA;AACH,YAAA,MAAM,IAAI,KAAK,CACX,2DAA2D,CAC9D,CAAC;AACL,QAAA,CAAA;;AAID,QAAA,OAAO,OAAO,CAAC;IACnB,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"MachineLearning.mjs","sources":["../../../src/client/ManagedIdentitySources/MachineLearning.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAoBH,MAAM,gCAAgC,G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xB,qBAAqB,CAAC,uBAAuB,EAC/C;AACE,YAAA,OAAO,CAAC,eAAe,CACnB,IAAI,CAAC,iDAAiD,CAClD,iBAAiB,CAAC,MAAM,EACxB,KAAK;AACL,YAAA,IAAI;AACP,aAAA,CACJ,GAAG,iBAAiB,CAAC,EAAE,CAAC;AAC5B,SAAA;AAAM,aAAA;AACH,YAAA,MAAM,IAAI,KAAK,CACX,2DAA2D,CAC9D,CAAC;AACL,SAAA;;AAID,QAAA,OAAO,OAAO,CAAC;KAClB;AACJ;;;;"}
@@ -11,37 +11,71 @@ export declare class ServiceFabric extends BaseManagedIdentitySource {
11
11
  private identityEndpoint;
12
12
  private identityHeader;
13
13
  /**
14
- * Constructs a new ServiceFabric managed identity source.
15
- * @param logger Logger instance for logging
16
- * @param nodeStorage NodeStorage instance for caching
17
- * @param networkClient Network client for HTTP requests
18
- * @param cryptoProvider Crypto provider for cryptographic operations
19
- * @param disableInternalRetries Whether to disable internal retry logic
20
- * @param identityEndpoint The Service Fabric managed identity endpoint
21
- * @param identityHeader The Service Fabric managed identity secret header
14
+ * Constructs a new ServiceFabric managed identity source for acquiring tokens from Azure Service Fabric clusters.
15
+ *
16
+ * Service Fabric managed identity allows applications running in Service Fabric clusters to authenticate
17
+ * without storing credentials in code. This source handles token acquisition using the Service Fabric
18
+ * Managed Identity Token Service (MITS).
19
+ *
20
+ * @param logger - Logger instance for logging authentication events and debugging information
21
+ * @param nodeStorage - NodeStorage instance for caching tokens and other authentication artifacts
22
+ * @param networkClient - Network client for making HTTP requests to the Service Fabric identity endpoint
23
+ * @param cryptoProvider - Crypto provider for cryptographic operations like token validation
24
+ * @param disableInternalRetries - Whether to disable internal retry logic for failed requests
25
+ * @param identityEndpoint - The Service Fabric managed identity endpoint URL
26
+ * @param identityHeader - The Service Fabric managed identity secret header value
22
27
  */
23
28
  constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean, identityEndpoint: string, identityHeader: string);
24
29
  /**
25
- * Retrieves the environment variables required for Service Fabric managed identity.
26
- * @returns An array containing the identity endpoint, identity header, and identity server thumbprint.
30
+ * Retrieves the environment variables required for Service Fabric managed identity authentication.
31
+ *
32
+ * Service Fabric managed identity requires three specific environment variables to be set by the
33
+ * Service Fabric runtime:
34
+ * - IDENTITY_ENDPOINT: The endpoint URL for the Managed Identity Token Service (MITS)
35
+ * - IDENTITY_HEADER: A secret value used for authentication with the MITS
36
+ * - IDENTITY_SERVER_THUMBPRINT: The thumbprint of the MITS server certificate for secure communication
37
+ *
38
+ * @returns An array containing the identity endpoint, identity header, and identity server thumbprint values.
39
+ * Elements will be undefined if the corresponding environment variables are not set.
27
40
  */
28
41
  static getEnvironmentVariables(): Array<string | undefined>;
29
42
  /**
30
- * Attempts to create a ServiceFabric managed identity source if all required environment variables are present.
31
- * @param logger Logger instance for logging
32
- * @param nodeStorage NodeStorage instance for caching
33
- * @param networkClient Network client for HTTP requests
34
- * @param cryptoProvider Crypto provider for cryptographic operations
35
- * @param disableInternalRetries Whether to disable internal retry logic
36
- * @param managedIdentityId Managed identity identifier
37
- * @returns A ServiceFabric instance if environment variables are set, otherwise null
43
+ * Attempts to create a ServiceFabric managed identity source if the runtime environment supports it.
44
+ *
45
+ * Checks for the presence of all required Service Fabric environment variables
46
+ * and validates the endpoint URL format. It will only create a ServiceFabric instance if the application
47
+ * is running in a properly configured Service Fabric cluster with managed identity enabled.
48
+ *
49
+ * Note: User-assigned managed identities must be configured at the cluster level, not at runtime.
50
+ * This method will log a warning if a user-assigned identity is requested.
51
+ *
52
+ * @param logger - Logger instance for logging creation events and validation results
53
+ * @param nodeStorage - NodeStorage instance for caching tokens and authentication artifacts
54
+ * @param networkClient - Network client for making HTTP requests to the identity endpoint
55
+ * @param cryptoProvider - Crypto provider for cryptographic operations
56
+ * @param disableInternalRetries - Whether to disable internal retry logic for failed requests
57
+ * @param managedIdentityId - Managed identity identifier specifying system-assigned or user-assigned identity
58
+ *
59
+ * @returns A ServiceFabric instance if all environment variables are valid and present, otherwise null
38
60
  */
39
61
  static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean, managedIdentityId: ManagedIdentityId): ServiceFabric | null;
40
62
  /**
41
- * Creates the request parameters for acquiring a token from the Service Fabric cluster.
42
- * @param resource - The resource URI for which the token is requested.
43
- * @param managedIdentityId - The managed identity ID (system-assigned or user-assigned).
44
- * @returns A ManagedIdentityRequestParameters object configured for Service Fabric.
63
+ * Creates HTTP request parameters for acquiring an access token from the Service Fabric Managed Identity Token Service (MITS).
64
+ *
65
+ * This method constructs a properly formatted HTTP GET request that includes:
66
+ * - The secret header for authentication with MITS
67
+ * - API version parameter for the Service Fabric MSI endpoint
68
+ * - Resource parameter specifying the target Azure service
69
+ * - Optional identity parameters for user-assigned managed identities
70
+ *
71
+ * The request follows the Service Fabric managed identity protocol and uses the 2019-07-01-preview API version.
72
+ * For user-assigned identities, the appropriate query parameter (client_id, object_id, or resource_id) is added
73
+ * based on the identity type.
74
+ *
75
+ * @param resource - The Azure resource URI for which the access token is requested (e.g., "https://vault.azure.net/")
76
+ * @param managedIdentityId - The managed identity configuration specifying system-assigned or user-assigned identity details
77
+ *
78
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
45
79
  */
46
80
  createRequest(resource: string, managedIdentityId: ManagedIdentityId): ManagedIdentityRequestParameters;
47
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceFabric.d.ts","sourceRoot":"","sources":["../../../src/client/ManagedIdentitySources/ServiceFabric.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,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AACH,qBAAa,aAAc,SAAQ,yBAAyB;IACxD,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAAS;IAE/B;;;;;;;;;;;;;;OAcG;gBAEC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,MAAM;IAc1B;;;;;;;;;;;OAWG;WACW,uBAAuB,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAkBlE;;;;;;;;;;;;;;;;;;OAkBG;WACW,SAAS,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,iBAAiB,EAAE,iBAAiB,GACrC,aAAa,GAAG,IAAI;IA6CvB;;;;;;;;;;;;;;;;;OAiBG;IACI,aAAa,CAChB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,iBAAiB,GACrC,gCAAgC;CA6BtC"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v5.0.0-alpha.0 2025-10-02 */
1
+ /*! @azure/msal-node v5.0.0-beta.0 2025-12-05 */
2
2
  'use strict';
3
3
  import { ManagedIdentityRequestParameters } from '../../config/ManagedIdentityRequestParameters.mjs';
4
4
  import { BaseManagedIdentitySource } from './BaseManagedIdentitySource.mjs';
@@ -14,14 +14,19 @@ const SERVICE_FABRIC_MSI_API_VERSION = "2019-07-01-preview";
14
14
  */
15
15
  class ServiceFabric extends BaseManagedIdentitySource {
16
16
  /**
17
- * Constructs a new ServiceFabric managed identity source.
18
- * @param logger Logger instance for logging
19
- * @param nodeStorage NodeStorage instance for caching
20
- * @param networkClient Network client for HTTP requests
21
- * @param cryptoProvider Crypto provider for cryptographic operations
22
- * @param disableInternalRetries Whether to disable internal retry logic
23
- * @param identityEndpoint The Service Fabric managed identity endpoint
24
- * @param identityHeader The Service Fabric managed identity secret header
17
+ * Constructs a new ServiceFabric managed identity source for acquiring tokens from Azure Service Fabric clusters.
18
+ *
19
+ * Service Fabric managed identity allows applications running in Service Fabric clusters to authenticate
20
+ * without storing credentials in code. This source handles token acquisition using the Service Fabric
21
+ * Managed Identity Token Service (MITS).
22
+ *
23
+ * @param logger - Logger instance for logging authentication events and debugging information
24
+ * @param nodeStorage - NodeStorage instance for caching tokens and other authentication artifacts
25
+ * @param networkClient - Network client for making HTTP requests to the Service Fabric identity endpoint
26
+ * @param cryptoProvider - Crypto provider for cryptographic operations like token validation
27
+ * @param disableInternalRetries - Whether to disable internal retry logic for failed requests
28
+ * @param identityEndpoint - The Service Fabric managed identity endpoint URL
29
+ * @param identityHeader - The Service Fabric managed identity secret header value
25
30
  */
26
31
  constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint, identityHeader) {
27
32
  super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
@@ -29,8 +34,16 @@ class ServiceFabric extends BaseManagedIdentitySource {
29
34
  this.identityHeader = identityHeader;
30
35
  }
31
36
  /**
32
- * Retrieves the environment variables required for Service Fabric managed identity.
33
- * @returns An array containing the identity endpoint, identity header, and identity server thumbprint.
37
+ * Retrieves the environment variables required for Service Fabric managed identity authentication.
38
+ *
39
+ * Service Fabric managed identity requires three specific environment variables to be set by the
40
+ * Service Fabric runtime:
41
+ * - IDENTITY_ENDPOINT: The endpoint URL for the Managed Identity Token Service (MITS)
42
+ * - IDENTITY_HEADER: A secret value used for authentication with the MITS
43
+ * - IDENTITY_SERVER_THUMBPRINT: The thumbprint of the MITS server certificate for secure communication
44
+ *
45
+ * @returns An array containing the identity endpoint, identity header, and identity server thumbprint values.
46
+ * Elements will be undefined if the corresponding environment variables are not set.
34
47
  */
35
48
  static getEnvironmentVariables() {
36
49
  const identityEndpoint = process.env[ManagedIdentityEnvironmentVariableNames.IDENTITY_ENDPOINT];
@@ -40,14 +53,23 @@ class ServiceFabric extends BaseManagedIdentitySource {
40
53
  return [identityEndpoint, identityHeader, identityServerThumbprint];
41
54
  }
42
55
  /**
43
- * Attempts to create a ServiceFabric managed identity source if all required environment variables are present.
44
- * @param logger Logger instance for logging
45
- * @param nodeStorage NodeStorage instance for caching
46
- * @param networkClient Network client for HTTP requests
47
- * @param cryptoProvider Crypto provider for cryptographic operations
48
- * @param disableInternalRetries Whether to disable internal retry logic
49
- * @param managedIdentityId Managed identity identifier
50
- * @returns A ServiceFabric instance if environment variables are set, otherwise null
56
+ * Attempts to create a ServiceFabric managed identity source if the runtime environment supports it.
57
+ *
58
+ * Checks for the presence of all required Service Fabric environment variables
59
+ * and validates the endpoint URL format. It will only create a ServiceFabric instance if the application
60
+ * is running in a properly configured Service Fabric cluster with managed identity enabled.
61
+ *
62
+ * Note: User-assigned managed identities must be configured at the cluster level, not at runtime.
63
+ * This method will log a warning if a user-assigned identity is requested.
64
+ *
65
+ * @param logger - Logger instance for logging creation events and validation results
66
+ * @param nodeStorage - NodeStorage instance for caching tokens and authentication artifacts
67
+ * @param networkClient - Network client for making HTTP requests to the identity endpoint
68
+ * @param cryptoProvider - Crypto provider for cryptographic operations
69
+ * @param disableInternalRetries - Whether to disable internal retry logic for failed requests
70
+ * @param managedIdentityId - Managed identity identifier specifying system-assigned or user-assigned identity
71
+ *
72
+ * @returns A ServiceFabric instance if all environment variables are valid and present, otherwise null
51
73
  */
52
74
  static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, managedIdentityId) {
53
75
  const [identityEndpoint, identityHeader, identityServerThumbprint] = ServiceFabric.getEnvironmentVariables();
@@ -63,10 +85,22 @@ class ServiceFabric extends BaseManagedIdentitySource {
63
85
  return new ServiceFabric(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint, identityHeader);
64
86
  }
65
87
  /**
66
- * Creates the request parameters for acquiring a token from the Service Fabric cluster.
67
- * @param resource - The resource URI for which the token is requested.
68
- * @param managedIdentityId - The managed identity ID (system-assigned or user-assigned).
69
- * @returns A ManagedIdentityRequestParameters object configured for Service Fabric.
88
+ * Creates HTTP request parameters for acquiring an access token from the Service Fabric Managed Identity Token Service (MITS).
89
+ *
90
+ * This method constructs a properly formatted HTTP GET request that includes:
91
+ * - The secret header for authentication with MITS
92
+ * - API version parameter for the Service Fabric MSI endpoint
93
+ * - Resource parameter specifying the target Azure service
94
+ * - Optional identity parameters for user-assigned managed identities
95
+ *
96
+ * The request follows the Service Fabric managed identity protocol and uses the 2019-07-01-preview API version.
97
+ * For user-assigned identities, the appropriate query parameter (client_id, object_id, or resource_id) is added
98
+ * based on the identity type.
99
+ *
100
+ * @param resource - The Azure resource URI for which the access token is requested (e.g., "https://vault.azure.net/")
101
+ * @param managedIdentityId - The managed identity configuration specifying system-assigned or user-assigned identity details
102
+ *
103
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
70
104
  */
71
105
  createRequest(resource, managedIdentityId) {
72
106
  const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.identityEndpoint);
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceFabric.mjs","sources":["../../../src/client/ManagedIdentitySources/ServiceFabric.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAiBH,MAAM,8BAA8B,GAAW,oBAAoB,CAAC;AAEpE;;AAEG;AACG,MAAO,aAAc,SAAQ,yBAAyB,CAAA;AAIxD;;;;;;;;;AASG;AACH,IAAA,WAAA,CACI,MAAc,EACd,WAAwB,EACxB,aAA6B,EAC7B,cAA8B,EAC9B,sBAA+B,EAC/B,gBAAwB,EACxB,cAAsB,EAAA;QAEtB,KAAK,CACD,MAAM,EACN,WAAW,EACX,aAAa,EACb,cAAc,EACd,sBAAsB,CACzB,CAAC;AAEF,QAAA,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACzC,QAAA,IAAI,CAAC,cAAc,GAAG,cAA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yBAAyB,CAAA,WAAA,EAAc,0BAA0B,CAAC,cAAc,oBAAoB,EACnP,EAAE,CACL,CAAC;AAEF,QAAA,IACI,iBAAiB,CAAC,MAAM,KAAK,qBAAqB,CAAC,eAAe,EACpE;YACE,MAAM,CAAC,OAAO,CACV,CAAA,mBAAA,EAAsB,0BAA0B,CAAC,cAAc,CAAA,oNAAA,CAAsN,EACrR,EAAE,CACL,CAAC;AACL,QAAA,CAAA;AAED,QAAA,OAAO,IAAI,aAAa,CACpB,MAAM,EACN,WAAW,EACX,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,CACjB,CAAC;IACN,CAAC;AAED;;;;;AAKG;IACI,aAAa,CAChB,QAAgB,EAChB,iBAAoC,EAAA;AAEpC,QAAA,MAAM,OAAO,GACT,IAAI,gCAAgC,CAChC,UAAU,CAAC,GAAG,EACd,IAAI,CAAC,gBAAgB,CACxB,CAAC;AAEN,QAAA,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,4BAA4B,CAAC;YAChE,IAAI,CAAC,cAAc,CAAC;AAExB,QAAA,OAAO,CAAC,eAAe,CAAC,8BAA8B,CAAC,WAAW,CAAC;AAC/D,YAAA,8BAA8B,CAAC;AACnC,QAAA,OAAO,CAAC,eAAe,CAAC,8BAA8B,CAAC,QAAQ,CAAC;AAC5D,YAAA,QAAQ,CAAC;AAEb,QAAA,IACI,iBAAiB,CAAC,MAAM,KAAK,qBAAqB,CAAC,eAAe,EACpE;AACE,YAAA,OAAO,CAAC,eAAe,CACnB,IAAI,CAAC,iDAAiD,CAClD,iBAAiB,CAAC,MAAM,CAC3B,CACJ,GAAG,iBAAiB,CAAC,EAAE,CAAC;AAC5B,QAAA,CAAA;;AAID,QAAA,OAAO,OAAO,CAAC;IACnB,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"ServiceFabric.mjs","sources":["../../../src/client/ManagedIdentitySources/ServiceFabric.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;A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CAAC,8BAA8B,CAAC,QAAQ,CAAC;AAC5D,YAAA,QAAQ,CAAC;AAEb,QAAA,IACI,iBAAiB,CAAC,MAAM,KAAK,qBAAqB,CAAC,eAAe,EACpE;AACE,YAAA,OAAO,CAAC,eAAe,CACnB,IAAI,CAAC,iDAAiD,CAClD,iBAAiB,CAAC,MAAM,CAC3B,CACJ,GAAG,iBAAiB,CAAC,EAAE,CAAC;AAC5B,SAAA;;AAID,QAAA,OAAO,OAAO,CAAC;KAClB;AACJ;;;;"}
@@ -1,5 +1,6 @@
1
- import { AuthenticationResult, BaseClient, ClientConfiguration } from "@azure/msal-common/node";
1
+ import { AuthenticationResult, ClientConfiguration } from "@azure/msal-common/node";
2
2
  import { CommonOnBehalfOfRequest } from "../request/CommonOnBehalfOfRequest.js";
3
+ import { BaseClient } from "./BaseClient.js";
3
4
  /**
4
5
  * On-Behalf-Of client
5
6
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"OnBehalfOfClient.d.ts","sourceRoot":"","sources":["../../src/client/OnBehalfOfClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAKH,oBAAoB,EAGpB,UAAU,EAEV,mBAAmB,EAgBtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAC5C,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,iBAAiB,CAAS;gBAEtB,aAAa,EAAE,mBAAmB;IAI9C;;;OAGG;IACU,YAAY,CACrB,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA4BvC;;;;;;;OAOG;YACW,6BAA6B;IAwF3C;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAuBlC;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IA4CtC;;;;OAIG;YACW,mBAAmB;IA4DjC;;;OAGG;YACW,sBAAsB;CA0FvC"}
1
+ {"version":3,"file":"OnBehalfOfClient.d.ts","sourceRoot":"","sources":["../../src/client/OnBehalfOfClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAKH,oBAAoB,EAIpB,mBAAmB,EAetB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAC5C,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,iBAAiB,CAAS;gBAEtB,aAAa,EAAE,mBAAmB;IAI9C;;;OAGG;IACU,YAAY,CACrB,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA4BvC;;;;;;;OAOG;YACW,6BAA6B;IAwF3C;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;IAuBlC;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IA4CtC;;;;OAIG;YACW,mBAAmB;IA4DjC;;;OAGG;YACW,sBAAsB;CA0FvC"}
@@ -1,7 +1,8 @@
1
- /*! @azure/msal-node v5.0.0-alpha.0 2025-10-02 */
1
+ /*! @azure/msal-node v5.0.0-beta.0 2025-12-05 */
2
2
  'use strict';
3
- import { BaseClient, StubPerformanceClient, ScopeSet, Constants, createClientAuthError, ClientAuthErrorCodes, TimeUtils, AuthToken, ResponseHandler, UrlString, RequestParameterBuilder, AADServerParamKeys, getClientAssertion, UrlUtils } from '@azure/msal-common/node';
3
+ import { ScopeSet, Constants, createClientAuthError, ClientAuthErrorCodes, TimeUtils, AuthToken, ResponseHandler, UrlString, RequestParameterBuilder, AADServerParamKeys, getClientAssertion, UrlUtils } from '@azure/msal-common/node';
4
4
  import { EncodingUtils } from '../utils/EncodingUtils.mjs';
5
+ import { BaseClient } from './BaseClient.mjs';
5
6
 
6
7
  /*
7
8
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -13,7 +14,7 @@ import { EncodingUtils } from '../utils/EncodingUtils.mjs';
13
14
  */
14
15
  class OnBehalfOfClient extends BaseClient {
15
16
  constructor(configuration) {
16
- super(configuration, new StubPerformanceClient());
17
+ super(configuration);
17
18
  }
18
19
  /**
19
20
  * Public API to acquire tokens with on behalf of flow