@azure/msal-node 5.0.0-alpha.0 → 5.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/dist/cache/CacheHelpers.mjs +1 -1
  2. package/dist/cache/NodeStorage.mjs +1 -1
  3. package/dist/cache/NodeStorage.mjs.map +1 -1
  4. package/dist/cache/TokenCache.mjs +1 -1
  5. package/dist/cache/TokenCache.mjs.map +1 -1
  6. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  7. package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
  8. package/dist/cache/serializer/Deserializer.mjs +1 -1
  9. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  10. package/dist/cache/serializer/Serializer.mjs +1 -1
  11. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  12. package/dist/client/BaseClient.d.ts +42 -0
  13. package/dist/client/BaseClient.d.ts.map +1 -0
  14. package/dist/client/BaseClient.mjs +68 -0
  15. package/dist/client/BaseClient.mjs.map +1 -0
  16. package/dist/client/ClientApplication.mjs +1 -1
  17. package/dist/client/ClientApplication.mjs.map +1 -1
  18. package/dist/client/ClientAssertion.mjs +1 -1
  19. package/dist/client/ClientAssertion.mjs.map +1 -1
  20. package/dist/client/ClientCredentialClient.d.ts +2 -1
  21. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  22. package/dist/client/ClientCredentialClient.mjs +4 -3
  23. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  24. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  25. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  26. package/dist/client/DeviceCodeClient.d.ts +2 -1
  27. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  28. package/dist/client/DeviceCodeClient.mjs +6 -5
  29. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  30. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  31. package/dist/client/ManagedIdentityApplication.mjs.map +1 -1
  32. package/dist/client/ManagedIdentityClient.mjs +1 -1
  33. package/dist/client/ManagedIdentityClient.mjs.map +1 -1
  34. package/dist/client/ManagedIdentitySources/AppService.d.ts +54 -0
  35. package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
  36. package/dist/client/ManagedIdentitySources/AppService.mjs +55 -1
  37. package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -1
  38. package/dist/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
  39. package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
  40. package/dist/client/ManagedIdentitySources/AzureArc.mjs +82 -1
  41. package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -1
  42. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
  43. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
  44. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +81 -1
  45. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
  46. package/dist/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
  47. package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
  48. package/dist/client/ManagedIdentitySources/CloudShell.mjs +55 -1
  49. package/dist/client/ManagedIdentitySources/CloudShell.mjs.map +1 -1
  50. package/dist/client/ManagedIdentitySources/Imds.d.ts +44 -22
  51. package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
  52. package/dist/client/ManagedIdentitySources/Imds.mjs +44 -22
  53. package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
  54. package/dist/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
  55. package/dist/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
  56. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +66 -1
  57. package/dist/client/ManagedIdentitySources/MachineLearning.mjs.map +1 -1
  58. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
  59. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
  60. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +57 -23
  61. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs.map +1 -1
  62. package/dist/client/OnBehalfOfClient.d.ts +2 -1
  63. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  64. package/dist/client/OnBehalfOfClient.mjs +4 -3
  65. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  66. package/dist/client/PublicClientApplication.d.ts.map +1 -1
  67. package/dist/client/PublicClientApplication.mjs +21 -5
  68. package/dist/client/PublicClientApplication.mjs.map +1 -1
  69. package/dist/client/UsernamePasswordClient.d.ts +2 -1
  70. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  71. package/dist/client/UsernamePasswordClient.mjs +4 -3
  72. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  73. package/dist/config/Configuration.d.ts +0 -6
  74. package/dist/config/Configuration.d.ts.map +1 -1
  75. package/dist/config/Configuration.mjs +3 -5
  76. package/dist/config/Configuration.mjs.map +1 -1
  77. package/dist/config/ManagedIdentityId.mjs +1 -1
  78. package/dist/config/ManagedIdentityId.mjs.map +1 -1
  79. package/dist/config/ManagedIdentityRequestParameters.mjs +3 -3
  80. package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
  81. package/dist/crypto/CryptoProvider.mjs +1 -1
  82. package/dist/crypto/CryptoProvider.mjs.map +1 -1
  83. package/dist/crypto/GuidGenerator.mjs +1 -1
  84. package/dist/crypto/GuidGenerator.mjs.map +1 -1
  85. package/dist/crypto/HashUtils.mjs +1 -1
  86. package/dist/crypto/HashUtils.mjs.map +1 -1
  87. package/dist/crypto/PkceGenerator.mjs +1 -1
  88. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  89. package/dist/error/ClientAuthErrorCodes.mjs +1 -1
  90. package/dist/error/ManagedIdentityError.mjs +1 -1
  91. package/dist/error/ManagedIdentityError.mjs.map +1 -1
  92. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  93. package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -1
  94. package/dist/error/NodeAuthError.d.ts +8 -0
  95. package/dist/error/NodeAuthError.d.ts.map +1 -1
  96. package/dist/error/NodeAuthError.mjs +11 -1
  97. package/dist/error/NodeAuthError.mjs.map +1 -1
  98. package/dist/index.d.ts +0 -6
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.mjs +1 -7
  101. package/dist/index.mjs.map +1 -1
  102. package/dist/internals.mjs +1 -1
  103. package/dist/network/HttpClient.d.ts +54 -14
  104. package/dist/network/HttpClient.d.ts.map +1 -1
  105. package/dist/network/HttpClient.mjs +140 -262
  106. package/dist/network/HttpClient.mjs.map +1 -1
  107. package/dist/network/HttpClientWithRetries.mjs +1 -1
  108. package/dist/network/HttpClientWithRetries.mjs.map +1 -1
  109. package/dist/network/LoopbackClient.mjs +1 -1
  110. package/dist/network/LoopbackClient.mjs.map +1 -1
  111. package/dist/packageMetadata.d.ts +1 -1
  112. package/dist/packageMetadata.d.ts.map +1 -1
  113. package/dist/packageMetadata.mjs +2 -2
  114. package/dist/protocol/Authorize.mjs +2 -2
  115. package/dist/protocol/Authorize.mjs.map +1 -1
  116. package/dist/request/AuthorizationCodeRequest.d.ts +2 -1
  117. package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
  118. package/dist/request/AuthorizationUrlRequest.d.ts +2 -2
  119. package/dist/request/ClientCredentialRequest.d.ts +0 -1
  120. package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
  121. package/dist/request/CommonClientCredentialRequest.d.ts +3 -2
  122. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  123. package/dist/request/CommonDeviceCodeRequest.d.ts +3 -2
  124. package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  125. package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -2
  126. package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  127. package/dist/request/CommonUsernamePasswordRequest.d.ts +2 -1
  128. package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  129. package/dist/request/InteractiveRequest.d.ts +1 -1
  130. package/dist/request/InteractiveRequest.d.ts.map +1 -1
  131. package/dist/request/OnBehalfOfRequest.d.ts +0 -1
  132. package/dist/request/OnBehalfOfRequest.d.ts.map +1 -1
  133. package/dist/request/RefreshTokenRequest.d.ts +2 -1
  134. package/dist/request/RefreshTokenRequest.d.ts.map +1 -1
  135. package/dist/request/SilentFlowRequest.d.ts +2 -1
  136. package/dist/request/SilentFlowRequest.d.ts.map +1 -1
  137. package/dist/request/UsernamePasswordRequest.d.ts +2 -1
  138. package/dist/request/UsernamePasswordRequest.d.ts.map +1 -1
  139. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
  140. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs.map +1 -1
  141. package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
  142. package/dist/retry/ExponentialRetryStrategy.mjs.map +1 -1
  143. package/dist/retry/ImdsRetryPolicy.mjs +1 -1
  144. package/dist/retry/ImdsRetryPolicy.mjs.map +1 -1
  145. package/dist/retry/LinearRetryStrategy.mjs +1 -1
  146. package/dist/retry/LinearRetryStrategy.mjs.map +1 -1
  147. package/dist/utils/Constants.d.ts +2 -9
  148. package/dist/utils/Constants.d.ts.map +1 -1
  149. package/dist/utils/Constants.mjs +4 -12
  150. package/dist/utils/Constants.mjs.map +1 -1
  151. package/dist/utils/EncodingUtils.mjs +1 -1
  152. package/dist/utils/EncodingUtils.mjs.map +1 -1
  153. package/dist/utils/TimeUtils.mjs +1 -1
  154. package/dist/utils/TimeUtils.mjs.map +1 -1
  155. package/lib/msal-node.cjs +5747 -5335
  156. package/lib/msal-node.cjs.map +1 -1
  157. package/lib/types/client/BaseClient.d.ts +42 -0
  158. package/lib/types/client/BaseClient.d.ts.map +1 -0
  159. package/lib/types/client/ClientCredentialClient.d.ts +2 -1
  160. package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
  161. package/lib/types/client/DeviceCodeClient.d.ts +2 -1
  162. package/lib/types/client/DeviceCodeClient.d.ts.map +1 -1
  163. package/lib/types/client/ManagedIdentitySources/AppService.d.ts +54 -0
  164. package/lib/types/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
  165. package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
  166. package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
  167. package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
  168. package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
  169. package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
  170. package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
  171. package/lib/types/client/ManagedIdentitySources/Imds.d.ts +44 -22
  172. package/lib/types/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
  173. package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
  174. package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
  175. package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
  176. package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
  177. package/lib/types/client/OnBehalfOfClient.d.ts +2 -1
  178. package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -1
  179. package/lib/types/client/PublicClientApplication.d.ts.map +1 -1
  180. package/lib/types/client/UsernamePasswordClient.d.ts +2 -1
  181. package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
  182. package/lib/types/config/Configuration.d.ts +0 -6
  183. package/lib/types/config/Configuration.d.ts.map +1 -1
  184. package/lib/types/error/NodeAuthError.d.ts +8 -0
  185. package/lib/types/error/NodeAuthError.d.ts.map +1 -1
  186. package/lib/types/index.d.ts +0 -6
  187. package/lib/types/index.d.ts.map +1 -1
  188. package/lib/types/network/HttpClient.d.ts +54 -14
  189. package/lib/types/network/HttpClient.d.ts.map +1 -1
  190. package/lib/types/packageMetadata.d.ts +1 -1
  191. package/lib/types/packageMetadata.d.ts.map +1 -1
  192. package/lib/types/request/AuthorizationCodeRequest.d.ts +2 -1
  193. package/lib/types/request/AuthorizationCodeRequest.d.ts.map +1 -1
  194. package/lib/types/request/AuthorizationUrlRequest.d.ts +2 -2
  195. package/lib/types/request/ClientCredentialRequest.d.ts +0 -1
  196. package/lib/types/request/ClientCredentialRequest.d.ts.map +1 -1
  197. package/lib/types/request/CommonClientCredentialRequest.d.ts +3 -2
  198. package/lib/types/request/CommonClientCredentialRequest.d.ts.map +1 -1
  199. package/lib/types/request/CommonDeviceCodeRequest.d.ts +3 -2
  200. package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  201. package/lib/types/request/CommonOnBehalfOfRequest.d.ts +1 -2
  202. package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  203. package/lib/types/request/CommonUsernamePasswordRequest.d.ts +2 -1
  204. package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  205. package/lib/types/request/InteractiveRequest.d.ts +1 -1
  206. package/lib/types/request/InteractiveRequest.d.ts.map +1 -1
  207. package/lib/types/request/OnBehalfOfRequest.d.ts +0 -1
  208. package/lib/types/request/OnBehalfOfRequest.d.ts.map +1 -1
  209. package/lib/types/request/RefreshTokenRequest.d.ts +2 -1
  210. package/lib/types/request/RefreshTokenRequest.d.ts.map +1 -1
  211. package/lib/types/request/SilentFlowRequest.d.ts +2 -1
  212. package/lib/types/request/SilentFlowRequest.d.ts.map +1 -1
  213. package/lib/types/request/UsernamePasswordRequest.d.ts +2 -1
  214. package/lib/types/request/UsernamePasswordRequest.d.ts.map +1 -1
  215. package/lib/types/utils/Constants.d.ts +2 -9
  216. package/lib/types/utils/Constants.d.ts.map +1 -1
  217. package/package.json +88 -88
  218. package/src/client/BaseClient.ts +158 -0
  219. package/src/client/ClientCredentialClient.ts +2 -3
  220. package/src/client/DeviceCodeClient.ts +4 -5
  221. package/src/client/ManagedIdentitySources/AppService.ts +54 -0
  222. package/src/client/ManagedIdentitySources/AzureArc.ts +81 -0
  223. package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +92 -2
  224. package/src/client/ManagedIdentitySources/CloudShell.ts +54 -0
  225. package/src/client/ManagedIdentitySources/Imds.ts +43 -21
  226. package/src/client/ManagedIdentitySources/MachineLearning.ts +65 -0
  227. package/src/client/ManagedIdentitySources/ServiceFabric.ts +56 -22
  228. package/src/client/OnBehalfOfClient.ts +2 -3
  229. package/src/client/PublicClientApplication.ts +22 -4
  230. package/src/client/UsernamePasswordClient.ts +2 -3
  231. package/src/config/Configuration.ts +2 -14
  232. package/src/config/ManagedIdentityRequestParameters.ts +2 -2
  233. package/src/error/NodeAuthError.ts +14 -0
  234. package/src/index.ts +0 -8
  235. package/src/network/HttpClient.ts +166 -372
  236. package/src/packageMetadata.ts +1 -1
  237. package/src/protocol/Authorize.ts +1 -1
  238. package/src/request/AuthorizationCodeRequest.ts +2 -1
  239. package/src/request/AuthorizationUrlRequest.ts +2 -2
  240. package/src/request/ClientCredentialRequest.ts +0 -1
  241. package/src/request/CommonClientCredentialRequest.ts +6 -2
  242. package/src/request/CommonDeviceCodeRequest.ts +3 -6
  243. package/src/request/CommonOnBehalfOfRequest.ts +4 -2
  244. package/src/request/CommonUsernamePasswordRequest.ts +2 -1
  245. package/src/request/InteractiveRequest.ts +1 -4
  246. package/src/request/OnBehalfOfRequest.ts +0 -1
  247. package/src/request/RefreshTokenRequest.ts +2 -1
  248. package/src/request/SilentFlowRequest.ts +2 -1
  249. package/src/request/UsernamePasswordRequest.ts +2 -1
  250. package/src/utils/Constants.ts +2 -11
  251. package/dist/utils/NetworkUtils.mjs +0 -43
  252. package/dist/utils/NetworkUtils.mjs.map +0 -1
