@azure/identity 4.8.1-alpha.20250410.1 → 4.9.1-alpha.20250416.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 (323) hide show
  1. package/dist/browser/constants.d.ts +1 -1
  2. package/dist/browser/constants.js +1 -1
  3. package/dist/browser/constants.js.map +1 -1
  4. package/dist/commonjs/constants.d.ts +1 -1
  5. package/dist/commonjs/constants.js +1 -1
  6. package/dist/commonjs/constants.js.map +1 -1
  7. package/dist/esm/constants.d.ts +1 -1
  8. package/dist/esm/constants.js +1 -1
  9. package/dist/esm/constants.js.map +1 -1
  10. package/dist/workerd/client/identityClient.d.ts +65 -0
  11. package/dist/workerd/client/identityClient.d.ts.map +1 -0
  12. package/dist/workerd/client/identityClient.js +248 -0
  13. package/dist/workerd/client/identityClient.js.map +1 -0
  14. package/dist/workerd/constants.d.ts +69 -0
  15. package/dist/workerd/constants.d.ts.map +1 -0
  16. package/dist/workerd/constants.js +75 -0
  17. package/dist/workerd/constants.js.map +1 -0
  18. package/dist/workerd/credentials/authorityValidationOptions.d.ts +16 -0
  19. package/dist/workerd/credentials/authorityValidationOptions.d.ts.map +1 -0
  20. package/dist/workerd/credentials/authorityValidationOptions.js +4 -0
  21. package/dist/workerd/credentials/authorityValidationOptions.js.map +1 -0
  22. package/dist/workerd/credentials/authorizationCodeCredential.d.ts +73 -0
  23. package/dist/workerd/credentials/authorizationCodeCredential.d.ts.map +1 -0
  24. package/dist/workerd/credentials/authorizationCodeCredential.js +60 -0
  25. package/dist/workerd/credentials/authorizationCodeCredential.js.map +1 -0
  26. package/dist/workerd/credentials/authorizationCodeCredentialOptions.d.ts +8 -0
  27. package/dist/workerd/credentials/authorizationCodeCredentialOptions.d.ts.map +1 -0
  28. package/dist/workerd/credentials/authorizationCodeCredentialOptions.js +4 -0
  29. package/dist/workerd/credentials/authorizationCodeCredentialOptions.js.map +1 -0
  30. package/dist/workerd/credentials/azureApplicationCredential.d.ts +24 -0
  31. package/dist/workerd/credentials/azureApplicationCredential.d.ts.map +1 -0
  32. package/dist/workerd/credentials/azureApplicationCredential.js +32 -0
  33. package/dist/workerd/credentials/azureApplicationCredential.js.map +1 -0
  34. package/dist/workerd/credentials/azureApplicationCredentialOptions.d.ts +13 -0
  35. package/dist/workerd/credentials/azureApplicationCredentialOptions.d.ts.map +1 -0
  36. package/dist/workerd/credentials/azureApplicationCredentialOptions.js +4 -0
  37. package/dist/workerd/credentials/azureApplicationCredentialOptions.js.map +1 -0
  38. package/dist/workerd/credentials/azureCliCredential.d.ts +64 -0
  39. package/dist/workerd/credentials/azureCliCredential.d.ts.map +1 -0
  40. package/dist/workerd/credentials/azureCliCredential.js +191 -0
  41. package/dist/workerd/credentials/azureCliCredential.js.map +1 -0
  42. package/dist/workerd/credentials/azureCliCredentialOptions.d.ts +20 -0
  43. package/dist/workerd/credentials/azureCliCredentialOptions.d.ts.map +1 -0
  44. package/dist/workerd/credentials/azureCliCredentialOptions.js +4 -0
  45. package/dist/workerd/credentials/azureCliCredentialOptions.js.map +1 -0
  46. package/dist/workerd/credentials/azureDeveloperCliCredential.d.ts +71 -0
  47. package/dist/workerd/credentials/azureDeveloperCliCredential.d.ts.map +1 -0
  48. package/dist/workerd/credentials/azureDeveloperCliCredential.js +173 -0
  49. package/dist/workerd/credentials/azureDeveloperCliCredential.js.map +1 -0
  50. package/dist/workerd/credentials/azureDeveloperCliCredentialOptions.d.ts +15 -0
  51. package/dist/workerd/credentials/azureDeveloperCliCredentialOptions.d.ts.map +1 -0
  52. package/dist/workerd/credentials/azureDeveloperCliCredentialOptions.js +4 -0
  53. package/dist/workerd/credentials/azureDeveloperCliCredentialOptions.js.map +1 -0
  54. package/dist/workerd/credentials/azurePipelinesCredential.d.ts +38 -0
  55. package/dist/workerd/credentials/azurePipelinesCredential.d.ts.map +1 -0
  56. package/dist/workerd/credentials/azurePipelinesCredential.js +141 -0
  57. package/dist/workerd/credentials/azurePipelinesCredential.js.map +1 -0
  58. package/dist/workerd/credentials/azurePipelinesCredentialOptions.d.ts +9 -0
  59. package/dist/workerd/credentials/azurePipelinesCredentialOptions.d.ts.map +1 -0
  60. package/dist/workerd/credentials/azurePipelinesCredentialOptions.js +4 -0
  61. package/dist/workerd/credentials/azurePipelinesCredentialOptions.js.map +1 -0
  62. package/dist/workerd/credentials/azurePowerShellCredential.d.ts +75 -0
  63. package/dist/workerd/credentials/azurePowerShellCredential.d.ts.map +1 -0
  64. package/dist/workerd/credentials/azurePowerShellCredential.js +229 -0
  65. package/dist/workerd/credentials/azurePowerShellCredential.js.map +1 -0
  66. package/dist/workerd/credentials/azurePowerShellCredentialOptions.d.ts +15 -0
  67. package/dist/workerd/credentials/azurePowerShellCredentialOptions.d.ts.map +1 -0
  68. package/dist/workerd/credentials/azurePowerShellCredentialOptions.js +4 -0
  69. package/dist/workerd/credentials/azurePowerShellCredentialOptions.js.map +1 -0
  70. package/dist/workerd/credentials/brokerAuthOptions.d.ts +13 -0
  71. package/dist/workerd/credentials/brokerAuthOptions.d.ts.map +1 -0
  72. package/dist/workerd/credentials/brokerAuthOptions.js +2 -0
  73. package/dist/workerd/credentials/brokerAuthOptions.js.map +1 -0
  74. package/dist/workerd/credentials/browserCustomizationOptions.d.ts +19 -0
  75. package/dist/workerd/credentials/browserCustomizationOptions.d.ts.map +1 -0
  76. package/dist/workerd/credentials/browserCustomizationOptions.js +4 -0
  77. package/dist/workerd/credentials/browserCustomizationOptions.js.map +1 -0
  78. package/dist/workerd/credentials/chainedTokenCredential.d.ts +51 -0
  79. package/dist/workerd/credentials/chainedTokenCredential.d.ts.map +1 -0
  80. package/dist/workerd/credentials/chainedTokenCredential.js +92 -0
  81. package/dist/workerd/credentials/chainedTokenCredential.js.map +1 -0
  82. package/dist/workerd/credentials/clientAssertionCredential.d.ts +33 -0
  83. package/dist/workerd/credentials/clientAssertionCredential.d.ts.map +1 -0
  84. package/dist/workerd/credentials/clientAssertionCredential.js +55 -0
  85. package/dist/workerd/credentials/clientAssertionCredential.js.map +1 -0
  86. package/dist/workerd/credentials/clientAssertionCredentialOptions.d.ts +9 -0
  87. package/dist/workerd/credentials/clientAssertionCredentialOptions.d.ts.map +1 -0
  88. package/dist/workerd/credentials/clientAssertionCredentialOptions.js +4 -0
  89. package/dist/workerd/credentials/clientAssertionCredentialOptions.js.map +1 -0
  90. package/dist/workerd/credentials/clientCertificateCredential.d.ts +72 -0
  91. package/dist/workerd/credentials/clientCertificateCredential.d.ts.map +1 -0
  92. package/dist/workerd/credentials/clientCertificateCredential.js +122 -0
  93. package/dist/workerd/credentials/clientCertificateCredential.js.map +1 -0
  94. package/dist/workerd/credentials/clientCertificateCredentialModels.d.ts +31 -0
  95. package/dist/workerd/credentials/clientCertificateCredentialModels.d.ts.map +1 -0
  96. package/dist/workerd/credentials/clientCertificateCredentialModels.js +4 -0
  97. package/dist/workerd/credentials/clientCertificateCredentialModels.js.map +1 -0
  98. package/dist/workerd/credentials/clientCertificateCredentialOptions.d.ts +14 -0
  99. package/dist/workerd/credentials/clientCertificateCredentialOptions.d.ts.map +1 -0
  100. package/dist/workerd/credentials/clientCertificateCredentialOptions.js +4 -0
  101. package/dist/workerd/credentials/clientCertificateCredentialOptions.js.map +1 -0
  102. package/dist/workerd/credentials/clientSecretCredential.d.ts +37 -0
  103. package/dist/workerd/credentials/clientSecretCredential.d.ts.map +1 -0
  104. package/dist/workerd/credentials/clientSecretCredential.js +60 -0
  105. package/dist/workerd/credentials/clientSecretCredential.js.map +1 -0
  106. package/dist/workerd/credentials/clientSecretCredentialOptions.d.ts +9 -0
  107. package/dist/workerd/credentials/clientSecretCredentialOptions.d.ts.map +1 -0
  108. package/dist/workerd/credentials/clientSecretCredentialOptions.js +4 -0
  109. package/dist/workerd/credentials/clientSecretCredentialOptions.js.map +1 -0
  110. package/dist/workerd/credentials/credentialPersistenceOptions.d.ts +30 -0
  111. package/dist/workerd/credentials/credentialPersistenceOptions.d.ts.map +1 -0
  112. package/dist/workerd/credentials/credentialPersistenceOptions.js +4 -0
  113. package/dist/workerd/credentials/credentialPersistenceOptions.js.map +1 -0
  114. package/dist/workerd/credentials/defaultAzureCredential.d.ts +65 -0
  115. package/dist/workerd/credentials/defaultAzureCredential.d.ts.map +1 -0
  116. package/dist/workerd/credentials/defaultAzureCredential.js +164 -0
  117. package/dist/workerd/credentials/defaultAzureCredential.js.map +1 -0
  118. package/dist/workerd/credentials/defaultAzureCredentialOptions.d.ts +49 -0
  119. package/dist/workerd/credentials/defaultAzureCredentialOptions.d.ts.map +1 -0
  120. package/dist/workerd/credentials/defaultAzureCredentialOptions.js +4 -0
  121. package/dist/workerd/credentials/defaultAzureCredentialOptions.js.map +1 -0
  122. package/dist/workerd/credentials/deviceCodeCredential.d.ts +67 -0
  123. package/dist/workerd/credentials/deviceCodeCredential.d.ts.map +1 -0
  124. package/dist/workerd/credentials/deviceCodeCredential.js +91 -0
  125. package/dist/workerd/credentials/deviceCodeCredential.js.map +1 -0
  126. package/dist/workerd/credentials/deviceCodeCredentialOptions.d.ts +53 -0
  127. package/dist/workerd/credentials/deviceCodeCredentialOptions.d.ts.map +1 -0
  128. package/dist/workerd/credentials/deviceCodeCredentialOptions.js +4 -0
  129. package/dist/workerd/credentials/deviceCodeCredentialOptions.js.map +1 -0
  130. package/dist/workerd/credentials/environmentCredential.d.ts +52 -0
  131. package/dist/workerd/credentials/environmentCredential.d.ts.map +1 -0
  132. package/dist/workerd/credentials/environmentCredential.js +130 -0
  133. package/dist/workerd/credentials/environmentCredential.js.map +1 -0
  134. package/dist/workerd/credentials/environmentCredentialOptions.d.ts +9 -0
  135. package/dist/workerd/credentials/environmentCredentialOptions.d.ts.map +1 -0
  136. package/dist/workerd/credentials/environmentCredentialOptions.js +4 -0
  137. package/dist/workerd/credentials/environmentCredentialOptions.js.map +1 -0
  138. package/dist/workerd/credentials/interactiveBrowserCredential.d.ts +56 -0
  139. package/dist/workerd/credentials/interactiveBrowserCredential.d.ts.map +1 -0
  140. package/dist/workerd/credentials/interactiveBrowserCredential.js +91 -0
  141. package/dist/workerd/credentials/interactiveBrowserCredential.js.map +1 -0
  142. package/dist/workerd/credentials/interactiveBrowserCredentialOptions.d.ts +77 -0
  143. package/dist/workerd/credentials/interactiveBrowserCredentialOptions.d.ts.map +1 -0
  144. package/dist/workerd/credentials/interactiveBrowserCredentialOptions.js +4 -0
  145. package/dist/workerd/credentials/interactiveBrowserCredentialOptions.js.map +1 -0
  146. package/dist/workerd/credentials/interactiveCredentialOptions.d.ts +25 -0
  147. package/dist/workerd/credentials/interactiveCredentialOptions.d.ts.map +1 -0
  148. package/dist/workerd/credentials/interactiveCredentialOptions.js +4 -0
  149. package/dist/workerd/credentials/interactiveCredentialOptions.js.map +1 -0
  150. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.d.ts +18 -0
  151. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.d.ts.map +1 -0
  152. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.js +99 -0
  153. package/dist/workerd/credentials/managedIdentityCredential/imdsMsi.js.map +1 -0
  154. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts +12 -0
  155. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.d.ts.map +1 -0
  156. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.js +33 -0
  157. package/dist/workerd/credentials/managedIdentityCredential/imdsRetryPolicy.js.map +1 -0
  158. package/dist/workerd/credentials/managedIdentityCredential/index.d.ts +61 -0
  159. package/dist/workerd/credentials/managedIdentityCredential/index.d.ts.map +1 -0
  160. package/dist/workerd/credentials/managedIdentityCredential/index.js +239 -0
  161. package/dist/workerd/credentials/managedIdentityCredential/index.js.map +1 -0
  162. package/dist/workerd/credentials/managedIdentityCredential/models.d.ts +24 -0
  163. package/dist/workerd/credentials/managedIdentityCredential/models.d.ts.map +1 -0
  164. package/dist/workerd/credentials/managedIdentityCredential/models.js +4 -0
  165. package/dist/workerd/credentials/managedIdentityCredential/models.js.map +1 -0
  166. package/dist/workerd/credentials/managedIdentityCredential/options.d.ts +37 -0
  167. package/dist/workerd/credentials/managedIdentityCredential/options.d.ts.map +1 -0
  168. package/dist/workerd/credentials/managedIdentityCredential/options.js +4 -0
  169. package/dist/workerd/credentials/managedIdentityCredential/options.js.map +1 -0
  170. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts +14 -0
  171. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.d.ts.map +1 -0
  172. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js +32 -0
  173. package/dist/workerd/credentials/managedIdentityCredential/tokenExchangeMsi.js.map +1 -0
  174. package/dist/workerd/credentials/managedIdentityCredential/utils.d.ts +37 -0
  175. package/dist/workerd/credentials/managedIdentityCredential/utils.d.ts.map +1 -0
  176. package/dist/workerd/credentials/managedIdentityCredential/utils.js +81 -0
  177. package/dist/workerd/credentials/managedIdentityCredential/utils.js.map +1 -0
  178. package/dist/workerd/credentials/multiTenantTokenCredentialOptions.d.ts +12 -0
  179. package/dist/workerd/credentials/multiTenantTokenCredentialOptions.d.ts.map +1 -0
  180. package/dist/workerd/credentials/multiTenantTokenCredentialOptions.js +4 -0
  181. package/dist/workerd/credentials/multiTenantTokenCredentialOptions.js.map +1 -0
  182. package/dist/workerd/credentials/onBehalfOfCredential.d.ts +105 -0
  183. package/dist/workerd/credentials/onBehalfOfCredential.d.ts.map +1 -0
  184. package/dist/workerd/credentials/onBehalfOfCredential.js +112 -0
  185. package/dist/workerd/credentials/onBehalfOfCredential.js.map +1 -0
  186. package/dist/workerd/credentials/onBehalfOfCredentialOptions.d.ts +76 -0
  187. package/dist/workerd/credentials/onBehalfOfCredentialOptions.d.ts.map +1 -0
  188. package/dist/workerd/credentials/onBehalfOfCredentialOptions.js +4 -0
  189. package/dist/workerd/credentials/onBehalfOfCredentialOptions.js.map +1 -0
  190. package/dist/workerd/credentials/usernamePasswordCredential.d.ts +42 -0
  191. package/dist/workerd/credentials/usernamePasswordCredential.d.ts.map +1 -0
  192. package/dist/workerd/credentials/usernamePasswordCredential.js +68 -0
  193. package/dist/workerd/credentials/usernamePasswordCredential.js.map +1 -0
  194. package/dist/workerd/credentials/usernamePasswordCredentialOptions.d.ts +10 -0
  195. package/dist/workerd/credentials/usernamePasswordCredentialOptions.d.ts.map +1 -0
  196. package/dist/workerd/credentials/usernamePasswordCredentialOptions.js +4 -0
  197. package/dist/workerd/credentials/usernamePasswordCredentialOptions.js.map +1 -0
  198. package/dist/workerd/credentials/visualStudioCodeCredential.d.ts +66 -0
  199. package/dist/workerd/credentials/visualStudioCodeCredential.d.ts.map +1 -0
  200. package/dist/workerd/credentials/visualStudioCodeCredential.js +196 -0
  201. package/dist/workerd/credentials/visualStudioCodeCredential.js.map +1 -0
  202. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.d.ts +16 -0
  203. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.d.ts.map +1 -0
  204. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.js +4 -0
  205. package/dist/workerd/credentials/visualStudioCodeCredentialOptions.js.map +1 -0
  206. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts +16 -0
  207. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.d.ts.map +1 -0
  208. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js +4 -0
  209. package/dist/workerd/credentials/visualStudioCodeCredentialPlugin.js.map +1 -0
  210. package/dist/workerd/credentials/workloadIdentityCredential.d.ts +47 -0
  211. package/dist/workerd/credentials/workloadIdentityCredential.d.ts.map +1 -0
  212. package/dist/workerd/credentials/workloadIdentityCredential.js +114 -0
  213. package/dist/workerd/credentials/workloadIdentityCredential.js.map +1 -0
  214. package/dist/workerd/credentials/workloadIdentityCredentialOptions.d.ts +20 -0
  215. package/dist/workerd/credentials/workloadIdentityCredentialOptions.d.ts.map +1 -0
  216. package/dist/workerd/credentials/workloadIdentityCredentialOptions.js +4 -0
  217. package/dist/workerd/credentials/workloadIdentityCredentialOptions.js.map +1 -0
  218. package/dist/workerd/errors.d.ts +139 -0
  219. package/dist/workerd/errors.d.ts.map +1 -0
  220. package/dist/workerd/errors.js +123 -0
  221. package/dist/workerd/errors.js.map +1 -0
  222. package/dist/workerd/index.d.ts +61 -0
  223. package/dist/workerd/index.d.ts.map +1 -0
  224. package/dist/workerd/index.js +34 -0
  225. package/dist/workerd/index.js.map +1 -0
  226. package/dist/workerd/msal/browserFlows/msalBrowserCommon.d.ts +19 -0
  227. package/dist/workerd/msal/browserFlows/msalBrowserCommon.d.ts.map +1 -0
  228. package/dist/workerd/msal/browserFlows/msalBrowserCommon.js +291 -0
  229. package/dist/workerd/msal/browserFlows/msalBrowserCommon.js.map +1 -0
  230. package/dist/workerd/msal/browserFlows/msalBrowserOptions.d.ts +87 -0
  231. package/dist/workerd/msal/browserFlows/msalBrowserOptions.d.ts.map +1 -0
  232. package/dist/workerd/msal/browserFlows/msalBrowserOptions.js +4 -0
  233. package/dist/workerd/msal/browserFlows/msalBrowserOptions.js.map +1 -0
  234. package/dist/workerd/msal/credentials.d.ts +52 -0
  235. package/dist/workerd/msal/credentials.d.ts.map +1 -0
  236. package/dist/workerd/msal/credentials.js +4 -0
  237. package/dist/workerd/msal/credentials.js.map +1 -0
  238. package/dist/workerd/msal/msal.d.ts +3 -0
  239. package/dist/workerd/msal/msal.d.ts.map +1 -0
  240. package/dist/workerd/msal/msal.js +5 -0
  241. package/dist/workerd/msal/msal.js.map +1 -0
  242. package/dist/workerd/msal/nodeFlows/brokerOptions.d.ts +44 -0
  243. package/dist/workerd/msal/nodeFlows/brokerOptions.d.ts.map +1 -0
  244. package/dist/workerd/msal/nodeFlows/brokerOptions.js +2 -0
  245. package/dist/workerd/msal/nodeFlows/brokerOptions.js.map +1 -0
  246. package/dist/workerd/msal/nodeFlows/msalClient.d.ts +186 -0
  247. package/dist/workerd/msal/nodeFlows/msalClient.d.ts.map +1 -0
  248. package/dist/workerd/msal/nodeFlows/msalClient.js +469 -0
  249. package/dist/workerd/msal/nodeFlows/msalClient.js.map +1 -0
  250. package/dist/workerd/msal/nodeFlows/msalPlugins.d.ts +91 -0
  251. package/dist/workerd/msal/nodeFlows/msalPlugins.d.ts.map +1 -0
  252. package/dist/workerd/msal/nodeFlows/msalPlugins.js +87 -0
  253. package/dist/workerd/msal/nodeFlows/msalPlugins.js.map +1 -0
  254. package/dist/workerd/msal/nodeFlows/tokenCachePersistenceOptions.d.ts +24 -0
  255. package/dist/workerd/msal/nodeFlows/tokenCachePersistenceOptions.d.ts.map +1 -0
  256. package/dist/workerd/msal/nodeFlows/tokenCachePersistenceOptions.js +4 -0
  257. package/dist/workerd/msal/nodeFlows/tokenCachePersistenceOptions.js.map +1 -0
  258. package/dist/workerd/msal/types.d.ts +87 -0
  259. package/dist/workerd/msal/types.d.ts.map +1 -0
  260. package/dist/workerd/msal/types.js +4 -0
  261. package/dist/workerd/msal/types.js.map +1 -0
  262. package/dist/workerd/msal/utils.d.ts +95 -0
  263. package/dist/workerd/msal/utils.d.ts.map +1 -0
  264. package/dist/workerd/msal/utils.js +238 -0
  265. package/dist/workerd/msal/utils.js.map +1 -0
  266. package/dist/workerd/package.json +3 -0
  267. package/dist/workerd/plugins/consumer.d.ts +28 -0
  268. package/dist/workerd/plugins/consumer.d.ts.map +1 -0
  269. package/dist/workerd/plugins/consumer.js +43 -0
  270. package/dist/workerd/plugins/consumer.js.map +1 -0
  271. package/dist/workerd/plugins/provider.d.ts +36 -0
  272. package/dist/workerd/plugins/provider.d.ts.map +1 -0
  273. package/dist/workerd/plugins/provider.js +4 -0
  274. package/dist/workerd/plugins/provider.js.map +1 -0
  275. package/dist/workerd/regionalAuthority.d.ts +122 -0
  276. package/dist/workerd/regionalAuthority.d.ts.map +1 -0
  277. package/dist/workerd/regionalAuthority.js +140 -0
  278. package/dist/workerd/regionalAuthority.js.map +1 -0
  279. package/dist/workerd/tokenCredentialOptions.d.ts +28 -0
  280. package/dist/workerd/tokenCredentialOptions.d.ts.map +1 -0
  281. package/dist/workerd/tokenCredentialOptions.js +4 -0
  282. package/dist/workerd/tokenCredentialOptions.js.map +1 -0
  283. package/dist/workerd/tokenProvider.d.ts +39 -0
  284. package/dist/workerd/tokenProvider.d.ts.map +1 -0
  285. package/dist/workerd/tokenProvider.js +53 -0
  286. package/dist/workerd/tokenProvider.js.map +1 -0
  287. package/dist/workerd/util/authHostEnv-browser.d.mts +4 -0
  288. package/dist/workerd/util/authHostEnv-browser.d.mts.map +1 -0
  289. package/dist/workerd/util/authHostEnv-browser.mjs +7 -0
  290. package/dist/workerd/util/authHostEnv-browser.mjs.map +1 -0
  291. package/dist/workerd/util/identityTokenEndpoint.d.ts +2 -0
  292. package/dist/workerd/util/identityTokenEndpoint.d.ts.map +1 -0
  293. package/dist/workerd/util/identityTokenEndpoint.js +11 -0
  294. package/dist/workerd/util/identityTokenEndpoint.js.map +1 -0
  295. package/dist/workerd/util/logging.d.ts +70 -0
  296. package/dist/workerd/util/logging.d.ts.map +1 -0
  297. package/dist/workerd/util/logging.js +94 -0
  298. package/dist/workerd/util/logging.js.map +1 -0
  299. package/dist/workerd/util/processMultiTenantRequest.d.ts +10 -0
  300. package/dist/workerd/util/processMultiTenantRequest.d.ts.map +1 -0
  301. package/dist/workerd/util/processMultiTenantRequest.js +35 -0
  302. package/dist/workerd/util/processMultiTenantRequest.js.map +1 -0
  303. package/dist/workerd/util/processUtils.d.ts +13 -0
  304. package/dist/workerd/util/processUtils.d.ts.map +1 -0
  305. package/dist/workerd/util/processUtils.js +32 -0
  306. package/dist/workerd/util/processUtils.js.map +1 -0
  307. package/dist/workerd/util/scopeUtils.d.ts +17 -0
  308. package/dist/workerd/util/scopeUtils.d.ts.map +1 -0
  309. package/dist/workerd/util/scopeUtils.js +29 -0
  310. package/dist/workerd/util/scopeUtils.js.map +1 -0
  311. package/dist/workerd/util/subscriptionUtils.d.ts +6 -0
  312. package/dist/workerd/util/subscriptionUtils.d.ts.map +1 -0
  313. package/dist/workerd/util/subscriptionUtils.js +14 -0
  314. package/dist/workerd/util/subscriptionUtils.js.map +1 -0
  315. package/dist/workerd/util/tenantIdUtils.d.ts +15 -0
  316. package/dist/workerd/util/tenantIdUtils.d.ts.map +1 -0
  317. package/dist/workerd/util/tenantIdUtils.js +44 -0
  318. package/dist/workerd/util/tenantIdUtils.js.map +1 -0
  319. package/dist/workerd/util/tracing.d.ts +6 -0
  320. package/dist/workerd/util/tracing.d.ts.map +1 -0
  321. package/dist/workerd/util/tracing.js +14 -0
  322. package/dist/workerd/util/tracing.js.map +1 -0
  323. package/package.json +9 -3
