@azure/msal-node 2.5.1 → 2.7.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 (265) hide show
  1. package/dist/cache/ITokenCache.d.ts +15 -15
  2. package/dist/cache/NodeStorage.cjs +423 -405
  3. package/dist/cache/NodeStorage.cjs.map +1 -1
  4. package/dist/cache/NodeStorage.d.ts +193 -182
  5. package/dist/cache/NodeStorage.d.ts.map +1 -1
  6. package/dist/cache/NodeStorage.mjs +424 -406
  7. package/dist/cache/NodeStorage.mjs.map +1 -1
  8. package/dist/cache/TokenCache.cjs +265 -265
  9. package/dist/cache/TokenCache.cjs.map +1 -1
  10. package/dist/cache/TokenCache.d.ts +90 -90
  11. package/dist/cache/TokenCache.mjs +265 -265
  12. package/dist/cache/TokenCache.mjs.map +1 -1
  13. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  14. package/dist/cache/distributed/DistributedCachePlugin.cjs.map +1 -1
  15. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  16. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  17. package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
  18. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  19. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  20. package/dist/cache/serializer/Deserializer.cjs +170 -167
  21. package/dist/cache/serializer/Deserializer.cjs.map +1 -1
  22. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  23. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  24. package/dist/cache/serializer/Deserializer.mjs +170 -167
  25. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  26. package/dist/cache/serializer/Serializer.cjs +137 -134
  27. package/dist/cache/serializer/Serializer.cjs.map +1 -1
  28. package/dist/cache/serializer/Serializer.d.ts +39 -39
  29. package/dist/cache/serializer/Serializer.d.ts.map +1 -1
  30. package/dist/cache/serializer/Serializer.mjs +137 -134
  31. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  32. package/dist/cache/serializer/SerializerTypes.d.ts +102 -101
  33. package/dist/cache/serializer/SerializerTypes.d.ts.map +1 -1
  34. package/dist/client/ClientApplication.cjs +333 -333
  35. package/dist/client/ClientApplication.cjs.map +1 -1
  36. package/dist/client/ClientApplication.d.ts +142 -142
  37. package/dist/client/ClientApplication.d.ts.map +1 -1
  38. package/dist/client/ClientApplication.mjs +333 -333
  39. package/dist/client/ClientApplication.mjs.map +1 -1
  40. package/dist/client/ClientAssertion.cjs +116 -116
  41. package/dist/client/ClientAssertion.cjs.map +1 -1
  42. package/dist/client/ClientAssertion.d.ts +46 -46
  43. package/dist/client/ClientAssertion.mjs +116 -116
  44. package/dist/client/ClientAssertion.mjs.map +1 -1
  45. package/dist/client/ClientCredentialClient.cjs +194 -189
  46. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  47. package/dist/client/ClientCredentialClient.d.ts +33 -33
  48. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  49. package/dist/client/ClientCredentialClient.mjs +195 -190
  50. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  51. package/dist/client/ConfidentialClientApplication.cjs +163 -163
  52. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  53. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  54. package/dist/client/ConfidentialClientApplication.mjs +163 -163
  55. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  56. package/dist/client/DeviceCodeClient.cjs +207 -207
  57. package/dist/client/DeviceCodeClient.cjs.map +1 -1
  58. package/dist/client/DeviceCodeClient.d.ts +53 -53
  59. package/dist/client/DeviceCodeClient.mjs +207 -207
  60. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  61. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  62. package/dist/client/IPublicClientApplication.d.ts +42 -42
  63. package/dist/client/ManagedIdentityApplication.cjs +96 -0
  64. package/dist/client/ManagedIdentityApplication.cjs.map +1 -0
  65. package/dist/client/ManagedIdentityApplication.d.ts +24 -0
  66. package/dist/client/ManagedIdentityApplication.d.ts.map +1 -0
  67. package/dist/client/ManagedIdentityApplication.mjs +94 -0
  68. package/dist/client/ManagedIdentityApplication.mjs.map +1 -0
  69. package/dist/client/ManagedIdentityClient.cjs +49 -0
  70. package/dist/client/ManagedIdentityClient.cjs.map +1 -0
  71. package/dist/client/ManagedIdentityClient.d.ts +25 -0
  72. package/dist/client/ManagedIdentityClient.d.ts.map +1 -0
  73. package/dist/client/ManagedIdentityClient.mjs +47 -0
  74. package/dist/client/ManagedIdentityClient.mjs.map +1 -0
  75. package/dist/client/ManagedIdentitySources/AppService.cjs +79 -0
  76. package/dist/client/ManagedIdentitySources/AppService.cjs.map +1 -0
  77. package/dist/client/ManagedIdentitySources/AppService.d.ts +17 -0
  78. package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -0
  79. package/dist/client/ManagedIdentitySources/AppService.mjs +77 -0
  80. package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -0
  81. package/dist/client/ManagedIdentitySources/AzureArc.cjs +107 -0
  82. package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +1 -0
  83. package/dist/client/ManagedIdentitySources/AzureArc.d.ts +19 -0
  84. package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -0
  85. package/dist/client/ManagedIdentitySources/AzureArc.mjs +104 -0
  86. package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -0
  87. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +87 -0
  88. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +1 -0
  89. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +19 -0
  90. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -0
  91. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +85 -0
  92. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -0
  93. package/dist/client/ManagedIdentitySources/CloudShell.d.ts +7 -0
  94. package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -0
  95. package/dist/client/ManagedIdentitySources/Imds.cjs +63 -0
  96. package/dist/client/ManagedIdentitySources/Imds.cjs.map +1 -0
  97. package/dist/client/ManagedIdentitySources/Imds.d.ts +13 -0
  98. package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -0
  99. package/dist/client/ManagedIdentitySources/Imds.mjs +61 -0
  100. package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -0
  101. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +7 -0
  102. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -0
  103. package/dist/client/OnBehalfOfClient.cjs +202 -202
  104. package/dist/client/OnBehalfOfClient.cjs.map +1 -1
  105. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  106. package/dist/client/OnBehalfOfClient.mjs +202 -202
  107. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  108. package/dist/client/PublicClientApplication.cjs +229 -229
  109. package/dist/client/PublicClientApplication.cjs.map +1 -1
  110. package/dist/client/PublicClientApplication.d.ts +71 -71
  111. package/dist/client/PublicClientApplication.mjs +229 -229
  112. package/dist/client/PublicClientApplication.mjs.map +1 -1
  113. package/dist/client/UsernamePasswordClient.cjs +95 -95
  114. package/dist/client/UsernamePasswordClient.cjs.map +1 -1
  115. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  116. package/dist/client/UsernamePasswordClient.mjs +95 -95
  117. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  118. package/dist/config/Configuration.cjs +88 -72
  119. package/dist/config/Configuration.cjs.map +1 -1
  120. package/dist/config/Configuration.d.ts +122 -107
  121. package/dist/config/Configuration.d.ts.map +1 -1
  122. package/dist/config/Configuration.mjs +88 -73
  123. package/dist/config/Configuration.mjs.map +1 -1
  124. package/dist/config/ManagedIdentityId.cjs +59 -0
  125. package/dist/config/ManagedIdentityId.cjs.map +1 -0
  126. package/dist/config/ManagedIdentityId.d.ts +12 -0
  127. package/dist/config/ManagedIdentityId.d.ts.map +1 -0
  128. package/dist/config/ManagedIdentityId.mjs +57 -0
  129. package/dist/config/ManagedIdentityId.mjs.map +1 -0
  130. package/dist/config/ManagedIdentityRequestParameters.cjs +38 -0
  131. package/dist/config/ManagedIdentityRequestParameters.cjs.map +1 -0
  132. package/dist/config/ManagedIdentityRequestParameters.d.ts +12 -0
  133. package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -0
  134. package/dist/config/ManagedIdentityRequestParameters.mjs +36 -0
  135. package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -0
  136. package/dist/crypto/CryptoProvider.cjs +75 -75
  137. package/dist/crypto/CryptoProvider.cjs.map +1 -1
  138. package/dist/crypto/CryptoProvider.d.ts +52 -52
  139. package/dist/crypto/CryptoProvider.mjs +75 -75
  140. package/dist/crypto/CryptoProvider.mjs.map +1 -1
  141. package/dist/crypto/GuidGenerator.cjs +22 -22
  142. package/dist/crypto/GuidGenerator.cjs.map +1 -1
  143. package/dist/crypto/GuidGenerator.d.ts +14 -14
  144. package/dist/crypto/GuidGenerator.mjs +22 -22
  145. package/dist/crypto/GuidGenerator.mjs.map +1 -1
  146. package/dist/crypto/HashUtils.cjs +13 -13
  147. package/dist/crypto/HashUtils.cjs.map +1 -1
  148. package/dist/crypto/HashUtils.d.ts +8 -8
  149. package/dist/crypto/HashUtils.mjs +13 -13
  150. package/dist/crypto/HashUtils.mjs.map +1 -1
  151. package/dist/crypto/PkceGenerator.cjs +49 -49
  152. package/dist/crypto/PkceGenerator.cjs.map +1 -1
  153. package/dist/crypto/PkceGenerator.d.ts +22 -22
  154. package/dist/crypto/PkceGenerator.mjs +49 -49
  155. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  156. package/dist/error/ManagedIdentityError.cjs +40 -0
  157. package/dist/error/ManagedIdentityError.cjs.map +1 -0
  158. package/dist/error/ManagedIdentityError.d.ts +22 -0
  159. package/dist/error/ManagedIdentityError.d.ts.map +1 -0
  160. package/dist/error/ManagedIdentityError.mjs +36 -0
  161. package/dist/error/ManagedIdentityError.mjs.map +1 -0
  162. package/dist/error/ManagedIdentityErrorCodes.cjs +28 -0
  163. package/dist/error/ManagedIdentityErrorCodes.cjs.map +1 -0
  164. package/dist/error/ManagedIdentityErrorCodes.d.ts +10 -0
  165. package/dist/error/ManagedIdentityErrorCodes.d.ts.map +1 -0
  166. package/dist/error/ManagedIdentityErrorCodes.mjs +18 -0
  167. package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -0
  168. package/dist/error/NodeAuthError.cjs +85 -85
  169. package/dist/error/NodeAuthError.cjs.map +1 -1
  170. package/dist/error/NodeAuthError.d.ts +65 -65
  171. package/dist/error/NodeAuthError.mjs +85 -85
  172. package/dist/error/NodeAuthError.mjs.map +1 -1
  173. package/dist/index.cjs +3 -1
  174. package/dist/index.cjs.map +1 -1
  175. package/dist/index.d.ts +44 -42
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.mjs +2 -1
  178. package/dist/index.mjs.map +1 -1
  179. package/dist/internals.cjs +8 -8
  180. package/dist/internals.cjs.map +1 -1
  181. package/dist/internals.d.ts +6 -6
  182. package/dist/internals.mjs +8 -8
  183. package/dist/internals.mjs.map +1 -1
  184. package/dist/network/HttpClient.cjs +283 -276
  185. package/dist/network/HttpClient.cjs.map +1 -1
  186. package/dist/network/HttpClient.d.ts +26 -25
  187. package/dist/network/HttpClient.d.ts.map +1 -1
  188. package/dist/network/HttpClient.mjs +283 -276
  189. package/dist/network/HttpClient.mjs.map +1 -1
  190. package/dist/network/ILoopbackClient.d.ts +10 -10
  191. package/dist/network/LoopbackClient.cjs +77 -77
  192. package/dist/network/LoopbackClient.cjs.map +1 -1
  193. package/dist/network/LoopbackClient.d.ts +21 -21
  194. package/dist/network/LoopbackClient.mjs +77 -77
  195. package/dist/network/LoopbackClient.mjs.map +1 -1
  196. package/dist/packageMetadata.cjs +4 -4
  197. package/dist/packageMetadata.cjs.map +1 -1
  198. package/dist/packageMetadata.d.ts +2 -2
  199. package/dist/packageMetadata.d.ts.map +1 -1
  200. package/dist/packageMetadata.mjs +4 -4
  201. package/dist/packageMetadata.mjs.map +1 -1
  202. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  203. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  204. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  205. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  206. package/dist/request/InteractiveRequest.d.ts +22 -22
  207. package/dist/request/ManagedIdentityRequest.d.ts +9 -0
  208. package/dist/request/ManagedIdentityRequest.d.ts.map +1 -0
  209. package/dist/request/ManagedIdentityRequestParams.d.ts +10 -0
  210. package/dist/request/ManagedIdentityRequestParams.d.ts.map +1 -0
  211. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  212. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  213. package/dist/request/SignOutRequest.d.ts +5 -5
  214. package/dist/request/SilentFlowRequest.d.ts +16 -16
  215. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  216. package/dist/response/ManagedIdentityTokenResponse.d.ts +25 -0
  217. package/dist/response/ManagedIdentityTokenResponse.d.ts.map +1 -0
  218. package/dist/utils/Constants.cjs +109 -80
  219. package/dist/utils/Constants.cjs.map +1 -1
  220. package/dist/utils/Constants.d.ts +106 -86
  221. package/dist/utils/Constants.d.ts.map +1 -1
  222. package/dist/utils/Constants.mjs +100 -81
  223. package/dist/utils/Constants.mjs.map +1 -1
  224. package/dist/utils/EncodingUtils.cjs +44 -44
  225. package/dist/utils/EncodingUtils.cjs.map +1 -1
  226. package/dist/utils/EncodingUtils.d.ts +26 -26
  227. package/dist/utils/EncodingUtils.mjs +44 -44
  228. package/dist/utils/EncodingUtils.mjs.map +1 -1
  229. package/dist/utils/NetworkUtils.cjs +38 -38
  230. package/dist/utils/NetworkUtils.cjs.map +1 -1
  231. package/dist/utils/NetworkUtils.d.ts +5 -5
  232. package/dist/utils/NetworkUtils.mjs +38 -38
  233. package/dist/utils/NetworkUtils.mjs.map +1 -1
  234. package/package.json +3 -3
  235. package/src/cache/NodeStorage.ts +24 -7
  236. package/src/cache/TokenCache.ts +1 -1
  237. package/src/cache/serializer/Deserializer.ts +5 -0
  238. package/src/cache/serializer/Serializer.ts +5 -0
  239. package/src/cache/serializer/SerializerTypes.ts +1 -0
  240. package/src/client/ClientApplication.ts +10 -9
  241. package/src/client/ClientCredentialClient.ts +72 -27
  242. package/src/client/ConfidentialClientApplication.ts +2 -2
  243. package/src/client/DeviceCodeClient.ts +1 -1
  244. package/src/client/ManagedIdentityApplication.ts +194 -0
  245. package/src/client/ManagedIdentityClient.ts +111 -0
  246. package/src/client/ManagedIdentitySources/AppService.ts +151 -0
  247. package/src/client/ManagedIdentitySources/AzureArc.ts +208 -0
  248. package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +169 -0
  249. package/src/client/ManagedIdentitySources/CloudShell.ts +19 -0
  250. package/src/client/ManagedIdentitySources/Imds.ts +112 -0
  251. package/src/client/ManagedIdentitySources/ServiceFabric.ts +19 -0
  252. package/src/client/OnBehalfOfClient.ts +5 -5
  253. package/src/client/PublicClientApplication.ts +1 -1
  254. package/src/config/Configuration.ts +47 -1
  255. package/src/config/ManagedIdentityId.ts +73 -0
  256. package/src/config/ManagedIdentityRequestParameters.ts +53 -0
  257. package/src/error/ManagedIdentityError.ts +46 -0
  258. package/src/error/ManagedIdentityErrorCodes.ts +15 -0
  259. package/src/index.ts +4 -0
  260. package/src/network/HttpClient.ts +17 -5
  261. package/src/packageMetadata.ts +1 -1
  262. package/src/request/ManagedIdentityRequest.ts +15 -0
  263. package/src/request/ManagedIdentityRequestParams.ts +14 -0
  264. package/src/response/ManagedIdentityTokenResponse.ts +33 -0
  265. package/src/utils/Constants.ts +27 -0