@@ -0,0 +1,42 @@
1
+ import { ClientConfiguration, CommonClientConfiguration, INetworkModule, NetworkRequestOptions, Logger, ICrypto, CacheManager, ServerTelemetryManager, Authority, CcsCredential, RequestThumbprint, ServerAuthorizationTokenResponse, NetworkResponse, BaseAuthRequest, StubPerformanceClient } from "@azure/msal-common/node";
2
+ /**
3
+ * Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
4
+ * @internal
5
+ */
6
+ export declare abstract class BaseClient {
7
+ logger: Logger;
8
+ protected config: CommonClientConfiguration;
9
+ protected cryptoUtils: ICrypto;
10
+ protected cacheManager: CacheManager;
11
+ protected networkClient: INetworkModule;
12
+ protected serverTelemetryManager: ServerTelemetryManager | null;
13
+ authority: Authority;
14
+ protected performanceClient: StubPerformanceClient;
15
+ protected constructor(configuration: ClientConfiguration);
16
+ /**
17
+ * Creates default headers for requests to token endpoint
18
+ */
19
+ protected createTokenRequestHeaders(ccsCred?: CcsCredential): Record<string, string>;
20
+ /**
21
+ * Http post to token endpoint
22
+ * @param tokenEndpoint
23
+ * @param queryString
24
+ * @param headers
25
+ * @param thumbprint
26
+ */
27
+ protected executePostToTokenEndpoint(tokenEndpoint: string, queryString: string, headers: Record<string, string>, thumbprint: RequestThumbprint, correlationId: string): Promise<NetworkResponse<ServerAuthorizationTokenResponse>>;
28
+ /**
29
+ * Wraps sendPostRequestAsync with necessary preflight and postflight logic
30
+ * @param thumbprint - Request thumbprint for throttling
31
+ * @param tokenEndpoint - Endpoint to make the POST to
32
+ * @param options - Body and Headers to include on the POST request
33
+ * @param correlationId - CorrelationId for telemetry
34
+ */
35
+ sendPostRequest<T extends ServerAuthorizationTokenResponse>(thumbprint: RequestThumbprint, tokenEndpoint: string, options: NetworkRequestOptions, correlationId: string): Promise<NetworkResponse<T>>;
36
+ /**
37
+ * Creates query string for the /token request
38
+ * @param request
39
+ */
40
+ createTokenQueryParameters(request: BaseAuthRequest): string;
41
+ }
42
+ //# sourceMappingURL=BaseClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseClient.d.ts","sourceRoot":"","sources":["../../../src/client/BaseClient.ts"],"names":[],"mappings":"AAKA,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,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;CAQ/D"}
@@ -1,6 +1,7 @@
1
- import { AuthenticationResult, Authority, BaseClient, CacheManager, ClientConfiguration, Constants, IAppTokenProvider, ICrypto, ServerTelemetryManager } from "@azure/msal-common/node";
1
+ import { AuthenticationResult, Authority, CacheManager, ClientConfiguration, Constants, IAppTokenProvider, ICrypto, ServerTelemetryManager } from "@azure/msal-common/node";
2
2
  import { ManagedIdentityConfiguration } from "../config/Configuration.js";
