@azure/msal-node 2.2.0-alpha.0 → 2.3.0-alpha.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 (183) hide show
  1. package/dist/cache/NodeStorage.cjs +3 -3
  2. package/dist/cache/NodeStorage.cjs.map +1 -1
  3. package/dist/cache/NodeStorage.d.ts +2 -2
  4. package/dist/cache/NodeStorage.d.ts.map +1 -1
  5. package/dist/cache/NodeStorage.mjs +3 -3
  6. package/dist/cache/NodeStorage.mjs.map +1 -1
  7. package/dist/cache/TokenCache.cjs +1 -1
  8. package/dist/cache/TokenCache.mjs +1 -1
  9. package/dist/cache/distributed/DistributedCachePlugin.cjs +1 -1
  10. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  11. package/dist/cache/serializer/Deserializer.cjs +1 -1
  12. package/dist/cache/serializer/Deserializer.mjs +1 -1
  13. package/dist/cache/serializer/Serializer.cjs +1 -1
  14. package/dist/cache/serializer/Serializer.mjs +1 -1
  15. package/dist/client/ClientApplication.cjs +2 -2
  16. package/dist/client/ClientApplication.cjs.map +1 -1
  17. package/dist/client/ClientApplication.d.ts.map +1 -1
  18. package/dist/client/ClientApplication.mjs +3 -3
  19. package/dist/client/ClientApplication.mjs.map +1 -1
  20. package/dist/client/ClientAssertion.cjs +1 -1
  21. package/dist/client/ClientAssertion.mjs +1 -1
  22. package/dist/client/ClientCredentialClient.cjs +27 -23
  23. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  24. package/dist/client/ClientCredentialClient.d.ts +3 -3
  25. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  26. package/dist/client/ClientCredentialClient.mjs +28 -24
  27. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  28. package/dist/client/ConfidentialClientApplication.cjs +1 -1
  29. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  30. package/dist/client/DeviceCodeClient.cjs +1 -1
  31. package/dist/client/DeviceCodeClient.mjs +1 -1
  32. package/dist/client/ManagedIdentityApplication.cjs +96 -0
  33. package/dist/client/ManagedIdentityApplication.cjs.map +1 -0
  34. package/dist/client/ManagedIdentityApplication.d.ts +24 -0
  35. package/dist/client/ManagedIdentityApplication.d.ts.map +1 -0
  36. package/dist/client/ManagedIdentityApplication.mjs +94 -0
  37. package/dist/client/ManagedIdentityApplication.mjs.map +1 -0
  38. package/dist/client/ManagedIdentityClient.cjs +49 -0
  39. package/dist/client/ManagedIdentityClient.cjs.map +1 -0
  40. package/dist/client/ManagedIdentityClient.d.ts +25 -0
  41. package/dist/client/ManagedIdentityClient.d.ts.map +1 -0
  42. package/dist/client/ManagedIdentityClient.mjs +47 -0
  43. package/dist/client/ManagedIdentityClient.mjs.map +1 -0
  44. package/dist/client/ManagedIdentitySources/AppService.cjs +79 -0
  45. package/dist/client/ManagedIdentitySources/AppService.cjs.map +1 -0
  46. package/dist/client/ManagedIdentitySources/AppService.d.ts +17 -0
  47. package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -0
  48. package/dist/client/ManagedIdentitySources/AppService.mjs +77 -0
  49. package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -0
  50. package/dist/client/ManagedIdentitySources/AzureArc.cjs +107 -0
  51. package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +1 -0
  52. package/dist/client/ManagedIdentitySources/AzureArc.d.ts +19 -0
  53. package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -0
  54. package/dist/client/ManagedIdentitySources/AzureArc.mjs +104 -0
  55. package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -0
  56. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +87 -0
  57. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +1 -0
  58. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +19 -0
  59. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -0
  60. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +85 -0
  61. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -0
  62. package/dist/client/ManagedIdentitySources/CloudShell.d.ts +7 -0
  63. package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -0
  64. package/dist/client/ManagedIdentitySources/Imds.cjs +63 -0
  65. package/dist/client/ManagedIdentitySources/Imds.cjs.map +1 -0
  66. package/dist/client/ManagedIdentitySources/Imds.d.ts +13 -0
  67. package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -0
  68. package/dist/client/ManagedIdentitySources/Imds.mjs +61 -0
  69. package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -0
  70. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +7 -0
  71. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -0
  72. package/dist/client/OnBehalfOfClient.cjs +1 -1
  73. package/dist/client/OnBehalfOfClient.mjs +1 -1
  74. package/dist/client/PublicClientApplication.cjs +1 -1
  75. package/dist/client/PublicClientApplication.mjs +1 -1
  76. package/dist/client/UsernamePasswordClient.cjs +1 -1
  77. package/dist/client/UsernamePasswordClient.mjs +1 -1
  78. package/dist/config/Configuration.cjs +18 -2
  79. package/dist/config/Configuration.cjs.map +1 -1
  80. package/dist/config/Configuration.d.ts +15 -0
  81. package/dist/config/Configuration.d.ts.map +1 -1
  82. package/dist/config/Configuration.mjs +18 -3
  83. package/dist/config/Configuration.mjs.map +1 -1
  84. package/dist/config/ManagedIdentityId.cjs +59 -0
  85. package/dist/config/ManagedIdentityId.cjs.map +1 -0
  86. package/dist/config/ManagedIdentityId.d.ts +12 -0
  87. package/dist/config/ManagedIdentityId.d.ts.map +1 -0
  88. package/dist/config/ManagedIdentityId.mjs +57 -0
  89. package/dist/config/ManagedIdentityId.mjs.map +1 -0
  90. package/dist/config/ManagedIdentityRequestParameters.cjs +38 -0
  91. package/dist/config/ManagedIdentityRequestParameters.cjs.map +1 -0
  92. package/dist/config/ManagedIdentityRequestParameters.d.ts +12 -0
  93. package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -0
  94. package/dist/config/ManagedIdentityRequestParameters.mjs +36 -0
  95. package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -0
  96. package/dist/crypto/CryptoProvider.cjs +1 -1
  97. package/dist/crypto/CryptoProvider.mjs +1 -1
  98. package/dist/crypto/GuidGenerator.cjs +1 -1
  99. package/dist/crypto/GuidGenerator.mjs +1 -1
  100. package/dist/crypto/HashUtils.cjs +1 -1
  101. package/dist/crypto/HashUtils.mjs +1 -1
  102. package/dist/crypto/PkceGenerator.cjs +1 -1
  103. package/dist/crypto/PkceGenerator.mjs +1 -1
  104. package/dist/error/ManagedIdentityError.cjs +40 -0
  105. package/dist/error/ManagedIdentityError.cjs.map +1 -0
  106. package/dist/error/ManagedIdentityError.d.ts +22 -0
  107. package/dist/error/ManagedIdentityError.d.ts.map +1 -0
  108. package/dist/error/ManagedIdentityError.mjs +36 -0
  109. package/dist/error/ManagedIdentityError.mjs.map +1 -0
  110. package/dist/error/ManagedIdentityErrorCodes.cjs +28 -0
  111. package/dist/error/ManagedIdentityErrorCodes.cjs.map +1 -0
  112. package/dist/error/ManagedIdentityErrorCodes.d.ts +10 -0
  113. package/dist/error/ManagedIdentityErrorCodes.d.ts.map +1 -0
  114. package/dist/error/ManagedIdentityErrorCodes.mjs +18 -0
  115. package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -0
  116. package/dist/error/NodeAuthError.cjs +1 -1
  117. package/dist/error/NodeAuthError.mjs +1 -1
  118. package/dist/index.cjs +3 -1
  119. package/dist/index.cjs.map +1 -1
  120. package/dist/index.d.ts +3 -1
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.mjs +2 -1
  123. package/dist/index.mjs.map +1 -1
  124. package/dist/internals.cjs +1 -1
  125. package/dist/internals.mjs +1 -1
  126. package/dist/network/HttpClient.cjs +13 -6
  127. package/dist/network/HttpClient.cjs.map +1 -1
  128. package/dist/network/HttpClient.d.ts +2 -1
  129. package/dist/network/HttpClient.d.ts.map +1 -1
  130. package/dist/network/HttpClient.mjs +13 -6
  131. package/dist/network/HttpClient.mjs.map +1 -1
  132. package/dist/network/LoopbackClient.cjs +2 -1
  133. package/dist/network/LoopbackClient.cjs.map +1 -1
  134. package/dist/network/LoopbackClient.d.ts.map +1 -1
  135. package/dist/network/LoopbackClient.mjs +2 -1
  136. package/dist/network/LoopbackClient.mjs.map +1 -1
  137. package/dist/packageMetadata.cjs +2 -2
  138. package/dist/packageMetadata.cjs.map +1 -1
  139. package/dist/packageMetadata.d.ts +1 -1
  140. package/dist/packageMetadata.d.ts.map +1 -1
  141. package/dist/packageMetadata.mjs +2 -2
  142. package/dist/packageMetadata.mjs.map +1 -1
  143. package/dist/request/ManagedIdentityRequest.d.ts +9 -0
  144. package/dist/request/ManagedIdentityRequest.d.ts.map +1 -0
  145. package/dist/request/ManagedIdentityRequestParams.d.ts +10 -0
  146. package/dist/request/ManagedIdentityRequestParams.d.ts.map +1 -0
  147. package/dist/response/ManagedIdentityTokenResponse.d.ts +25 -0
  148. package/dist/response/ManagedIdentityTokenResponse.d.ts.map +1 -0
  149. package/dist/utils/Constants.cjs +30 -1
  150. package/dist/utils/Constants.cjs.map +1 -1
  151. package/dist/utils/Constants.d.ts +20 -0
  152. package/dist/utils/Constants.d.ts.map +1 -1
  153. package/dist/utils/Constants.mjs +21 -2
  154. package/dist/utils/Constants.mjs.map +1 -1
  155. package/dist/utils/EncodingUtils.cjs +1 -1
  156. package/dist/utils/EncodingUtils.mjs +1 -1
  157. package/dist/utils/NetworkUtils.cjs +1 -1
  158. package/dist/utils/NetworkUtils.mjs +1 -1
  159. package/package.json +2 -2
  160. package/src/cache/NodeStorage.ts +8 -2
  161. package/src/client/ClientApplication.ts +3 -1
  162. package/src/client/ClientCredentialClient.ts +65 -25
  163. package/src/client/ManagedIdentityApplication.ts +194 -0
  164. package/src/client/ManagedIdentityClient.ts +111 -0
  165. package/src/client/ManagedIdentitySources/AppService.ts +151 -0
  166. package/src/client/ManagedIdentitySources/AzureArc.ts +208 -0
  167. package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +169 -0
  168. package/src/client/ManagedIdentitySources/CloudShell.ts +19 -0
  169. package/src/client/ManagedIdentitySources/Imds.ts +112 -0
  170. package/src/client/ManagedIdentitySources/ServiceFabric.ts +19 -0
  171. package/src/config/Configuration.ts +47 -1
  172. package/src/config/ManagedIdentityId.ts +73 -0
  173. package/src/config/ManagedIdentityRequestParameters.ts +53 -0
  174. package/src/error/ManagedIdentityError.ts +46 -0
  175. package/src/error/ManagedIdentityErrorCodes.ts +15 -0
  176. package/src/index.ts +3 -0
  177. package/src/network/HttpClient.ts +17 -5
  178. package/src/network/LoopbackClient.ts +1 -0
  179. package/src/packageMetadata.ts +1 -1
  180. package/src/request/ManagedIdentityRequest.ts +15 -0
  181. package/src/request/ManagedIdentityRequestParams.ts +14 -0
  182. package/src/response/ManagedIdentityTokenResponse.ts +33 -0
  183. package/src/utils/Constants.ts +27 -0
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  import { BaseClient, ScopeSet, CacheOutcome, createClientAuthError, ClientAuthErrorCodes, TimeUtils, AuthToken, ResponseHandler, AuthenticationScheme, CredentialType, UrlString, RequestParameterBuilder, GrantType, AADServerParamKeys, Constants } from '@azure/msal-common';
4
4
  import { EncodingUtils } from '../utils/EncodingUtils.mjs';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  import { ApiId, LOOPBACK_SERVER_CONSTANTS, Constants as Constants$1 } from '../utils/Constants.mjs';