@@ -0,0 +1,114 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { credentialLogger, processEnvVars } from "../util/logging.js";
4
+ import { ClientAssertionCredential } from "./clientAssertionCredential.js";
5
+ import { CredentialUnavailableError } from "../errors.js";
6
+ import { checkTenantId } from "../util/tenantIdUtils.js";
7
+ import { readFile } from "node:fs/promises";
8
+ const credentialName = "WorkloadIdentityCredential";
9
+ /**
10
+ * Contains the list of all supported environment variable names so that an
11
+ * appropriate error message can be generated when no credentials can be
12
+ * configured.
13
+ *
14
+ * @internal
15
+ */
16
+ export const SupportedWorkloadEnvironmentVariables = [
17
+ "AZURE_TENANT_ID",
18
+ "AZURE_CLIENT_ID",
19
+ "AZURE_FEDERATED_TOKEN_FILE",
20
+ ];
21
+ const logger = credentialLogger(credentialName);
22
+ /**
23
+ * Workload Identity authentication is a feature in Azure that allows applications running on virtual machines (VMs)
24
+ * to access other Azure resources without the need for a service principal or managed identity. With Workload Identity
25
+ * authentication, applications authenticate themselves using their own identity, rather than using a shared service
26
+ * principal or managed identity. Under the hood, Workload Identity authentication uses the concept of Service Account
27
+ * Credentials (SACs), which are automatically created by Azure and stored securely in the VM. By using Workload
28
+ * Identity authentication, you can avoid the need to manage and rotate service principals or managed identities for
29
+ * each application on each VM. Additionally, because SACs are created automatically and managed by Azure, you don't
30
+ * need to worry about storing and securing sensitive credentials themselves.
31
+ * The WorkloadIdentityCredential supports Microsoft Entra Workload ID authentication on Azure Kubernetes and acquires
32
+ * a token using the SACs available in the Azure Kubernetes environment.
33
+ * Refer to <a href="https://learn.microsoft.com/azure/aks/workload-identity-overview">Microsoft Entra
34
+ * Workload ID</a> for more information.
35
+ */
36
+ export class WorkloadIdentityCredential {
37
+ /**
38
+ * WorkloadIdentityCredential supports Microsoft Entra Workload ID on Kubernetes.
39
+ *
40
+ * @param options - The identity client options to use for authentication.
41
+ */
42
+ constructor(options) {
43
+ this.azureFederatedTokenFileContent = undefined;
44
+ this.cacheDate = undefined;
45
+ // Logging environment variables for error details
46
+ const assignedEnv = processEnvVars(SupportedWorkloadEnvironmentVariables).assigned.join(", ");
47
+ logger.info(`Found the following environment variables: ${assignedEnv}`);
48
+ const workloadIdentityCredentialOptions = options !== null && options !== void 0 ? options : {};
49
+ const tenantId = workloadIdentityCredentialOptions.tenantId || process.env.AZURE_TENANT_ID;
50
+ const clientId = workloadIdentityCredentialOptions.clientId || process.env.AZURE_CLIENT_ID;
51
+ this.federatedTokenFilePath =
52
+ workloadIdentityCredentialOptions.tokenFilePath || process.env.AZURE_FEDERATED_TOKEN_FILE;
53
+ if (tenantId) {
54
+ checkTenantId(logger, tenantId);
55
+ }
56
+ if (!clientId) {
57
+ throw new CredentialUnavailableError(`${credentialName}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID".
58
+ See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);
59
+ }
60
+ if (!tenantId) {
61
+ throw new CredentialUnavailableError(`${credentialName}: is unavailable. tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_TENANT_ID".
62
+ See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);
63
+ }
64
+ if (!this.federatedTokenFilePath) {
65
+ throw new CredentialUnavailableError(`${credentialName}: is unavailable. federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_FEDERATED_TOKEN_FILE".
66
+ See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);
67
+ }
68
+ logger.info(`Invoking ClientAssertionCredential with tenant ID: ${tenantId}, clientId: ${workloadIdentityCredentialOptions.clientId} and federated token path: [REDACTED]`);
69
+ this.client = new ClientAssertionCredential(tenantId, clientId, this.readFileContents.bind(this), options);
70
+ }
71
+ /**
72
+ * Authenticates with Microsoft Entra ID and returns an access token if successful.
73
+ * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.
74
+ *
75
+ * @param scopes - The list of scopes for which the token will have access.
76
+ * @param options - The options used to configure any requests this
77
+ * TokenCredential implementation might make.
78
+ */
79
+ async getToken(scopes, options) {
80
+ if (!this.client) {
81
+ const errorMessage = `${credentialName}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters.
82
+ In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables -
83
+ "AZURE_TENANT_ID",
84
+ "AZURE_CLIENT_ID",
85
+ "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;
86
+ logger.info(errorMessage);
87
+ throw new CredentialUnavailableError(errorMessage);
88
+ }
89
+ logger.info("Invoking getToken() of Client Assertion Credential");
90
+ return this.client.getToken(scopes, options);
91
+ }
92
+ async readFileContents() {
93
+ // Cached assertions expire after 5 minutes
94
+ if (this.cacheDate !== undefined && Date.now() - this.cacheDate >= 1000 * 60 * 5) {
95
+ this.azureFederatedTokenFileContent = undefined;
96
+ }
97
+ if (!this.federatedTokenFilePath) {
98
+ throw new CredentialUnavailableError(`${credentialName}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);
99
+ }
100
+ if (!this.azureFederatedTokenFileContent) {
101
+ const file = await readFile(this.federatedTokenFilePath, "utf8");
102
+ const value = file.trim();
103
+ if (!value) {
104
+ throw new CredentialUnavailableError(`${credentialName}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`);
105
+ }
106
+ else {
107
+ this.azureFederatedTokenFileContent = value;
108
+ this.cacheDate = Date.now();
109
+ }
110
+ }
111
+ return this.azureFederatedTokenFileContent;
112
+ }
113
+ }
114
+ //# sourceMappingURL=workloadIdentityCredential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workloadIdentityCredential.js","sourceRoot":"","sources":["../../../src/credentials/workloadIdentityCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,cAAc,GAAG,4BAA4B,CAAC;AACpD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,iBAAiB;IACjB,iBAAiB;IACjB,4BAA4B;CAC7B,CAAC;AACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;AAChD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,0BAA0B;IAMrC;;;;OAIG;IACH,YAAY,OAA2C;QAT/C,mCAA8B,GAAuB,SAAS,CAAC;QAC/D,cAAS,GAAuB,SAAS,CAAC;QAShD,kDAAkD;QAClD,MAAM,WAAW,GAAG,cAAc,CAAC,qCAAqC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9F,MAAM,CAAC,IAAI,CAAC,8CAA8C,WAAW,EAAE,CAAC,CAAC;QAEzE,MAAM,iCAAiC,GAAG,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,CAAC,CAAC;YAC1B,MAAM,IAAI,0BAA0B,CAAC,YAAY,CAAC,CAAC;QACrD,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAEO,KAAK,CAAC,gBAAgB;QAC5B,2CAA2C;QAC3C,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;YACjF,IAAI,CAAC,8BAA8B,GAAG,SAAS,CAAC;QAClD,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACjC,MAAM,IAAI,0BAA0B,CAClC,GAAG,cAAc,gDAAgD,IAAI,CAAC,sBAAsB,GAAG,CAChG,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,8BAA8B,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;YACjE,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YAC1B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI,0BAA0B,CAClC,GAAG,cAAc,4CAA4C,IAAI,CAAC,sBAAsB,GAAG,CAC5F,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,8BAA8B,GAAG,KAAK,CAAC;gBAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,8BAA8B,CAAC;IAC7C,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AccessToken, GetTokenOptions, TokenCredential } from \"@azure/core-auth\";\nimport { credentialLogger, processEnvVars } from \"../util/logging.js\";\n\nimport { ClientAssertionCredential } from \"./clientAssertionCredential.js\";\nimport { CredentialUnavailableError } from \"../errors.js\";\nimport type { WorkloadIdentityCredentialOptions } from \"./workloadIdentityCredentialOptions.js\";\nimport { checkTenantId } from \"../util/tenantIdUtils.js\";\nimport { readFile } from \"node:fs/promises\";\n\nconst credentialName = \"WorkloadIdentityCredential\";\n/**\n * Contains the list of all supported environment variable names so that an\n * appropriate error message can be generated when no credentials can be\n * configured.\n *\n * @internal\n */\nexport const SupportedWorkloadEnvironmentVariables = [\n \"AZURE_TENANT_ID\",\n \"AZURE_CLIENT_ID\",\n \"AZURE_FEDERATED_TOKEN_FILE\",\n];\nconst logger = credentialLogger(credentialName);\n/**\n * Workload Identity authentication is a feature in Azure that allows applications running on virtual machines (VMs)\n * to access other Azure resources without the need for a service principal or managed identity. With Workload Identity\n * authentication, applications authenticate themselves using their own identity, rather than using a shared service\n * principal or managed identity. Under the hood, Workload Identity authentication uses the concept of Service Account\n * Credentials (SACs), which are automatically created by Azure and stored securely in the VM. By using Workload\n * Identity authentication, you can avoid the need to manage and rotate service principals or managed identities for\n * each application on each VM. Additionally, because SACs are created automatically and managed by Azure, you don't\n * need to worry about storing and securing sensitive credentials themselves.\n * The WorkloadIdentityCredential supports Microsoft Entra Workload ID authentication on Azure Kubernetes and acquires\n * a token using the SACs available in the Azure Kubernetes environment.\n * Refer to <a href=\"https://learn.microsoft.com/azure/aks/workload-identity-overview\">Microsoft Entra\n * Workload ID</a> for more information.\n */\nexport class WorkloadIdentityCredential implements TokenCredential {\n private client: ClientAssertionCredential | undefined;\n private azureFederatedTokenFileContent: string | undefined = undefined;\n private cacheDate: number | undefined = undefined;\n private federatedTokenFilePath: string | undefined;\n\n /**\n * WorkloadIdentityCredential supports Microsoft Entra Workload ID on Kubernetes.\n *\n * @param options - The identity client options to use for authentication.\n */\n constructor(options?: WorkloadIdentityCredentialOptions) {\n // Logging environment variables for error details\n const assignedEnv = processEnvVars(SupportedWorkloadEnvironmentVariables).assigned.join(\", \");\n logger.info(`Found the following environment variables: ${assignedEnv}`);\n\n const workloadIdentityCredentialOptions = options ?? {};\n const tenantId = workloadIdentityCredentialOptions.tenantId || process.env.AZURE_TENANT_ID;\n const clientId = workloadIdentityCredentialOptions.clientId || process.env.AZURE_CLIENT_ID;\n this.federatedTokenFilePath =\n workloadIdentityCredentialOptions.tokenFilePath || process.env.AZURE_FEDERATED_TOKEN_FILE;\n if (tenantId) {\n checkTenantId(logger, tenantId);\n }\n if (!clientId) {\n throw new CredentialUnavailableError(\n `${credentialName}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - \"AZURE_CLIENT_ID\".\n See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`,\n );\n }\n\n if (!tenantId) {\n throw new CredentialUnavailableError(\n `${credentialName}: is unavailable. tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - \"AZURE_TENANT_ID\".\n See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`,\n );\n }\n\n if (!this.federatedTokenFilePath) {\n throw new CredentialUnavailableError(\n `${credentialName}: is unavailable. federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - \"AZURE_FEDERATED_TOKEN_FILE\".\n See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`,\n );\n }\n\n logger.info(\n `Invoking ClientAssertionCredential with tenant ID: ${tenantId}, clientId: ${workloadIdentityCredentialOptions.clientId} and federated token path: [REDACTED]`,\n );\n this.client = new ClientAssertionCredential(\n tenantId,\n clientId,\n this.readFileContents.bind(this),\n options,\n );\n }\n\n /**\n * Authenticates with Microsoft Entra ID and returns an access token if successful.\n * If authentication fails, a {@link CredentialUnavailableError} will be thrown with the details of the failure.\n *\n * @param scopes - The list of scopes for which the token will have access.\n * @param options - The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n public async getToken(\n scopes: string | string[],\n options?: GetTokenOptions,\n ): Promise<AccessToken | null> {\n if (!this.client) {\n const errorMessage = `${credentialName}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. \n In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables - \n \"AZURE_TENANT_ID\",\n \"AZURE_CLIENT_ID\",\n \"AZURE_FEDERATED_TOKEN_FILE\". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;\n logger.info(errorMessage);\n throw new CredentialUnavailableError(errorMessage);\n }\n logger.info(\"Invoking getToken() of Client Assertion Credential\");\n return this.client.getToken(scopes, options);\n }\n\n private async readFileContents(): Promise<string> {\n // Cached assertions expire after 5 minutes\n if (this.cacheDate !== undefined && Date.now() - this.cacheDate >= 1000 * 60 * 5) {\n this.azureFederatedTokenFileContent = undefined;\n }\n if (!this.federatedTokenFilePath) {\n throw new CredentialUnavailableError(\n `${credentialName}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`,\n );\n }\n if (!this.azureFederatedTokenFileContent) {\n const file = await readFile(this.federatedTokenFilePath, \"utf8\");\n const value = file.trim();\n if (!value) {\n throw new CredentialUnavailableError(\n `${credentialName}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`,\n );\n } else {\n this.azureFederatedTokenFileContent = value;\n this.cacheDate = Date.now();\n }\n }\n return this.azureFederatedTokenFileContent;\n }\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import type { AuthorityValidationOptions } from "./authorityValidationOptions.js";
2
+ import type { MultiTenantTokenCredentialOptions } from "./multiTenantTokenCredentialOptions.js";
3
+ /**
4
+ * Options for the {@link WorkloadIdentityCredential}
5
+ */
6
+ export interface WorkloadIdentityCredentialOptions extends MultiTenantTokenCredentialOptions, AuthorityValidationOptions {
7
+ /**
8
+ * ID of the application's Microsoft Entra tenant. Also called its directory ID.
9
+ */
10
+ tenantId?: string;
11
+ /**
12
+ * The client ID of a Microsoft Entra app registration.
13
+ */
14
+ clientId?: string;
15
+ /**
16
+ * The path to a file containing a Kubernetes service account token that authenticates the identity.
17
+ */
18
+ tokenFilePath?: string;
19
+ }
20
+ //# sourceMappingURL=workloadIdentityCredentialOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workloadIdentityCredentialOptions.d.ts","sourceRoot":"","sources":["../../../src/credentials/workloadIdentityCredentialOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,iCACf,SAAQ,iCAAiC,EACvC,0BAA0B;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=workloadIdentityCredentialOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workloadIdentityCredentialOptions.js","sourceRoot":"","sources":["../../../src/credentials/workloadIdentityCredentialOptions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AuthorityValidationOptions } from \"./authorityValidationOptions.js\";\nimport type { MultiTenantTokenCredentialOptions } from \"./multiTenantTokenCredentialOptions.js\";\n\n/**\n * Options for the {@link WorkloadIdentityCredential}\n */\nexport interface WorkloadIdentityCredentialOptions\n extends MultiTenantTokenCredentialOptions,\n AuthorityValidationOptions {\n /**\n * ID of the application's Microsoft Entra tenant. Also called its directory ID.\n */\n tenantId?: string;\n /**\n * The client ID of a Microsoft Entra app registration.\n */\n clientId?: string;\n /**\n * The path to a file containing a Kubernetes service account token that authenticates the identity.\n */\n tokenFilePath?: string;\n}\n"]}
@@ -0,0 +1,139 @@
1
+ import type { GetTokenOptions } from "@azure/core-auth";
2
+ /**
3
+ * See the official documentation for more details:
4
+ *
5
+ * https://learn.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code#error-response-1
6
+ *
7
+ * NOTE: This documentation is for v1 OAuth support but the same error
8
+ * response details still apply to v2.
9
+ */
10
+ export interface ErrorResponse {
11
+ /**
12
+ * The string identifier for the error.
13
+ */
14
+ error: string;
15
+ /**
16
+ * The error's description.
17
+ */
18
+ errorDescription: string;
19
+ /**
20
+ * An array of codes pertaining to the error(s) that occurred.
21
+ */
22
+ errorCodes?: number[];
23
+ /**
24
+ * The timestamp at which the error occurred.
25
+ */
26
+ timestamp?: string;
27
+ /**
28
+ * The trace identifier for this error occurrence.
29
+ */
30
+ traceId?: string;
31
+ /**
32
+ * The correlation ID to be used for tracking the source of the error.
33
+ */
34
+ correlationId?: string;
35
+ }
36
+ /**
37
+ * Used for internal deserialization of OAuth responses. Public model is ErrorResponse
38
+ * @internal
39
+ */
40
+ export interface OAuthErrorResponse {
41
+ error: string;
42
+ error_description: string;
43
+ error_codes?: number[];
44
+ timestamp?: string;
45
+ trace_id?: string;
46
+ correlation_id?: string;
47
+ }
48
+ /**
49
+ * The Error.name value of an CredentialUnavailable
50
+ */
51
+ export declare const CredentialUnavailableErrorName = "CredentialUnavailableError";
52
+ /**
53
+ * This signifies that the credential that was tried in a chained credential
54
+ * was not available to be used as the credential. Rather than treating this as
55
+ * an error that should halt the chain, it's caught and the chain continues
56
+ */
57
+ export declare class CredentialUnavailableError extends Error {
58
+ constructor(message?: string, options?: {
59
+ cause?: unknown;
60
+ });
61
+ }
62
+ /**
63
+ * The Error.name value of an AuthenticationError
64
+ */
65
+ export declare const AuthenticationErrorName = "AuthenticationError";
66
+ /**
67
+ * Provides details about a failure to authenticate with Azure Active
68
+ * Directory. The `errorResponse` field contains more details about
69
+ * the specific failure.
70
+ */
71
+ export declare class AuthenticationError extends Error {
72
+ /**
73
+ * The HTTP status code returned from the authentication request.
74
+ */
75
+ readonly statusCode: number;
76
+ /**
77
+ * The error response details.
78
+ */
79
+ readonly errorResponse: ErrorResponse;
80
+ constructor(statusCode: number, errorBody: object | string | undefined | null, options?: {
81
+ cause?: unknown;
82
+ });
83
+ }
84
+ /**
85
+ * The Error.name value of an AggregateAuthenticationError
86
+ */
87
+ export declare const AggregateAuthenticationErrorName = "AggregateAuthenticationError";
88
+ /**
89
+ * Provides an `errors` array containing {@link AuthenticationError} instance
90
+ * for authentication failures from credentials in a {@link ChainedTokenCredential}.
91
+ */
92
+ export declare class AggregateAuthenticationError extends Error {
93
+ /**
94
+ * The array of error objects that were thrown while trying to authenticate
95
+ * with the credentials in a {@link ChainedTokenCredential}.
96
+ */
97
+ errors: any[];
98
+ constructor(errors: any[], errorMessage?: string);
99
+ }
100
+ /**
101
+ * Optional parameters to the {@link AuthenticationRequiredError}
102
+ */
103
+ export interface AuthenticationRequiredErrorOptions {
104
+ /**
105
+ * The list of scopes for which the token will have access.
106
+ */
107
+ scopes: string[];
108
+ /**
109
+ * The options passed to the getToken request.
110
+ */
111
+ getTokenOptions?: GetTokenOptions;
112
+ /**
113
+ * The message of the error.
114
+ */
115
+ message?: string;
116
+ /**
117
+ * The underlying cause, if any, that caused the authentication to fail.
118
+ */
119
+ cause?: unknown;
120
+ }
121
+ /**
122
+ * Error used to enforce authentication after trying to retrieve a token silently.
123
+ */
124
+ export declare class AuthenticationRequiredError extends Error {
125
+ /**
126
+ * The list of scopes for which the token will have access.
127
+ */
128
+ scopes: string[];
129
+ /**
130
+ * The options passed to the getToken request.
131
+ */
132
+ getTokenOptions?: GetTokenOptions;
133
+ constructor(
134
+ /**
135
+ * Optional parameters. A message can be specified. The {@link GetTokenOptions} of the request can also be specified to more easily associate the error with the received parameters.
136
+ */
137
+ options: AuthenticationRequiredErrorOptions);
138
+ }
139
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAUD;;GAEG;AACH,eAAO,MAAM,8BAA8B,+BAA+B,CAAC;AAE3E;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAK5D;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAE7D;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C;;OAEG;IACH,SAAgB,UAAU,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACH,SAAgB,aAAa,EAAE,aAAa,CAAC;gBAG3C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,EAC7C,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CA8ChC;AAED;;GAEG;AACH,eAAO,MAAM,gCAAgC,iCAAiC,CAAC;AAE/E;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD;;;OAGG;IACI,MAAM,EAAE,GAAG,EAAE,CAAC;gBAET,MAAM,EAAE,GAAG,EAAE,EAAE,YAAY,CAAC,EAAE,MAAM;CAQjD;AAaD;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD;;OAEG;IACI,MAAM,EAAE,MAAM,EAAE,CAAC;IACxB;;OAEG;IACI,eAAe,CAAC,EAAE,eAAe,CAAC;;IAGvC;;OAEG;IACH,OAAO,EAAE,kCAAkC;CAW9C"}
@@ -0,0 +1,123 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ function isErrorResponse(errorResponse) {
4
+ return (errorResponse &&
5
+ typeof errorResponse.error === "string" &&
6
+ typeof errorResponse.error_description === "string");
7
+ }
8
+ /**
9
+ * The Error.name value of an CredentialUnavailable
10
+ */
11
+ export const CredentialUnavailableErrorName = "CredentialUnavailableError";
12
+ /**
13
+ * This signifies that the credential that was tried in a chained credential
14
+ * was not available to be used as the credential. Rather than treating this as
15
+ * an error that should halt the chain, it's caught and the chain continues
16
+ */
17
+ export class CredentialUnavailableError extends Error {
18
+ constructor(message, options) {
19
+ // @ts-expect-error - TypeScript does not recognize this until we use ES2022 as the target; however, all our major runtimes do support the `cause` property
20
+ super(message, options);
21
+ this.name = CredentialUnavailableErrorName;
22
+ }
23
+ }
24
+ /**
25
+ * The Error.name value of an AuthenticationError
26
+ */
27
+ export const AuthenticationErrorName = "AuthenticationError";
28
+ /**
29
+ * Provides details about a failure to authenticate with Azure Active
30
+ * Directory. The `errorResponse` field contains more details about
31
+ * the specific failure.
32
+ */
33
+ export class AuthenticationError extends Error {
34
+ constructor(statusCode, errorBody, options) {
35
+ let errorResponse = {
36
+ error: "unknown",
37
+ errorDescription: "An unknown error occurred and no additional details are available.",
38
+ };
39
+ if (isErrorResponse(errorBody)) {
40
+ errorResponse = convertOAuthErrorResponseToErrorResponse(errorBody);
41
+ }
42
+ else if (typeof errorBody === "string") {
43
+ try {
44
+ // Most error responses will contain JSON-formatted error details
45
+ // in the response body
46
+ const oauthErrorResponse = JSON.parse(errorBody);
47
+ errorResponse = convertOAuthErrorResponseToErrorResponse(oauthErrorResponse);
48
+ }
49
+ catch (e) {
50
+ if (statusCode === 400) {
51
+ errorResponse = {
52
+ error: "invalid_request",
53
+ errorDescription: `The service indicated that the request was invalid.\n\n${errorBody}`,
54
+ };
55
+ }
56
+ else {
57
+ errorResponse = {
58
+ error: "unknown_error",
59
+ errorDescription: `An unknown error has occurred. Response body:\n\n${errorBody}`,
60
+ };
61
+ }
62
+ }
63
+ }
64
+ else {
65
+ errorResponse = {
66
+ error: "unknown_error",
67
+ errorDescription: "An unknown error occurred and no additional details are available.",
68
+ };
69
+ }
70
+ super(`${errorResponse.error} Status code: ${statusCode}\nMore details:\n${errorResponse.errorDescription},`,
71
+ // @ts-expect-error - TypeScript does not recognize this until we use ES2022 as the target; however, all our major runtimes do support the `cause` property
72
+ options);
73
+ this.statusCode = statusCode;
74
+ this.errorResponse = errorResponse;
75
+ // Ensure that this type reports the correct name
76
+ this.name = AuthenticationErrorName;
77
+ }
78
+ }
79
+ /**
80
+ * The Error.name value of an AggregateAuthenticationError
81
+ */
82
+ export const AggregateAuthenticationErrorName = "AggregateAuthenticationError";
83
+ /**
84
+ * Provides an `errors` array containing {@link AuthenticationError} instance
85
+ * for authentication failures from credentials in a {@link ChainedTokenCredential}.
86
+ */
87
+ export class AggregateAuthenticationError extends Error {
88
+ constructor(errors, errorMessage) {
89
+ const errorDetail = errors.join("\n");
90
+ super(`${errorMessage}\n${errorDetail}`);
91
+ this.errors = errors;
92
+ // Ensure that this type reports the correct name
93
+ this.name = AggregateAuthenticationErrorName;
94
+ }
95
+ }
96
+ function convertOAuthErrorResponseToErrorResponse(errorBody) {
97
+ return {
98
+ error: errorBody.error,
99
+ errorDescription: errorBody.error_description,
100
+ correlationId: errorBody.correlation_id,
101
+ errorCodes: errorBody.error_codes,
102
+ timestamp: errorBody.timestamp,
103
+ traceId: errorBody.trace_id,
104
+ };
105
+ }
106
+ /**
107
+ * Error used to enforce authentication after trying to retrieve a token silently.
108
+ */
109
+ export class AuthenticationRequiredError extends Error {
110
+ constructor(
111
+ /**
112
+ * Optional parameters. A message can be specified. The {@link GetTokenOptions} of the request can also be specified to more easily associate the error with the received parameters.
113
+ */
114
+ options) {
115
+ super(options.message,
116
+ // @ts-expect-error - TypeScript does not recognize this until we use ES2022 as the target; however, all our major runtimes do support the `cause` property
117
+ options.cause ? { cause: options.cause } : undefined);
118
+ this.scopes = options.scopes;
119
+ this.getTokenOptions = options.getTokenOptions;
120
+ this.name = "AuthenticationRequiredError";
121
+ }
122
+ }
123
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAyDlC,SAAS,eAAe,CAAC,aAAkB;IACzC,OAAO,CACL,aAAa;QACb,OAAO,aAAa,CAAC,KAAK,KAAK,QAAQ;QACvC,OAAO,aAAa,CAAC,iBAAiB,KAAK,QAAQ,CACpD,CAAC;AACJ,CAAC;AAED;;GAEG;A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AC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CACrD,CAAC;QACF,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC5C,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { GetTokenOptions } from \"@azure/core-auth\";\n\n/**\n * See the official documentation for more details:\n *\n * https://learn.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code#error-response-1\n *\n * NOTE: This documentation is for v1 OAuth support but the same error\n * response details still apply to v2.\n */\nexport interface ErrorResponse {\n /**\n * The string identifier for the error.\n */\n error: string;\n\n /**\n * The error's description.\n */\n errorDescription: string;\n\n /**\n * An array of codes pertaining to the error(s) that occurred.\n */\n errorCodes?: number[];\n\n /**\n * The timestamp at which the error occurred.\n */\n timestamp?: string;\n\n /**\n * The trace identifier for this error occurrence.\n */\n traceId?: string;\n\n /**\n * The correlation ID to be used for tracking the source of the error.\n */\n correlationId?: string;\n}\n\n/**\n * Used for internal deserialization of OAuth responses. Public model is ErrorResponse\n * @internal\n */\nexport interface OAuthErrorResponse {\n error: string;\n error_description: string;\n error_codes?: number[];\n timestamp?: string;\n trace_id?: string;\n correlation_id?: string;\n}\n\nfunction isErrorResponse(errorResponse: any): errorResponse is OAuthErrorResponse {\n return (\n errorResponse &&\n typeof errorResponse.error === \"string\" &&\n typeof errorResponse.error_description === \"string\"\n );\n}\n\n/**\n * The Error.name value of an CredentialUnavailable\n */\nexport const CredentialUnavailableErrorName = \"CredentialUnavailableError\";\n\n/**\n * This signifies that the credential that was tried in a chained credential\n * was not available to be used as the credential. Rather than treating this as\n * an error that should halt the chain, it's caught and the chain continues\n */\nexport class CredentialUnavailableError extends Error {\n constructor(message?: string, options?: { cause?: unknown }) {\n // @ts-expect-error - TypeScript does not recognize this until we use ES2022 as the target; however, all our major runtimes do support the `cause` property\n super(message, options);\n this.name = CredentialUnavailableErrorName;\n }\n}\n\n/**\n * The Error.name value of an AuthenticationError\n */\nexport const AuthenticationErrorName = \"AuthenticationError\";\n\n/**\n * Provides details about a failure to authenticate with Azure Active\n * Directory. The `errorResponse` field contains more details about\n * the specific failure.\n */\nexport class AuthenticationError extends Error {\n /**\n * The HTTP status code returned from the authentication request.\n */\n public readonly statusCode: number;\n\n /**\n * The error response details.\n */\n public readonly errorResponse: ErrorResponse;\n\n constructor(\n statusCode: number,\n errorBody: object | string | undefined | null,\n options?: { cause?: unknown },\n ) {\n let errorResponse: ErrorResponse = {\n error: \"unknown\",\n errorDescription: \"An unknown error occurred and no additional details are available.\",\n };\n\n if (isErrorResponse(errorBody)) {\n errorResponse = convertOAuthErrorResponseToErrorResponse(errorBody);\n } else if (typeof errorBody === \"string\") {\n try {\n // Most error responses will contain JSON-formatted error details\n // in the response body\n const oauthErrorResponse: OAuthErrorResponse = JSON.parse(errorBody);\n errorResponse = convertOAuthErrorResponseToErrorResponse(oauthErrorResponse);\n } catch (e: any) {\n if (statusCode === 400) {\n errorResponse = {\n error: \"invalid_request\",\n errorDescription: `The service indicated that the request was invalid.\\n\\n${errorBody}`,\n };\n } else {\n errorResponse = {\n error: \"unknown_error\",\n errorDescription: `An unknown error has occurred. Response body:\\n\\n${errorBody}`,\n };\n }\n }\n } else {\n errorResponse = {\n error: \"unknown_error\",\n errorDescription: \"An unknown error occurred and no additional details are available.\",\n };\n }\n\n super(\n `${errorResponse.error} Status code: ${statusCode}\\nMore details:\\n${errorResponse.errorDescription},`,\n // @ts-expect-error - TypeScript does not recognize this until we use ES2022 as the target; however, all our major runtimes do support the `cause` property\n options,\n );\n this.statusCode = statusCode;\n this.errorResponse = errorResponse;\n\n // Ensure that this type reports the correct name\n this.name = AuthenticationErrorName;\n }\n}\n\n/**\n * The Error.name value of an AggregateAuthenticationError\n */\nexport const AggregateAuthenticationErrorName = \"AggregateAuthenticationError\";\n\n/**\n * Provides an `errors` array containing {@link AuthenticationError} instance\n * for authentication failures from credentials in a {@link ChainedTokenCredential}.\n */\nexport class AggregateAuthenticationError extends Error {\n /**\n * The array of error objects that were thrown while trying to authenticate\n * with the credentials in a {@link ChainedTokenCredential}.\n */\n public errors: any[];\n\n constructor(errors: any[], errorMessage?: string) {\n const errorDetail = errors.join(\"\\n\");\n super(`${errorMessage}\\n${errorDetail}`);\n this.errors = errors;\n\n // Ensure that this type reports the correct name\n this.name = AggregateAuthenticationErrorName;\n }\n}\n\nfunction convertOAuthErrorResponseToErrorResponse(errorBody: OAuthErrorResponse): ErrorResponse {\n return {\n error: errorBody.error,\n errorDescription: errorBody.error_description,\n correlationId: errorBody.correlation_id,\n errorCodes: errorBody.error_codes,\n timestamp: errorBody.timestamp,\n traceId: errorBody.trace_id,\n };\n}\n\n/**\n * Optional parameters to the {@link AuthenticationRequiredError}\n */\nexport interface AuthenticationRequiredErrorOptions {\n /**\n * The list of scopes for which the token will have access.\n */\n scopes: string[];\n /**\n * The options passed to the getToken request.\n */\n getTokenOptions?: GetTokenOptions;\n /**\n * The message of the error.\n */\n message?: string;\n /**\n * The underlying cause, if any, that caused the authentication to fail.\n */\n cause?: unknown;\n}\n\n/**\n * Error used to enforce authentication after trying to retrieve a token silently.\n */\nexport class AuthenticationRequiredError extends Error {\n /**\n * The list of scopes for which the token will have access.\n */\n public scopes: string[];\n /**\n * The options passed to the getToken request.\n */\n public getTokenOptions?: GetTokenOptions;\n\n constructor(\n /**\n * Optional parameters. A message can be specified. The {@link GetTokenOptions} of the request can also be specified to more easily associate the error with the received parameters.\n */\n options: AuthenticationRequiredErrorOptions,\n ) {\n super(\n options.message,\n // @ts-expect-error - TypeScript does not recognize this until we use ES2022 as the target; however, all our major runtimes do support the `cause` property\n options.cause ? { cause: options.cause } : undefined,\n );\n this.scopes = options.scopes;\n this.getTokenOptions = options.getTokenOptions;\n this.name = \"AuthenticationRequiredError\";\n }\n}\n"]}
@@ -0,0 +1,61 @@
1
+ export * from "./plugins/consumer.js";
2
+ export { IdentityPlugin } from "./plugins/provider.js";
3
+ import type { TokenCredential } from "@azure/core-auth";
4
+ export { AuthenticationError, ErrorResponse, AggregateAuthenticationError, AuthenticationErrorName, AggregateAuthenticationErrorName, CredentialUnavailableError, CredentialUnavailableErrorName, AuthenticationRequiredError, AuthenticationRequiredErrorOptions, } from "./errors.js";
5
+ export { AuthenticationRecord } from "./msal/types.js";
6
+ export { serializeAuthenticationRecord, deserializeAuthenticationRecord } from "./msal/utils.js";
7
+ export { TokenCredentialOptions } from "./tokenCredentialOptions.js";
8
+ export { MultiTenantTokenCredentialOptions } from "./credentials/multiTenantTokenCredentialOptions.js";
9
+ export { AuthorityValidationOptions } from "./credentials/authorityValidationOptions.js";
10
+ export { BrokerAuthOptions } from "./credentials/brokerAuthOptions.js";
11
+ export { BrokerOptions, BrokerEnabledOptions, BrokerDisabledOptions, } from "./msal/nodeFlows/brokerOptions.js";
12
+ export { InteractiveCredentialOptions } from "./credentials/interactiveCredentialOptions.js";
13
+ export { ChainedTokenCredential } from "./credentials/chainedTokenCredential.js";
14
+ export { ClientSecretCredential } from "./credentials/clientSecretCredential.js";
15
+ export { ClientSecretCredentialOptions } from "./credentials/clientSecretCredentialOptions.js";
16
+ export { DefaultAzureCredential } from "./credentials/defaultAzureCredential.js";
17
+ export { DefaultAzureCredentialOptions, DefaultAzureCredentialClientIdOptions, DefaultAzureCredentialResourceIdOptions, } from "./credentials/defaultAzureCredentialOptions.js";
18
+ export { EnvironmentCredential } from "./credentials/environmentCredential.js";
19
+ export { EnvironmentCredentialOptions } from "./credentials/environmentCredentialOptions.js";
20
+ export { ClientCertificateCredential } from "./credentials/clientCertificateCredential.js";
21
+ export { ClientCertificateCredentialPEMConfiguration, ClientCertificatePEMCertificatePath, ClientCertificatePEMCertificate, } from "./credentials/clientCertificateCredentialModels.js";
22
+ export { ClientCertificateCredentialOptions } from "./credentials/clientCertificateCredentialOptions.js";
23
+ export { ClientAssertionCredential } from "./credentials/clientAssertionCredential.js";
24
+ export { ClientAssertionCredentialOptions } from "./credentials/clientAssertionCredentialOptions.js";
25
+ export { CredentialPersistenceOptions } from "./credentials/credentialPersistenceOptions.js";
26
+ export { AzureCliCredential } from "./credentials/azureCliCredential.js";
27
+ export { AzureCliCredentialOptions } from "./credentials/azureCliCredentialOptions.js";
28
+ export { AzureDeveloperCliCredential } from "./credentials/azureDeveloperCliCredential.js";
29
+ export { AzureDeveloperCliCredentialOptions } from "./credentials/azureDeveloperCliCredentialOptions.js";
30
+ export { InteractiveBrowserCredential } from "./credentials/interactiveBrowserCredential.js";
31
+ export { InteractiveBrowserCredentialNodeOptions, InteractiveBrowserCredentialInBrowserOptions, BrowserLoginStyle, } from "./credentials/interactiveBrowserCredentialOptions.js";
32
+ export { ManagedIdentityCredential } from "./credentials/managedIdentityCredential/index.js";
33
+ export { ManagedIdentityCredentialClientIdOptions, ManagedIdentityCredentialResourceIdOptions, ManagedIdentityCredentialObjectIdOptions, } from "./credentials/managedIdentityCredential/options.js";
34
+ export { DeviceCodeCredential } from "./credentials/deviceCodeCredential.js";
35
+ export { DeviceCodePromptCallback, DeviceCodeInfo, } from "./credentials/deviceCodeCredentialOptions.js";
36
+ export { DeviceCodeCredentialOptions } from "./credentials/deviceCodeCredentialOptions.js";
37
+ export { AzurePipelinesCredential as AzurePipelinesCredential } from "./credentials/azurePipelinesCredential.js";
38
+ export { AzurePipelinesCredentialOptions as AzurePipelinesCredentialOptions } from "./credentials/azurePipelinesCredentialOptions.js";
39
+ export { AuthorizationCodeCredential } from "./credentials/authorizationCodeCredential.js";
40
+ export { AuthorizationCodeCredentialOptions } from "./credentials/authorizationCodeCredentialOptions.js";
41
+ export { AzurePowerShellCredential } from "./credentials/azurePowerShellCredential.js";
42
+ export { AzurePowerShellCredentialOptions } from "./credentials/azurePowerShellCredentialOptions.js";
43
+ export { OnBehalfOfCredentialOptions, OnBehalfOfCredentialSecretOptions, OnBehalfOfCredentialCertificateOptions, OnBehalfOfCredentialAssertionOptions, } from "./credentials/onBehalfOfCredentialOptions.js";
44
+ export { UsernamePasswordCredential } from "./credentials/usernamePasswordCredential.js";
45
+ export { UsernamePasswordCredentialOptions } from "./credentials/usernamePasswordCredentialOptions.js";
46
+ export { VisualStudioCodeCredential } from "./credentials/visualStudioCodeCredential.js";
47
+ export { VisualStudioCodeCredentialOptions } from "./credentials/visualStudioCodeCredentialOptions.js";
48
+ export { OnBehalfOfCredential } from "./credentials/onBehalfOfCredential.js";
49
+ export { WorkloadIdentityCredential } from "./credentials/workloadIdentityCredential.js";
50
+ export { WorkloadIdentityCredentialOptions } from "./credentials/workloadIdentityCredentialOptions.js";
51
+ export { BrowserCustomizationOptions } from "./credentials/browserCustomizationOptions.js";
52
+ export { TokenCachePersistenceOptions } from "./msal/nodeFlows/tokenCachePersistenceOptions.js";
53
+ export { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-auth";
54
+ export { logger } from "./util/logging.js";
55
+ export { AzureAuthorityHosts } from "./constants.js";
56
+ /**
57
+ * Returns a new instance of the {@link DefaultAzureCredential}.
58
+ */
59
+ export declare function getDefaultAzureCredential(): TokenCredential;
60
+ export { getBearerTokenProvider, GetBearerTokenProviderOptions } from "./tokenProvider.js";
61
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,4BAA4B,EAC5B,uBAAuB,EACvB,gCAAgC,EAChC,0BAA0B,EAC1B,8BAA8B,EAC9B,2BAA2B,EAC3B,kCAAkC,GACnC,MAAM,aAAa,CAAC;AAErB,OAAO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CAAC;AACzF,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAEhG,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,eAAe,CAE3D;AAED,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,34 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export * from "./plugins/consumer.js";
4
+ import { DefaultAzureCredential } from "./credentials/defaultAzureCredential.js";
5
+ export { AuthenticationError, AggregateAuthenticationError, AuthenticationErrorName, AggregateAuthenticationErrorName, CredentialUnavailableError, CredentialUnavailableErrorName, AuthenticationRequiredError, } from "./errors.js";
6
+ export { serializeAuthenticationRecord, deserializeAuthenticationRecord } from "./msal/utils.js";
7
+ export { ChainedTokenCredential } from "./credentials/chainedTokenCredential.js";
8
+ export { ClientSecretCredential } from "./credentials/clientSecretCredential.js";
9
+ export { DefaultAzureCredential } from "./credentials/defaultAzureCredential.js";
10
+ export { EnvironmentCredential } from "./credentials/environmentCredential.js";
11
+ export { ClientCertificateCredential } from "./credentials/clientCertificateCredential.js";
12
+ export { ClientAssertionCredential } from "./credentials/clientAssertionCredential.js";
13
+ export { AzureCliCredential } from "./credentials/azureCliCredential.js";
14
+ export { AzureDeveloperCliCredential } from "./credentials/azureDeveloperCliCredential.js";
15
+ export { InteractiveBrowserCredential } from "./credentials/interactiveBrowserCredential.js";
16
+ export { ManagedIdentityCredential } from "./credentials/managedIdentityCredential/index.js";
17
+ export { DeviceCodeCredential } from "./credentials/deviceCodeCredential.js";
18
+ export { AzurePipelinesCredential as AzurePipelinesCredential } from "./credentials/azurePipelinesCredential.js";
19
+ export { AuthorizationCodeCredential } from "./credentials/authorizationCodeCredential.js";
20
+ export { AzurePowerShellCredential } from "./credentials/azurePowerShellCredential.js";
21
+ export { UsernamePasswordCredential } from "./credentials/usernamePasswordCredential.js";
22
+ export { VisualStudioCodeCredential } from "./credentials/visualStudioCodeCredential.js";
23
+ export { OnBehalfOfCredential } from "./credentials/onBehalfOfCredential.js";
24
+ export { WorkloadIdentityCredential } from "./credentials/workloadIdentityCredential.js";
25
+ export { logger } from "./util/logging.js";
26
+ export { AzureAuthorityHosts } from "./constants.js";
27
+ /**
28
+ * Returns a new instance of the {@link DefaultAzureCredential}.
29
+ */
30
+ export function getDefaultAzureCredential() {
31
+ return new DefaultAzureCredential();
32
+ }
33
+ export { getBearerTokenProvider } from "./tokenProvider.js";
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,uBAAuB,CAAC;AAKtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EACL,mBAAmB,EAEnB,4BAA4B,EAC5B,uBAAuB,EACvB,gCAAgC,EAChC,0BAA0B,EAC1B,8BAA8B,EAC9B,2BAA2B,GAE5B,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAejG,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,O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\"./plugins/consumer.js\";\n\nexport { IdentityPlugin } from \"./plugins/provider.js\";\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { DefaultAzureCredential } from \"./credentials/defaultAzureCredential.js\";\n\nexport {\n AuthenticationError,\n ErrorResponse,\n AggregateAuthenticationError,\n AuthenticationErrorName,\n AggregateAuthenticationErrorName,\n CredentialUnavailableError,\n CredentialUnavailableErrorName,\n AuthenticationRequiredError,\n AuthenticationRequiredErrorOptions,\n} from \"./errors.js\";\n\nexport { AuthenticationRecord } from \"./msal/types.js\";\nexport { serializeAuthenticationRecord, deserializeAuthenticationRecord } from \"./msal/utils.js\";\nexport { TokenCredentialOptions } from \"./tokenCredentialOptions.js\";\nexport { MultiTenantTokenCredentialOptions } from \"./credentials/multiTenantTokenCredentialOptions.js\";\nexport { AuthorityValidationOptions } from \"./credentials/authorityValidationOptions.js\";\n// TODO: Export again once we're ready to release this feature.\n// export { RegionalAuthority } from \"./regionalAuthority\";\n\nexport { BrokerAuthOptions } from \"./credentials/brokerAuthOptions.js\";\nexport {\n BrokerOptions,\n BrokerEnabledOptions,\n BrokerDisabledOptions,\n} from \"./msal/nodeFlows/brokerOptions.js\";\nexport { InteractiveCredentialOptions } from \"./credentials/interactiveCredentialOptions.js\";\n\nexport { ChainedTokenCredential } from \"./credentials/chainedTokenCredential.js\";\n\nexport { ClientSecretCredential } from \"./credentials/clientSecretCredential.js\";\nexport { ClientSecretCredentialOptions } from \"./credentials/clientSecretCredentialOptions.js\";\n\nexport { DefaultAzureCredential } from \"./credentials/defaultAzureCredential.js\";\nexport {\n DefaultAzureCredentialOptions,\n DefaultAzureCredentialClientIdOptions,\n DefaultAzureCredentialResourceIdOptions,\n} from \"./credentials/defaultAzureCredentialOptions.js\";\n\nexport { EnvironmentCredential } from \"./credentials/environmentCredential.js\";\nexport { EnvironmentCredentialOptions } from \"./credentials/environmentCredentialOptions.js\";\n\nexport { ClientCertificateCredential } from \"./credentials/clientCertificateCredential.js\";\nexport {\n ClientCertificateCredentialPEMConfiguration,\n ClientCertificatePEMCertificatePath,\n ClientCertificatePEMCertificate,\n} from \"./credentials/clientCertificateCredentialModels.js\";\nexport { ClientCertificateCredentialOptions } from \"./credentials/clientCertificateCredentialOptions.js\";\nexport { ClientAssertionCredential } from \"./credentials/clientAssertionCredential.js\";\nexport { ClientAssertionCredentialOptions } from \"./credentials/clientAssertionCredentialOptions.js\";\nexport { CredentialPersistenceOptions } from \"./credentials/credentialPersistenceOptions.js\";\nexport { AzureCliCredential } from \"./credentials/azureCliCredential.js\";\nexport { AzureCliCredentialOptions } from \"./credentials/azureCliCredentialOptions.js\";\nexport { AzureDeveloperCliCredential } from \"./credentials/azureDeveloperCliCredential.js\";\nexport { AzureDeveloperCliCredentialOptions } from \"./credentials/azureDeveloperCliCredentialOptions.js\";\nexport { InteractiveBrowserCredential } from \"./credentials/interactiveBrowserCredential.js\";\nexport {\n InteractiveBrowserCredentialNodeOptions,\n InteractiveBrowserCredentialInBrowserOptions,\n BrowserLoginStyle,\n} from \"./credentials/interactiveBrowserCredentialOptions.js\";\nexport { ManagedIdentityCredential } from \"./credentials/managedIdentityCredential/index.js\";\nexport {\n ManagedIdentityCredentialClientIdOptions,\n ManagedIdentityCredentialResourceIdOptions,\n ManagedIdentityCredentialObjectIdOptions,\n} from \"./credentials/managedIdentityCredential/options.js\";\nexport { DeviceCodeCredential } from \"./credentials/deviceCodeCredential.js\";\nexport {\n DeviceCodePromptCallback,\n DeviceCodeInfo,\n} from \"./credentials/deviceCodeCredentialOptions.js\";\nexport { DeviceCodeCredentialOptions } from \"./credentials/deviceCodeCredentialOptions.js\";\nexport { AzurePipelinesCredential as AzurePipelinesCredential } from \"./credentials/azurePipelinesCredential.js\";\nexport { AzurePipelinesCredentialOptions as AzurePipelinesCredentialOptions } from \"./credentials/azurePipelinesCredentialOptions.js\";\nexport { AuthorizationCodeCredential } from \"./credentials/authorizationCodeCredential.js\";\nexport { AuthorizationCodeCredentialOptions } from \"./credentials/authorizationCodeCredentialOptions.js\";\nexport { AzurePowerShellCredential } from \"./credentials/azurePowerShellCredential.js\";\nexport { AzurePowerShellCredentialOptions } from \"./credentials/azurePowerShellCredentialOptions.js\";\nexport {\n OnBehalfOfCredentialOptions,\n OnBehalfOfCredentialSecretOptions,\n OnBehalfOfCredentialCertificateOptions,\n OnBehalfOfCredentialAssertionOptions,\n} from \"./credentials/onBehalfOfCredentialOptions.js\";\nexport { UsernamePasswordCredential } from \"./credentials/usernamePasswordCredential.js\";\nexport { UsernamePasswordCredentialOptions } from \"./credentials/usernamePasswordCredentialOptions.js\";\nexport { VisualStudioCodeCredential } from \"./credentials/visualStudioCodeCredential.js\";\nexport { VisualStudioCodeCredentialOptions } from \"./credentials/visualStudioCodeCredentialOptions.js\";\nexport { OnBehalfOfCredential } from \"./credentials/onBehalfOfCredential.js\";\nexport { WorkloadIdentityCredential } from \"./credentials/workloadIdentityCredential.js\";\nexport { WorkloadIdentityCredentialOptions } from \"./credentials/workloadIdentityCredentialOptions.js\";\nexport { BrowserCustomizationOptions } from \"./credentials/browserCustomizationOptions.js\";\nexport { TokenCachePersistenceOptions } from \"./msal/nodeFlows/tokenCachePersistenceOptions.js\";\n\nexport { TokenCredential, GetTokenOptions, AccessToken } from \"@azure/core-auth\";\nexport { logger } from \"./util/logging.js\";\n\nexport { AzureAuthorityHosts } from \"./constants.js\";\n\n/**\n * Returns a new instance of the {@link DefaultAzureCredential}.\n */\nexport function getDefaultAzureCredential(): TokenCredential {\n return new DefaultAzureCredential();\n}\n\nexport { getBearerTokenProvider, GetBearerTokenProviderOptions } from \"./tokenProvider.js\";\n"]}
@@ -0,0 +1,19 @@
1
+ import type { MsalBrowserFlowOptions } from "./msalBrowserOptions.js";
2
+ import type { AccessToken } from "@azure/core-auth";
3
+ import type { AuthenticationRecord } from "../types.js";
4
+ import type { CredentialFlowGetTokenOptions } from "../credentials.js";
5
+ /**
6
+ * Methods that are used by InteractiveBrowserCredential
7
+ * @internal
8
+ */
9
+ export interface MsalBrowserClient {
10
+ getActiveAccount(): Promise<AuthenticationRecord | undefined>;
11
+ getToken(scopes: string[], options: CredentialFlowGetTokenOptions): Promise<AccessToken>;
12
+ }
13
+ /**
14
+ * Uses MSAL Browser 2.X for browser authentication,
15
+ * which uses the [Auth Code Flow](https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow).
16
+ * @internal
17
+ */
18
+ export declare function createMsalBrowserClient(options: MsalBrowserFlowOptions): MsalBrowserClient;
19
+ //# sourceMappingURL=msalBrowserCommon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"msalBrowserCommon.d.ts","sourceRoot":"","sources":["../../../../src/msal/browserFlows/msalBrowserCommon.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAYtE,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAc,MAAM,aAAa,CAAC;AAEpE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AA2CvE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,IAAI,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;IAC9D,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC1F;AAKD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,GAAG,iBAAiB,CA+R1F"}