3
3
  import { CommonClientCredentialRequest } from "../request/CommonClientCredentialRequest.js";
4
+ import { BaseClient } from "./BaseClient.js";
4
5
  /**
5
6
  * OAuth2.0 client credential grant
6
7
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"ClientCredentialClient.d.ts","sourceRoot":"","sources":["../../../src/client/ClientCredentialClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,YAAY,EAEZ,mBAAmB,EACnB,SAAS,EAET,iBAAiB,EACjB,OAAO,EAMP,sBAAsB,EAUzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,4BAA4B,EAE/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAE5F;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;IAClD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAoB;gBAGlD,aAAa,EAAE,mBAAmB,EAClC,gBAAgB,CAAC,EAAE,iBAAiB;IAMxC;;;OAGG;IACU,YAAY,CACrB,OAAO,EAAE,6BAA6B,GACvC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA0CvC;;OAEG;IACU,6BAA6B,CACtC,OAAO,EAAE,6BAA6B,EACtC,MAAM,EAAE,mBAAmB,GAAG,4BAA4B,EAC1D,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,s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C;;;;OAIG;YACW,mBAAmB;IAmGjC;;;OAGG;YACW,sBAAsB;CAiFvC"}
@@ -1,5 +1,6 @@
1
- import { AuthenticationResult, BaseClient, ClientConfiguration } from "@azure/msal-common/node";
1
+ import { AuthenticationResult, ClientConfiguration } from "@azure/msal-common/node";
2
2
  import { CommonDeviceCodeRequest } from "../request/CommonDeviceCodeRequest.js";
3
+ import { BaseClient } from "./BaseClient.js";
3
4
  /**
4
5
  * OAuth2.0 Device code client
5
6
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceCodeClient.d.ts","sourceRoot":"","sources":["../../../src/client/DeviceCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,oBAAoB,EACpB,UAAU,EACV,mBAAmB,EAetB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAGhF;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;gBAChC,aAAa,EAAE,mBAAmB;IAI9C;;;;OAIG;IACU,YAAY,CACrB,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA6BvC;;;OAGG;YACW,aAAa;IA+B3B;;;OAGG;IACI,0BAA0B,CAC7B,OAAO,EAAE,uBAAuB,GACjC,MAAM;IAaT;;;;;;;OAOG;YACW,sCAAsC;IAoCpD;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IA+BzB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IA2CvB;;;;OAIG;YACW,0BAA0B;IA8FxC;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;CAqDjC"}
1
+ {"version":3,"file":"DeviceCodeClient.d.ts","sourceRoot":"","sources":["../../../src/client/DeviceCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,oBAAoB,EACpB,mBAAmB,EActB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;gBAChC,aAAa,EAAE,mBAAmB;IAI9C;;;;OAIG;IACU,YAAY,CACrB,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA6BvC;;;OAGG;YACW,aAAa;IA+B3B;;;OAGG;IACI,0BAA0B,CAC7B,OAAO,EAAE,uBAAuB,GACjC,MAAM;IAaT;;;;;;;OAOG;YACW,sCAAsC;IAoCpD;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IA+BzB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IA2CvB;;;;OAIG;YACW,0BAA0B;IA8FxC;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;CAqDjC"}
@@ -5,14 +5,68 @@ import { ManagedIdentityRequestParameters } from "../../config/ManagedIdentityRe
5
5
  import { ManagedIdentityId } from "../../config/ManagedIdentityId.js";
6
6
  import { NodeStorage } from "../../cache/NodeStorage.js";
7
7
  /**
8
+ * Azure App Service Managed Identity Source implementation.
9
+ *
10
+ * This class provides managed identity authentication for applications running in Azure App Service.
11
+ * It uses the local metadata service endpoint available within App Service environments to obtain
12
+ * access tokens without requiring explicit credentials.
13
+ *
8
14
  * Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/AppServiceManagedIdentitySource.cs
9
15
  */