4
4
  import { AuthError, OIDC_DEFAULT_SCOPES, ResponseMode, CodeChallengeMethodValues, ServerError, Constants } from '@azure/msal-common';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  import { BaseClient, TimeUtils, ResponseHandler, UrlString, CcsCredentialType, RequestParameterBuilder, GrantType, StringUtils } from '@azure/msal-common';
4
4
 
@@ -1,9 +1,10 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
5
  var msalCommon = require('@azure/msal-common');
6
6
  var HttpClient = require('../network/HttpClient.cjs');
7
+ var ManagedIdentityId = require('./ManagedIdentityId.cjs');
7
8
 
8
9
  /*
9
10
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -66,7 +67,8 @@ const DEFAULT_TELEMETRY_OPTIONS = {
66
67
  function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
67
68
  const systemOptions = {
68
69
  ...DEFAULT_SYSTEM_OPTIONS,
69
- networkClient: new HttpClient.HttpClient(system?.proxyUrl, system?.customAgentOptions),
70
+ networkClient: new HttpClient.HttpClient(system?.proxyUrl, system?.customAgentOptions, false // Managed Identity
71
+ ),
70
72
  loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
71
73
  };
72
74
  return {
@@ -76,7 +78,21 @@ function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
76
78
  system: { ...systemOptions, ...system },
77
79
  telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
78
80
  };
81
+ }
82
+ function buildManagedIdentityConfiguration({ managedIdentityIdParams, system, }) {
83
+ const managedIdentityId = new ManagedIdentityId.ManagedIdentityId(managedIdentityIdParams);
84
+ const systemOptions = {
85
+ ...DEFAULT_SYSTEM_OPTIONS,
86
+ loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
87
+ networkClient: new HttpClient.HttpClient(system?.proxyUrl, system?.customAgentOptions, true // Managed Identity
88
+ ),
89
+ };
90
+ return {
91
+ managedIdentityId: managedIdentityId,
92
+ system: { ...systemOptions, ...system },
93
+ };
79
94
  }
80
95
 
81
96
  exports.buildAppConfiguration = buildAppConfiguration;
97
+ exports.buildManagedIdentityConfiguration = buildManagedIdentityConfiguration;
82
98
  //# sourceMappingURL=Configuration.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.cjs","sources":["../../src/config/Configuration.ts"],"sourcesContent":[null],"names":["Constants","ProtocolMode","AzureCloudInstance","HttpClient"],"mappings":";;;;;;;;;AAKA;AAaA;;;;;;;;;;AAaG,KAAA;AACH,IAAM;IACF,sBAAiB,EAAAA,oBAAA,CAAA,YAAA;IACjB,iBAAY,EAAOA,oBAAA,CAAA,YAAA;IACnB,kBAAe,EAAA,EAAO;IACtB,YAAe,EAAAC,uBAAU,CAAA,GAAA;AACzB,IAAA,iBAAiB,EAAG;QAChB,kBAAkB,EAACC,6BAAA,CAAA,IAAA;QACnB,MAAU,EAAAF,qBAAQ,YAAC;;8BAErB,EAAA,KAAA;AACF,CAAA,CAAA;MACsB,qBAAC,GAAE;IACzB,yBAAoB,EAAO,KAAA;AAC3B,CAAA,CAAA;MACY,sBAAG,GAAY;IAC3B,cAAiB,EAAA,MAAG;;KAEtB;AAEF,IAAA,iBAAA,EAAA,KAAA;;;;;AAKG,IAAA,aAAA,EAAA,IAAAG,qBAAA,EAAA;AACH,IAAM,QAAM,uBAAY,YAAG;IACvB,kBAAc,EAAA,EAAA;;MAEhB,yBAAA,GAAA;AAEF,IAAA,WAAA,EAAA;;;;;;AAMG;AACH;;;AAIA;;;;;;AAMG,SAAA,qBAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA,MAAA,EAAA,SAAA,GAAA,EAAA;AACH,IAAM,MAAA;QACW,GAAA,sBAAgB;QAChB,aAAG,EAAA,IAAAA,qBAAe,CAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,kBAAA,CAAA;QACvB,aAAS,EAAC,MAAA,EAAA,aAAA,IAAA,sBAAA;KACA,CAAA;IACpB,OAAA;AAEF,QAAM,IAAM,2BAAuB,EAAA,GAAA,IAAA,EAAA;QACpB,MAAA,EAAC,EAAE,GAAA,MAAA,EAAA;QAChB,KAAA,EAAA,EAAA,GAAA,qBAAA,EAAA,GAAA,KAAA,EAAA;AAEF,QAAA,MAAA,EAAA,EAAA,GAAA,aAAA,EAAA,GAAA,MAAA,EAAA;;;;;;;"}
1
+ {"version":3,"file":"Configuration.cjs","sources":["../../src/config/Configuration.ts"],"sourcesContent":[null],"names":["Constants","ProtocolMode","AzureCloudInstance","HttpClient"],"mappings":";;;;;;;;;;AAKA;AAaA;;;;;;;;;;AAcG,KAAA;AACH,IAAM;IACF,sBAAiB,EAAAA,oBAAA,CAAA,YAAA;IACjB,iBAAY,EAAOA,oBAAA,CAAA,YAAA;IACnB,kBAAe,EAAA,EAAO;IACtB,YAAe,EAAAC,uBAAU,CAAA,GAAA;AACzB,IAAA,iBAAiB,EAAG;QAChB,kBAAkB,EAACC,6BAAA,CAAA,IAAA;QACnB,MAAU,EAAAF,qBAAQ,YAAC;;8BAErB,EAAA,KAAA;AACF,CAAA,CAAA;MACsB,qBAAC,GAAE;IACzB,yBAAoB,EAAO,KAAA;AAC3B,CAAA,CAAA;MACY,sBAAG,GAAY;IAC3B,cAAiB,EAAA,MAAG;;KAEtB;AAEF,IAAA,iBAAA,EAAA,KAAA;;;;;AAKG,IAAA,aAAA,EAAA,IAAAG,qBAAA,EAAA;AACH,IAAM,QAAM,uBAAY,YAAG;IACvB,kBAAc,EAAA,EAAA;;MAEhB,yBAAA,GAAA;AAEF,IAAA,WAAA,EAAA;;;;;;AAMG;AACH;;;AAIA;;;;;;AAMG,SAAA,qBAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA,MAAA,EAAA,SAAA,GAAA,EAAA;AACH,IAAM,MAAA;QACW,GAAA,sBAAgB;QAChB,aAAG,EAAA,IAAAA,qBAAe,CAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,kBAAA,EAAA,KAAA;SACvB;QACU,aAAA,EAAC,MAAM,eAAgB,IAAA,sBAAmB;KAC9D,CAAA;AAEF,IAAM,OAAA;QACS,IAAA,EAAA,EAAC,GAAE,oBAAqB,EAAA,GAAA,IAAA,EAAA;QACrC,MAAA,EAAA,EAAA,GAAA,MAAA,EAAA;AAEF,QAAA,KAAA,EAAA,EAAA,GAAA,qBAAA,EAAA,GAAA,KAAA,EAAA;;;;;;;;;AASG,QAAA,aAAA,EAAA,MAAA,EAAA,aAAA,IAAA,sBAAA;AACH,QAAM,mBAAsBA,qBAAA,CAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,kBAAA,EAAA,IAAA;SACpB;KACE,CAAA;IACN,OAAQ;QACF,iBAAG,EAAA,iBAAkB;QAClB,MAAC,EAAE,EAAA,GAAA,aAAA,EAAoB,GAAC,MAAA,EAAA;KACnC,CAAA;AAEF;;;;;"}
@@ -3,6 +3,7 @@
3
3
  import { LoggerOptions, INetworkModule, ProtocolMode, ICachePlugin, AzureCloudOptions, ApplicationTelemetry, INativeBrokerPlugin } from "@azure/msal-common";
4
4
  import http from "http";
5
5
  import https from "https";
6
+ import { ManagedIdentityId } from "./ManagedIdentityId.js";
6
7
  /**
7
8
  * - clientId - Client id of the application.
8
9
  * - authority - Url of the authority. If no value is set, defaults to https://login.microsoftonline.com/common.
@@ -85,6 +86,15 @@ export type Configuration = {
85
86
  system?: NodeSystemOptions;
86
87
  telemetry?: NodeTelemetryOptions;
87
88
  };
89
+ export type ManagedIdentityIdParams = {
90
+ userAssignedClientId?: string;
91
+ userAssignedResourceId?: string;
92
+ userAssignedObjectId?: string;
93
+ };
94
+ export type ManagedIdentityConfiguration = {
95
+ managedIdentityIdParams?: ManagedIdentityIdParams;
96
+ system?: NodeSystemOptions;
97
+ };
88
98
  /** @internal */
