@azure/identity 4.10.3-alpha.20250708.2 → 4.11.0-alpha.20250717.4

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 (351) hide show
  1. package/README.md +19 -1
  2. package/dist/browser/client/identityClient.js +30 -18
  3. package/dist/browser/client/identityClient.js.map +1 -1
  4. package/dist/browser/constants.d.ts +1 -1
  5. package/dist/browser/constants.d.ts.map +1 -1
  6. package/dist/browser/constants.js +1 -1
  7. package/dist/browser/constants.js.map +1 -1
  8. package/dist/browser/credentials/brokerCredential.d.ts +35 -0
  9. package/dist/browser/credentials/brokerCredential.d.ts.map +1 -0
  10. package/dist/browser/credentials/brokerCredential.js +69 -0
  11. package/dist/browser/credentials/brokerCredential.js.map +1 -0
  12. package/dist/browser/credentials/chainedTokenCredential.js +1 -1
  13. package/dist/browser/credentials/chainedTokenCredential.js.map +1 -1
  14. package/dist/browser/credentials/clientSecretCredential-browser.mjs.map +1 -1
  15. package/dist/browser/credentials/clientSecretCredential.js +7 -2
  16. package/dist/browser/credentials/interactiveBrowserCredential-browser.mjs.map +1 -1
  17. package/dist/browser/credentials/interactiveBrowserCredential.js +19 -6
  18. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js +4 -6
  19. package/dist/browser/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
  20. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +5 -4
  21. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +1 -1
  22. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.js +16 -6
  23. package/dist/browser/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
  24. package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.js +7 -1
  25. package/dist/browser/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
  26. package/dist/browser/credentials/usernamePasswordCredential-browser.mjs.map +1 -1
  27. package/dist/browser/credentials/usernamePasswordCredential.js +7 -1
  28. package/dist/browser/credentials/visualStudioCodeCredentialOptions.d.ts +0 -4
  29. package/dist/browser/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -1
  30. package/dist/browser/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
  31. package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -4
  32. package/dist/browser/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -1
  33. package/dist/browser/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
  34. package/dist/browser/errors.js +21 -0
  35. package/dist/browser/errors.js.map +1 -1
  36. package/dist/browser/msal/browserFlows/msalBrowserCommon.js +15 -15
  37. package/dist/browser/msal/browserFlows/msalBrowserCommon.js.map +1 -1
  38. package/dist/browser/msal/nodeFlows/msalClient.d.ts +13 -0
  39. package/dist/browser/msal/nodeFlows/msalClient.d.ts.map +1 -1
  40. package/dist/browser/msal/nodeFlows/msalClient.js +127 -94
  41. package/dist/browser/msal/nodeFlows/msalClient.js.map +1 -1
  42. package/dist/browser/msal/nodeFlows/msalPlugins.d.ts +19 -1
  43. package/dist/browser/msal/nodeFlows/msalPlugins.d.ts.map +1 -1
  44. package/dist/browser/msal/nodeFlows/msalPlugins.js +61 -16
  45. package/dist/browser/msal/nodeFlows/msalPlugins.js.map +1 -1
  46. package/dist/browser/msal/utils.js +3 -4
  47. package/dist/browser/msal/utils.js.map +1 -1
  48. package/dist/browser/plugins/provider.d.ts +2 -2
  49. package/dist/browser/plugins/provider.d.ts.map +1 -1
  50. package/dist/browser/plugins/provider.js.map +1 -1
  51. package/dist/browser/regionalAuthority.js +1 -2
  52. package/dist/browser/regionalAuthority.js.map +1 -1
  53. package/dist/browser/tokenProvider.js +1 -2
  54. package/dist/browser/tokenProvider.js.map +1 -1
  55. package/dist/browser/util/logging.js +6 -2
  56. package/dist/browser/util/logging.js.map +1 -1
  57. package/dist/browser/util/processMultiTenantRequest-browser.mjs.map +1 -1
  58. package/dist/browser/util/processMultiTenantRequest.js +1 -2
  59. package/dist/browser/util/processUtils.d.ts +1 -1
  60. package/dist/browser/util/processUtils.d.ts.map +1 -1
  61. package/dist/browser/util/processUtils.js +1 -1
  62. package/dist/browser/util/processUtils.js.map +1 -1
  63. package/dist/commonjs/client/identityClient.js +30 -18
  64. package/dist/commonjs/client/identityClient.js.map +1 -1
  65. package/dist/commonjs/constants.d.ts +1 -1
  66. package/dist/commonjs/constants.d.ts.map +1 -1
  67. package/dist/commonjs/constants.js +1 -1
  68. package/dist/commonjs/constants.js.map +1 -1
  69. package/dist/commonjs/credentials/authorizationCodeCredential.js +17 -3
  70. package/dist/commonjs/credentials/authorizationCodeCredential.js.map +1 -1
  71. package/dist/commonjs/credentials/azureCliCredential.js +15 -12
  72. package/dist/commonjs/credentials/azureCliCredential.js.map +1 -1
  73. package/dist/commonjs/credentials/azureDeveloperCliCredential.js +12 -10
  74. package/dist/commonjs/credentials/azureDeveloperCliCredential.js.map +1 -1
  75. package/dist/commonjs/credentials/azurePipelinesCredential.js +9 -5
  76. package/dist/commonjs/credentials/azurePipelinesCredential.js.map +1 -1
  77. package/dist/commonjs/credentials/azurePowerShellCredential.js +10 -7
  78. package/dist/commonjs/credentials/azurePowerShellCredential.js.map +1 -1
  79. package/dist/commonjs/credentials/brokerCredential.d.ts +35 -0
  80. package/dist/commonjs/credentials/brokerCredential.d.ts.map +1 -0
  81. package/dist/commonjs/credentials/brokerCredential.js +73 -0
  82. package/dist/commonjs/credentials/brokerCredential.js.map +1 -0
  83. package/dist/commonjs/credentials/chainedTokenCredential.js +1 -1
  84. package/dist/commonjs/credentials/chainedTokenCredential.js.map +1 -1
  85. package/dist/commonjs/credentials/clientAssertionCredential.js +11 -2
  86. package/dist/commonjs/credentials/clientAssertionCredential.js.map +1 -1
  87. package/dist/commonjs/credentials/clientCertificateCredential.js +19 -9
  88. package/dist/commonjs/credentials/clientCertificateCredential.js.map +1 -1
  89. package/dist/commonjs/credentials/clientSecretCredential.js +10 -2
  90. package/dist/commonjs/credentials/clientSecretCredential.js.map +1 -1
  91. package/dist/commonjs/credentials/defaultAzureCredential.d.ts +18 -0
  92. package/dist/commonjs/credentials/defaultAzureCredential.d.ts.map +1 -1
  93. package/dist/commonjs/credentials/defaultAzureCredential.js +69 -19
  94. package/dist/commonjs/credentials/defaultAzureCredential.js.map +1 -1
  95. package/dist/commonjs/credentials/deviceCodeCredential.js +24 -10
  96. package/dist/commonjs/credentials/deviceCodeCredential.js.map +1 -1
  97. package/dist/commonjs/credentials/environmentCredential.js +4 -6
  98. package/dist/commonjs/credentials/environmentCredential.js.map +1 -1
  99. package/dist/commonjs/credentials/interactiveBrowserCredential.js +30 -11
  100. package/dist/commonjs/credentials/interactiveBrowserCredential.js.map +1 -1
  101. package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js +4 -6
  102. package/dist/commonjs/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
  103. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +5 -4
  104. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +1 -1
  105. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js +16 -6
  106. package/dist/commonjs/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
  107. package/dist/commonjs/credentials/managedIdentityCredential/index.js +28 -18
  108. package/dist/commonjs/credentials/managedIdentityCredential/index.js.map +1 -1
  109. package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js +7 -1
  110. package/dist/commonjs/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
  111. package/dist/commonjs/credentials/onBehalfOfCredential.js +13 -1
  112. package/dist/commonjs/credentials/onBehalfOfCredential.js.map +1 -1
  113. package/dist/commonjs/credentials/usernamePasswordCredential.js +10 -2
  114. package/dist/commonjs/credentials/usernamePasswordCredential.js.map +1 -1
  115. package/dist/commonjs/credentials/visualStudioCodeCredential.d.ts +15 -26
  116. package/dist/commonjs/credentials/visualStudioCodeCredential.d.ts.map +1 -1
  117. package/dist/commonjs/credentials/visualStudioCodeCredential.js +69 -130
  118. package/dist/commonjs/credentials/visualStudioCodeCredential.js.map +1 -1
  119. package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.d.ts +0 -4
  120. package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -1
  121. package/dist/commonjs/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
  122. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -4
  123. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -1
  124. package/dist/commonjs/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
  125. package/dist/commonjs/credentials/workloadIdentityCredential.js +5 -3
  126. package/dist/commonjs/credentials/workloadIdentityCredential.js.map +1 -1
  127. package/dist/commonjs/errors.js +21 -0
  128. package/dist/commonjs/errors.js.map +1 -1
  129. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js +15 -15
  130. package/dist/commonjs/msal/browserFlows/msalBrowserCommon.js.map +1 -1
  131. package/dist/commonjs/msal/nodeFlows/msalClient.d.ts +13 -0
  132. package/dist/commonjs/msal/nodeFlows/msalClient.d.ts.map +1 -1
  133. package/dist/commonjs/msal/nodeFlows/msalClient.js +127 -94
  134. package/dist/commonjs/msal/nodeFlows/msalClient.js.map +1 -1
  135. package/dist/commonjs/msal/nodeFlows/msalPlugins.d.ts +19 -1
  136. package/dist/commonjs/msal/nodeFlows/msalPlugins.d.ts.map +1 -1
  137. package/dist/commonjs/msal/nodeFlows/msalPlugins.js +63 -17
  138. package/dist/commonjs/msal/nodeFlows/msalPlugins.js.map +1 -1
  139. package/dist/commonjs/msal/utils.js +3 -4
  140. package/dist/commonjs/msal/utils.js.map +1 -1
  141. package/dist/commonjs/plugins/consumer.d.ts.map +1 -1
  142. package/dist/commonjs/plugins/consumer.js +1 -2
  143. package/dist/commonjs/plugins/consumer.js.map +1 -1
  144. package/dist/commonjs/plugins/provider.d.ts +2 -2
  145. package/dist/commonjs/plugins/provider.d.ts.map +1 -1
  146. package/dist/commonjs/plugins/provider.js.map +1 -1
  147. package/dist/commonjs/regionalAuthority.js +1 -2
  148. package/dist/commonjs/regionalAuthority.js.map +1 -1
  149. package/dist/commonjs/tokenProvider.js +1 -2
  150. package/dist/commonjs/tokenProvider.js.map +1 -1
  151. package/dist/commonjs/util/logging.js +6 -2
  152. package/dist/commonjs/util/logging.js.map +1 -1
  153. package/dist/commonjs/util/processMultiTenantRequest.js +2 -3
  154. package/dist/commonjs/util/processMultiTenantRequest.js.map +1 -1
  155. package/dist/commonjs/util/processUtils.d.ts +1 -1
  156. package/dist/commonjs/util/processUtils.d.ts.map +1 -1
  157. package/dist/commonjs/util/processUtils.js +2 -2
  158. package/dist/commonjs/util/processUtils.js.map +1 -1
  159. package/dist/esm/client/identityClient.js +30 -18
  160. package/dist/esm/client/identityClient.js.map +1 -1
  161. package/dist/esm/constants.d.ts +1 -1
  162. package/dist/esm/constants.d.ts.map +1 -1
  163. package/dist/esm/constants.js +1 -1
  164. package/dist/esm/constants.js.map +1 -1
  165. package/dist/esm/credentials/authorizationCodeCredential.js +17 -3
  166. package/dist/esm/credentials/authorizationCodeCredential.js.map +1 -1
  167. package/dist/esm/credentials/azureCliCredential.js +15 -12
  168. package/dist/esm/credentials/azureCliCredential.js.map +1 -1
  169. package/dist/esm/credentials/azureDeveloperCliCredential.js +12 -10
  170. package/dist/esm/credentials/azureDeveloperCliCredential.js.map +1 -1
  171. package/dist/esm/credentials/azurePipelinesCredential.js +9 -5
  172. package/dist/esm/credentials/azurePipelinesCredential.js.map +1 -1
  173. package/dist/esm/credentials/azurePowerShellCredential.js +10 -7
  174. package/dist/esm/credentials/azurePowerShellCredential.js.map +1 -1
  175. package/dist/esm/credentials/brokerCredential.d.ts +35 -0
  176. package/dist/esm/credentials/brokerCredential.d.ts.map +1 -0
  177. package/dist/esm/credentials/brokerCredential.js +69 -0
  178. package/dist/esm/credentials/brokerCredential.js.map +1 -0
  179. package/dist/esm/credentials/chainedTokenCredential.js +1 -1
  180. package/dist/esm/credentials/chainedTokenCredential.js.map +1 -1
  181. package/dist/esm/credentials/clientAssertionCredential.js +11 -2
  182. package/dist/esm/credentials/clientAssertionCredential.js.map +1 -1
  183. package/dist/esm/credentials/clientCertificateCredential.js +19 -9
  184. package/dist/esm/credentials/clientCertificateCredential.js.map +1 -1
  185. package/dist/esm/credentials/clientSecretCredential.js +10 -2
  186. package/dist/esm/credentials/clientSecretCredential.js.map +1 -1
  187. package/dist/esm/credentials/defaultAzureCredential.d.ts +18 -0
  188. package/dist/esm/credentials/defaultAzureCredential.d.ts.map +1 -1
  189. package/dist/esm/credentials/defaultAzureCredential.js +67 -19
  190. package/dist/esm/credentials/defaultAzureCredential.js.map +1 -1
  191. package/dist/esm/credentials/deviceCodeCredential.js +24 -10
  192. package/dist/esm/credentials/deviceCodeCredential.js.map +1 -1
  193. package/dist/esm/credentials/environmentCredential.js +4 -6
  194. package/dist/esm/credentials/environmentCredential.js.map +1 -1
  195. package/dist/esm/credentials/interactiveBrowserCredential.js +30 -11
  196. package/dist/esm/credentials/interactiveBrowserCredential.js.map +1 -1
  197. package/dist/esm/credentials/managedIdentityCredential/imdsMsi.js +4 -6
  198. package/dist/esm/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
  199. package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +5 -4
  200. package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +1 -1
  201. package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.js +16 -6
  202. package/dist/esm/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
  203. package/dist/esm/credentials/managedIdentityCredential/index.js +28 -18
  204. package/dist/esm/credentials/managedIdentityCredential/index.js.map +1 -1
  205. package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.js +7 -1
  206. package/dist/esm/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
  207. package/dist/esm/credentials/onBehalfOfCredential.js +13 -1
  208. package/dist/esm/credentials/onBehalfOfCredential.js.map +1 -1
  209. package/dist/esm/credentials/usernamePasswordCredential.js +10 -2
  210. package/dist/esm/credentials/usernamePasswordCredential.js.map +1 -1
  211. package/dist/esm/credentials/visualStudioCodeCredential.d.ts +15 -26
  212. package/dist/esm/credentials/visualStudioCodeCredential.d.ts.map +1 -1
  213. package/dist/esm/credentials/visualStudioCodeCredential.js +69 -128
  214. package/dist/esm/credentials/visualStudioCodeCredential.js.map +1 -1
  215. package/dist/esm/credentials/visualStudioCodeCredentialOptions.d.ts +0 -4
  216. package/dist/esm/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -1
  217. package/dist/esm/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
  218. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -4
  219. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -1
  220. package/dist/esm/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
  221. package/dist/esm/credentials/workloadIdentityCredential.js +5 -3
  222. package/dist/esm/credentials/workloadIdentityCredential.js.map +1 -1
  223. package/dist/esm/errors.js +21 -0
  224. package/dist/esm/errors.js.map +1 -1
  225. package/dist/esm/msal/browserFlows/msalBrowserCommon.js +15 -15
  226. package/dist/esm/msal/browserFlows/msalBrowserCommon.js.map +1 -1
  227. package/dist/esm/msal/nodeFlows/msalClient.d.ts +13 -0
  228. package/dist/esm/msal/nodeFlows/msalClient.d.ts.map +1 -1
  229. package/dist/esm/msal/nodeFlows/msalClient.js +127 -94
  230. package/dist/esm/msal/nodeFlows/msalClient.js.map +1 -1
  231. package/dist/esm/msal/nodeFlows/msalPlugins.d.ts +19 -1
  232. package/dist/esm/msal/nodeFlows/msalPlugins.d.ts.map +1 -1
  233. package/dist/esm/msal/nodeFlows/msalPlugins.js +61 -16
  234. package/dist/esm/msal/nodeFlows/msalPlugins.js.map +1 -1
  235. package/dist/esm/msal/utils.js +3 -4
  236. package/dist/esm/msal/utils.js.map +1 -1
  237. package/dist/esm/plugins/consumer.d.ts.map +1 -1
  238. package/dist/esm/plugins/consumer.js +2 -3
  239. package/dist/esm/plugins/consumer.js.map +1 -1
  240. package/dist/esm/plugins/provider.d.ts +2 -2
  241. package/dist/esm/plugins/provider.d.ts.map +1 -1
  242. package/dist/esm/plugins/provider.js.map +1 -1
  243. package/dist/esm/regionalAuthority.js +1 -2
  244. package/dist/esm/regionalAuthority.js.map +1 -1
  245. package/dist/esm/tokenProvider.js +1 -2
  246. package/dist/esm/tokenProvider.js.map +1 -1
  247. package/dist/esm/util/logging.js +6 -2
  248. package/dist/esm/util/logging.js.map +1 -1
  249. package/dist/esm/util/processMultiTenantRequest.js +2 -3
  250. package/dist/esm/util/processMultiTenantRequest.js.map +1 -1
  251. package/dist/esm/util/processUtils.d.ts +1 -1
  252. package/dist/esm/util/processUtils.d.ts.map +1 -1
  253. package/dist/esm/util/processUtils.js +1 -1
  254. package/dist/esm/util/processUtils.js.map +1 -1
  255. package/dist/workerd/client/identityClient.js +30 -18
  256. package/dist/workerd/client/identityClient.js.map +1 -1
  257. package/dist/workerd/constants.d.ts +1 -1
  258. package/dist/workerd/constants.d.ts.map +1 -1
  259. package/dist/workerd/constants.js +1 -1
  260. package/dist/workerd/constants.js.map +1 -1
  261. package/dist/workerd/credentials/authorizationCodeCredential.js +17 -3
  262. package/dist/workerd/credentials/authorizationCodeCredential.js.map +1 -1
  263. package/dist/workerd/credentials/azureCliCredential.js +15 -12
  264. package/dist/workerd/credentials/azureCliCredential.js.map +1 -1
  265. package/dist/workerd/credentials/azureDeveloperCliCredential.js +12 -10
  266. package/dist/workerd/credentials/azureDeveloperCliCredential.js.map +1 -1
  267. package/dist/workerd/credentials/azurePipelinesCredential.js +9 -5
  268. package/dist/workerd/credentials/azurePipelinesCredential.js.map +1 -1
  269. package/dist/workerd/credentials/azurePowerShellCredential.js +10 -7
  270. package/dist/workerd/credentials/azurePowerShellCredential.js.map +1 -1
  271. package/dist/workerd/credentials/brokerCredential.d.ts +35 -0
  272. package/dist/workerd/credentials/brokerCredential.d.ts.map +1 -0
  273. package/dist/workerd/credentials/brokerCredential.js +69 -0
  274. package/dist/workerd/credentials/brokerCredential.js.map +1 -0
  275. package/dist/workerd/credentials/chainedTokenCredential.js +1 -1
  276. package/dist/workerd/credentials/chainedTokenCredential.js.map +1 -1
  277. package/dist/workerd/credentials/clientAssertionCredential.js +11 -2
  278. package/dist/workerd/credentials/clientAssertionCredential.js.map +1 -1
  279. package/dist/workerd/credentials/clientCertificateCredential.js +19 -9
  280. package/dist/workerd/credentials/clientCertificateCredential.js.map +1 -1
  281. package/dist/workerd/credentials/clientSecretCredential.js +10 -2
  282. package/dist/workerd/credentials/clientSecretCredential.js.map +1 -1
  283. package/dist/workerd/credentials/defaultAzureCredential.d.ts +18 -0
  284. package/dist/workerd/credentials/defaultAzureCredential.d.ts.map +1 -1
  285. package/dist/workerd/credentials/defaultAzureCredential.js +67 -19
  286. package/dist/workerd/credentials/defaultAzureCredential.js.map +1 -1
  287. package/dist/workerd/credentials/deviceCodeCredential.js +24 -10
  288. package/dist/workerd/credentials/deviceCodeCredential.js.map +1 -1
  289. package/dist/workerd/credentials/environmentCredential.js +4 -6
  290. package/dist/workerd/credentials/environmentCredential.js.map +1 -1
  291. package/dist/workerd/credentials/interactiveBrowserCredential.js +30 -11
  292. package/dist/workerd/credentials/interactiveBrowserCredential.js.map +1 -1
  293. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.js +4 -6
  294. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.js.map +1 -1
  295. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +5 -4
  296. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +1 -1
  297. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.js +16 -6
  298. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -1
  299. package/dist/workerd/credentials/managedIdentityCredential/index.js +28 -18
  300. package/dist/workerd/credentials/managedIdentityCredential/index.js.map +1 -1
  301. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js +7 -1
  302. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -1
  303. package/dist/workerd/credentials/onBehalfOfCredential.js +13 -1
  304. package/dist/workerd/credentials/onBehalfOfCredential.js.map +1 -1
  305. package/dist/workerd/credentials/usernamePasswordCredential.js +10 -2
  306. package/dist/workerd/credentials/usernamePasswordCredential.js.map +1 -1
  307. package/dist/workerd/credentials/visualStudioCodeCredential.d.ts +15 -26
  308. package/dist/workerd/credentials/visualStudioCodeCredential.d.ts.map +1 -1
  309. package/dist/workerd/credentials/visualStudioCodeCredential.js +69 -128
  310. package/dist/workerd/credentials/visualStudioCodeCredential.js.map +1 -1
  311. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.d.ts +0 -4
  312. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -1
  313. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.js.map +1 -1
  314. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts +0 -4
  315. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -1
  316. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js.map +1 -1
  317. package/dist/workerd/credentials/workloadIdentityCredential.js +5 -3
  318. package/dist/workerd/credentials/workloadIdentityCredential.js.map +1 -1
  319. package/dist/workerd/errors.js +21 -0
  320. package/dist/workerd/errors.js.map +1 -1
  321. package/dist/workerd/msal/browserFlows/msalBrowserCommon.js +15 -15
  322. package/dist/workerd/msal/browserFlows/msalBrowserCommon.js.map +1 -1
  323. package/dist/workerd/msal/nodeFlows/msalClient.d.ts +13 -0
  324. package/dist/workerd/msal/nodeFlows/msalClient.d.ts.map +1 -1
  325. package/dist/workerd/msal/nodeFlows/msalClient.js +127 -94
  326. package/dist/workerd/msal/nodeFlows/msalClient.js.map +1 -1
  327. package/dist/workerd/msal/nodeFlows/msalPlugins.d.ts +19 -1
  328. package/dist/workerd/msal/nodeFlows/msalPlugins.d.ts.map +1 -1
  329. package/dist/workerd/msal/nodeFlows/msalPlugins.js +61 -16
  330. package/dist/workerd/msal/nodeFlows/msalPlugins.js.map +1 -1
  331. package/dist/workerd/msal/utils.js +3 -4
  332. package/dist/workerd/msal/utils.js.map +1 -1
  333. package/dist/workerd/plugins/consumer.d.ts.map +1 -1
  334. package/dist/workerd/plugins/consumer.js +2 -3
  335. package/dist/workerd/plugins/consumer.js.map +1 -1
  336. package/dist/workerd/plugins/provider.d.ts +2 -2
  337. package/dist/workerd/plugins/provider.d.ts.map +1 -1
  338. package/dist/workerd/plugins/provider.js.map +1 -1
  339. package/dist/workerd/regionalAuthority.js +1 -2
  340. package/dist/workerd/regionalAuthority.js.map +1 -1
  341. package/dist/workerd/tokenProvider.js +1 -2
  342. package/dist/workerd/tokenProvider.js.map +1 -1
  343. package/dist/workerd/util/logging.js +6 -2
  344. package/dist/workerd/util/logging.js.map +1 -1
  345. package/dist/workerd/util/processMultiTenantRequest.js +2 -3
  346. package/dist/workerd/util/processMultiTenantRequest.js.map +1 -1
  347. package/dist/workerd/util/processUtils.d.ts +1 -1
  348. package/dist/workerd/util/processUtils.d.ts.map +1 -1
  349. package/dist/workerd/util/processUtils.js +1 -1
  350. package/dist/workerd/util/processUtils.js.map +1 -1
  351. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/plugins/provider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AACtG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAEjG;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAExD;;GAEG;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AOG;AACH,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,yBAAyB,EAAE,yBAAyB,CAAC;IACrD,uBAAuB,EAAE,iCAAiC,CAAC;CAC5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/plugins/provider.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCachePersistenceOptions } from \"../msal/nodeFlows/tokenCachePersistenceOptions.js\";\nimport type { VSCodeCredentialFinder } from \"../credentials/visualStudioCodeCredentialPlugin.js\";\n\n/**\n * The type of an Azure Identity plugin, a function accepting a plugin\n * context.\n */\nexport type IdentityPlugin = (context: unknown) => void;\n\n/**\n * Plugin context entries for controlling cache plugins.\n */\nexport interface CachePluginControl {\n setPersistence(\n persistenceFactory: (\n options?: TokenCachePersistenceOptions,\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n ) => Promise<import(\"@azure/msal-node\").ICachePlugin>,\n ): void;\n}\n\nexport interface NativeBrokerPluginControl {\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n setNativeBroker(nativeBroker: import(\"@azure/msal-node\").INativeBrokerPlugin): void;\n}\n\n/**\n * Plugin context entries for controlling VisualStudioCodeCredential.\n */\nexport interface VisualStudioCodeCredentialControl {\n setVsCodeCredentialFinder(finder: VSCodeCredentialFinder): void;\n}\n\n/**\n * Context options passed to a plugin during initialization.\n *\n * Plugin authors are responsible for casting their plugin context values\n * to this type.\n *\n * @internal\n */\nexport interface AzurePluginContext {\n cachePluginControl: CachePluginControl;\n nativeBrokerPluginControl: NativeBrokerPluginControl;\n vsCodeCredentialControl: VisualStudioCodeCredentialControl;\n}\n"]}
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../src/plugins/provider.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCachePersistenceOptions } from \"../msal/nodeFlows/tokenCachePersistenceOptions.js\";\n\n/**\n * The type of an Azure Identity plugin, a function accepting a plugin\n * context.\n */\nexport type IdentityPlugin = (context: unknown) => void;\n\n/**\n * Plugin context entries for controlling cache plugins.\n */\nexport interface CachePluginControl {\n setPersistence(\n persistenceFactory: (\n options?: TokenCachePersistenceOptions,\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n ) => Promise<import(\"@azure/msal-node\").ICachePlugin>,\n ): void;\n}\n\nexport interface NativeBrokerPluginControl {\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n setNativeBroker(nativeBroker: import(\"@azure/msal-node\").INativeBrokerPlugin): void;\n}\n\n/**\n * Plugin context entries for controlling VisualStudioCodeCredential.\n */\nexport interface VisualStudioCodeCredentialControl {\n setVSCodeAuthRecordPath(path: string): void;\n setVSCodeBroker(broker: import(\"@azure/msal-node\").INativeBrokerPlugin): void;\n}\n\n/**\n * Context options passed to a plugin during initialization.\n *\n * Plugin authors are responsible for casting their plugin context values\n * to this type.\n *\n * @internal\n */\nexport interface AzurePluginContext {\n cachePluginControl: CachePluginControl;\n nativeBrokerPluginControl: NativeBrokerPluginControl;\n vsCodeCredentialControl: VisualStudioCodeCredentialControl;\n}\n"]}
@@ -125,11 +125,10 @@ export function calculateRegionalAuthority(regionalAuthority) {
125
125
  // Note: as of today only 3 credentials support regional authority, and the parameter
126
126
  // is not exposed via the public API. Regional Authority is _only_ supported
127
127
  // via the AZURE_REGIONAL_AUTHORITY_NAME env var and _only_ for: ClientSecretCredential, ClientCertificateCredential, and ClientAssertionCredential.
128
- var _a, _b;
129
128
  // Accepting the regionalAuthority parameter will allow us to support it in the future.
130
129
  let azureRegion = regionalAuthority;
131
130
  if (azureRegion === undefined &&
132
- ((_b = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.AZURE_REGIONAL_AUTHORITY_NAME) !== undefined) {
131
+ globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME !== undefined) {
133
132
  azureRegion = process.env.AZURE_REGIONAL_AUTHORITY_NAME;
134
133
  }
135
134
  if (azureRegion === RegionalAuthority.AutoDiscoverRegion) {
@@ -1 +1 @@
1
- {"version":3,"file":"regionalAuthority.js","sourceRoot":"","sources":["../../src/regionalAuthority.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAN,IAAY,iBA2GX;AA3GD,WAAY,iBAAiB;IAC3B,uDAAuD;IACvD,8DAAyC,CAAA;IACzC,wEAAwE;IACxE,sCAAiB,CAAA;IACjB,yEAAyE;IACzE,wCAAmB,CAAA;IACnB,2EAA2E;IAC3E,4CAAuB,CAAA;IACvB,wEAAwE;IACxE,sCAAiB,CAAA;IACjB,yEAAyE;IACzE,wCAAmB,CAAA;IACnB,gFAAgF;IAChF,sDAAiC,CAAA;IACjC,gFAAgF;IAChF,sDAAiC,CAAA;IACjC,+EAA+E;IAC/E,oDAA+B,CAAA;IAC/B,+EAA+E;IAC/E,oDAA+B,CAAA;IAC/B,4EAA4E;IAC5E,8CAAyB,CAAA;IACzB,6EAA6E;IAC7E,gDAA2B,CAAA;IAC3B,6EAA6E;IAC7E,gDAA2B,CAAA;IAC3B,4EAA4E;IAC5E,8CAAyB,CAAA;IACzB,yEAAyE;IACzE,wCAAmB,CAAA;IACnB,wEAAwE;IACxE,sCAAiB,CAAA;IACjB,+EAA+E;IAC/E,oDAA+B,CAAA;IAC/B,6EAA6E;IAC7E,gDAA2B,CAAA;IAC3B,kFAAkF;IAClF,0DAAqC,CAAA;IACrC,iFAAiF;IACjF,wDAAmC,CAAA;IACnC,8EAA8E;IAC9E,kDAA6B,CAAA;IAC7B,oFAAoF;IACpF,8DAAyC,CAAA;IACzC,4EAA4E;IAC5E,8CAAyB,CAAA;IACzB,4EAA4E;IAC5E,8CAAyB,CAAA;IACz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W,GAAG,iBAAiB,CAAC;IAEpC,IACE,WAAW,KAAK,SAAS;QACzB,CAAA,MAAA,MAAA,UAAU,CAAC,OAAO,0CAAE,GAAG,0CAAE,6BAA6B,MAAK,SAAS,EACpE,CAAC;QACD,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC;IAC1D,CAAC;IAED,IAAI,WAAW,KAAK,iBAAiB,CAAC,kBAAkB,EAAE,CAAC;QACzD,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Helps specify a regional authority, or \"AutoDiscoverRegion\" to auto-detect the region.\n */\nexport enum RegionalAuthority {\n /** Instructs MSAL to attempt to discover the region */\n AutoDiscoverRegion = \"AutoDiscoverRegion\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westus' region. */\n USWest = \"westus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westus2' region. */\n USWest2 = \"westus2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'centralus' region. */\n USCentral = \"centralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'eastus' region. */\n USEast = \"eastus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'eastus2' region. */\n USEast2 = \"eastus2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'northcentralus' region. */\n USNorthCentral = \"northcentralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southcentralus' region. */\n USSouthCentral = \"southcentralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westcentralus' region. */\n USWestCentral = \"westcentralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'canadacentral' region. */\n CanadaCentral = \"canadacentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'canadaeast' region. */\n CanadaEast = \"canadaeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'brazilsouth' region. */\n BrazilSouth = \"brazilsouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'northeurope' region. */\n EuropeNorth = \"northeurope\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westeurope' region. */\n EuropeWest = \"westeurope\",\n /** Uses the {@link RegionalAuthority} for the Azure 'uksouth' region. */\n UKSouth = \"uksouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'ukwest' region. */\n UKWest = \"ukwest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'francecentral' region. */\n FranceCentral = \"francecentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'francesouth' region. */\n FranceSouth = \"francesouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandnorth' region. */\n SwitzerlandNorth = \"switzerlandnorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandwest' region. */\n SwitzerlandWest = \"switzerlandwest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanynorth' region. */\n GermanyNorth = \"germanynorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanywestcentral' region. */\n GermanyWestCentral = \"germanywestcentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'norwaywest' region. */\n NorwayWest = \"norwaywest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'norwayeast' region. */\n NorwayEast = \"norwayeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'eastasia' region. */\n AsiaEast = \"eastasia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southeastasia' region. */\n AsiaSouthEast = \"southeastasia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'japaneast' region. */\n JapanEast = \"japaneast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'japanwest' region. */\n JapanWest = \"japanwest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiaeast' region. */\n AustraliaEast = \"australiaeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiasoutheast' region. */\n AustraliaSouthEast = \"australiasoutheast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral' region. */\n AustraliaCentral = \"australiacentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral2' region. */\n AustraliaCentral2 = \"australiacentral2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'centralindia' region. */\n IndiaCentral = \"centralindia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southindia' region. */\n IndiaSouth = \"southindia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westindia' region. */\n IndiaWest = \"westindia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'koreasouth' region. */\n KoreaSouth = \"koreasouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'koreacentral' region. */\n KoreaCentral = \"koreacentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'uaecentral' region. */\n UAECentral = \"uaecentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'uaenorth' region. */\n UAENorth = \"uaenorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southafricanorth' region. */\n SouthAfricaNorth = \"southafricanorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southafricawest' region. */\n SouthAfricaWest = \"southafricawest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth' region. */\n ChinaNorth = \"chinanorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast' region. */\n ChinaEast = \"chinaeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth2' region. */\n ChinaNorth2 = \"chinanorth2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast2' region. */\n ChinaEast2 = \"chinaeast2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanycentral' region. */\n GermanyCentral = \"germanycentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanynortheast' region. */\n GermanyNorthEast = \"germanynortheast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgovvirginia' region. */\n GovernmentUSVirginia = \"usgovvirginia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgoviowa' region. */\n GovernmentUSIowa = \"usgoviowa\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgovarizona' region. */\n GovernmentUSArizona = \"usgovarizona\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgovtexas' region. */\n GovernmentUSTexas = \"usgovtexas\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usdodeast' region. */\n GovernmentUSDodEast = \"usdodeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usdodcentral' region. */\n GovernmentUSDodCentral = \"usdodcentral\",\n}\n\n/**\n * Calculates the correct regional authority based on the supplied value\n * and the AZURE_REGIONAL_AUTHORITY_NAME environment variable.\n *\n * Values will be returned verbatim, except for {@link RegionalAuthority.AutoDiscoverRegion}\n * which is mapped to a value MSAL can understand.\n *\n * @internal\n */\nexport function calculateRegionalAuthority(regionalAuthority?: string): string | undefined {\n // Note: as of today only 3 credentials support regional authority, and the parameter\n // is not exposed via the public API. Regional Authority is _only_ supported\n // via the AZURE_REGIONAL_AUTHORITY_NAME env var and _only_ for: ClientSecretCredential, ClientCertificateCredential, and ClientAssertionCredential.\n\n // Accepting the regionalAuthority parameter will allow us to support it in the future.\n let azureRegion = regionalAuthority;\n\n if (\n azureRegion === undefined &&\n globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME !== undefined\n ) {\n azureRegion = process.env.AZURE_REGIONAL_AUTHORITY_NAME;\n }\n\n if (azureRegion === RegionalAuthority.AutoDiscoverRegion) {\n return \"AUTO_DISCOVER\";\n }\n\n return azureRegion;\n}\n"]}
1
+ {"version":3,"file":"regionalAuthority.js","sourceRoot":"","sources":["../../src/regionalAuthority.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAN,IAAY,iBA2GX;AA3GD,WAAY,iBAAiB;IAC3B,uDAAuD;IACvD,8DAAyC,CAAA;IACzC,wEAAwE;IACxE,sCAAiB,CAAA;IACjB,yEAAyE;IACzE,wCAAmB,CAAA;IACnB,2EAA2E;IAC3E,4CAAuB,CAAA;IACvB,wEAA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C1E,0CAAqB,CAAA;IACrB,kFAAkF;IAClF,0DAAqC,CAAA;IACrC,iFAAiF;IACjF,wDAAmC,CAAA;IACnC,4EAA4E;IAC5E,8CAAyB,CAAA;IACzB,2EAA2E;IAC3E,4CAAuB,CAAA;IACvB,6EAA6E;IAC7E,gDAA2B,CAAA;IAC3B,4EAA4E;IAC5E,8CAAyB,CAAA;IACzB,gFAAgF;IAChF,sDAAiC,CAAA;IACjC,kFAAkF;IAClF,0DAAqC,CAAA;IACrC,+EAA+E;IAC/E,2DAAsC,CAAA;IACtC,2EAA2E;IAC3E,mDAA8B,CAAA;IAC9B,8EAA8E;IAC9E,yDAAoC,CAAA;IACpC,4EAA4E;IAC5E,qDAAgC,CAAA;IAChC,2EAA2E;IAC3E,sDAAiC,CAAA;IACjC,8EAA8E;IAC9E,4DAAuC,CAAA;AACzC,CAAC,EA3GW,iBAAiB,KAAjB,iBAAiB,QA2G5B;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CAAC,iBAA0B;IACnE,qFAAqF;IACrF,4EAA4E;IAC5E,oJAAoJ;IAEpJ,uFAAuF;IACvF,IAAI,WAAW,GAAG,iBAAiB,CAAC;IAEpC,IACE,WAAW,KAAK,SAAS;QACzB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,6BAA6B,KAAK,SAAS,EACpE,CAAC;QACD,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC;IAC1D,CAAC;IAED,IAAI,WAAW,KAAK,iBAAiB,CAAC,kBAAkB,EAAE,CAAC;QACzD,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Helps specify a regional authority, or \"AutoDiscoverRegion\" to auto-detect the region.\n */\nexport enum RegionalAuthority {\n /** Instructs MSAL to attempt to discover the region */\n AutoDiscoverRegion = \"AutoDiscoverRegion\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westus' region. */\n USWest = \"westus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westus2' region. */\n USWest2 = \"westus2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'centralus' region. */\n USCentral = \"centralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'eastus' region. */\n USEast = \"eastus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'eastus2' region. */\n USEast2 = \"eastus2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'northcentralus' region. */\n USNorthCentral = \"northcentralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southcentralus' region. */\n USSouthCentral = \"southcentralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westcentralus' region. */\n USWestCentral = \"westcentralus\",\n /** Uses the {@link RegionalAuthority} for the Azure 'canadacentral' region. */\n CanadaCentral = \"canadacentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'canadaeast' region. */\n CanadaEast = \"canadaeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'brazilsouth' region. */\n BrazilSouth = \"brazilsouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'northeurope' region. */\n EuropeNorth = \"northeurope\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westeurope' region. */\n EuropeWest = \"westeurope\",\n /** Uses the {@link RegionalAuthority} for the Azure 'uksouth' region. */\n UKSouth = \"uksouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'ukwest' region. */\n UKWest = \"ukwest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'francecentral' region. */\n FranceCentral = \"francecentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'francesouth' region. */\n FranceSouth = \"francesouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandnorth' region. */\n SwitzerlandNorth = \"switzerlandnorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandwest' region. */\n SwitzerlandWest = \"switzerlandwest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanynorth' region. */\n GermanyNorth = \"germanynorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanywestcentral' region. */\n GermanyWestCentral = \"germanywestcentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'norwaywest' region. */\n NorwayWest = \"norwaywest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'norwayeast' region. */\n NorwayEast = \"norwayeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'eastasia' region. */\n AsiaEast = \"eastasia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southeastasia' region. */\n AsiaSouthEast = \"southeastasia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'japaneast' region. */\n JapanEast = \"japaneast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'japanwest' region. */\n JapanWest = \"japanwest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiaeast' region. */\n AustraliaEast = \"australiaeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiasoutheast' region. */\n AustraliaSouthEast = \"australiasoutheast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral' region. */\n AustraliaCentral = \"australiacentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral2' region. */\n AustraliaCentral2 = \"australiacentral2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'centralindia' region. */\n IndiaCentral = \"centralindia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southindia' region. */\n IndiaSouth = \"southindia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'westindia' region. */\n IndiaWest = \"westindia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'koreasouth' region. */\n KoreaSouth = \"koreasouth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'koreacentral' region. */\n KoreaCentral = \"koreacentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'uaecentral' region. */\n UAECentral = \"uaecentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'uaenorth' region. */\n UAENorth = \"uaenorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southafricanorth' region. */\n SouthAfricaNorth = \"southafricanorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'southafricawest' region. */\n SouthAfricaWest = \"southafricawest\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth' region. */\n ChinaNorth = \"chinanorth\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast' region. */\n ChinaEast = \"chinaeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth2' region. */\n ChinaNorth2 = \"chinanorth2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast2' region. */\n ChinaEast2 = \"chinaeast2\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanycentral' region. */\n GermanyCentral = \"germanycentral\",\n /** Uses the {@link RegionalAuthority} for the Azure 'germanynortheast' region. */\n GermanyNorthEast = \"germanynortheast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgovvirginia' region. */\n GovernmentUSVirginia = \"usgovvirginia\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgoviowa' region. */\n GovernmentUSIowa = \"usgoviowa\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgovarizona' region. */\n GovernmentUSArizona = \"usgovarizona\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usgovtexas' region. */\n GovernmentUSTexas = \"usgovtexas\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usdodeast' region. */\n GovernmentUSDodEast = \"usdodeast\",\n /** Uses the {@link RegionalAuthority} for the Azure 'usdodcentral' region. */\n GovernmentUSDodCentral = \"usdodcentral\",\n}\n\n/**\n * Calculates the correct regional authority based on the supplied value\n * and the AZURE_REGIONAL_AUTHORITY_NAME environment variable.\n *\n * Values will be returned verbatim, except for {@link RegionalAuthority.AutoDiscoverRegion}\n * which is mapped to a value MSAL can understand.\n *\n * @internal\n */\nexport function calculateRegionalAuthority(regionalAuthority?: string): string | undefined {\n // Note: as of today only 3 credentials support regional authority, and the parameter\n // is not exposed via the public API. Regional Authority is _only_ supported\n // via the AZURE_REGIONAL_AUTHORITY_NAME env var and _only_ for: ClientSecretCredential, ClientCertificateCredential, and ClientAssertionCredential.\n\n // Accepting the regionalAuthority parameter will allow us to support it in the future.\n let azureRegion = regionalAuthority;\n\n if (\n azureRegion === undefined &&\n globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME !== undefined\n ) {\n azureRegion = process.env.AZURE_REGIONAL_AUTHORITY_NAME;\n }\n\n if (azureRegion === RegionalAuthority.AutoDiscoverRegion) {\n return \"AUTO_DISCOVER\";\n }\n\n return azureRegion;\n}\n"]}
@@ -28,7 +28,6 @@ export function getBearerTokenProvider(credential, scopes, options) {
28
28
  const pipeline = createEmptyPipeline();
29
29
  pipeline.addPolicy(bearerTokenAuthenticationPolicy({ credential, scopes }));
30
30
  async function getRefreshedToken() {
31
- var _a;
32
31
  // Create a pipeline with just the bearer token policy
33
32
  // and run a dummy request through it to get the token
34
33
  const res = await pipeline.sendRequest({
@@ -42,7 +41,7 @@ export function getBearerTokenProvider(credential, scopes, options) {
42
41
  abortSignal,
43
42
  tracingOptions,
44
43
  }));
45
- const accessToken = (_a = res.headers.get("authorization")) === null || _a === void 0 ? void 0 : _a.split(" ")[1];
44
+ const accessToken = res.headers.get("authorization")?.split(" ")[1];
46
45
  if (!accessToken) {
47
46
  throw new Error("Failed to get access token");
48
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tokenProvider.js","sourceRoot":"","sources":["../../src/tokenProvider.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAiBnC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,sBAAsB,CACpC,UAA2B,EAC3B,MAAyB,EACzB,OAAuC;IAEvC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,+BAA+B,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5E,KAAK,UAAU,iBAAiB;;QAC9B,sDAAsD;QACtD,sDAAsD;QACtD,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,WAAW,CACpC;YACE,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CACvB,OAAO,CAAC,OAAO,CAAC;gBACd,OAAO;gBACP,MAAM,EAAE,GAAG;gBACX,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAC;SACL,EACD,qBAAqB,CAAC;YACpB,GAAG,EAAE,qBAAqB;YAC1B,WAAW;YACX,cAAc;SACf,CAAC,CACH,CAAC;QACF,MAAM,WAAW,GAAG,MAAA,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,0CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential, TracingContext } from \"@azure/core-auth\";\nimport {\n bearerTokenAuthenticationPolicy,\n createEmptyPipeline,\n createPipelineRequest,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * The options to configure the token provider.\n */\nexport interface GetBearerTokenProviderOptions {\n /** The abort signal to abort requests to get tokens */\n abortSignal?: AbortSignal;\n /** The tracing options for the requests to get tokens */\n tracingOptions?: {\n /**\n * Tracing Context for the current request to get a token.\n */\n tracingContext?: TracingContext;\n };\n}\n\n/**\n * Returns a callback that provides a bearer token.\n * For example, the bearer token can be used to authenticate a request as follows:\n * ```ts snippet:token_provider_example\n * import { DefaultAzureCredential, getBearerTokenProvider } from \"@azure/identity\";\n * import { createPipelineRequest } from \"@azure/core-rest-pipeline\";\n *\n * const credential = new DefaultAzureCredential();\n * const scope = \"https://cognitiveservices.azure.com/.default\";\n * const getAccessToken = getBearerTokenProvider(credential, scope);\n * const token = await getAccessToken();\n *\n * // usage\n * const request = createPipelineRequest({ url: \"https://example.com\" });\n * request.headers.set(\"Authorization\", `Bearer ${token}`);\n * ```\n *\n * @param credential - The credential used to authenticate the request.\n * @param scopes - The scopes required for the bearer token.\n * @param options - Options to configure the token provider.\n * @returns a callback that provides a bearer token.\n */\nexport function getBearerTokenProvider(\n credential: TokenCredential,\n scopes: string | string[],\n options?: GetBearerTokenProviderOptions,\n): () => Promise<string> {\n const { abortSignal, tracingOptions } = options || {};\n const pipeline = createEmptyPipeline();\n pipeline.addPolicy(bearerTokenAuthenticationPolicy({ credential, scopes }));\n async function getRefreshedToken(): Promise<string> {\n // Create a pipeline with just the bearer token policy\n // and run a dummy request through it to get the token\n const res = await pipeline.sendRequest(\n {\n sendRequest: (request) =>\n Promise.resolve({\n request,\n status: 200,\n headers: request.headers,\n }),\n },\n createPipelineRequest({\n url: \"https://example.com\",\n abortSignal,\n tracingOptions,\n }),\n );\n const accessToken = res.headers.get(\"authorization\")?.split(\" \")[1];\n if (!accessToken) {\n throw new Error(\"Failed to get access token\");\n }\n return accessToken;\n }\n return getRefreshedToken;\n}\n"]}
1
+ {"version":3,"file":"tokenProvider.js","sourceRoot":"","sources":["../../src/tokenProvider.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAiBnC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,sBAAsB,CACpC,UAA2B,EAC3B,MAAyB,EACzB,OAAuC;IAEvC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,+BAA+B,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5E,KAAK,UAAU,iBAAiB;QAC9B,sDAAsD;QACtD,sDAAsD;QACtD,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,WAAW,CACpC;YACE,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CACvB,OAAO,CAAC,OAAO,CAAC;gBACd,OAAO;gBACP,MAAM,EAAE,GAAG;gBACX,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAC;SACL,EACD,qBAAqB,CAAC;YACpB,GAAG,EAAE,qBAAqB;YAC1B,WAAW;YACX,cAAc;SACf,CAAC,CACH,CAAC;QACF,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential, TracingContext } from \"@azure/core-auth\";\nimport {\n bearerTokenAuthenticationPolicy,\n createEmptyPipeline,\n createPipelineRequest,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * The options to configure the token provider.\n */\nexport interface GetBearerTokenProviderOptions {\n /** The abort signal to abort requests to get tokens */\n abortSignal?: AbortSignal;\n /** The tracing options for the requests to get tokens */\n tracingOptions?: {\n /**\n * Tracing Context for the current request to get a token.\n */\n tracingContext?: TracingContext;\n };\n}\n\n/**\n * Returns a callback that provides a bearer token.\n * For example, the bearer token can be used to authenticate a request as follows:\n * ```ts snippet:token_provider_example\n * import { DefaultAzureCredential, getBearerTokenProvider } from \"@azure/identity\";\n * import { createPipelineRequest } from \"@azure/core-rest-pipeline\";\n *\n * const credential = new DefaultAzureCredential();\n * const scope = \"https://cognitiveservices.azure.com/.default\";\n * const getAccessToken = getBearerTokenProvider(credential, scope);\n * const token = await getAccessToken();\n *\n * // usage\n * const request = createPipelineRequest({ url: \"https://example.com\" });\n * request.headers.set(\"Authorization\", `Bearer ${token}`);\n * ```\n *\n * @param credential - The credential used to authenticate the request.\n * @param scopes - The scopes required for the bearer token.\n * @param options - Options to configure the token provider.\n * @returns a callback that provides a bearer token.\n */\nexport function getBearerTokenProvider(\n credential: TokenCredential,\n scopes: string | string[],\n options?: GetBearerTokenProviderOptions,\n): () => Promise<string> {\n const { abortSignal, tracingOptions } = options || {};\n const pipeline = createEmptyPipeline();\n pipeline.addPolicy(bearerTokenAuthenticationPolicy({ credential, scopes }));\n async function getRefreshedToken(): Promise<string> {\n // Create a pipeline with just the bearer token policy\n // and run a dummy request through it to get the token\n const res = await pipeline.sendRequest(\n {\n sendRequest: (request) =>\n Promise.resolve({\n request,\n status: 200,\n headers: request.headers,\n }),\n },\n createPipelineRequest({\n url: \"https://example.com\",\n abortSignal,\n tracingOptions,\n }),\n );\n const accessToken = res.headers.get(\"authorization\")?.split(\" \")[1];\n if (!accessToken) {\n throw new Error(\"Failed to get access token\");\n }\n return accessToken;\n }\n return getRefreshedToken;\n}\n"]}
@@ -41,7 +41,7 @@ export function formatSuccess(scope) {
41
41
  */
42
42
  export function formatError(scope, error) {
43
43
  let message = "ERROR.";
44
- if (scope === null || scope === void 0 ? void 0 : scope.length) {
44
+ if (scope?.length) {
45
45
  message += ` Scopes: ${Array.isArray(scope) ? scope.join(", ") : scope}.`;
46
46
  }
47
47
  return `${message} Error message: ${typeof error === "string" ? error : error.message}.`;
@@ -89,6 +89,10 @@ export function credentialLoggerInstance(title, parent, log = logger) {
89
89
  */
90
90
  export function credentialLogger(title, log = logger) {
91
91
  const credLogger = credentialLoggerInstance(title, undefined, log);
92
- return Object.assign(Object.assign({}, credLogger), { parent: log, getToken: credentialLoggerInstance("=> getToken()", credLogger, log) });
92
+ return {
93
+ ...credLogger,
94
+ parent: log,
95
+ getToken: credentialLoggerInstance("=> getToken()", credLogger, log),
96
+ };
93
97
  }
94
98
  //# sourceMappingURL=logging.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../src/util/logging.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAOrD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,gBAA0B;IACvD,OAAO,gBAAgB,CAAC,MAAM,CAC5B,CAAC,GAA2B,EAAE,WAAmB,EAAE,EAAE;QACnD,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAC7B,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC9B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,cAAsB,EAAE,gBAA0B;IAC3E,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACtD,MAAM,CAAC,IAAI,CACT,GAAG,cAAc,kDAAkD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAA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AAe;QAC5B,GAAG,CAAC,KAAK,CAAC,GAAG,SAAS,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAED,OAAO;QACL,KAAK;QACL,SAAS;QACT,IAAI;QACJ,OAAO;QACP,OAAO;QACP,KAAK;KACN,CAAC;AACJ,CAAC;AAWD;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,MAAmB,MAAM;IACvE,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACnE,uCACK,UAAU,KACb,MAAM,EAAE,GAAG,EACX,QAAQ,EAAE,wBAAwB,CAAC,eAAe,EAAE,UAAU,EAAE,GAAG,CAAC,IACpE;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AzureLogger } from \"@azure/logger\";\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The AzureLogger used for all clients within the identity package\n */\nexport const logger = createClientLogger(\"identity\");\n\ninterface EnvironmentAccumulator {\n missing: string[];\n assigned: string[];\n}\n\n/**\n * Separates a list of environment variable names into a plain object with two arrays: an array of missing environment variables and another array with assigned environment variables.\n * @param supportedEnvVars - List of environment variable names\n */\nexport function processEnvVars(supportedEnvVars: string[]): EnvironmentAccumulator {\n return supportedEnvVars.reduce(\n (acc: EnvironmentAccumulator, envVariable: string) => {\n if (process.env[envVariable]) {\n acc.assigned.push(envVariable);\n } else {\n acc.missing.push(envVariable);\n }\n return acc;\n },\n { missing: [], assigned: [] },\n );\n}\n\n/**\n * Based on a given list of environment variable names,\n * logs the environment variables currently assigned during the usage of a credential that goes by the given name.\n * @param credentialName - Name of the credential in use\n * @param supportedEnvVars - List of environment variables supported by that credential\n */\nexport function logEnvVars(credentialName: string, supportedEnvVars: string[]): void {\n const { assigned } = processEnvVars(supportedEnvVars);\n logger.info(\n `${credentialName} => Found the following environment variables: ${assigned.join(\", \")}`,\n );\n}\n\n/**\n * Formatting the success event on the credentials\n */\nexport function formatSuccess(scope: string | string[]): string {\n return `SUCCESS. Scopes: ${Array.isArray(scope) ? scope.join(\", \") : scope}.`;\n}\n\n/**\n * Formatting the success event on the credentials\n */\nexport function formatError(scope: string | string[] | undefined, error: Error | string): string {\n let message = \"ERROR.\";\n if (scope?.length) {\n message += ` Scopes: ${Array.isArray(scope) ? scope.join(\", \") : scope}.`;\n }\n return `${message} Error message: ${typeof error === \"string\" ? error : error.message}.`;\n}\n\n/**\n * A CredentialLoggerInstance is a logger properly formatted to work in a credential's constructor, and its methods.\n */\nexport interface CredentialLoggerInstance {\n title: string;\n fullTitle: string;\n info(message: string): void;\n warning(message: string): void;\n verbose(message: string): void;\n error(err: string): void;\n}\n\n/**\n * Generates a CredentialLoggerInstance.\n *\n * It logs with the format:\n *\n * `[title] => [message]`\n *\n */\nexport function credentialLoggerInstance(\n title: string,\n parent?: CredentialLoggerInstance,\n log: AzureLogger = logger,\n): CredentialLoggerInstance {\n const fullTitle = parent ? `${parent.fullTitle} ${title}` : title;\n\n function info(message: string): void {\n log.info(`${fullTitle} =>`, message);\n }\n\n function warning(message: string): void {\n log.warning(`${fullTitle} =>`, message);\n }\n\n function verbose(message: string): void {\n log.verbose(`${fullTitle} =>`, message);\n }\n\n function error(message: string): void {\n log.error(`${fullTitle} =>`, message);\n }\n\n return {\n title,\n fullTitle,\n info,\n warning,\n verbose,\n error,\n };\n}\n\n/**\n * A CredentialLogger is a logger declared at the credential's constructor, and used at any point in the credential.\n * It has all the properties of a CredentialLoggerInstance, plus other logger instances, one per method.\n */\nexport interface CredentialLogger extends CredentialLoggerInstance {\n parent: AzureLogger;\n getToken: CredentialLoggerInstance;\n}\n\n/**\n * Generates a CredentialLogger, which is a logger declared at the credential's constructor, and used at any point in the credential.\n * It has all the properties of a CredentialLoggerInstance, plus other logger instances, one per method.\n *\n * It logs with the format:\n *\n * `[title] => [message]`\n * `[title] => getToken() => [message]`\n *\n */\nexport function credentialLogger(title: string, log: AzureLogger = logger): CredentialLogger {\n const credLogger = credentialLoggerInstance(title, undefined, log);\n return {\n ...credLogger,\n parent: log,\n getToken: credentialLoggerInstance(\"=> getToken()\", credLogger, log),\n };\n}\n"]}
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../src/util/logging.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAOrD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,gBAA0B;IACvD,OAAO,gBAAgB,CAAC,MAAM,CAC5B,CAAC,GAA2B,EAAE,WAAmB,EAAE,EAAE;QACnD,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAC7B,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC9B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,cAAsB,EAAE,gBAA0B;IAC3E,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACtD,MAAM,CAAC,IAAI,CACT,GAAG,cAAc,kDAAkD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAwB;IACpD,OAAO,oBAAoB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAA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O;QACP,OAAO;QACP,KAAK;KACN,CAAC;AACJ,CAAC;AAWD;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,MAAmB,MAAM;IACvE,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACnE,OAAO;QACL,GAAG,UAAU;QACb,MAAM,EAAE,GAAG;QACX,QAAQ,EAAE,wBAAwB,CAAC,eAAe,EAAE,UAAU,EAAE,GAAG,CAAC;KACrE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AzureLogger } from \"@azure/logger\";\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The AzureLogger used for all clients within the identity package\n */\nexport const logger = createClientLogger(\"identity\");\n\ninterface EnvironmentAccumulator {\n missing: string[];\n assigned: string[];\n}\n\n/**\n * Separates a list of environment variable names into a plain object with two arrays: an array of missing environment variables and another array with assigned environment variables.\n * @param supportedEnvVars - List of environment variable names\n */\nexport function processEnvVars(supportedEnvVars: string[]): EnvironmentAccumulator {\n return supportedEnvVars.reduce(\n (acc: EnvironmentAccumulator, envVariable: string) => {\n if (process.env[envVariable]) {\n acc.assigned.push(envVariable);\n } else {\n acc.missing.push(envVariable);\n }\n return acc;\n },\n { missing: [], assigned: [] },\n );\n}\n\n/**\n * Based on a given list of environment variable names,\n * logs the environment variables currently assigned during the usage of a credential that goes by the given name.\n * @param credentialName - Name of the credential in use\n * @param supportedEnvVars - List of environment variables supported by that credential\n */\nexport function logEnvVars(credentialName: string, supportedEnvVars: string[]): void {\n const { assigned } = processEnvVars(supportedEnvVars);\n logger.info(\n `${credentialName} => Found the following environment variables: ${assigned.join(\", \")}`,\n );\n}\n\n/**\n * Formatting the success event on the credentials\n */\nexport function formatSuccess(scope: string | string[]): string {\n return `SUCCESS. Scopes: ${Array.isArray(scope) ? scope.join(\", \") : scope}.`;\n}\n\n/**\n * Formatting the success event on the credentials\n */\nexport function formatError(scope: string | string[] | undefined, error: Error | string): string {\n let message = \"ERROR.\";\n if (scope?.length) {\n message += ` Scopes: ${Array.isArray(scope) ? scope.join(\", \") : scope}.`;\n }\n return `${message} Error message: ${typeof error === \"string\" ? error : error.message}.`;\n}\n\n/**\n * A CredentialLoggerInstance is a logger properly formatted to work in a credential's constructor, and its methods.\n */\nexport interface CredentialLoggerInstance {\n title: string;\n fullTitle: string;\n info(message: string): void;\n warning(message: string): void;\n verbose(message: string): void;\n error(err: string): void;\n}\n\n/**\n * Generates a CredentialLoggerInstance.\n *\n * It logs with the format:\n *\n * `[title] => [message]`\n *\n */\nexport function credentialLoggerInstance(\n title: string,\n parent?: CredentialLoggerInstance,\n log: AzureLogger = logger,\n): CredentialLoggerInstance {\n const fullTitle = parent ? `${parent.fullTitle} ${title}` : title;\n\n function info(message: string): void {\n log.info(`${fullTitle} =>`, message);\n }\n\n function warning(message: string): void {\n log.warning(`${fullTitle} =>`, message);\n }\n\n function verbose(message: string): void {\n log.verbose(`${fullTitle} =>`, message);\n }\n\n function error(message: string): void {\n log.error(`${fullTitle} =>`, message);\n }\n\n return {\n title,\n fullTitle,\n info,\n warning,\n verbose,\n error,\n };\n}\n\n/**\n * A CredentialLogger is a logger declared at the credential's constructor, and used at any point in the credential.\n * It has all the properties of a CredentialLoggerInstance, plus other logger instances, one per method.\n */\nexport interface CredentialLogger extends CredentialLoggerInstance {\n parent: AzureLogger;\n getToken: CredentialLoggerInstance;\n}\n\n/**\n * Generates a CredentialLogger, which is a logger declared at the credential's constructor, and used at any point in the credential.\n * It has all the properties of a CredentialLoggerInstance, plus other logger instances, one per method.\n *\n * It logs with the format:\n *\n * `[title] => [message]`\n * `[title] => getToken() => [message]`\n *\n */\nexport function credentialLogger(title: string, log: AzureLogger = logger): CredentialLogger {\n const credLogger = credentialLoggerInstance(title, undefined, log);\n return {\n ...credLogger,\n parent: log,\n getToken: credentialLoggerInstance(\"=> getToken()\", credLogger, log),\n };\n}\n"]}
@@ -11,7 +11,6 @@ function createConfigurationErrorMessage(tenantId) {
11
11
  * @internal
12
12
  */
13
13
  export function processMultiTenantRequest(tenantId, getTokenOptions, additionallyAllowedTenantIds = [], logger) {
14
- var _a;
15
14
  let resolvedTenantId;
16
15
  if (process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH) {
17
16
  resolvedTenantId = tenantId;
@@ -20,14 +19,14 @@ export function processMultiTenantRequest(tenantId, getTokenOptions, additionall
20
19
  resolvedTenantId = tenantId;
21
20
  }
22
21
  else {
23
- resolvedTenantId = (_a = getTokenOptions === null || getTokenOptions === void 0 ? void 0 : getTokenOptions.tenantId) !== null && _a !== void 0 ? _a : tenantId;
22
+ resolvedTenantId = getTokenOptions?.tenantId ?? tenantId;
24
23
  }
25
24
  if (tenantId &&
26
25
  resolvedTenantId !== tenantId &&
27
26
  !additionallyAllowedTenantIds.includes("*") &&
28
27
  !additionallyAllowedTenantIds.some((t) => t.localeCompare(resolvedTenantId) === 0)) {
29
28
  const message = createConfigurationErrorMessage(resolvedTenantId);
30
- logger === null || logger === void 0 ? void 0 : logger.info(message);
29
+ logger?.info(message);
31
30
  throw new CredentialUnavailableError(message);
32
31
  }
33
32
  return resolvedTenantId;
@@ -1 +1 @@
1
- {"version":3,"file":"processMultiTenantRequest.js","sourceRoot":"","sources":["../../../src/util/processMultiTenantRequest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAG1D,SAAS,+BAA+B,CAAC,QAAgB;IACvD,OAAO,yEAAyE,QAAQ,qMAAqM,CAAC;AAChS,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAAiB,EACjB,eAAiC,EACjC,+BAAyC,EAAE,EAC3C,MAAyB;;IAEzB,IAAI,gBAAoC,CAAC;IACzC,IAAI,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,CAAC;QACvD,gBAAgB,GAAG,QAAQ,CAAC;IAC9B,CAAC;SAAM,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QAC/B,gBAAgB,GAAG,QAAQ,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,gBAAgB,GAAG,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,QAAQ,mCAAI,QAAQ,CAAC;IAC3D,CAAC;IACD,IACE,QAAQ;QACR,gBAAgB,KAAK,QAAQ;QAC7B,CAAC,4BAA4B,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC3C,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,gBAAiB,CAAC,KAAK,CAAC,CAAC,EACnF,CAAC;QACD,MAAM,OAAO,GAAG,+BAA+B,CAAC,gBAAiB,CAAC,CAAC;QACnE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,MAAM,IAAI,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { GetTokenOptions } from \"@azure/core-auth\";\nimport { CredentialUnavailableError } from \"../errors.js\";\nimport type { CredentialLogger } from \"./logging.js\";\n\nfunction createConfigurationErrorMessage(tenantId: string): string {\n return `The current credential is not configured to acquire tokens for tenant ${tenantId}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add \"*\" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`;\n}\n\n/**\n * Of getToken contains a tenantId, this functions allows picking this tenantId as the appropriate for authentication,\n * unless multitenant authentication has been disabled through the AZURE_IDENTITY_DISABLE_MULTITENANTAUTH (on Node.js),\n * or unless the original tenant Id is `adfs`.\n * @internal\n */\nexport function processMultiTenantRequest(\n tenantId?: string,\n getTokenOptions?: GetTokenOptions,\n additionallyAllowedTenantIds: string[] = [],\n logger?: CredentialLogger,\n): string | undefined {\n let resolvedTenantId: string | undefined;\n if (process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH) {\n resolvedTenantId = tenantId;\n } else if (tenantId === \"adfs\") {\n resolvedTenantId = tenantId;\n } else {\n resolvedTenantId = getTokenOptions?.tenantId ?? tenantId;\n }\n if (\n tenantId &&\n resolvedTenantId !== tenantId &&\n !additionallyAllowedTenantIds.includes(\"*\") &&\n !additionallyAllowedTenantIds.some((t) => t.localeCompare(resolvedTenantId!) === 0)\n ) {\n const message = createConfigurationErrorMessage(resolvedTenantId!);\n logger?.info(message);\n throw new CredentialUnavailableError(message);\n }\n\n return resolvedTenantId;\n}\n"]}
1
+ {"version":3,"file":"processMultiTenantRequest.js","sourceRoot":"","sources":["../../../src/util/processMultiTenantRequest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAG1D,SAAS,+BAA+B,CAAC,QAAgB;IACvD,OAAO,yEAAyE,QAAQ,qMAAqM,CAAC;AAChS,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,QAAiB,EACjB,eAAiC,EACjC,+BAAyC,EAAE,EAC3C,MAAyB;IAEzB,IAAI,gBAAoC,CAAC;IACzC,IAAI,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,CAAC;QACvD,gBAAgB,GAAG,QAAQ,CAAC;IAC9B,CAAC;SAAM,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QAC/B,gBAAgB,GAAG,QAAQ,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,gBAAgB,GAAG,eAAe,EAAE,QAAQ,IAAI,QAAQ,CAAC;IAC3D,CAAC;IACD,IACE,QAAQ;QACR,gBAAgB,KAAK,QAAQ;QAC7B,CAAC,4BAA4B,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC3C,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,gBAAiB,CAAC,KAAK,CAAC,CAAC,EACnF,CAAC;QACD,MAAM,OAAO,GAAG,+BAA+B,CAAC,gBAAiB,CAAC,CAAC;QACnE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,MAAM,IAAI,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { GetTokenOptions } from \"@azure/core-auth\";\nimport { CredentialUnavailableError } from \"../errors.js\";\nimport type { CredentialLogger } from \"./logging.js\";\n\nfunction createConfigurationErrorMessage(tenantId: string): string {\n return `The current credential is not configured to acquire tokens for tenant ${tenantId}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add \"*\" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`;\n}\n\n/**\n * Of getToken contains a tenantId, this functions allows picking this tenantId as the appropriate for authentication,\n * unless multitenant authentication has been disabled through the AZURE_IDENTITY_DISABLE_MULTITENANTAUTH (on Node.js),\n * or unless the original tenant Id is `adfs`.\n * @internal\n */\nexport function processMultiTenantRequest(\n tenantId?: string,\n getTokenOptions?: GetTokenOptions,\n additionallyAllowedTenantIds: string[] = [],\n logger?: CredentialLogger,\n): string | undefined {\n let resolvedTenantId: string | undefined;\n if (process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH) {\n resolvedTenantId = tenantId;\n } else if (tenantId === \"adfs\") {\n resolvedTenantId = tenantId;\n } else {\n resolvedTenantId = getTokenOptions?.tenantId ?? tenantId;\n }\n if (\n tenantId &&\n resolvedTenantId !== tenantId &&\n !additionallyAllowedTenantIds.includes(\"*\") &&\n !additionallyAllowedTenantIds.some((t) => t.localeCompare(resolvedTenantId!) === 0)\n ) {\n const message = createConfigurationErrorMessage(resolvedTenantId!);\n logger?.info(message);\n throw new CredentialUnavailableError(message);\n }\n\n return resolvedTenantId;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import * as childProcess from "child_process";
1
+ import childProcess from "node:child_process";
2
2
  /**
3
3
  * Easy to mock childProcess utils.
4
4
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"processUtils.d.ts","sourceRoot":"","sources":["../../../src/util/processUtils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB;;;OAGG;mBAEK,MAAM,UACJ,MAAM,EAAE,YACN,YAAY,CAAC,iCAAiC,GACvD,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;CAiB5B,CAAC"}
1
+ {"version":3,"file":"processUtils.d.ts","sourceRoot":"","sources":["../../../src/util/processUtils.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB;;;OAGG;mBAEK,MAAM,UACJ,MAAM,EAAE,YACN,YAAY,CAAC,iCAAiC,GACvD,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;CAiB5B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import * as childProcess from "child_process";
3
+ import childProcess from "node:child_process";
4
4
  /**
5
5
  * Easy to mock childProcess utils.
6
6
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"processUtils.js","sourceRoot":"","sources":["../../../src/util/processUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;;;OAGG;IACH,QAAQ,CACN,IAAY,EACZ,MAAgB,EAChB,OAAwD;QAExD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;gBACrE,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC5B,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACnC,CAAC;gBACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC5B,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACnC,CAAC;gBACD,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;oBACpB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBAC7C,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,CAAC;gBAClB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport * as childProcess from \"child_process\";\n\n/**\n * Easy to mock childProcess utils.\n * @internal\n */\nexport const processUtils = {\n /**\n * Promisifying childProcess.execFile\n * @internal\n */\n execFile(\n file: string,\n params: string[],\n options?: childProcess.ExecFileOptionsWithStringEncoding,\n ): Promise<string | Buffer> {\n return new Promise((resolve, reject) => {\n childProcess.execFile(file, params, options, (error, stdout, stderr) => {\n if (Buffer.isBuffer(stdout)) {\n stdout = stdout.toString(\"utf8\");\n }\n if (Buffer.isBuffer(stderr)) {\n stderr = stderr.toString(\"utf8\");\n }\n if (stderr || error) {\n reject(stderr ? new Error(stderr) : error);\n } else {\n resolve(stdout);\n }\n });\n });\n },\n};\n"]}
1
+ {"version":3,"file":"processUtils.js","sourceRoot":"","sources":["../../../src/util/processUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;;;OAGG;IACH,QAAQ,CACN,IAAY,EACZ,MAAgB,EAChB,OAAwD;QAExD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;gBACrE,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC5B,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACnC,CAAC;gBACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC5B,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACnC,CAAC;gBACD,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;oBACpB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBAC7C,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,CAAC;gBAClB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport childProcess from \"node:child_process\";\n\n/**\n * Easy to mock childProcess utils.\n * @internal\n */\nexport const processUtils = {\n /**\n * Promisifying childProcess.execFile\n * @internal\n */\n execFile(\n file: string,\n params: string[],\n options?: childProcess.ExecFileOptionsWithStringEncoding,\n ): Promise<string | Buffer> {\n return new Promise((resolve, reject) => {\n childProcess.execFile(file, params, options, (error, stdout, stderr) => {\n if (Buffer.isBuffer(stdout)) {\n stdout = stdout.toString(\"utf8\");\n }\n if (Buffer.isBuffer(stderr)) {\n stderr = stderr.toString(\"utf8\");\n }\n if (stderr || error) {\n reject(stderr ? new Error(stderr) : error);\n } else {\n resolve(stdout);\n }\n });\n });\n },\n};\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@azure/identity",
3
3
  "sdk-type": "client",
4
- "version": "4.10.3-alpha.20250708.2",
4
+ "version": "4.11.0-alpha.20250717.4",
5
5
  "description": "Provides credential implementations for Azure SDK libraries that can authenticate with Microsoft Entra ID",
6
6
  "main": "./dist/commonjs/index.js",
7
7
  "module": "./dist/esm/index.js",
@@ -107,7 +107,7 @@
107
107
  },
108
108
  "type": "module",
109
109
  "tshy": {
110
- "project": "./tsconfig.src.json",
110
+ "project": "../../../tsconfig.src.build.json",
111
111
  "exports": {
112
112
  "./package.json": "./package.json",
113
113
  ".": "./src/index.ts"