10
16
  export declare class AppService extends BaseManagedIdentitySource {
11
17
  private identityEndpoint;
12
18
  private identityHeader;
19
+ /**
20
+ * Creates a new instance of the AppService managed identity source.
21
+ *
22
+ * @param logger - Logger instance for diagnostic output
23
+ * @param nodeStorage - Node.js storage implementation for caching
24
+ * @param networkClient - Network client for making HTTP requests
25
+ * @param cryptoProvider - Cryptographic operations provider
26
+ * @param disableInternalRetries - Whether to disable internal retry logic
27
+ * @param identityEndpoint - The App Service identity endpoint URL
28
+ * @param identityHeader - The secret header value required for authentication
29
+ */
13
30
  constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean, identityEndpoint: string, identityHeader: string);
31
+ /**
32
+ * Retrieves the required environment variables for App Service managed identity.
33
+ *
34
+ * App Service managed identity requires two environment variables:
35
+ * - IDENTITY_ENDPOINT: The URL of the local metadata service
36
+ * - IDENTITY_HEADER: A secret header value for authentication
37
+ *
38
+ * @returns An array containing [identityEndpoint, identityHeader] values from environment variables.
39
+ * Either value may be undefined if the environment variable is not set.
40
+ */
14
41
  static getEnvironmentVariables(): Array<string | undefined>;
42
+ /**
43
+ * Attempts to create an AppService managed identity source if the environment supports it.
44
+ *
45
+ * This method checks for the presence of required environment variables and validates
46
+ * the identity endpoint URL. If the environment is not suitable for App Service managed
47
+ * identity (missing environment variables or invalid endpoint), it returns null.
48
+ *
49
+ * @param logger - Logger instance for diagnostic output
50
+ * @param nodeStorage - Node.js storage implementation for caching
51
+ * @param networkClient - Network client for making HTTP requests
52
+ * @param cryptoProvider - Cryptographic operations provider
53
+ * @param disableInternalRetries - Whether to disable internal retry logic
54
+ *
55
+ * @returns A new AppService instance if the environment is suitable, null otherwise
56
+ */
15
57
  static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean): AppService | null;
58
+ /**
59
+ * Creates a managed identity token request for the App Service environment.
60
+ *
61
+ * This method constructs an HTTP GET request to the App Service identity endpoint
62
+ * with the required headers, query parameters, and managed identity configuration.
63
+ * The request includes the secret header for authentication and appropriate API version.
64
+ *
65
+ * @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
66
+ * @param managedIdentityId - The managed identity configuration specifying whether to use system-assigned or user-assigned identity
67
+ *
68
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
69
+ */
16
70
  createRequest(resource: string, managedIdentityId: ManagedIdentityId): ManagedIdentityRequestParameters;
17
71
  }
18
72
  //# sourceMappingURL=AppService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppService.d.ts","sourceRoot":"","sources":["../../../../src/client/ManagedIdentitySources/AppService.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAS3E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAKzD;;GAEG;AACH,qBAAa,UAAW,SAAQ,yBAAyB;IACrD,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAAS;gBAG3B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,MAAM;WAcZ,uBAAuB,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;WAapD,SAAS,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,GAChC,UAAU,GAAG,IAAI;IAqCb,aAAa,CAChB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,iBAAiB,GACrC,gCAAgC;CA6BtC"}
