@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,238 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { AuthenticationRequiredError, CredentialUnavailableError } from "../errors.js";
4
+ import { credentialLogger, formatError } from "../util/logging.js";
5
+ import { DefaultAuthority, DefaultAuthorityHost, DefaultTenantId } from "../constants.js";
6
+ import { randomUUID as coreRandomUUID, isNode, isNodeLike } from "@azure/core-util";
7
+ import { AbortError } from "@azure/abort-controller";
8
+ import { msalCommon } from "./msal.js";
9
+ /**
10
+ * @internal
11
+ */
12
+ const logger = credentialLogger("IdentityUtils");
13
+ /**
14
+ * Latest AuthenticationRecord version
15
+ * @internal
16
+ */
17
+ const LatestAuthenticationRecordVersion = "1.0";
18
+ /**
19
+ * Ensures the validity of the MSAL token
20
+ * @internal
21
+ */
22
+ export function ensureValidMsalToken(scopes, msalToken, getTokenOptions) {
23
+ const error = (message) => {
24
+ logger.getToken.info(message);
25
+ return new AuthenticationRequiredError({
26
+ scopes: Array.isArray(scopes) ? scopes : [scopes],
27
+ getTokenOptions,
28
+ message,
29
+ });
30
+ };
31
+ if (!msalToken) {
32
+ throw error("No response");
33
+ }
34
+ if (!msalToken.expiresOn) {
35
+ throw error(`Response had no "expiresOn" property.`);
36
+ }
37
+ if (!msalToken.accessToken) {
38
+ throw error(`Response had no "accessToken" property.`);
39
+ }
40
+ }
41
+ /**
42
+ * Returns the authority host from either the options bag or the AZURE_AUTHORITY_HOST environment variable.
43
+ *
44
+ * Defaults to {@link DefaultAuthorityHost}.
45
+ * @internal
46
+ */
47
+ export function getAuthorityHost(options) {
48
+ let authorityHost = options === null || options === void 0 ? void 0 : options.authorityHost;
49
+ if (!authorityHost && isNodeLike) {
50
+ authorityHost = process.env.AZURE_AUTHORITY_HOST;
51
+ }
52
+ return authorityHost !== null && authorityHost !== void 0 ? authorityHost : DefaultAuthorityHost;
53
+ }
54
+ /**
55
+ * Generates a valid authority by combining a host with a tenantId.
56
+ * @internal
57
+ */
58
+ export function getAuthority(tenantId, host) {
59
+ if (!host) {
60
+ host = DefaultAuthorityHost;
61
+ }
62
+ if (new RegExp(`${tenantId}/?$`).test(host)) {
63
+ return host;
64
+ }
65
+ if (host.endsWith("/")) {
66
+ return host + tenantId;
67
+ }
68
+ else {
69
+ return `${host}/${tenantId}`;
70
+ }
71
+ }
72
+ /**
73
+ * Generates the known authorities.
74
+ * If the Tenant Id is `adfs`, the authority can't be validated since the format won't match the expected one.
75
+ * For that reason, we have to force MSAL to disable validating the authority
76
+ * by sending it within the known authorities in the MSAL configuration.
77
+ * @internal
78
+ */
79
+ export function getKnownAuthorities(tenantId, authorityHost, disableInstanceDiscovery) {
80
+ if ((tenantId === "adfs" && authorityHost) || disableInstanceDiscovery) {
81
+ return [authorityHost];
82
+ }
83
+ return [];
84
+ }
85
+ /**
86
+ * Generates a logger that can be passed to the MSAL clients.
87
+ * @param credLogger - The logger of the credential.
88
+ * @internal
89
+ */
90
+ export const defaultLoggerCallback = (credLogger, platform = isNode ? "Node" : "Browser") => (level, message, containsPii) => {
91
+ if (containsPii) {
92
+ return;
93
+ }
94
+ switch (level) {
95
+ case msalCommon.LogLevel.Error:
96
+ credLogger.info(`MSAL ${platform} V2 error: ${message}`);
97
+ return;
98
+ case msalCommon.LogLevel.Info:
99
+ credLogger.info(`MSAL ${platform} V2 info message: ${message}`);
100
+ return;
101
+ case msalCommon.LogLevel.Verbose:
102
+ credLogger.info(`MSAL ${platform} V2 verbose message: ${message}`);
103
+ return;
104
+ case msalCommon.LogLevel.Warning:
105
+ credLogger.info(`MSAL ${platform} V2 warning: ${message}`);
106
+ return;
107
+ }
108
+ };
109
+ /**
110
+ * @internal
111
+ */
112
+ export function getMSALLogLevel(logLevel) {
113
+ switch (logLevel) {
114
+ case "error":
115
+ return msalCommon.LogLevel.Error;
116
+ case "info":
117
+ return msalCommon.LogLevel.Info;
118
+ case "verbose":
119
+ return msalCommon.LogLevel.Verbose;
120
+ case "warning":
121
+ return msalCommon.LogLevel.Warning;
122
+ default:
123
+ // default msal logging level should be Info
124
+ return msalCommon.LogLevel.Info;
125
+ }
126
+ }
127
+ /**
128
+ * Wraps core-util's randomUUID in order to allow for mocking in tests.
129
+ * This prepares the library for the upcoming core-util update to ESM.
130
+ *
131
+ * @internal
132
+ * @returns A string containing a random UUID
133
+ */
134
+ export function randomUUID() {
135
+ return coreRandomUUID();
136
+ }
137
+ /**
138
+ * Handles MSAL errors.
139
+ */
140
+ export function handleMsalError(scopes, error, getTokenOptions) {
141
+ if (error.name === "AuthError" ||
142
+ error.name === "ClientAuthError" ||
143
+ error.name === "BrowserAuthError") {
144
+ const msalError = error;
145
+ switch (msalError.errorCode) {
146
+ case "endpoints_resolution_error":
147
+ logger.info(formatError(scopes, error.message));
148
+ return new CredentialUnavailableError(error.message);
149
+ case "device_code_polling_cancelled":
150
+ return new AbortError("The authentication has been aborted by the caller.");
151
+ case "consent_required":
152
+ case "interaction_required":
153
+ case "login_required":
154
+ logger.info(formatError(scopes, `Authentication returned errorCode ${msalError.errorCode}`));
155
+ break;
156
+ default:
157
+ logger.info(formatError(scopes, `Failed to acquire token: ${error.message}`));
158
+ break;
159
+ }
160
+ }
161
+ if (error.name === "ClientConfigurationError" ||
162
+ error.name === "BrowserConfigurationAuthError" ||
163
+ error.name === "AbortError" ||
164
+ error.name === "AuthenticationError") {
165
+ return error;
166
+ }
167
+ if (error.name === "NativeAuthError") {
168
+ logger.info(formatError(scopes, `Error from the native broker: ${error.message} with status code: ${error.statusCode}`));
169
+ return error;
170
+ }
171
+ return new AuthenticationRequiredError({ scopes, getTokenOptions, message: error.message });
172
+ }
173
+ // transformations
174
+ export function publicToMsal(account) {
175
+ return {
176
+ localAccountId: account.homeAccountId,
177
+ environment: account.authority,
178
+ username: account.username,
179
+ homeAccountId: account.homeAccountId,
180
+ tenantId: account.tenantId,
181
+ };
182
+ }
183
+ export function msalToPublic(clientId, account) {
184
+ var _a;
185
+ const record = {
186
+ authority: (_a = account.environment) !== null && _a !== void 0 ? _a : DefaultAuthority,
187
+ homeAccountId: account.homeAccountId,
188
+ tenantId: account.tenantId || DefaultTenantId,
189
+ username: account.username,
190
+ clientId,
191
+ version: LatestAuthenticationRecordVersion,
192
+ };
193
+ return record;
194
+ }
195
+ /**
196
+ * Serializes an `AuthenticationRecord` into a string.
197
+ *
198
+ * The output of a serialized authentication record will contain the following properties:
199
+ *
200
+ * - "authority"
201
+ * - "homeAccountId"
202
+ * - "clientId"
203
+ * - "tenantId"
204
+ * - "username"
205
+ * - "version"
206
+ *
207
+ * To later convert this string to a serialized `AuthenticationRecord`, please use the exported function `deserializeAuthenticationRecord()`.
208
+ */
209
+ export function serializeAuthenticationRecord(record) {
210
+ return JSON.stringify(record);
211
+ }
212
+ /**
213
+ * Deserializes a previously serialized authentication record from a string into an object.
214
+ *
215
+ * The input string must contain the following properties:
216
+ *
217
+ * - "authority"
218
+ * - "homeAccountId"
219
+ * - "clientId"
220
+ * - "tenantId"
221
+ * - "username"
222
+ * - "version"
223
+ *
224
+ * If the version we receive is unsupported, an error will be thrown.
225
+ *
226
+ * At the moment, the only available version is: "1.0", which is always set when the authentication record is serialized.
227
+ *
228
+ * @param serializedRecord - Authentication record previously serialized into string.
229
+ * @returns AuthenticationRecord.
230
+ */
231
+ export function deserializeAuthenticationRecord(serializedRecord) {
232
+ const parsed = JSON.parse(serializedRecord);
233
+ if (parsed.version && parsed.version !== LatestAuthenticationRecordVersion) {
234
+ throw Error("Unsupported AuthenticationRecord version");
235
+ }
236
+ return parsed;
237
+ }
238
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/msal/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEpF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAMvC;;GAEG;AACH,MAAM,MAAM,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;AAEjD;;;GAGG;AACH,MAAM,iCAAiC,GAAG,KAAK,CAAC;AAEhD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAyB,EACzB,SAA4B,EAC5B,eAAiC;IAEjC,MAAM,KAAK,GAAG,CAAC,OAAe,EAAS,EAAE;QACvC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9B,OAAO,IAAI,2BAA2B,CAAC;YACrC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YACjD,eAAe;YACf,OAAO;SACR,CAAC,CAAC;IACL,CAAC,CAAC;IACF,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE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AAM,CAAC,OAAO,KAAK,iCAAiC,EAAE,CAAC;QAC3E,MAAM,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AuthenticationRecord, MsalAccountInfo, MsalToken, ValidMsalToken } from \"./types.js\";\nimport { AuthenticationRequiredError, CredentialUnavailableError } from \"../errors.js\";\nimport type { CredentialLogger } from \"../util/logging.js\";\nimport { credentialLogger, formatError } from \"../util/logging.js\";\nimport { DefaultAuthority, DefaultAuthorityHost, DefaultTenantId } from \"../constants.js\";\nimport { randomUUID as coreRandomUUID, isNode, isNodeLike } from \"@azure/core-util\";\n\nimport { AbortError } from \"@azure/abort-controller\";\nimport type { AzureLogLevel } from \"@azure/logger\";\nimport type { GetTokenOptions } from \"@azure/core-auth\";\nimport { msalCommon } from \"./msal.js\";\n\nexport interface ILoggerCallback {\n (level: msalCommon.LogLevel, message: string, containsPii: boolean): void;\n}\n\n/**\n * @internal\n */\nconst logger = credentialLogger(\"IdentityUtils\");\n\n/**\n * Latest AuthenticationRecord version\n * @internal\n */\nconst LatestAuthenticationRecordVersion = \"1.0\";\n\n/**\n * Ensures the validity of the MSAL token\n * @internal\n */\nexport function ensureValidMsalToken(\n scopes: string | string[],\n msalToken?: MsalToken | null,\n getTokenOptions?: GetTokenOptions,\n): asserts msalToken is ValidMsalToken {\n const error = (message: string): Error => {\n logger.getToken.info(message);\n return new AuthenticationRequiredError({\n scopes: Array.isArray(scopes) ? scopes : [scopes],\n getTokenOptions,\n message,\n });\n };\n if (!msalToken) {\n throw error(\"No response\");\n }\n if (!msalToken.expiresOn) {\n throw error(`Response had no \"expiresOn\" property.`);\n }\n if (!msalToken.accessToken) {\n throw error(`Response had no \"accessToken\" property.`);\n }\n}\n\n/**\n * Returns the authority host from either the options bag or the AZURE_AUTHORITY_HOST environment variable.\n *\n * Defaults to {@link DefaultAuthorityHost}.\n * @internal\n */\nexport function getAuthorityHost(options?: { authorityHost?: string }): string {\n let authorityHost = options?.authorityHost;\n\n if (!authorityHost && isNodeLike) {\n authorityHost = process.env.AZURE_AUTHORITY_HOST;\n }\n\n return authorityHost ?? DefaultAuthorityHost;\n}\n\n/**\n * Generates a valid authority by combining a host with a tenantId.\n * @internal\n */\nexport function getAuthority(tenantId: string, host?: string): string {\n if (!host) {\n host = DefaultAuthorityHost;\n }\n if (new RegExp(`${tenantId}/?$`).test(host)) {\n return host;\n }\n if (host.endsWith(\"/\")) {\n return host + tenantId;\n } else {\n return `${host}/${tenantId}`;\n }\n}\n\n/**\n * Generates the known authorities.\n * If the Tenant Id is `adfs`, the authority can't be validated since the format won't match the expected one.\n * For that reason, we have to force MSAL to disable validating the authority\n * by sending it within the known authorities in the MSAL configuration.\n * @internal\n */\nexport function getKnownAuthorities(\n tenantId: string,\n authorityHost: string,\n disableInstanceDiscovery?: boolean,\n): string[] {\n if ((tenantId === \"adfs\" && authorityHost) || disableInstanceDiscovery) {\n return [authorityHost];\n }\n return [];\n}\n\n/**\n * Generates a logger that can be passed to the MSAL clients.\n * @param credLogger - The logger of the credential.\n * @internal\n */\nexport const defaultLoggerCallback: (\n logger: CredentialLogger,\n platform?: \"Node\" | \"Browser\",\n) => ILoggerCallback =\n (credLogger: CredentialLogger, platform: \"Node\" | \"Browser\" = isNode ? \"Node\" : \"Browser\") =>\n (level, message, containsPii): void => {\n if (containsPii) {\n return;\n }\n switch (level) {\n case msalCommon.LogLevel.Error:\n credLogger.info(`MSAL ${platform} V2 error: ${message}`);\n return;\n case msalCommon.LogLevel.Info:\n credLogger.info(`MSAL ${platform} V2 info message: ${message}`);\n return;\n case msalCommon.LogLevel.Verbose:\n credLogger.info(`MSAL ${platform} V2 verbose message: ${message}`);\n return;\n case msalCommon.LogLevel.Warning:\n credLogger.info(`MSAL ${platform} V2 warning: ${message}`);\n return;\n }\n };\n\n/**\n * @internal\n */\nexport function getMSALLogLevel(logLevel: AzureLogLevel | undefined): msalCommon.LogLevel {\n switch (logLevel) {\n case \"error\":\n return msalCommon.LogLevel.Error;\n case \"info\":\n return msalCommon.LogLevel.Info;\n case \"verbose\":\n return msalCommon.LogLevel.Verbose;\n case \"warning\":\n return msalCommon.LogLevel.Warning;\n default:\n // default msal logging level should be Info\n return msalCommon.LogLevel.Info;\n }\n}\n\n/**\n * Wraps core-util's randomUUID in order to allow for mocking in tests.\n * This prepares the library for the upcoming core-util update to ESM.\n *\n * @internal\n * @returns A string containing a random UUID\n */\nexport function randomUUID(): string {\n return coreRandomUUID();\n}\n\n/**\n * Handles MSAL errors.\n */\nexport function handleMsalError(\n scopes: string[],\n error: Error,\n getTokenOptions?: GetTokenOptions,\n): Error {\n if (\n error.name === \"AuthError\" ||\n error.name === \"ClientAuthError\" ||\n error.name === \"BrowserAuthError\"\n ) {\n const msalError = error as msalCommon.AuthError;\n switch (msalError.errorCode) {\n case \"endpoints_resolution_error\":\n logger.info(formatError(scopes, error.message));\n return new CredentialUnavailableError(error.message);\n case \"device_code_polling_cancelled\":\n return new AbortError(\"The authentication has been aborted by the caller.\");\n case \"consent_required\":\n case \"interaction_required\":\n case \"login_required\":\n logger.info(\n formatError(scopes, `Authentication returned errorCode ${msalError.errorCode}`),\n );\n break;\n default:\n logger.info(formatError(scopes, `Failed to acquire token: ${error.message}`));\n break;\n }\n }\n if (\n error.name === \"ClientConfigurationError\" ||\n error.name === \"BrowserConfigurationAuthError\" ||\n error.name === \"AbortError\" ||\n error.name === \"AuthenticationError\"\n ) {\n return error;\n }\n if (error.name === \"NativeAuthError\") {\n logger.info(\n formatError(\n scopes,\n `Error from the native broker: ${error.message} with status code: ${\n (error as any).statusCode\n }`,\n ),\n );\n return error;\n }\n return new AuthenticationRequiredError({ scopes, getTokenOptions, message: error.message });\n}\n\n// transformations\nexport function publicToMsal(account: AuthenticationRecord): msalCommon.AccountInfo {\n return {\n localAccountId: account.homeAccountId,\n environment: account.authority,\n username: account.username,\n homeAccountId: account.homeAccountId,\n tenantId: account.tenantId,\n };\n}\n\nexport function msalToPublic(clientId: string, account: MsalAccountInfo): AuthenticationRecord {\n const record = {\n authority: account.environment ?? DefaultAuthority,\n homeAccountId: account.homeAccountId,\n tenantId: account.tenantId || DefaultTenantId,\n username: account.username,\n clientId,\n version: LatestAuthenticationRecordVersion,\n };\n return record;\n}\n\n/**\n * Serializes an `AuthenticationRecord` into a string.\n *\n * The output of a serialized authentication record will contain the following properties:\n *\n * - \"authority\"\n * - \"homeAccountId\"\n * - \"clientId\"\n * - \"tenantId\"\n * - \"username\"\n * - \"version\"\n *\n * To later convert this string to a serialized `AuthenticationRecord`, please use the exported function `deserializeAuthenticationRecord()`.\n */\nexport function serializeAuthenticationRecord(record: AuthenticationRecord): string {\n return JSON.stringify(record);\n}\n\n/**\n * Deserializes a previously serialized authentication record from a string into an object.\n *\n * The input string must contain the following properties:\n *\n * - \"authority\"\n * - \"homeAccountId\"\n * - \"clientId\"\n * - \"tenantId\"\n * - \"username\"\n * - \"version\"\n *\n * If the version we receive is unsupported, an error will be thrown.\n *\n * At the moment, the only available version is: \"1.0\", which is always set when the authentication record is serialized.\n *\n * @param serializedRecord - Authentication record previously serialized into string.\n * @returns AuthenticationRecord.\n */\nexport function deserializeAuthenticationRecord(serializedRecord: string): AuthenticationRecord {\n const parsed: AuthenticationRecord & { version?: string } = JSON.parse(serializedRecord);\n\n if (parsed.version && parsed.version !== LatestAuthenticationRecordVersion) {\n throw Error(\"Unsupported AuthenticationRecord version\");\n }\n\n return parsed;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,28 @@
1
+ import type { IdentityPlugin } from "./provider.js";
2
+ /**
3
+ * Extend Azure Identity with additional functionality. Pass a plugin from
4
+ * a plugin package, such as:
5
+ *
6
+ * - `@azure/identity-cache-persistence`: provides persistent token caching
7
+ * - `@azure/identity-vscode`: provides the dependencies of
8
+ * `VisualStudioCodeCredential` and enables it
9
+ *
10
+ * Example:
11
+ *
12
+ * ```ts snippet:consumer_example
13
+ * import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
14
+ *
15
+ * useIdentityPlugin(cachePersistencePlugin);
16
+ * // The plugin has the capability to extend `DeviceCodeCredential` and to
17
+ * // add middleware to the underlying credentials, such as persistence.
18
+ * const credential = new DeviceCodeCredential({
19
+ * tokenCachePersistenceOptions: {
20
+ * enabled: true,
21
+ * },
22
+ * });
23
+ * ```
24
+ *
25
+ * @param plugin - the plugin to register
26
+ */
27
+ export declare function useIdentityPlugin(plugin: IdentityPlugin): void;
28
+ //# sourceMappingURL=consumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consumer.d.ts","sourceRoot":"","sources":["../../../src/plugins/consumer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAsB,cAAc,EAAE,MAAM,eAAe,CAAC;AAmBxE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAE9D"}
@@ -0,0 +1,43 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { msalNodeFlowCacheControl, msalNodeFlowNativeBrokerControl, } from "../msal/nodeFlows/msalPlugins.js";
4
+ import { vsCodeCredentialControl } from "../credentials/visualStudioCodeCredential.js";
5
+ /**
6
+ * The context passed to an Identity plugin. This contains objects that
7
+ * plugins can use to set backend implementations.
8
+ * @internal
9
+ */
10
+ const pluginContext = {
11
+ cachePluginControl: msalNodeFlowCacheControl,
12
+ nativeBrokerPluginControl: msalNodeFlowNativeBrokerControl,
13
+ vsCodeCredentialControl: vsCodeCredentialControl,
14
+ };
15
+ /**
16
+ * Extend Azure Identity with additional functionality. Pass a plugin from
17
+ * a plugin package, such as:
18
+ *
19
+ * - `@azure/identity-cache-persistence`: provides persistent token caching
20
+ * - `@azure/identity-vscode`: provides the dependencies of
21
+ * `VisualStudioCodeCredential` and enables it
22
+ *
23
+ * Example:
24
+ *
25
+ * ```ts snippet:consumer_example
26
+ * import { useIdentityPlugin, DeviceCodeCredential } from "@azure/identity";
27
+ *
28
+ * useIdentityPlugin(cachePersistencePlugin);
29
+ * // The plugin has the capability to extend `DeviceCodeCredential` and to
30
+ * // add middleware to the underlying credentials, such as persistence.
31
+ * const credential = new DeviceCodeCredential({
32
+ * tokenCachePersistenceOptions: {
33
+ * enabled: true,
34
+ * },
35
+ * });
36
+ * ```
37
+ *
38
+ * @param plugin - the plugin to register
39
+ */
40
+ export function useIdentityPlugin(plugin) {
41
+ plugin(pluginContext);
42
+ }
43
+ //# sourceMappingURL=consumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consumer.js","sourceRoot":"","sources":["../../../src/plugins/consumer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EACL,wBAAwB,EACxB,+BAA+B,GAChC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF;;;;GAIG;AACH,MAAM,aAAa,GAAuB;IACxC,kBAAkB,EAAE,wBAAwB;IAC5C,yBAAyB,EAAE,+BAA+B;IAC1D,uBAAuB,EAAE,uBAAuB;CACjD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,MAAM,CAAC,aAAa,CAAC,CAAC;AACxB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AzurePluginContext, IdentityPlugin } from \"./provider.js\";\nimport {\n msalNodeFlowCacheControl,\n msalNodeFlowNativeBrokerControl,\n} from \"../msal/nodeFlows/msalPlugins.js\";\n\nimport { vsCodeCredentialControl } from \"../credentials/visualStudioCodeCredential.js\";\n\n/**\n * The context passed to an Identity plugin. This contains objects that\n * plugins can use to set backend implementations.\n * @internal\n */\nconst pluginContext: AzurePluginContext = {\n cachePluginControl: msalNodeFlowCacheControl,\n nativeBrokerPluginControl: msalNodeFlowNativeBrokerControl,\n vsCodeCredentialControl: vsCodeCredentialControl,\n};\n\n/**\n * Extend Azure Identity with additional functionality. Pass a plugin from\n * a plugin package, such as:\n *\n * - `@azure/identity-cache-persistence`: provides persistent token caching\n * - `@azure/identity-vscode`: provides the dependencies of\n * `VisualStudioCodeCredential` and enables it\n *\n * Example:\n *\n * ```ts snippet:consumer_example\n * import { useIdentityPlugin, DeviceCodeCredential } from \"@azure/identity\";\n *\n * useIdentityPlugin(cachePersistencePlugin);\n * // The plugin has the capability to extend `DeviceCodeCredential` and to\n * // add middleware to the underlying credentials, such as persistence.\n * const credential = new DeviceCodeCredential({\n * tokenCachePersistenceOptions: {\n * enabled: true,\n * },\n * });\n * ```\n *\n * @param plugin - the plugin to register\n */\nexport function useIdentityPlugin(plugin: IdentityPlugin): void {\n plugin(pluginContext);\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import type { TokenCachePersistenceOptions } from "../msal/nodeFlows/tokenCachePersistenceOptions.js";
2
+ import type { VSCodeCredentialFinder } from "../credentials/visualStudioCodeCredentialPlugin.js";
3
+ /**
4
+ * The type of an Azure Identity plugin, a function accepting a plugin
5
+ * context.
6
+ */
7
+ export type IdentityPlugin = (context: unknown) => void;
8
+ /**
9
+ * Plugin context entries for controlling cache plugins.
10
+ */
11
+ export interface CachePluginControl {
12
+ setPersistence(persistenceFactory: (options?: TokenCachePersistenceOptions) => Promise<import("@azure/msal-node").ICachePlugin>): void;
13
+ }
14
+ export interface NativeBrokerPluginControl {
15
+ setNativeBroker(nativeBroker: import("@azure/msal-node").INativeBrokerPlugin): void;
16
+ }
17
+ /**
18
+ * Plugin context entries for controlling VisualStudioCodeCredential.
19
+ */
20
+ export interface VisualStudioCodeCredentialControl {
21
+ setVsCodeCredentialFinder(finder: VSCodeCredentialFinder): void;
22
+ }
23
+ /**
24
+ * Context options passed to a plugin during initialization.
25
+ *
26
+ * Plugin authors are responsible for casting their plugin context values
27
+ * to this type.
28
+ *
29
+ * @internal
30
+ */
31
+ export interface AzurePluginContext {
32
+ cachePluginControl: CachePluginControl;
33
+ nativeBrokerPluginControl: NativeBrokerPluginControl;
34
+ vsCodeCredentialControl: VisualStudioCodeCredentialControl;
35
+ }
36
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +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;AACH,MAAM,WAAW,kBAAkB;IACjC,cAAc,CACZ,kBAAkB,EAAE,CAClB,OAAO,CAAC,EAAE,4BAA4B,KAEnC,OAAO,CAAC,OAAO,kBAAkB,EAAE,YAAY,CAAC,GACpD,IAAI,CAAC;CACT;AAED,MAAM,WAAW,yBAAyB;IAExC,eAAe,CAAC,YAAY,EAAE,OAAO,kBAAkB,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACrF;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,yBAAyB,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACjE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,yBAAyB,EAAE,yBAAyB,CAAC;IACrD,uBAAuB,EAAE,iCAAiC,CAAC;CAC5D"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Helps specify a regional authority, or "AutoDiscoverRegion" to auto-detect the region.
3
+ */
4
+ export declare enum RegionalAuthority {
5
+ /** Instructs MSAL to attempt to discover the region */
6
+ AutoDiscoverRegion = "AutoDiscoverRegion",
7
+ /** Uses the {@link RegionalAuthority} for the Azure 'westus' region. */
8
+ USWest = "westus",
9
+ /** Uses the {@link RegionalAuthority} for the Azure 'westus2' region. */
10
+ USWest2 = "westus2",
11
+ /** Uses the {@link RegionalAuthority} for the Azure 'centralus' region. */
12
+ USCentral = "centralus",
13
+ /** Uses the {@link RegionalAuthority} for the Azure 'eastus' region. */
14
+ USEast = "eastus",
15
+ /** Uses the {@link RegionalAuthority} for the Azure 'eastus2' region. */
16
+ USEast2 = "eastus2",
17
+ /** Uses the {@link RegionalAuthority} for the Azure 'northcentralus' region. */
18
+ USNorthCentral = "northcentralus",
19
+ /** Uses the {@link RegionalAuthority} for the Azure 'southcentralus' region. */
20
+ USSouthCentral = "southcentralus",
21
+ /** Uses the {@link RegionalAuthority} for the Azure 'westcentralus' region. */
22
+ USWestCentral = "westcentralus",
23
+ /** Uses the {@link RegionalAuthority} for the Azure 'canadacentral' region. */
24
+ CanadaCentral = "canadacentral",
25
+ /** Uses the {@link RegionalAuthority} for the Azure 'canadaeast' region. */
26
+ CanadaEast = "canadaeast",
27
+ /** Uses the {@link RegionalAuthority} for the Azure 'brazilsouth' region. */
28
+ BrazilSouth = "brazilsouth",
29
+ /** Uses the {@link RegionalAuthority} for the Azure 'northeurope' region. */
30
+ EuropeNorth = "northeurope",
31
+ /** Uses the {@link RegionalAuthority} for the Azure 'westeurope' region. */
32
+ EuropeWest = "westeurope",
33
+ /** Uses the {@link RegionalAuthority} for the Azure 'uksouth' region. */
34
+ UKSouth = "uksouth",
35
+ /** Uses the {@link RegionalAuthority} for the Azure 'ukwest' region. */
36
+ UKWest = "ukwest",
37
+ /** Uses the {@link RegionalAuthority} for the Azure 'francecentral' region. */
38
+ FranceCentral = "francecentral",
39
+ /** Uses the {@link RegionalAuthority} for the Azure 'francesouth' region. */
40
+ FranceSouth = "francesouth",
41
+ /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandnorth' region. */
42
+ SwitzerlandNorth = "switzerlandnorth",
43
+ /** Uses the {@link RegionalAuthority} for the Azure 'switzerlandwest' region. */
44
+ SwitzerlandWest = "switzerlandwest",
45
+ /** Uses the {@link RegionalAuthority} for the Azure 'germanynorth' region. */
46
+ GermanyNorth = "germanynorth",
47
+ /** Uses the {@link RegionalAuthority} for the Azure 'germanywestcentral' region. */
48
+ GermanyWestCentral = "germanywestcentral",
49
+ /** Uses the {@link RegionalAuthority} for the Azure 'norwaywest' region. */
50
+ NorwayWest = "norwaywest",
51
+ /** Uses the {@link RegionalAuthority} for the Azure 'norwayeast' region. */
52
+ NorwayEast = "norwayeast",
53
+ /** Uses the {@link RegionalAuthority} for the Azure 'eastasia' region. */
54
+ AsiaEast = "eastasia",
55
+ /** Uses the {@link RegionalAuthority} for the Azure 'southeastasia' region. */
56
+ AsiaSouthEast = "southeastasia",
57
+ /** Uses the {@link RegionalAuthority} for the Azure 'japaneast' region. */
58
+ JapanEast = "japaneast",
59
+ /** Uses the {@link RegionalAuthority} for the Azure 'japanwest' region. */
60
+ JapanWest = "japanwest",
61
+ /** Uses the {@link RegionalAuthority} for the Azure 'australiaeast' region. */
62
+ AustraliaEast = "australiaeast",
63
+ /** Uses the {@link RegionalAuthority} for the Azure 'australiasoutheast' region. */
64
+ AustraliaSouthEast = "australiasoutheast",
65
+ /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral' region. */
66
+ AustraliaCentral = "australiacentral",
67
+ /** Uses the {@link RegionalAuthority} for the Azure 'australiacentral2' region. */
68
+ AustraliaCentral2 = "australiacentral2",
69
+ /** Uses the {@link RegionalAuthority} for the Azure 'centralindia' region. */
70
+ IndiaCentral = "centralindia",
71
+ /** Uses the {@link RegionalAuthority} for the Azure 'southindia' region. */
72
+ IndiaSouth = "southindia",
73
+ /** Uses the {@link RegionalAuthority} for the Azure 'westindia' region. */
74
+ IndiaWest = "westindia",
75
+ /** Uses the {@link RegionalAuthority} for the Azure 'koreasouth' region. */
76
+ KoreaSouth = "koreasouth",
77
+ /** Uses the {@link RegionalAuthority} for the Azure 'koreacentral' region. */
78
+ KoreaCentral = "koreacentral",
79
+ /** Uses the {@link RegionalAuthority} for the Azure 'uaecentral' region. */
80
+ UAECentral = "uaecentral",
81
+ /** Uses the {@link RegionalAuthority} for the Azure 'uaenorth' region. */
82
+ UAENorth = "uaenorth",
83
+ /** Uses the {@link RegionalAuthority} for the Azure 'southafricanorth' region. */
84
+ SouthAfricaNorth = "southafricanorth",
85
+ /** Uses the {@link RegionalAuthority} for the Azure 'southafricawest' region. */
86
+ SouthAfricaWest = "southafricawest",
87
+ /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth' region. */
88
+ ChinaNorth = "chinanorth",
89
+ /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast' region. */
90
+ ChinaEast = "chinaeast",
91
+ /** Uses the {@link RegionalAuthority} for the Azure 'chinanorth2' region. */
92
+ ChinaNorth2 = "chinanorth2",
93
+ /** Uses the {@link RegionalAuthority} for the Azure 'chinaeast2' region. */
94
+ ChinaEast2 = "chinaeast2",
95
+ /** Uses the {@link RegionalAuthority} for the Azure 'germanycentral' region. */
96
+ GermanyCentral = "germanycentral",
97
+ /** Uses the {@link RegionalAuthority} for the Azure 'germanynortheast' region. */
98
+ GermanyNorthEast = "germanynortheast",
99
+ /** Uses the {@link RegionalAuthority} for the Azure 'usgovvirginia' region. */
100
+ GovernmentUSVirginia = "usgovvirginia",
101
+ /** Uses the {@link RegionalAuthority} for the Azure 'usgoviowa' region. */
102
+ GovernmentUSIowa = "usgoviowa",
103
+ /** Uses the {@link RegionalAuthority} for the Azure 'usgovarizona' region. */
104
+ GovernmentUSArizona = "usgovarizona",
105
+ /** Uses the {@link RegionalAuthority} for the Azure 'usgovtexas' region. */
106
+ GovernmentUSTexas = "usgovtexas",
107
+ /** Uses the {@link RegionalAuthority} for the Azure 'usdodeast' region. */
108
+ GovernmentUSDodEast = "usdodeast",
109
+ /** Uses the {@link RegionalAuthority} for the Azure 'usdodcentral' region. */
110
+ GovernmentUSDodCentral = "usdodcentral"
111
+ }
112
+ /**
113
+ * Calculates the correct regional authority based on the supplied value
114
+ * and the AZURE_REGIONAL_AUTHORITY_NAME environment variable.
115
+ *
116
+ * Values will be returned verbatim, except for {@link RegionalAuthority.AutoDiscoverRegion}
117
+ * which is mapped to a value MSAL can understand.
118
+ *
119
+ * @internal
120
+ */
121
+ export declare function calculateRegionalAuthority(regionalAuthority?: string): string | undefined;
122
+ //# sourceMappingURL=regionalAuthority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regionalAuthority.d.ts","sourceRoot":"","sources":["../../src/regionalAuthority.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,uDAAuD;IACvD,kBAAkB,uBAAuB;IACzC,wEAAwE;IACxE,MAAM,WAAW;IACjB,yEAAyE;IACzE,OAAO,YAAY;IACnB,2EAA2E;IAC3E,SAAS,cAAc;IACvB,wEAAwE;IACxE,MAAM,WAAW;IACjB,yEAAyE;IACzE,OAAO,YAAY;IACnB,gFAAgF;IAChF,cAAc,mBAAmB;IACjC,gFAAgF;IAChF,cAAc,mBAAmB;IACjC,+EAA+E;IAC/E,aAAa,kBAAkB;IAC/B,+EAA+E;IAC/E,aAAa,kBAAkB;IAC/B,4EAA4E;IAC5E,UAAU,eAAe;IACzB,6EAA6E;IAC7E,WAAW,gBAAgB;IAC3B,6EAA6E;IAC7E,WAAW,gBAAgB;IAC3B,4EAA4E;IAC5E,UAAU,eAAe;IACzB,yEAAyE;IACzE,OAAO,YAAY;IACnB,wEAAwE;IACxE,MAAM,WAAW;IACjB,+EAA+E;IAC/E,aAAa,kBAAkB;IAC/B,6EAA6E;IAC7E,WAAW,gBAAgB;IAC3B,kFAAkF;IAClF,gBAAgB,qBAAqB;IACrC,iFAAiF;IACjF,eAAe,oBAAoB;IACnC,8EAA8E;IAC9E,YAAY,iBAAiB;IAC7B,oFAAoF;IACpF,kBAAkB,uBAAuB;IACzC,4EAA4E;IAC5E,UAAU,eAAe;IACzB,4EAA4E;IAC5E,UAAU,eAAe;IACzB,0EAA0E;IAC1E,QAAQ,aAAa;IACrB,+EAA+E;IAC/E,aAAa,kBAAkB;IAC/B,2EAA2E;IAC3E,SAAS,cAAc;IACvB,2EAA2E;IAC3E,SAAS,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