89
99
  export type NodeConfiguration = {
90
100
  auth: Required<NodeAuthOptions>;
@@ -105,4 +115,9 @@ export type NodeConfiguration = {
105
115
  * @internal
106
116
  */
107
117
  export declare function buildAppConfiguration({ auth, broker, cache, system, telemetry, }: Configuration): NodeConfiguration;
118
+ export type ManagedIdentityNodeConfiguration = {
119
+ managedIdentityId: ManagedIdentityId;
120
+ system: Required<NodeSystemOptions>;
121
+ };
122
+ export declare function buildManagedIdentityConfiguration({ managedIdentityIdParams, system, }: ManagedIdentityConfiguration): ManagedIdentityNodeConfiguration;
108
123
  //# sourceMappingURL=Configuration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/config/Configuration.ts"],"names":[],"mappings":";;AAKA,OAAO,EACH,aAAa,EACb,cAAc,EAEd,YAAY,EACZ,YAAY,EAGZ,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,GAAG,C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MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAChC,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,YAAY,CAAC;IACpB,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACpC,SAAS,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,MAAM,EACN,SAAS,GACZ,EAAE,aAAa,GAAG,iBAAiB,CAoBnC;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC3C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;CACvC,CAAC;AAEF,wBAAgB,iCAAiC,CAAC,EAC9C,uBAAuB,EACvB,MAAM,GACT,EAAE,4BAA4B,GAAG,gCAAgC,CAqBjE"}
@@ -1,7 +1,8 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  import { Constants, ProtocolMode, AzureCloudInstance, LogLevel } from '@azure/msal-common';
4
4
  import { HttpClient } from '../network/HttpClient.mjs';
5
+ import { ManagedIdentityId } from './ManagedIdentityId.mjs';
5
6
 
6
7
  /*
7
8
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -64,7 +65,8 @@ const DEFAULT_TELEMETRY_OPTIONS = {
64
65
  function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
65
66
  const systemOptions = {
66
67
  ...DEFAULT_SYSTEM_OPTIONS,
67
- networkClient: new HttpClient(system?.proxyUrl, system?.customAgentOptions),
68
+ networkClient: new HttpClient(system?.proxyUrl, system?.customAgentOptions, false // Managed Identity
69
+ ),
68
70
  loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
69
71
  };
70
72
  return {
@@ -74,7 +76,20 @@ function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
74
76
  system: { ...systemOptions, ...system },
75
77
  telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
76
78
  };
79
+ }
80
+ function buildManagedIdentityConfiguration({ managedIdentityIdParams, system, }) {
81
+ const managedIdentityId = new ManagedIdentityId(managedIdentityIdParams);
82
+ const systemOptions = {
83
+ ...DEFAULT_SYSTEM_OPTIONS,
84
+ loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
85
+ networkClient: new HttpClient(system?.proxyUrl, system?.customAgentOptions, true // Managed Identity
86
+ ),
87
+ };
88
+ return {
89
+ managedIdentityId: managedIdentityId,
90
+ system: { ...systemOptions, ...system },
91
+ };
77
92
  }
78
93
 
79
- export { buildAppConfiguration };
94
+ export { buildAppConfiguration, buildManagedIdentityConfiguration };
80
95
  //# sourceMappingURL=Configuration.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.mjs","sources":["../../src/config/Configuration.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAKA;AAaA;;;;;;;;;;AAaG,KAAA;AACH,IAAM;IACF,sBAAiB,EAAA,SAAA,CAAA,YAAA;IACjB,iBAAY,EAAO,SAAA,CAAA,YAAA;IACnB,kBAAe,EAAA,EAAO;IACtB,YAAe,EAAA,YAAU,CAAA,GAAA;AACzB,IAAA,iBAAiB,EAAG;QAChB,kBAAkB,EAAC,kBAAA,CAAA,IAAA;QACnB,MAAU,EAAA,UAAQ,YAAC;;8BAErB,EAAA,KAAA;AACF,CAAA,CAAA;MACsB,qBAAC,GAAE;IACzB,yBAAoB,EAAO,KAAA;AAC3B,CAAA,CAAA;MACY,sBAAG,GAAY;IAC3B,cAAiB,EAAA,MAAG;;KAEtB;AAEF,IAAA,iBAAA,EAAA,KAAA;;;;;AAKG,IAAA,aAAA,EAAA,IAAA,UAAA,EAAA;AACH,IAAM,QAAM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AA;AACH,IAAM,QAAM,YAAY,YAAG;IACvB,kBAAc,EAAA,EAAA;;MAEhB,yBAAA,GAAA;AAEF,IAAA,WAAA,EAAA;;;;;;AAMG;AACH;;;AAIA;;;;;;AAMG,SAAA,qBAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA,MAAA,EAAA,SAAA,GAAA,EAAA;AACH,IAAM,MAAA;QACW,GAAA,sBAAgB;QAChB,aAAG,EAAA,IAAA,UAAe,CAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,kBAAA,EAAA,KAAA;SACvB;QACU,aAAA,EAAC,MAAM,eAAgB,IAAA,sBAAmB;KAC9D,CAAA;AAEF,IAAM,OAAA;QACS,IAAA,EAAA,EAAC,GAAE,oBAAqB,EAAA,GAAA,IAAA,EAAA;QACrC,MAAA,EAAA,EAAA,GAAA,MAAA,EAAA;AAEF,QAAA,KAAA,EAAA,EAAA,GAAA,qBAAA,EAAA,GAAA,KAAA,EAAA;;;;;;;;;AASG,QAAA,aAAA,EAAA,MAAA,EAAA,aAAA,IAAA,sBAAA;AACH,QAAM,mBAAsB,UAAA,CAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,kBAAA,EAAA,IAAA;SACpB;KACE,CAAA;IACN,OAAQ;QACF,iBAAG,EAAA,iBAAkB;QAClB,MAAC,EAAE,EAAA,GAAA,aAAA,EAAoB,GAAC,MAAA,EAAA;KACnC,CAAA;AAEF;;;;"}
@@ -0,0 +1,59 @@
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
+ 'use strict';
3
+ 'use strict';
4
+
5
+ var ManagedIdentityError = require('../error/ManagedIdentityError.cjs');
6
+ var Constants = require('../utils/Constants.cjs');
7
+ var ManagedIdentityErrorCodes = require('../error/ManagedIdentityErrorCodes.cjs');
8
+
9
+ /*
10
+ * Copyright (c) Microsoft Corporation. All rights reserved.
11
+ * Licensed under the MIT License.
12
+ */
13
+ class ManagedIdentityId {
14
+ get id() {
15
+ return this._id;
16
+ }
17
+ set id(value) {
18
+ this._id = value;
19
+ }
20
+ get idType() {
21
+ return this._idType;
22
+ }
23
+ set idType(value) {
24
+ this._idType = value;
25
+ }
26
+ constructor(managedIdentityIdParams) {
27
+ const userAssignedClientId = managedIdentityIdParams?.userAssignedClientId;
28
+ const userAssignedResourceId = managedIdentityIdParams?.userAssignedResourceId;
29
+ const userAssignedObjectId = managedIdentityIdParams?.userAssignedObjectId;
30
+ if (userAssignedClientId) {
31
+ if (userAssignedResourceId || userAssignedObjectId) {
32
+ throw ManagedIdentityError.createManagedIdentityError(ManagedIdentityErrorCodes.invalidManagedIdentityIdType);
33
+ }
34
+ this.id = userAssignedClientId;
35
+ this.idType = Constants.ManagedIdentityIdType.USER_ASSIGNED_CLIENT_ID;
36
+ }
37
+ else if (userAssignedResourceId) {
38
+ if (userAssignedClientId || userAssignedObjectId) {
39
+ throw ManagedIdentityError.createManagedIdentityError(ManagedIdentityErrorCodes.invalidManagedIdentityIdType);
40
+ }
41
+ this.id = userAssignedResourceId;
42
+ this.idType = Constants.ManagedIdentityIdType.USER_ASSIGNED_RESOURCE_ID;
43
+ }
44
+ else if (userAssignedObjectId) {
45
+ if (userAssignedClientId || userAssignedResourceId) {
46
+ throw ManagedIdentityError.createManagedIdentityError(ManagedIdentityErrorCodes.invalidManagedIdentityIdType);
47
+ }
48
+ this.id = userAssignedObjectId;
49
+ this.idType = Constants.ManagedIdentityIdType.USER_ASSIGNED_OBJECT_ID;
50
+ }
51
+ else {
52
+ this.id = Constants.DEFAULT_MANAGED_IDENTITY_ID;
53
+ this.idType = Constants.ManagedIdentityIdType.SYSTEM_ASSIGNED;
54
+ }
55
+ }
56
+ }
57
+
58
+ exports.ManagedIdentityId = ManagedIdentityId;
59
+ //# sourceMappingURL=ManagedIdentityId.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedIdentityId.cjs","sources":["../../src/config/ManagedIdentityId.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AASA;AAIA;AAEA;;AASW,uBAAgC,CAAA;IACvC,IAAW,EAAA,GAAA;QAGJ,OAAA,QAEN,CAAA;;AA0CJ,IAAA,IAAA,EAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,12 @@
1
+ import { ManagedIdentityIdType } from "../utils/Constants";
2
+ import { ManagedIdentityIdParams } from "./Configuration";
3
+ export declare class ManagedIdentityId {
4
+ private _id;
5
+ get id(): string;
6
+ private set id(value);
7
+ private _idType;
8
+ get idType(): ManagedIdentityIdType;
9
+ private set idType(value);
10
+ constructor(managedIdentityIdParams?: ManagedIdentityIdParams);
11
+ }
12
+ //# sourceMappingURL=ManagedIdentityId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedIdentityId.d.ts","sourceRoot":"","sources":["../../src/config/ManagedIdentityId.ts"],"names":[],"mappings":"AASA,OAAO,EAEH,qBAAqB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,GAAG,CAAS;IACpB,IAAW,EAAE,IAAI,MAAM,CAEtB;IACD,OAAO,KAAK,EAAE,QAEb;IAED,OAAO,CAAC,OAAO,CAAwB;IACvC,IAAW,MAAM,IAAI,qBAAqB,CAEzC;IACD,OAAO,KAAK,MAAM,QAEjB;gBAEW,uBAAuB,CAAC,EAAE,uBAAuB;CAwChE"}
@@ -0,0 +1,57 @@
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
+ 'use strict';
3
+ import { createManagedIdentityError } from '../error/ManagedIdentityError.mjs';
4
+ import { ManagedIdentityIdType, DEFAULT_MANAGED_IDENTITY_ID } from '../utils/Constants.mjs';
5
+ import { invalidManagedIdentityIdType } from '../error/ManagedIdentityErrorCodes.mjs';
6
+
7
+ /*
8
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9
+ * Licensed under the MIT License.
10
+ */
11
+ class ManagedIdentityId {
12
+ get id() {
13
+ return this._id;
14
+ }
15
+ set id(value) {
16
+ this._id = value;
17
+ }
18
+ get idType() {
19
+ return this._idType;
20
+ }
21
+ set idType(value) {
22
+ this._idType = value;
23
+ }
24
+ constructor(managedIdentityIdParams) {
25
+ const userAssignedClientId = managedIdentityIdParams?.userAssignedClientId;
26
+ const userAssignedResourceId = managedIdentityIdParams?.userAssignedResourceId;
27
+ const userAssignedObjectId = managedIdentityIdParams?.userAssignedObjectId;
28
+ if (userAssignedClientId) {
29
+ if (userAssignedResourceId || userAssignedObjectId) {
30
+ throw createManagedIdentityError(invalidManagedIdentityIdType);
31
+ }
32
+ this.id = userAssignedClientId;
33
+ this.idType = ManagedIdentityIdType.USER_ASSIGNED_CLIENT_ID;
34
+ }
35
+ else if (userAssignedResourceId) {
36
+ if (userAssignedClientId || userAssignedObjectId) {
37
+ throw createManagedIdentityError(invalidManagedIdentityIdType);
38
+ }
39
+ this.id = userAssignedResourceId;
40
+ this.idType = ManagedIdentityIdType.USER_ASSIGNED_RESOURCE_ID;
41
+ }
42
+ else if (userAssignedObjectId) {
43
+ if (userAssignedClientId || userAssignedResourceId) {
44
+ throw createManagedIdentityError(invalidManagedIdentityIdType);
45
+ }
46
+ this.id = userAssignedObjectId;
47
+ this.idType = ManagedIdentityIdType.USER_ASSIGNED_OBJECT_ID;
48
+ }
49
+ else {
50
+ this.id = DEFAULT_MANAGED_IDENTITY_ID;
51
+ this.idType = ManagedIdentityIdType.SYSTEM_ASSIGNED;
52
+ }
53
+ }
54
+ }
55
+
56
+ export { ManagedIdentityId };
57
+ //# sourceMappingURL=ManagedIdentityId.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedIdentityId.mjs","sources":["../../src/config/ManagedIdentityId.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AASA;AAIA;AAEA;;AASW,uBAAgC,CAAA;IACvC,IAAW,EAAA,GAAA;QAGJ,OAAA,QAEN,CAAA;;AA0CJ,IAAA,IAAA,EAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,38 @@
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
+ 'use strict';
3
+ 'use strict';
4
+
5
+ var msalCommon = require('@azure/msal-common');
6
+
7
+ /*
8
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9
+ * Licensed under the MIT License.
10
+ */
11
+ class ManagedIdentityRequestParameters {
12
+ constructor(httpMethod, endpoint) {
13
+ this.httpMethod = httpMethod;
14
+ this._baseEndpoint = endpoint;
15
+ this.headers = {};
16
+ this.bodyParameters = {};
17
+ this.queryParameters = {};
18
+ }
19
+ computeUri() {
20
+ const parameterBuilder = new msalCommon.RequestParameterBuilder();
21
+ if (this.queryParameters) {
22
+ parameterBuilder.addExtraQueryParameters(this.queryParameters);
23
+ }
24
+ const queryParametersString = parameterBuilder.createQueryString();
25
+ return msalCommon.UrlString.appendQueryString(this._baseEndpoint, queryParametersString);
26
+ }
27
+ computeParametersBodyString() {
28
+ const parameterBuilder = new msalCommon.RequestParameterBuilder();
29
+ if (this.bodyParameters) {
30
+ parameterBuilder.addExtraQueryParameters(this.bodyParameters);
31
+ }
32
+ const bodyParametersString = parameterBuilder.createQueryString();
33
+ return msalCommon.UrlString.appendQueryString(this._baseEndpoint, bodyParametersString);
34
+ }
35
+ }
36
+
37
+ exports.ManagedIdentityRequestParameters = ManagedIdentityRequestParameters;
38
+ //# sourceMappingURL=ManagedIdentityRequestParameters.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedIdentityRequestParameters.cjs","sources":["../../src/config/ManagedIdentityRequestParameters.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAMA;AAEA;;;AAIW,MAAA,gCAAuC,CAAA;AACvC,IAAA,WAAA,CAAA,UAAuB,EAAC,QAAQ,EAAA;AAE3B,QAAA,IAAA,CAAA,UAAA,GAAU,UAAE,CAAA;AAQjB,QAAA,IAAA,CAAA,aAAoB,GAAA,QAAA,CAAA;AAepB,QAAA,IAAA,CAAA,OAAA,GAAA,EAAA,CAAA;AAcV,QAAA,IAAA,CAAA,cAAA,GAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,12 @@
1
+ import { HttpMethod } from "../utils/Constants";
2
+ export declare class ManagedIdentityRequestParameters {
3
+ private _baseEndpoint;
4
+ httpMethod: HttpMethod;
5
+ headers: Record<string, string>;
6
+ bodyParameters: Record<string, string>;
7
+ queryParameters: Record<string, string>;
8
+ constructor(httpMethod: HttpMethod, endpoint: string);
9
+ computeUri(): string;
10
+ computeParametersBodyString(): string;
11
+ }
12
+ //# sourceMappingURL=ManagedIdentityRequestParameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedIdentityRequestParameters.d.ts","sourceRoot":"","sources":["../../src/config/ManagedIdentityRequestParameters.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,qBAAa,gCAAgC;IACzC,OAAO,CAAC,aAAa,CAAS;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEnC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM;IAQ7C,UAAU,IAAI,MAAM;IAepB,2BAA2B,IAAI,MAAM;CAc/C"}
@@ -0,0 +1,36 @@
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
+ 'use strict';
3
+ import { RequestParameterBuilder, UrlString } from '@azure/msal-common';
4
+
5
+ /*
6
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7
+ * Licensed under the MIT License.
8
+ */
9
+ class ManagedIdentityRequestParameters {
10
+ constructor(httpMethod, endpoint) {
11
+ this.httpMethod = httpMethod;
12
+ this._baseEndpoint = endpoint;
13
+ this.headers = {};
14
+ this.bodyParameters = {};
15
+ this.queryParameters = {};
16
+ }
17
+ computeUri() {
18
+ const parameterBuilder = new RequestParameterBuilder();
19
+ if (this.queryParameters) {
20
+ parameterBuilder.addExtraQueryParameters(this.queryParameters);
21
+ }
22
+ const queryParametersString = parameterBuilder.createQueryString();
23
+ return UrlString.appendQueryString(this._baseEndpoint, queryParametersString);
24
+ }
25
+ computeParametersBodyString() {
26
+ const parameterBuilder = new RequestParameterBuilder();
27
+ if (this.bodyParameters) {
28
+ parameterBuilder.addExtraQueryParameters(this.bodyParameters);
29
+ }
30
+ const bodyParametersString = parameterBuilder.createQueryString();
31
+ return UrlString.appendQueryString(this._baseEndpoint, bodyParametersString);
32
+ }
33
+ }
34
+
35
+ export { ManagedIdentityRequestParameters };
36
+ //# sourceMappingURL=ManagedIdentityRequestParameters.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedIdentityRequestParameters.mjs","sources":["../../src/config/ManagedIdentityRequestParameters.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAMA;AAEA;;;AAIW,MAAA,gCAAuC,CAAA;AACvC,IAAA,WAAA,CAAA,UAAuB,EAAC,QAAQ,EAAA;AAE3B,QAAA,IAAA,CAAA,UAAA,GAAU,UAAE,CAAA;AAQjB,QAAA,IAAA,CAAA,aAAoB,GAAA,QAAA,CAAA;AAepB,QAAA,IAAA,CAAA,OAAA,GAAA,EAAA,CAAA;AAcV,QAAA,IAAA,CAAA,cAAA,GAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  import { GuidGenerator } from './GuidGenerator.mjs';
4
4
  import { EncodingUtils } from '../utils/EncodingUtils.mjs';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  import { v4 } from 'uuid';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  import { Hash } from '../utils/Constants.mjs';
4
4
  import crypto from 'crypto';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
2
  'use strict';
3
3
  import { Constants } from '@azure/msal-common';
4
4
  import { RANDOM_OCTET_SIZE, CharSet } from '../utils/Constants.mjs';
@@ -0,0 +1,40 @@
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
+ 'use strict';
3
+ 'use strict';
4
+
5
+ var msalCommon = require('@azure/msal-common');
6
+ var ManagedIdentityErrorCodes = require('./ManagedIdentityErrorCodes.cjs');
7
+
8
+ /*
9
+ * Copyright (c) Microsoft Corporation. All rights reserved.
10
+ * Licensed under the MIT License.
11
+ */
12
+ /**
13
+ * ManagedIdentityErrorMessage class containing string constants used by error codes and messages.
14
+ */
15
+ const ManagedIdentityErrorMessages = {
16
+ [ManagedIdentityErrorCodes.invalidManagedIdentityIdType]: "More than one ManagedIdentityIdType was provided.",
17
+ [ManagedIdentityErrorCodes.invalidResource]: "The supplied resource is an invalid URL.",
18
+ [ManagedIdentityErrorCodes.missingId]: "A ManagedIdentityId id was not provided.",
19
+ [ManagedIdentityErrorCodes.unableToCreateAzureArc]: "Azure Arc Managed Identities can only be system assigned.",
20
+ [ManagedIdentityErrorCodes.unableToCreateSource]: "Unable to create a Managed Identity source based on environment variables.",
21
+ [ManagedIdentityErrorCodes.unableToReadSecretFile]: "Unable to read the secret file.",
22
+ [ManagedIdentityErrorCodes.urlParseError]: "The Managed Identity's 'IDENTITY_ENDPOINT' environment variable is malformed.",
23
+ [ManagedIdentityErrorCodes.wwwAuthenticateHeaderMissing]: "A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",
24
+ [ManagedIdentityErrorCodes.wwwAuthenticateHeaderUnsupportedFormat]: "A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format.",
25
+ };
26
+ class ManagedIdentityError extends msalCommon.AuthError {
27
+ constructor(errorCode) {
28
+ super(errorCode, ManagedIdentityErrorMessages[errorCode]);
29
+ this.name = "ManagedIdentityError";
30
+ Object.setPrototypeOf(this, ManagedIdentityError.prototype);
31
+ }
32
+ }
33
+ function createManagedIdentityError(errorCode) {
34
+ return new ManagedIdentityError(errorCode);
35
+ }
36
+
37
+ exports.ManagedIdentityError = ManagedIdentityError;
38
+ exports.ManagedIdentityErrorMessages = ManagedIdentityErrorMessages;
39
+ exports.createManagedIdentityError = createManagedIdentityError;
40
+ //# sourceMappingURL=ManagedIdentityError.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedIdentityError.cjs","sources":["../../src/error/ManagedIdentityError.ts"],"sourcesContent":[null],"names":["ManagedIdentityErrorCodes.unableToReadSecretFile","ManagedIdentityErrorCodes.urlParseError","ManagedIdentityErrorCodes.wwwAuthenticateHeaderMissing","ManagedIdentityErrorCodes.wwwAuthenticateHeaderUnsupportedFormat"],"mappings":";;;;;;;AAKA;AACA;AACA;AAEA;;;;;;;;;;IAsBE,CAAAA,gDAAA,GAAA,iCAAA;AAEF,IAAa,CAAAC,yHAAsC;AACnC,IAAA,CAAAC,sDAAiB,GAAA,8GAAA;AAKhC,IAAA,CAAAC,gEAAA,GAAA,+HAAA;AAED,EAAA;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,22 @@
1
+ import { AuthError } from "@azure/msal-common";
2
+ import * as ManagedIdentityErrorCodes from "./ManagedIdentityErrorCodes";
3
+ export { ManagedIdentityErrorCodes };
4
+ /**
5
+ * ManagedIdentityErrorMessage class containing string constants used by error codes and messages.
6
+ */
7
+ export declare const ManagedIdentityErrorMessages: {
8
+ invalid_managed_identity_id_type: string;
9
+ invalid_resource: string;
10
+ missing_client_id: string;
11
+ unable_to_create_azure_arc: string;
12
+ unable_to_create_source: string;
13
+ unable_to_read_secret_file: string;
14
+ url_parse_error: string;
15
+ www_authenticate_header_missing: string;
16
+ www_authenticate_header_unsupported_format: string;
17
+ };
18
+ export declare class ManagedIdentityError extends AuthError {
19
+ constructor(errorCode: string);
20
+ }
21
+ export declare function createManagedIdentityError(errorCode: string): ManagedIdentityError;
22
+ //# sourceMappingURL=ManagedIdentityError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedIdentityError.d.ts","sourceRoot":"","sources":["../../src/error/ManagedIdentityError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,yBAAyB,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;CAmBxC,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,SAAS;gBACnC,SAAS,EAAE,MAAM;CAKhC;AAED,wBAAgB,0BAA0B,CACtC,SAAS,EAAE,MAAM,GAClB,oBAAoB,CAEtB"}
@@ -0,0 +1,36 @@
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
+ 'use strict';
3
+ import { AuthError } from '@azure/msal-common';
4
+ import { invalidManagedIdentityIdType, invalidResource, missingId, unableToCreateAzureArc, unableToCreateSource, unableToReadSecretFile, urlParseError, wwwAuthenticateHeaderMissing, wwwAuthenticateHeaderUnsupportedFormat } from './ManagedIdentityErrorCodes.mjs';
5
+
6
+ /*
7
+ * Copyright (c) Microsoft Corporation. All rights reserved.
8
+ * Licensed under the MIT License.
9
+ */
10
+ /**
11
+ * ManagedIdentityErrorMessage class containing string constants used by error codes and messages.
12
+ */
13
+ const ManagedIdentityErrorMessages = {
14
+ [invalidManagedIdentityIdType]: "More than one ManagedIdentityIdType was provided.",
15
+ [invalidResource]: "The supplied resource is an invalid URL.",
16
+ [missingId]: "A ManagedIdentityId id was not provided.",
17
+ [unableToCreateAzureArc]: "Azure Arc Managed Identities can only be system assigned.",
18
+ [unableToCreateSource]: "Unable to create a Managed Identity source based on environment variables.",
19
+ [unableToReadSecretFile]: "Unable to read the secret file.",
20
+ [urlParseError]: "The Managed Identity's 'IDENTITY_ENDPOINT' environment variable is malformed.",
21
+ [wwwAuthenticateHeaderMissing]: "A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",
22
+ [wwwAuthenticateHeaderUnsupportedFormat]: "A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format.",
23
+ };
24
+ class ManagedIdentityError extends AuthError {
25
+ constructor(errorCode) {
26
+ super(errorCode, ManagedIdentityErrorMessages[errorCode]);
27
+ this.name = "ManagedIdentityError";
28
+ Object.setPrototypeOf(this, ManagedIdentityError.prototype);
29
+ }
30
+ }
31
+ function createManagedIdentityError(errorCode) {
32
+ return new ManagedIdentityError(errorCode);
33
+ }
34
+
35
+ export { ManagedIdentityError, ManagedIdentityErrorMessages, createManagedIdentityError };
36
+ //# sourceMappingURL=ManagedIdentityError.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ManagedIdentityError.mjs","sources":["../../src/error/ManagedIdentityError.ts"],"sourcesContent":[null],"names":["ManagedIdentityErrorCodes.unableToReadSecretFile","ManagedIdentityErrorCodes.urlParseError","ManagedIdentityErrorCodes.wwwAuthenticateHeaderMissing","ManagedIdentityErrorCodes.wwwAuthenticateHeaderUnsupportedFormat"],"mappings":";;;;;AAKA;AACA;AACA;AAEA;;;;;;;;;;IAsBE,CAAAA,sBAAA,GAAA,iCAAA;AAEF,IAAa,CAAAC,+FAAsC;AACnC,IAAA,CAAAC,4BAAiB,GAAA,8GAAA;AAKhC,IAAA,CAAAC,sCAAA,GAAA,+HAAA;AAED,EAAA;;;;;;;;;;;;;;"}
@@ -0,0 +1,28 @@
1
+ /*! @azure/msal-node v2.3.0-alpha.0 2023-12-07 */
2
+ 'use strict';
3
+ 'use strict';
4
+
5
+ /*
6
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7
+ * Licensed under the MIT License.
8
+ */
9
+ const invalidManagedIdentityIdType = "invalid_managed_identity_id_type";
10
+ const invalidResource = "invalid_resource";
11
+ const missingId = "missing_client_id";
12
+ const unableToCreateAzureArc = "unable_to_create_azure_arc";
13
+ const unableToCreateSource = "unable_to_create_source";
14
+ const unableToReadSecretFile = "unable_to_read_secret_file";
15
+ const urlParseError = "url_parse_error";
16
+ const wwwAuthenticateHeaderMissing = "www_authenticate_header_missing";
17
+ const wwwAuthenticateHeaderUnsupportedFormat = "www_authenticate_header_unsupported_format";
18
+
19
+ exports.invalidManagedIdentityIdType = invalidManagedIdentityIdType;
20
+ exports.invalidResource = invalidResource;
21
+ exports.missingId = missingId;
22
+ exports.unableToCreateAzureArc = unableToCreateAzureArc;
23
+ exports.unableToCreateSource = unableToCreateSource;
24
+ exports.unableToReadSecretFile = unableToReadSecretFile;
25
+ exports.urlParseError = urlParseError;
26
+ exports.wwwAuthenticateHeaderMissing = wwwAuthenticateHeaderMissing;
27
+ exports.wwwAuthenticateHeaderUnsupportedFormat = wwwAuthenticateHeaderUnsupportedFormat;
28
+ //# sourceMappingURL=ManagedIdentityErrorCodes.cjs.map