1
+ {"version":3,"file":"AppService.d.ts","sourceRoot":"","sources":["../../../../src/client/ManagedIdentitySources/AppService.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAS3E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAKzD;;;;;;;;GAQG;AACH,qBAAa,UAAW,SAAQ,yBAAyB;IACrD,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAAS;IAE/B;;;;;;;;;;OAUG;gBAEC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,MAAM;IAc1B;;;;;;;;;OASG;WACW,uBAAuB,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAalE;;;;;;;;;;;;;;OAcG;WACW,SAAS,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,GAChC,UAAU,GAAG,IAAI;IAqCpB;;;;;;;;;;;OAWG;IACI,aAAa,CAChB,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,iBAAiB,GACrC,gCAAgC;CA6BtC"}
@@ -14,14 +14,95 @@ type FilePathMap = {
14
14
  export declare const SUPPORTED_AZURE_ARC_PLATFORMS: FilePathMap;
15
15
  export declare const AZURE_ARC_FILE_DETECTION: FilePathMap;
16
16
  /**
17
+ * Azure Arc managed identity source implementation for acquiring tokens from Azure Arc-enabled servers.
18
+ *
19
+ * This class provides managed identity authentication for applications running on Azure Arc-enabled servers
20
+ * by communicating with the local Hybrid Instance Metadata Service (HIMDS). It supports both environment
21
+ * variable-based configuration and automatic detection through the HIMDS executable.
22
+ *
17
23
  * Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/AzureArcManagedIdentitySource.cs
18
24
  */
19
25
  export declare class AzureArc extends BaseManagedIdentitySource {
20
26
  private identityEndpoint;
27
+ /**
28
+ * Creates a new instance of the AzureArc managed identity source.
29
+ *
30
+ * @param logger - Logger instance for capturing telemetry and diagnostic information
31
+ * @param nodeStorage - Storage implementation for caching tokens and metadata
32
+ * @param networkClient - Network client for making HTTP requests to the identity endpoint
33
+ * @param cryptoProvider - Cryptographic operations provider for token validation and encryption
34
+ * @param disableInternalRetries - Flag to disable automatic retry logic for failed requests
35
+ * @param identityEndpoint - The Azure Arc identity endpoint URL for token requests
36
+ */
21
37
  constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean, identityEndpoint: string);
38
+ /**
39
+ * Retrieves and validates Azure Arc environment variables for managed identity configuration.
40
+ *
41
+ * This method checks for IDENTITY_ENDPOINT and IMDS_ENDPOINT environment variables.
42
+ * If either is missing, it attempts to detect the Azure Arc environment by checking for
43
+ * the HIMDS executable at platform-specific paths. On successful detection, it returns
44
+ * the default identity endpoint and a helper string indicating file-based detection.
45
+ *
46
+ * @returns An array containing [identityEndpoint, imdsEndpoint] where both values are
47
+ * strings if Azure Arc is available, or undefined if not available.
48
+ */
22
49
  static getEnvironmentVariables(): Array<string | undefined>;
50
+ /**
51
+ * Attempts to create an AzureArc managed identity source instance.
52
+ *
53
+ * Validates the Azure Arc environment by checking environment variables
54
+ * and performing file-based detection. It ensures that only system-assigned managed identities
55
+ * are supported for Azure Arc scenarios. The method performs comprehensive validation of
56
+ * endpoint URLs and logs detailed information about the detection process.
57
+ *
58
+ * @param logger - Logger instance for capturing creation and validation steps
59
+ * @param nodeStorage - Storage implementation for the managed identity source
60
+ * @param networkClient - Network client for HTTP communication
61
+ * @param cryptoProvider - Cryptographic operations provider
62
+ * @param disableInternalRetries - Whether to disable automatic retry mechanisms
63
+ * @param managedIdentityId - The managed identity configuration, must be system-assigned
64
+ *
65
+ * @returns AzureArc instance if the environment supports Azure Arc managed identity, null otherwise
66
+ *
67
+ * @throws {ManagedIdentityError} When a user-assigned managed identity is specified (not supported for Azure Arc)
68
+ */
23
69
  static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean, managedIdentityId: ManagedIdentityId): AzureArc | null;
70
+ /**
71
+ * Creates a properly formatted HTTP request for acquiring tokens from the Azure Arc identity endpoint.
72
+ *
73
+ * This method constructs a GET request to the Azure Arc HIMDS endpoint with the required metadata header
74
+ * and query parameters. The endpoint URL is normalized to use 127.0.0.1 instead of localhost for
75
+ * consistency. Additional body parameters are calculated by the base class during token acquisition.
76
+ *
77
+ * @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
78
+ *
79
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
80
+ */
24
81
  createRequest(resource: string): ManagedIdentityRequestParameters;
82
+ /**
83
+ * Processes the server response and handles Azure Arc-specific authentication challenges.
84
+ *
85
+ * This method implements the Azure Arc authentication flow which may require reading a secret file
86
+ * for authorization. When the initial request returns HTTP 401 Unauthorized, it extracts the file
87
+ * path from the WWW-Authenticate header, validates the file location and size, reads the secret,
88
+ * and retries the request with Basic authentication. The method includes comprehensive security
89
+ * validations to prevent path traversal and ensure file integrity.
90
+ *
91
+ * @param originalResponse - The initial HTTP response from the identity endpoint
92
+ * @param networkClient - Network client for making the retry request if needed
93
+ * @param networkRequest - The original request parameters (modified with auth header for retry)
94
+ * @param networkRequestOptions - Additional options for network requests
95
+ *
96
+ * @returns A promise that resolves to the server token response with access token and metadata
97
+ *
98
+ * @throws {ManagedIdentityError} When:
99
+ * - WWW-Authenticate header is missing or has unsupported format
100
+ * - Platform is not supported (not Windows or Linux)
101
+ * - Secret file has invalid extension (not .key)
102
+ * - Secret file path doesn't match expected platform path
103
+ * - Secret file cannot be read or is too large (>4096 bytes)
104
+ * @throws {ClientAuthError} When network errors occur during retry request
105
+ */
25
106
  getServerTokenResponseAsync(originalResponse: NetworkResponse<ManagedIdentityTokenResponse>, networkClient: INetworkModule, networkRequest: ManagedIdentityRequestParameters, networkRequestOptions: NetworkRequestOptions): Promise<ServerAuthorizationTokenResponse>;
26
107
  }
27
108
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"AzureArc.d.ts","sourceRoot":"","sources":["../../../../src/client/ManagedIdentitySources/AzureArc.ts"],"names":[],"mappings":"AAKA,OAAO,EAIH,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,MAAM,EACN,gCAAgC,EAEnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAchE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAOzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAGtE,eAAO,MAAM,eAAe,EAAE,MAAqB,CAAC;AACpD,eAAO,MAAM,mCAAmC,EAAE,MACS,CAAC;AAG5D,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,WAG3C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,WAGtC,CAAC;AAEF;;GAEG;AACH,qBAAa,QAAS,SAAQ,yBAAyB;IACnD,OAAO,CAAC,gBAAgB,CAAS;gBAG7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,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C;AAEF,eAAO,MAAM,6BAA6B,EAAE,WAG3C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,WAGtC,CAAC;AAEF;;;;;;;;GAQG;AACH,qBAAa,QAAS,SAAQ,yBAAyB;IACnD,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;;;;;;;;OASG;gBAEC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,gBAAgB,EAAE,MAAM;IAa5B;;;;;;;;;;OAUG;WACW,uBAAuB,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;IAoClE;;;;;;;;;;;;;;;;;;OAkBG;WACW,SAAS,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,iBAAiB,EAAE,iBAAiB,GACrC,QAAQ,GAAG,IAAI;IAkElB;;;;;;;;;;OAUG;IACI,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,gCAAgC;IAmBxE;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACU,2BAA2B,CACpC,gBAAgB,EAAE,eAAe,CAAC,4BAA4B,CAAC,EAC/D,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,gCAAgC,EAChD,qBAAqB,EAAE,qBAAqB,GAC7C,OAAO,CAAC,gCAAgC,CAAC;CAgH/C"}
@@ -6,6 +6,7 @@ import { ManagedIdentityRequest } from "../../request/ManagedIdentityRequest.js"
6
6
  import { ManagedIdentityIdType } from "../../utils/Constants.js";