@@ -1,82 +1,98 @@
1
- /*! @azure/msal-node v2.5.1 2023-11-07 */
1
+ /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
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
- * Copyright (c) Microsoft Corporation. All rights reserved.
10
- * Licensed under the MIT License.
11
- */
12
- const DEFAULT_AUTH_OPTIONS = {
13
- clientId: msalCommon.Constants.EMPTY_STRING,
14
- authority: msalCommon.Constants.DEFAULT_AUTHORITY,
15
- clientSecret: msalCommon.Constants.EMPTY_STRING,
16
- clientAssertion: msalCommon.Constants.EMPTY_STRING,
17
- clientCertificate: {
18
- thumbprint: msalCommon.Constants.EMPTY_STRING,
19
- privateKey: msalCommon.Constants.EMPTY_STRING,
20
- x5c: msalCommon.Constants.EMPTY_STRING,
21
- },
22
- knownAuthorities: [],
23
- cloudDiscoveryMetadata: msalCommon.Constants.EMPTY_STRING,
24
- authorityMetadata: msalCommon.Constants.EMPTY_STRING,
25
- clientCapabilities: [],
26
- protocolMode: msalCommon.ProtocolMode.AAD,
27
- azureCloudOptions: {
28
- azureCloudInstance: msalCommon.AzureCloudInstance.None,
29
- tenant: msalCommon.Constants.EMPTY_STRING,
30
- },
31
- skipAuthorityMetadataCache: false,
32
- };
33
- const DEFAULT_CACHE_OPTIONS = {
34
- claimsBasedCachingEnabled: false,
35
- };
36
- const DEFAULT_LOGGER_OPTIONS = {
37
- loggerCallback: () => {
38
- // allow users to not set logger call back
39
- },
40
- piiLoggingEnabled: false,
41
- logLevel: msalCommon.LogLevel.Info,
42
- };
43
- const DEFAULT_SYSTEM_OPTIONS = {
44
- loggerOptions: DEFAULT_LOGGER_OPTIONS,
45
- networkClient: new HttpClient.HttpClient(),
46
- proxyUrl: msalCommon.Constants.EMPTY_STRING,
47
- customAgentOptions: {},
48
- };
49
- const DEFAULT_TELEMETRY_OPTIONS = {
50
- application: {
51
- appName: msalCommon.Constants.EMPTY_STRING,
52
- appVersion: msalCommon.Constants.EMPTY_STRING,
53
- },
54
- };
55
- /**
56
- * Sets the default options when not explicitly configured from app developer
57
- *
58
- * @param auth - Authentication options
59
- * @param cache - Cache options
60
- * @param system - System options
61
- * @param telemetry - Telemetry options
62
- *
63
- * @returns Configuration
64
- * @internal
65
- */
66
- function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
67
- const systemOptions = {
68
- ...DEFAULT_SYSTEM_OPTIONS,
69
- networkClient: new HttpClient.HttpClient(system?.proxyUrl, system?.customAgentOptions),
70
- loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
71
- };
72
- return {
73
- auth: { ...DEFAULT_AUTH_OPTIONS, ...auth },
74
- broker: { ...broker },
75
- cache: { ...DEFAULT_CACHE_OPTIONS, ...cache },
76
- system: { ...systemOptions, ...system },
77
- telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
78
- };
9
+ /*
10
+ * Copyright (c) Microsoft Corporation. All rights reserved.
11
+ * Licensed under the MIT License.
12
+ */
13
+ const DEFAULT_AUTH_OPTIONS = {
14
+ clientId: msalCommon.Constants.EMPTY_STRING,
15
+ authority: msalCommon.Constants.DEFAULT_AUTHORITY,
16
+ clientSecret: msalCommon.Constants.EMPTY_STRING,
17
+ clientAssertion: msalCommon.Constants.EMPTY_STRING,
18
+ clientCertificate: {
19
+ thumbprint: msalCommon.Constants.EMPTY_STRING,
20
+ privateKey: msalCommon.Constants.EMPTY_STRING,
21
+ x5c: msalCommon.Constants.EMPTY_STRING,
22
+ },
23
+ knownAuthorities: [],
24
+ cloudDiscoveryMetadata: msalCommon.Constants.EMPTY_STRING,
25
+ authorityMetadata: msalCommon.Constants.EMPTY_STRING,
26
+ clientCapabilities: [],
27
+ protocolMode: msalCommon.ProtocolMode.AAD,
28
+ azureCloudOptions: {
29
+ azureCloudInstance: msalCommon.AzureCloudInstance.None,
30
+ tenant: msalCommon.Constants.EMPTY_STRING,
31
+ },
32
+ skipAuthorityMetadataCache: false,
33
+ };
34
+ const DEFAULT_CACHE_OPTIONS = {
35
+ claimsBasedCachingEnabled: false,
36
+ };
37
+ const DEFAULT_LOGGER_OPTIONS = {
38
+ loggerCallback: () => {
39
+ // allow users to not set logger call back
40
+ },
41
+ piiLoggingEnabled: false,
42
+ logLevel: msalCommon.LogLevel.Info,
43
+ };
44
+ const DEFAULT_SYSTEM_OPTIONS = {
45
+ loggerOptions: DEFAULT_LOGGER_OPTIONS,
46
+ networkClient: new HttpClient.HttpClient(),
47
+ proxyUrl: msalCommon.Constants.EMPTY_STRING,
48
+ customAgentOptions: {},
49
+ };
50
+ const DEFAULT_TELEMETRY_OPTIONS = {
51
+ application: {
52
+ appName: msalCommon.Constants.EMPTY_STRING,
53
+ appVersion: msalCommon.Constants.EMPTY_STRING,
54
+ },
55
+ };
56
+ /**
57
+ * Sets the default options when not explicitly configured from app developer
58
+ *
59
+ * @param auth - Authentication options
60
+ * @param cache - Cache options
61
+ * @param system - System options
62
+ * @param telemetry - Telemetry options
63
+ *
64
+ * @returns Configuration
65
+ * @internal
66
+ */
67
+ function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
68
+ const systemOptions = {
69
+ ...DEFAULT_SYSTEM_OPTIONS,
70
+ networkClient: new HttpClient.HttpClient(system?.proxyUrl, system?.customAgentOptions, false // Managed Identity
71
+ ),
72
+ loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
73
+ };
74
+ return {
75
+ auth: { ...DEFAULT_AUTH_OPTIONS, ...auth },
76
+ broker: { ...broker },
77
+ cache: { ...DEFAULT_CACHE_OPTIONS, ...cache },
78
+ system: { ...systemOptions, ...system },
79
+ telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
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","LogLevel","HttpClient","ManagedIdentityId"],"mappings":";;;;;;;;AAAA;;;AAGG;AAsHH,MAAM,oBAAoB,GAA8B;IACpD,QAAQ,EAAEA,oBAAS,CAAC,YAAY;IAChC,SAAS,EAAEA,oBAAS,CAAC,iBAAiB;IACtC,YAAY,EAAEA,oBAAS,CAAC,YAAY;IACpC,eAAe,EAAEA,oBAAS,CAAC,YAAY;AACvC,IAAA,iBAAiB,EAAE;QACf,UAAU,EAAEA,oBAAS,CAAC,YAAY;QAClC,UAAU,EAAEA,oBAAS,CAAC,YAAY;QAClC,GAAG,EAAEA,oBAAS,CAAC,YAAY;AAC9B,KAAA;AACD,IAAA,gBAAgB,EAAE,EAAE;IACpB,sBAAsB,EAAEA,oBAAS,CAAC,YAAY;IAC9C,iBAAiB,EAAEA,oBAAS,CAAC,YAAY;AACzC,IAAA,kBAAkB,EAAE,EAAE;IACtB,YAAY,EAAEC,uBAAY,CAAC,GAAG;AAC9B,IAAA,iBAAiB,EAAE;QACf,kBAAkB,EAAEC,6BAAkB,CAAC,IAAI;QAC3C,MAAM,EAAEF,oBAAS,CAAC,YAAY;AACjC,KAAA;AACD,IAAA,0BAA0B,EAAE,KAAK;CACpC,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E,GAAG,SAAS,EAAE;KAC5D,CAAC;AACN,CAAC;SAOe,iCAAiC,CAAC,EAC9C,uBAAuB,EACvB,MAAM,GACqB,EAAA;AAC3B,IAAA,MAAM,iBAAiB,GAAsB,IAAIC,mCAAiB,CAC9D,uBAAuB,CAC1B,CAAC;AAEF,IAAA,MAAM,aAAa,GAAgC;AAC/C,QAAA,GAAG,sBAAsB;AACzB,QAAA,aAAa,EAAE,MAAM,EAAE,aAAa,IAAI,sBAAsB;AAC9D,QAAA,aAAa,EAAE,IAAID,qBAAU,CACzB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,kBAEgB,EACxB,IAAI;AACP,SAAA;KACJ,CAAC;IAEF,OAAO;AACH,QAAA,iBAAiB,EAAE,iBAAiB;AACpC,QAAA,MAAM,EAAE,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE;KAC1C,CAAC;AACN;;;;;"}
@@ -1,108 +1,123 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { LoggerOptions, INetworkModule, ProtocolMode, ICachePlugin, AzureCloudOptions, ApplicationTelemetry, INativeBrokerPlugin } from "@azure/msal-common";
4
- import http from "http";
5
- import https from "https";
6
- /**
7
- * - clientId - Client id of the application.
8
- * - authority - Url of the authority. If no value is set, defaults to https://login.microsoftonline.com/common.
9
- * - knownAuthorities - Needed for Azure B2C and ADFS. All authorities that will be used in the client application. Only the host of the authority should be passed in.
10
- * - clientSecret - Secret string that the application uses when requesting a token. Only used in confidential client applications. Can be created in the Azure app registration portal.
11
- * - clientAssertion - Assertion string that the application uses when requesting a token. Only used in confidential client applications. Assertion should be of type urn:ietf:params:oauth:client-assertion-type:jwt-bearer.
12
- * - clientCertificate - Certificate that the application uses when requesting a token. Only used in confidential client applications. Requires hex encoded X.509 SHA-1 thumbprint of the certificiate, and the PEM encoded private key (string should contain -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- )
13
- * - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
14
- * - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.
15
- * @public
16
- */
17
- export type NodeAuthOptions = {
18
- clientId: string;
19
- authority?: string;
20
- clientSecret?: string;
21
- clientAssertion?: string;
22
- clientCertificate?: {
23
- thumbprint: string;
24
- privateKey: string;
25
- x5c?: string;
26
- };
27
- knownAuthorities?: Array<string>;
28
- cloudDiscoveryMetadata?: string;
29
- authorityMetadata?: string;
30
- clientCapabilities?: Array<string>;
31
- protocolMode?: ProtocolMode;
32
- azureCloudOptions?: AzureCloudOptions;
33
- skipAuthorityMetadataCache?: boolean;
34
- };
35
- /**
36
- * Use this to configure the below cache configuration options:
37
- *
38
- * - cachePlugin - Plugin for reading and writing token cache to disk.
39
- * @public
40
- */
41
- export type CacheOptions = {
42
- cachePlugin?: ICachePlugin;
43
- claimsBasedCachingEnabled?: boolean;
44
- };
45
- /**
46
- * Use this to configure the below broker options:
47
- * - nativeBrokerPlugin - Native broker implementation (should be imported from msal-node-extensions)
48
- *
49
- * Note: These options are only available for PublicClientApplications using the Authorization Code Flow
50
- * @public
51
- */
52
- export type BrokerOptions = {
53
- nativeBrokerPlugin?: INativeBrokerPlugin;
54
- };
55
- /**
56
- * Type for configuring logger and http client options
57
- *
58
- * - logger - Used to initialize the Logger object; TODO: Expand on logger details or link to the documentation on logger
59
- * - networkClient - Http client used for all http get and post calls. Defaults to using MSAL's default http client.
60
- * @public
61
- */
62
- export type NodeSystemOptions = {
63
- loggerOptions?: LoggerOptions;
64
- networkClient?: INetworkModule;
65
- proxyUrl?: string;
66
- customAgentOptions?: http.AgentOptions | https.AgentOptions;
67
- };
68
- export type NodeTelemetryOptions = {
69
- application?: ApplicationTelemetry;
70
- };
71
- /**
72
- * Use the configuration object to configure MSAL and initialize the client application object
73
- *
74
- * - auth: this is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform
75
- * - broker: this is where you configure broker options
76
- * - cache: this is where you configure cache location
77
- * - system: this is where you can configure the network client, logger
78
- * - telemetry: this is where you can configure telemetry options
79
- * @public
80
- */
81
- export type Configuration = {
82
- auth: NodeAuthOptions;
83
- broker?: BrokerOptions;
84
- cache?: CacheOptions;
85
- system?: NodeSystemOptions;
86
- telemetry?: NodeTelemetryOptions;
87
- };
88
- /** @internal */
89
- export type NodeConfiguration = {
90
- auth: Required<NodeAuthOptions>;
91
- broker: BrokerOptions;
92
- cache: CacheOptions;
93
- system: Required<NodeSystemOptions>;
94
- telemetry: Required<NodeTelemetryOptions>;
95
- };
96
- /**
97
- * Sets the default options when not explicitly configured from app developer
98
- *
99
- * @param auth - Authentication options
100
- * @param cache - Cache options
101
- * @param system - System options
102
- * @param telemetry - Telemetry options
103
- *
104
- * @returns Configuration
105
- * @internal
106
- */
107
- export declare function buildAppConfiguration({ auth, broker, cache, system, telemetry, }: Configuration): NodeConfiguration;
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { LoggerOptions, INetworkModule, ProtocolMode, ICachePlugin, AzureCloudOptions, ApplicationTelemetry, INativeBrokerPlugin } from "@azure/msal-common";
4
+ import http from "http";
5
+ import https from "https";
6
+ import { ManagedIdentityId } from "./ManagedIdentityId.js";
7
+ /**
8
+ * - clientId - Client id of the application.
9
+ * - authority - Url of the authority. If no value is set, defaults to https://login.microsoftonline.com/common.
10
+ * - knownAuthorities - Needed for Azure B2C and ADFS. All authorities that will be used in the client application. Only the host of the authority should be passed in.
11
+ * - clientSecret - Secret string that the application uses when requesting a token. Only used in confidential client applications. Can be created in the Azure app registration portal.
12
+ * - clientAssertion - Assertion string that the application uses when requesting a token. Only used in confidential client applications. Assertion should be of type urn:ietf:params:oauth:client-assertion-type:jwt-bearer.
13
+ * - clientCertificate - Certificate that the application uses when requesting a token. Only used in confidential client applications. Requires hex encoded X.509 SHA-1 thumbprint of the certificiate, and the PEM encoded private key (string should contain -----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY----- )
14
+ * - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
15
+ * - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.
16
+ * @public
17
+ */
18
+ export type NodeAuthOptions = {
19
+ clientId: string;
20
+ authority?: string;
21
+ clientSecret?: string;
22
+ clientAssertion?: string;
23
+ clientCertificate?: {
24
+ thumbprint: string;
25
+ privateKey: string;
26
+ x5c?: string;
27
+ };
28
+ knownAuthorities?: Array<string>;
29
+ cloudDiscoveryMetadata?: string;
30
+ authorityMetadata?: string;
31
+ clientCapabilities?: Array<string>;
32
+ protocolMode?: ProtocolMode;
33
+ azureCloudOptions?: AzureCloudOptions;
34
+ skipAuthorityMetadataCache?: boolean;
35
+ };
36
+ /**
37
+ * Use this to configure the below cache configuration options:
38
+ *
39
+ * - cachePlugin - Plugin for reading and writing token cache to disk.
40
+ * @public
41
+ */
42
+ export type CacheOptions = {
43
+ cachePlugin?: ICachePlugin;
44
+ claimsBasedCachingEnabled?: boolean;
45
+ };
46
+ /**
47
+ * Use this to configure the below broker options:
48
+ * - nativeBrokerPlugin - Native broker implementation (should be imported from msal-node-extensions)
49
+ *
50
+ * Note: These options are only available for PublicClientApplications using the Authorization Code Flow
51
+ * @public
52
+ */
53
+ export type BrokerOptions = {
54
+ nativeBrokerPlugin?: INativeBrokerPlugin;
55
+ };
56
+ /**
57
+ * Type for configuring logger and http client options
58
+ *
59
+ * - logger - Used to initialize the Logger object; TODO: Expand on logger details or link to the documentation on logger
60
+ * - networkClient - Http client used for all http get and post calls. Defaults to using MSAL's default http client.
61
+ * @public
62
+ */
63
+ export type NodeSystemOptions = {
64
+ loggerOptions?: LoggerOptions;
65
+ networkClient?: INetworkModule;
66
+ proxyUrl?: string;
67
+ customAgentOptions?: http.AgentOptions | https.AgentOptions;
68
+ };
69
+ export type NodeTelemetryOptions = {
70
+ application?: ApplicationTelemetry;
71
+ };
72
+ /**
73
+ * Use the configuration object to configure MSAL and initialize the client application object
74
+ *
75
+ * - auth: this is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform
76
+ * - broker: this is where you configure broker options
77
+ * - cache: this is where you configure cache location
78
+ * - system: this is where you can configure the network client, logger
79
+ * - telemetry: this is where you can configure telemetry options
80
+ * @public
81
+ */
82
+ export type Configuration = {
83
+ auth: NodeAuthOptions;
84
+ broker?: BrokerOptions;
85
+ cache?: CacheOptions;
86
+ system?: NodeSystemOptions;
87
+ telemetry?: NodeTelemetryOptions;
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
+ };
98
+ /** @internal */
99
+ export type NodeConfiguration = {
100
+ auth: Required<NodeAuthOptions>;
101
+ broker: BrokerOptions;
102
+ cache: CacheOptions;
103
+ system: Required<NodeSystemOptions>;
104
+ telemetry: Required<NodeTelemetryOptions>;
105
+ };
106
+ /**
107
+ * Sets the default options when not explicitly configured from app developer
108
+ *
109
+ * @param auth - Authentication options
110
+ * @param cache - Cache options
111
+ * @param system - System options
112
+ * @param telemetry - Telemetry options
113
+ *
114
+ * @returns Configuration
115
+ * @internal
116
+ */
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,oB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AY,CAAC;IACrB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,SAAS,CAAC,EAAE,oBAAoB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACvC,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AAkDF,gBAAgB;AAChB,MAAM,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,80 +1,95 @@
1
- /*! @azure/msal-node v2.5.1 2023-11-07 */
1
+ /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
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
- * Copyright (c) Microsoft Corporation. All rights reserved.
8
- * Licensed under the MIT License.
9
- */
10
- const DEFAULT_AUTH_OPTIONS = {
11
- clientId: Constants.EMPTY_STRING,
12
- authority: Constants.DEFAULT_AUTHORITY,
13
- clientSecret: Constants.EMPTY_STRING,
14
- clientAssertion: Constants.EMPTY_STRING,
15
- clientCertificate: {
16
- thumbprint: Constants.EMPTY_STRING,
17
- privateKey: Constants.EMPTY_STRING,
18
- x5c: Constants.EMPTY_STRING,
19
- },
20
- knownAuthorities: [],
21
- cloudDiscoveryMetadata: Constants.EMPTY_STRING,
22
- authorityMetadata: Constants.EMPTY_STRING,
23
- clientCapabilities: [],
24
- protocolMode: ProtocolMode.AAD,
25
- azureCloudOptions: {
26
- azureCloudInstance: AzureCloudInstance.None,
27
- tenant: Constants.EMPTY_STRING,
28
- },
29
- skipAuthorityMetadataCache: false,
30
- };
31
- const DEFAULT_CACHE_OPTIONS = {
32
- claimsBasedCachingEnabled: false,
33
- };
34
- const DEFAULT_LOGGER_OPTIONS = {
35
- loggerCallback: () => {
36
- // allow users to not set logger call back
37
- },
38
- piiLoggingEnabled: false,
39
- logLevel: LogLevel.Info,
40
- };
41
- const DEFAULT_SYSTEM_OPTIONS = {
42
- loggerOptions: DEFAULT_LOGGER_OPTIONS,
43
- networkClient: new HttpClient(),
44
- proxyUrl: Constants.EMPTY_STRING,
45
- customAgentOptions: {},
46
- };
47
- const DEFAULT_TELEMETRY_OPTIONS = {
48
- application: {
49
- appName: Constants.EMPTY_STRING,
50
- appVersion: Constants.EMPTY_STRING,
51
- },
52
- };
53
- /**
54
- * Sets the default options when not explicitly configured from app developer
55
- *
56
- * @param auth - Authentication options
57
- * @param cache - Cache options
58
- * @param system - System options
59
- * @param telemetry - Telemetry options
60
- *
61
- * @returns Configuration
62
- * @internal
63
- */
64
- function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
65
- const systemOptions = {
66
- ...DEFAULT_SYSTEM_OPTIONS,
67
- networkClient: new HttpClient(system?.proxyUrl, system?.customAgentOptions),
68
- loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
69
- };
70
- return {
71
- auth: { ...DEFAULT_AUTH_OPTIONS, ...auth },
72
- broker: { ...broker },
73
- cache: { ...DEFAULT_CACHE_OPTIONS, ...cache },
74
- system: { ...systemOptions, ...system },
75
- telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
76
- };
7
+ /*
8
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9
+ * Licensed under the MIT License.
10
+ */
11
+ const DEFAULT_AUTH_OPTIONS = {
12
+ clientId: Constants.EMPTY_STRING,
13
+ authority: Constants.DEFAULT_AUTHORITY,
14
+ clientSecret: Constants.EMPTY_STRING,
15
+ clientAssertion: Constants.EMPTY_STRING,
16
+ clientCertificate: {
17
+ thumbprint: Constants.EMPTY_STRING,
18
+ privateKey: Constants.EMPTY_STRING,
19
+ x5c: Constants.EMPTY_STRING,
20
+ },
21
+ knownAuthorities: [],
22
+ cloudDiscoveryMetadata: Constants.EMPTY_STRING,
23
+ authorityMetadata: Constants.EMPTY_STRING,
24
+ clientCapabilities: [],
25
+ protocolMode: ProtocolMode.AAD,
26
+ azureCloudOptions: {
27
+ azureCloudInstance: AzureCloudInstance.None,
28
+ tenant: Constants.EMPTY_STRING,
29
+ },
30
+ skipAuthorityMetadataCache: false,
31
+ };
32
+ const DEFAULT_CACHE_OPTIONS = {
33
+ claimsBasedCachingEnabled: false,
34
+ };
35
+ const DEFAULT_LOGGER_OPTIONS = {
36
+ loggerCallback: () => {
37
+ // allow users to not set logger call back
38
+ },
39
+ piiLoggingEnabled: false,
40
+ logLevel: LogLevel.Info,
41
+ };
42
+ const DEFAULT_SYSTEM_OPTIONS = {
43
+ loggerOptions: DEFAULT_LOGGER_OPTIONS,
44
+ networkClient: new HttpClient(),
45
+ proxyUrl: Constants.EMPTY_STRING,
46
+ customAgentOptions: {},
47
+ };
48
+ const DEFAULT_TELEMETRY_OPTIONS = {
49
+ application: {
50
+ appName: Constants.EMPTY_STRING,
51
+ appVersion: Constants.EMPTY_STRING,
52
+ },
53
+ };
54
+ /**
55
+ * Sets the default options when not explicitly configured from app developer
56
+ *
57
+ * @param auth - Authentication options
58
+ * @param cache - Cache options
59
+ * @param system - System options
60
+ * @param telemetry - Telemetry options
61
+ *
62
+ * @returns Configuration
63
+ * @internal
64
+ */
65
+ function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
66
+ const systemOptions = {
67
+ ...DEFAULT_SYSTEM_OPTIONS,
68
+ networkClient: new HttpClient(system?.proxyUrl, system?.customAgentOptions, false // Managed Identity
69
+ ),
70
+ loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
71
+ };
72
+ return {
73
+ auth: { ...DEFAULT_AUTH_OPTIONS, ...auth },
74
+ broker: { ...broker },
75
+ cache: { ...DEFAULT_CACHE_OPTIONS, ...cache },
76
+ system: { ...systemOptions, ...system },
77
+ telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
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":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