7
7
  import { ManagedIdentityTokenResponse } from "../../response/ManagedIdentityTokenResponse.js";
8
8
  import { NodeStorage } from "../../cache/NodeStorage.js";
9
+ import { ManagedIdentityErrorCodes } from "../../error/ManagedIdentityError.js";
9
10
  /**
10
11
  * Managed Identity User Assigned Id Query Parameter Names
11
12
  */
@@ -17,18 +18,108 @@ export declare const ManagedIdentityUserAssignedIdQueryParameterNames: {
17
18
  readonly MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS: "mi_res_id";
18
19
  };
19
20
  export type ManagedIdentityUserAssignedIdQueryParameterNames = (typeof ManagedIdentityUserAssignedIdQueryParameterNames)[keyof typeof ManagedIdentityUserAssignedIdQueryParameterNames];
21
+ /**
22
+ * Base class for all Managed Identity sources. Provides common functionality for
23
+ * authenticating with Azure Managed Identity endpoints across different Azure services
24
+ * including IMDS, App Service, Azure Arc, Service Fabric, Cloud Shell, and Machine Learning.
25
+ *
26
+ * This abstract class handles token acquisition, response processing, and network communication
27
+ * while allowing concrete implementations to define source-specific request creation logic.
28
+ */
20
29
  export declare abstract class BaseManagedIdentitySource {
21
30
  protected logger: Logger;
22
31
  private nodeStorage;
23
32
  private networkClient;
24
33
  private cryptoProvider;
25
34
  private disableInternalRetries;
35
+ /**
36
+ * Creates an instance of BaseManagedIdentitySource.
37
+ *
38
+ * @param logger - Logger instance for diagnostic information
39
+ * @param nodeStorage - Storage interface for caching tokens
40
+ * @param networkClient - Network client for making HTTP requests
41
+ * @param cryptoProvider - Cryptographic provider for token operations
42
+ * @param disableInternalRetries - Whether to disable automatic retry logic
43
+ */
26
44
  constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean);
27
- abstract createRequest(request: string, managedIdentityId: ManagedIdentityId): ManagedIdentityRequestParameters;
45
+ /**
46
+ * Creates a managed identity request with source-specific parameters.
47
+ * This method must be implemented by concrete managed identity sources to define
48
+ * how requests are constructed for their specific endpoint requirements.
49
+ *
50
+ * @param resource - The Azure resource URI for which the access token is requested (e.g., "https://vault.azure.net/")
51
+ * @param managedIdentityId - The managed identity configuration specifying system-assigned or user-assigned identity details
52
+ *
53
+ * @returns Request parameters configured for the specific managed identity source
54
+ */
55
+ abstract createRequest(resource: string, managedIdentityId: ManagedIdentityId): ManagedIdentityRequestParameters;
56
+ /**
57
+ * Processes the network response and converts it to a standardized server token response.
58
+ * This async version allows for source-specific response processing logic while maintaining
59
+ * backward compatibility with the synchronous version.
60
+ *
61
+ * @param response - The network response containing the managed identity token
62
+ * @param _networkClient - Network client used for the request (unused in base implementation)
63
+ * @param _networkRequest - The original network request parameters (unused in base implementation)
64
+ * @param _networkRequestOptions - The network request options (unused in base implementation)
65
+ *
66
+ * @returns Promise resolving to a standardized server authorization token response
67
+ */
28
68
  getServerTokenResponseAsync(response: NetworkResponse<ManagedIdentityTokenResponse>, _networkClient: INetworkModule, _networkRequest: ManagedIdentityRequestParameters, _networkRequestOptions: NetworkRequestOptions): Promise<ServerAuthorizationTokenResponse>;
69
+ /**
70
+ * Converts a managed identity token response to a standardized server authorization token response.
71
+ * Handles time format conversion, expiration calculation, and error mapping to ensure
72
+ * compatibility with the MSAL response handling pipeline.
73
+ *
74
+ * @param response - The network response containing the managed identity token
75
+ *
76
+ * @returns Standardized server authorization token response with normalized fields
77
+ */
29
78
  getServerTokenResponse(response: NetworkResponse<ManagedIdentityTokenResponse>): ServerAuthorizationTokenResponse;
79
+ /**
80
+ * Acquires an access token using the managed identity endpoint for the specified resource.
81
+ * This is the primary method for token acquisition, handling the complete flow from
82
+ * request creation through response processing and token caching.
83
+ *
84
+ * @param managedIdentityRequest - The managed identity request containing resource and optional parameters
85
+ * @param managedIdentityId - The managed identity configuration (system or user-assigned)
86
+ * @param fakeAuthority - Authority instance used for token caching (managed identity uses a placeholder authority)
87
+ * @param refreshAccessToken - Whether this is a token refresh operation
88
+ *
89
+ * @returns Promise resolving to an authentication result containing the access token and metadata
90
+ *
91
+ * @throws {AuthError} When network requests fail or token validation fails
92
+ * @throws {ClientAuthError} When network errors occur during the request
93
+ */
30
94
  acquireTokenWithManagedIdentity(managedIdentityRequest: ManagedIdentityRequest, managedIdentityId: ManagedIdentityId, fakeAuthority: Authority, refreshAccessToken?: boolean): Promise<AuthenticationResult>;
95
+ /**
96
+ * Determines the appropriate query parameter name for user-assigned managed identity
97
+ * based on the identity type, API version, and endpoint characteristics.
98
+ * Different Azure services and API versions use different parameter names for the same identity types.
99
+ *
100
+ * @param managedIdentityIdType - The type of user-assigned managed identity (client ID, object ID, or resource ID)
101
+ * @param isImds - Whether the request is being made to the IMDS (Instance Metadata Service) endpoint
102
+ * @param usesApi2017 - Whether the endpoint uses the 2017-09-01 API version (affects client ID parameter name)
103
+ *
104
+ * @returns The correct query parameter name for the specified identity type and endpoint
105
+ *
106
+ * @throws {ManagedIdentityError} When an invalid managed identity ID type is provided
107
+ */
31
108
  getManagedIdentityUserAssignedIdQueryParameterKey(managedIdentityIdType: ManagedIdentityIdType, isImds?: boolean, usesApi2017?: boolean): string;
32
- static getValidatedEnvVariableUrlString: (envVariableStringName: string, envVariable: string, sourceName: string, logger: Logger) => string;
109
+ /**
110
+ * Validates and normalizes an environment variable containing a URL string.
111
+ * This static utility method ensures that environment variables used for managed identity
112
+ * endpoints contain properly formatted URLs and provides informative error messages when validation fails.
113
+ *
114
+ * @param envVariableStringName - The name of the environment variable being validated (for error reporting)
115
+ * @param envVariable - The environment variable value containing the URL string
116
+ * @param sourceName - The name of the managed identity source (for error reporting)
117
+ * @param logger - Logger instance for diagnostic information
118
+ *
119
+ * @returns The validated and normalized URL string
120
+ *
121
+ * @throws {ManagedIdentityError} When the environment variable contains a malformed URL
122
+ */
123
+ static getValidatedEnvVariableUrlString: (envVariableStringName: keyof typeof ManagedIdentityErrorCodes.MsiEnvironmentVariableUrlMalformedErrorCodes, envVariable: string, sourceName: string, logger: Logger) => string;
33
124
  }
34
125
  //# sourceMappingURL=BaseManagedIdentitySource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseManagedIdentitySource.d.ts","sourceRoot":"","sources":["../../../../src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,SAAS,EAET,cAAc,EACd,MAAM,EACN,qBAAqB,EACr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CAAC,GACxD,gCAAgC;IA+CtB,+BAA+B,CACxC,sBAAsB,EAAE,sBAAsB,EAC9C,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,SAAS,EACxB,kBAAkB,CAAC,EAAE,OAAO,GAC7B,OAAO,CAAC,oBAAoB,CAAC;IAmHzB,iDAAiD,CACpD,qBAAqB,EAAE,qBAAqB,EAC5C,MAAM,CAAC,EAAE,OAAO,EAChB,WAAW,CAAC,EAAE,OAAO,GACtB,MAAM;IAoCT,OAAc,gCAAgC,0BACnB,MAAM,eAChB,MAAM,cACP,MAAM,UACV,MAAM,KACf,MAAM,CAgBP;CACL"}
1
+ {"version":3,"file":"BaseManagedIdentitySource.d.ts","sourceRoot":"","sources":["../../../../src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,SAAS,EAET,cAAc,EACd,MAAM,EACN,qBAAqB,EACrB,eAAe,EAEf,gCAAgC,EAGhC,oBAAoB,EAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAEH,qBAAqB,EAExB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACH,yBAAyB,EAE5B,MAAM,qCAAqC,CAAC;AAI7C;;GAEG;AACH,eAAO,MAAM,gDAAgD;;;;;;CAMnD,CAAC;AACX,MAAM,MAAM,gDAAgD,GACxD,CAAC,OAAO,gDAAgD,CAAC,CAAC,MAAM,OAAO,gDAAgD,CAAC,CAAC;AAE7H;;;;;;;GAO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,13 +5,67 @@ import { NodeStorage } from "../../cache/NodeStorage.js";
5
5
  import { CryptoProvider } from "../../crypto/CryptoProvider.js";
6
6
  import { ManagedIdentityId } from "../../config/ManagedIdentityId.js";
7
7
  /**
8
+ * Azure Cloud Shell managed identity source implementation.
9
+ *
10
+ * This class handles authentication for applications running in Azure Cloud Shell environment.
11
+ * Cloud Shell provides a browser-accessible shell for managing Azure resources and includes
12
+ * a pre-configured managed identity for authentication.
13
+ *
8
14
  * Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/CloudShellManagedIdentitySource.cs
9
15
  */
10
16
  export declare class CloudShell extends BaseManagedIdentitySource {
11
17
  private msiEndpoint;
18
+ /**
19
+ * Creates a new CloudShell managed identity source instance.
20
+ *
21
+ * @param logger - Logger instance for diagnostic logging
22
+ * @param nodeStorage - Node.js storage implementation for caching
23
+ * @param networkClient - HTTP client for making requests to the managed identity endpoint
24
+ * @param cryptoProvider - Cryptographic operations provider
25
+ * @param disableInternalRetries - Whether to disable automatic retry logic for failed requests
26
+ * @param msiEndpoint - The MSI endpoint URL obtained from environment variables
27
+ */
12
28
  constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean, msiEndpoint: string);
29
+ /**
30
+ * Retrieves the required environment variables for Cloud Shell managed identity.
31
+ *
32
+ * Cloud Shell requires the MSI_ENDPOINT environment variable to be set, which
33
+ * contains the URL of the managed identity service endpoint.
34
+ *
35
+ * @returns An array containing the MSI_ENDPOINT environment variable value (or undefined if not set)
36
+ */
13
37
  static getEnvironmentVariables(): Array<string | undefined>;
38
+ /**
39
+ * Attempts to create a CloudShell managed identity source instance.
40
+ *
41
+ * This method validates that the required environment variables are present and
42
+ * creates a CloudShell instance if the environment is properly configured.
43
+ * Cloud Shell only supports system-assigned managed identities.
44
+ *
45
+ * @param logger - Logger instance for diagnostic logging
46
+ * @param nodeStorage - Node.js storage implementation for caching
47
+ * @param networkClient - HTTP client for making requests
48
+ * @param cryptoProvider - Cryptographic operations provider
49
+ * @param disableInternalRetries - Whether to disable automatic retry logic
50
+ * @param managedIdentityId - The managed identity configuration (must be system-assigned)
51
+ *
52
+ * @returns A CloudShell instance if the environment is valid, null otherwise
53
+ *
54
+ * @throws {ManagedIdentityError} When a user-assigned managed identity is requested,
55
+ * as Cloud Shell only supports system-assigned identities
56
+ */
14
57
  static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean, managedIdentityId: ManagedIdentityId): CloudShell | null;
58
+ /**
59
+ * Creates an HTTP request to acquire an access token from the Cloud Shell managed identity endpoint.
60
+ *
61
+ * This method constructs a POST request to the MSI endpoint with the required headers and
62
+ * body parameters for Cloud Shell authentication. The request includes the target resource
63
+ * for which the access token is being requested.
64
+ *
65
+ * @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
66
+ *
67
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
68
+ */
15
69
  createRequest(resource: string): ManagedIdentityRequestParameters;
16
70
  }
17
71
  //# sourceMappingURL=CloudShell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CloudShell.d.ts","sourceRoot":"","sources":["../../../../src/client/ManagedIdentitySources/CloudShell.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAahE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE;;GAEG;AACH,qBAAa,UAAW,SAAQ,yBAAyB;IACrD,OAAO,CAAC,WAAW,C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;;;;;;;;;;;OAkBG;WACW,SAAS,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,iBAAiB,EAAE,iBAAiB,GACrC,UAAU,GAAG,IAAI;IA2CpB;;;;;;;;;;OAUG;IACI,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,gCAAgC;CAc3E"}
@@ -5,40 +5,62 @@ import { BaseManagedIdentitySource } from "./BaseManagedIdentitySource.js";
5
5
  import { CryptoProvider } from "../../crypto/CryptoProvider.js";
6
6
  import { NodeStorage } from "../../cache/NodeStorage.js";
7
7
  /**
8
+ * Managed Identity source implementation for Azure Instance Metadata Service (IMDS).
9
+ *
10
+ * IMDS is available on Azure Virtual Machines and Virtual Machine Scale Sets and provides
11
+ * a REST endpoint to obtain OAuth tokens for managed identities. This implementation
12
+ * handles both system-assigned and user-assigned managed identities.
13
+ *
8
14
  * Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/ImdsManagedIdentitySource.cs
9
15
  */
10
16
  export declare class Imds extends BaseManagedIdentitySource {
11
17
  private identityEndpoint;
12
18
  /**
13
- * Constructs an Imds instance.
14
- * @param logger - Logger instance for logging.
15
- * @param nodeStorage - NodeStorage instance for caching.
16
- * @param networkClient - Network client for HTTP requests.
17
- * @param cryptoProvider - CryptoProvider for cryptographic operations.
18
- * @param disableInternalRetries - Whether to disable internal retry logic.
19
- * @param identityEndpoint - The IMDS endpoint to use.
19
+ * Constructs an Imds instance with the specified configuration.
20
+ *
21
+ * @param logger - Logger instance for recording debug information and errors
22
+ * @param nodeStorage - NodeStorage instance used for token caching operations
23
+ * @param networkClient - Network client implementation for making HTTP requests to IMDS
24
+ * @param cryptoProvider - CryptoProvider for generating correlation IDs and other cryptographic operations
25
+ * @param disableInternalRetries - When true, disables the built-in retry logic for IMDS requests
26
+ * @param identityEndpoint - The complete IMDS endpoint URL including the token path
20
27
  */
21
28
  constructor(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean, identityEndpoint: string);
22
29
  /**
23
- * Attempts to create an Imds instance by determining the correct endpoint.
24
- * If the AZURE_POD_IDENTITY_AUTHORITY_HOST environment variable is set, it uses that as the endpoint.
25
- * Otherwise, it falls back to the default IMDS endpoint.
26
- *
27
- * @param logger - Logger instance for logging.
28
- * @param nodeStorage - NodeStorage instance for caching.
29
- * @param networkClient - Network client for HTTP requests.
30
- * @param cryptoProvider - CryptoProvider for cryptographic operations.
31
- * @param disableInternalRetries - Whether to disable internal retry logic.
32
- * @returns An instance of Imds configured with the appropriate endpoint.
30
+ * Creates an Imds instance with the appropriate endpoint configuration.
31
+ *
32
+ * This method checks for the presence of the AZURE_POD_IDENTITY_AUTHORITY_HOST environment
33
+ * variable, which is used in Azure Kubernetes Service (AKS) environments with Azure AD
34
+ * Pod Identity. If found, it uses that endpoint; otherwise, it falls back to the standard
35
+ * IMDS endpoint (169.254.169.254).
36
+ *
37
+ * @param logger - Logger instance for recording endpoint discovery and validation
38
+ * @param nodeStorage - NodeStorage instance for token caching
39
+ * @param networkClient - Network client for HTTP requests
40
+ * @param cryptoProvider - CryptoProvider for cryptographic operations
41
+ * @param disableInternalRetries - Whether to disable built-in retry logic
42
+ *
43
+ * @returns A configured Imds instance ready to make token requests
33
44
  */
34
45
  static tryCreate(logger: Logger, nodeStorage: NodeStorage, networkClient: INetworkModule, cryptoProvider: CryptoProvider, disableInternalRetries: boolean): Imds;
35
46
  /**
36
- * Creates a ManagedIdentityRequestParameters object for acquiring a token from IMDS.
37
- * Sets the required headers and query parameters for the IMDS token request.
47
+ * Creates a properly configured HTTP request for acquiring an access token from IMDS.
48
+ *
49
+ * This method builds a complete request object with all necessary headers, query parameters,
50
+ * and retry policies required by the Azure Instance Metadata Service.
51
+ *
52
+ * Key request components:
53
+ * - HTTP GET method to the IMDS token endpoint
54
+ * - Metadata header set to "true" (required by IMDS)
55
+ * - API version parameter (currently "2018-02-01")
56
+ * - Resource parameter specifying the target audience
57
+ * - Identity-specific parameters for user-assigned managed identities
58
+ * - IMDS-specific retry policy
59
+ *
60
+ * @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
61
+ * @param managedIdentityId - The managed identity configuration specifying whether to use system-assigned or user-assigned identity
38
62
  *
39
- * @param resource - The resource URI for which the token is requested.
40
- * @param managedIdentityId - The managed identity ID (system-assigned or user-assigned).
41
- * @returns A ManagedIdentityRequestParameters object configured for IMDS.
63
+ * @returns A configured ManagedIdentityRequestParameters object ready for network execution
42
64
  */
43
65
  createRequest(resource: string, managedIdentityId: ManagedIdentityId): ManagedIdentityRequestParameters;
44
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Imds.d.ts","sourceRoot":"","sources":["../../../../src/client/ManagedIdentitySources/Imds.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAShE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AASzD;;GAEG;AACH,qBAAa,IAAK,SAAQ,yBAAyB;IAC/C,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;;;;;;;OAQG;gBAEC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,cAAc,EAC9B,sBAAsB,EAAE,OAAO,EAC/B,gBAAgB,EAAE,MAAM;IAa5B;;;;;;;;;;;OAWG;WACW,SAAS,CACnB,MAAM,EAAE,MAAM,EAC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