@azure/msal-node 2.7.0-alpha.0 → 2.7.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/README.md +1 -1
  2. package/dist/cache/ITokenCache.d.ts +15 -15
  3. package/dist/cache/NodeStorage.cjs +423 -423
  4. package/dist/cache/NodeStorage.cjs.map +1 -1
  5. package/dist/cache/NodeStorage.d.ts +193 -193
  6. package/dist/cache/NodeStorage.d.ts.map +1 -1
  7. package/dist/cache/NodeStorage.mjs +424 -424
  8. package/dist/cache/NodeStorage.mjs.map +1 -1
  9. package/dist/cache/TokenCache.cjs +265 -265
  10. package/dist/cache/TokenCache.d.ts +90 -90
  11. package/dist/cache/TokenCache.mjs +265 -265
  12. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  13. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  14. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  15. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  16. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  17. package/dist/cache/serializer/Deserializer.cjs +167 -170
  18. package/dist/cache/serializer/Deserializer.cjs.map +1 -1
  19. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  20. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  21. package/dist/cache/serializer/Deserializer.mjs +168 -171
  22. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  23. package/dist/cache/serializer/Serializer.cjs +137 -137
  24. package/dist/cache/serializer/Serializer.d.ts +39 -39
  25. package/dist/cache/serializer/Serializer.mjs +137 -137
  26. package/dist/cache/serializer/SerializerTypes.d.ts +102 -102
  27. package/dist/client/ClientApplication.cjs +335 -333
  28. package/dist/client/ClientApplication.cjs.map +1 -1
  29. package/dist/client/ClientApplication.d.ts +143 -142
  30. package/dist/client/ClientApplication.d.ts.map +1 -1
  31. package/dist/client/ClientApplication.mjs +336 -334
  32. package/dist/client/ClientApplication.mjs.map +1 -1
  33. package/dist/client/ClientAssertion.cjs +116 -116
  34. package/dist/client/ClientAssertion.d.ts +46 -46
  35. package/dist/client/ClientAssertion.mjs +116 -116
  36. package/dist/client/ClientCredentialClient.cjs +194 -194
  37. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  38. package/dist/client/ClientCredentialClient.d.ts +33 -33
  39. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  40. package/dist/client/ClientCredentialClient.mjs +195 -195
  41. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  42. package/dist/client/ConfidentialClientApplication.cjs +166 -163
  43. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  44. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  45. package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
  46. package/dist/client/ConfidentialClientApplication.mjs +168 -165
  47. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  48. package/dist/client/DeviceCodeClient.cjs +207 -207
  49. package/dist/client/DeviceCodeClient.d.ts +53 -53
  50. package/dist/client/DeviceCodeClient.mjs +207 -207
  51. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  52. package/dist/client/IPublicClientApplication.d.ts +42 -42
  53. package/dist/client/ManagedIdentityApplication.cjs +75 -80
  54. package/dist/client/ManagedIdentityApplication.cjs.map +1 -1
  55. package/dist/client/ManagedIdentityApplication.d.ts +23 -23
  56. package/dist/client/ManagedIdentityApplication.d.ts.map +1 -1
  57. package/dist/client/ManagedIdentityApplication.mjs +76 -81
  58. package/dist/client/ManagedIdentityApplication.mjs.map +1 -1
  59. package/dist/client/ManagedIdentityClient.cjs +40 -36
  60. package/dist/client/ManagedIdentityClient.cjs.map +1 -1
  61. package/dist/client/ManagedIdentityClient.d.ts +19 -24
  62. package/dist/client/ManagedIdentityClient.d.ts.map +1 -1
  63. package/dist/client/ManagedIdentityClient.mjs +40 -36
  64. package/dist/client/ManagedIdentityClient.mjs.map +1 -1
  65. package/dist/client/ManagedIdentitySources/AppService.cjs +42 -69
  66. package/dist/client/ManagedIdentitySources/AppService.cjs.map +1 -1
  67. package/dist/client/ManagedIdentitySources/AppService.d.ts +16 -16
  68. package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
  69. package/dist/client/ManagedIdentitySources/AppService.mjs +43 -70
  70. package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -1
  71. package/dist/client/ManagedIdentitySources/AzureArc.cjs +81 -92
  72. package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +1 -1
  73. package/dist/client/ManagedIdentitySources/AzureArc.d.ts +18 -18
  74. package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
  75. package/dist/client/ManagedIdentitySources/AzureArc.mjs +84 -95
  76. package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -1
  77. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +116 -77
  78. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +1 -1
  79. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +30 -18
  80. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
  81. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +118 -80
  82. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
  83. package/dist/client/ManagedIdentitySources/CloudShell.cjs +47 -0
  84. package/dist/client/ManagedIdentitySources/CloudShell.cjs.map +1 -0
  85. package/dist/client/ManagedIdentitySources/CloudShell.d.ts +15 -6
  86. package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
  87. package/dist/client/ManagedIdentitySources/CloudShell.mjs +45 -0
  88. package/dist/client/ManagedIdentitySources/CloudShell.mjs.map +1 -0
  89. package/dist/client/ManagedIdentitySources/Imds.cjs +43 -52
  90. package/dist/client/ManagedIdentitySources/Imds.cjs.map +1 -1
  91. package/dist/client/ManagedIdentitySources/Imds.d.ts +12 -12
  92. package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
  93. package/dist/client/ManagedIdentitySources/Imds.mjs +44 -53
  94. package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
  95. package/dist/client/ManagedIdentitySources/ServiceFabric.cjs +61 -0
  96. package/dist/client/ManagedIdentitySources/ServiceFabric.cjs.map +1 -0
  97. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +16 -6
  98. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
  99. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +59 -0
  100. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs.map +1 -0
  101. package/dist/client/OnBehalfOfClient.cjs +202 -202
  102. package/dist/client/OnBehalfOfClient.cjs.map +1 -1
  103. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  104. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  105. package/dist/client/OnBehalfOfClient.mjs +203 -203
  106. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  107. package/dist/client/PublicClientApplication.cjs +229 -229
  108. package/dist/client/PublicClientApplication.d.ts +71 -71
  109. package/dist/client/PublicClientApplication.mjs +229 -229
  110. package/dist/client/UsernamePasswordClient.cjs +95 -95
  111. package/dist/client/UsernamePasswordClient.cjs.map +1 -1
  112. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  113. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  114. package/dist/client/UsernamePasswordClient.mjs +96 -96
  115. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  116. package/dist/config/Configuration.cjs +102 -86
  117. package/dist/config/Configuration.cjs.map +1 -1
  118. package/dist/config/Configuration.d.ts +126 -122
  119. package/dist/config/Configuration.d.ts.map +1 -1
  120. package/dist/config/Configuration.mjs +102 -86
  121. package/dist/config/Configuration.mjs.map +1 -1
  122. package/dist/config/ManagedIdentityId.cjs +48 -48
  123. package/dist/config/ManagedIdentityId.d.ts +11 -11
  124. package/dist/config/ManagedIdentityId.mjs +48 -48
  125. package/dist/config/ManagedIdentityRequestParameters.cjs +28 -29
  126. package/dist/config/ManagedIdentityRequestParameters.cjs.map +1 -1
  127. package/dist/config/ManagedIdentityRequestParameters.d.ts +11 -11
  128. package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
  129. package/dist/config/ManagedIdentityRequestParameters.mjs +28 -29
  130. package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
  131. package/dist/crypto/CryptoProvider.cjs +75 -75
  132. package/dist/crypto/CryptoProvider.d.ts +52 -52
  133. package/dist/crypto/CryptoProvider.mjs +75 -75
  134. package/dist/crypto/GuidGenerator.cjs +22 -22
  135. package/dist/crypto/GuidGenerator.d.ts +14 -14
  136. package/dist/crypto/GuidGenerator.mjs +22 -22
  137. package/dist/crypto/HashUtils.cjs +13 -13
  138. package/dist/crypto/HashUtils.d.ts +8 -8
  139. package/dist/crypto/HashUtils.mjs +13 -13
  140. package/dist/crypto/PkceGenerator.cjs +49 -49
  141. package/dist/crypto/PkceGenerator.d.ts +22 -22
  142. package/dist/crypto/PkceGenerator.mjs +49 -49
  143. package/dist/error/ManagedIdentityError.cjs +38 -28
  144. package/dist/error/ManagedIdentityError.cjs.map +1 -1
  145. package/dist/error/ManagedIdentityError.d.ts +26 -21
  146. package/dist/error/ManagedIdentityError.d.ts.map +1 -1
  147. package/dist/error/ManagedIdentityError.mjs +39 -29
  148. package/dist/error/ManagedIdentityError.mjs.map +1 -1
  149. package/dist/error/ManagedIdentityErrorCodes.cjs +26 -15
  150. package/dist/error/ManagedIdentityErrorCodes.cjs.map +1 -1
  151. package/dist/error/ManagedIdentityErrorCodes.d.ts +18 -9
  152. package/dist/error/ManagedIdentityErrorCodes.d.ts.map +1 -1
  153. package/dist/error/ManagedIdentityErrorCodes.mjs +23 -14
  154. package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -1
  155. package/dist/error/NodeAuthError.cjs +85 -85
  156. package/dist/error/NodeAuthError.d.ts +65 -65
  157. package/dist/error/NodeAuthError.mjs +85 -85
  158. package/dist/index.cjs +21 -21
  159. package/dist/index.d.ts +44 -44
  160. package/dist/index.d.ts.map +1 -1
  161. package/dist/index.mjs +1 -1
  162. package/dist/internals.cjs +8 -8
  163. package/dist/internals.d.ts +6 -6
  164. package/dist/internals.mjs +8 -8
  165. package/dist/network/HttpClient.cjs +281 -283
  166. package/dist/network/HttpClient.cjs.map +1 -1
  167. package/dist/network/HttpClient.d.ts +25 -26
  168. package/dist/network/HttpClient.d.ts.map +1 -1
  169. package/dist/network/HttpClient.mjs +281 -283
  170. package/dist/network/HttpClient.mjs.map +1 -1
  171. package/dist/network/HttpClientWithRetries.cjs +44 -0
  172. package/dist/network/HttpClientWithRetries.cjs.map +1 -0
  173. package/dist/network/HttpClientWithRetries.d.ts +12 -0
  174. package/dist/network/HttpClientWithRetries.d.ts.map +1 -0
  175. package/dist/network/HttpClientWithRetries.mjs +42 -0
  176. package/dist/network/HttpClientWithRetries.mjs.map +1 -0
  177. package/dist/network/ILoopbackClient.d.ts +10 -10
  178. package/dist/network/LoopbackClient.cjs +77 -77
  179. package/dist/network/LoopbackClient.d.ts +21 -21
  180. package/dist/network/LoopbackClient.mjs +77 -77
  181. package/dist/packageMetadata.cjs +4 -4
  182. package/dist/packageMetadata.d.ts +2 -2
  183. package/dist/packageMetadata.mjs +4 -4
  184. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  185. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  186. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  187. package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
  188. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  189. package/dist/request/InteractiveRequest.d.ts +22 -22
  190. package/dist/request/ManagedIdentityRequest.d.ts +8 -8
  191. package/dist/request/ManagedIdentityRequestParams.d.ts +9 -9
  192. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  193. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  194. package/dist/request/SignOutRequest.d.ts +5 -5
  195. package/dist/request/SilentFlowRequest.d.ts +16 -16
  196. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  197. package/dist/response/ManagedIdentityTokenResponse.d.ts +24 -24
  198. package/dist/retry/IHttpRetryPolicy.d.ts +6 -0
  199. package/dist/retry/IHttpRetryPolicy.d.ts.map +1 -0
  200. package/dist/retry/LinearRetryPolicy.cjs +47 -0
  201. package/dist/retry/LinearRetryPolicy.cjs.map +1 -0
  202. package/dist/retry/LinearRetryPolicy.d.ts +12 -0
  203. package/dist/retry/LinearRetryPolicy.d.ts.map +1 -0
  204. package/dist/retry/LinearRetryPolicy.mjs +45 -0
  205. package/dist/retry/LinearRetryPolicy.mjs.map +1 -0
  206. package/dist/utils/Constants.cjs +142 -103
  207. package/dist/utils/Constants.cjs.map +1 -1
  208. package/dist/utils/Constants.d.ts +132 -106
  209. package/dist/utils/Constants.d.ts.map +1 -1
  210. package/dist/utils/Constants.mjs +134 -100
  211. package/dist/utils/Constants.mjs.map +1 -1
  212. package/dist/utils/EncodingUtils.cjs +44 -44
  213. package/dist/utils/EncodingUtils.d.ts +26 -26
  214. package/dist/utils/EncodingUtils.mjs +44 -44
  215. package/dist/utils/NetworkUtils.cjs +38 -38
  216. package/dist/utils/NetworkUtils.d.ts +5 -5
  217. package/dist/utils/NetworkUtils.mjs +38 -38
  218. package/package.json +5 -5
  219. package/src/cache/NodeStorage.ts +4 -9
  220. package/src/cache/serializer/Deserializer.ts +1 -5
  221. package/src/client/ClientApplication.ts +24 -10
  222. package/src/client/ClientCredentialClient.ts +14 -6
  223. package/src/client/ConfidentialClientApplication.ts +10 -5
  224. package/src/client/ManagedIdentityApplication.ts +8 -16
  225. package/src/client/ManagedIdentityClient.ts +23 -11
  226. package/src/client/ManagedIdentitySources/AppService.ts +68 -97
  227. package/src/client/ManagedIdentitySources/AzureArc.ts +59 -68
  228. package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +82 -11
  229. package/src/client/ManagedIdentitySources/CloudShell.ts +93 -8
  230. package/src/client/ManagedIdentitySources/Imds.ts +54 -40
  231. package/src/client/ManagedIdentitySources/ServiceFabric.ts +126 -5
  232. package/src/client/OnBehalfOfClient.ts +18 -7
  233. package/src/client/UsernamePasswordClient.ts +16 -7
  234. package/src/config/Configuration.ts +50 -18
  235. package/src/config/ManagedIdentityRequestParameters.ts +1 -6
  236. package/src/error/ManagedIdentityError.ts +15 -4
  237. package/src/error/ManagedIdentityErrorCodes.ts +19 -1
  238. package/src/index.ts +1 -0
  239. package/src/network/HttpClient.ts +27 -39
  240. package/src/network/HttpClientWithRetries.ts +80 -0
  241. package/src/packageMetadata.ts +1 -1
  242. package/src/request/ClientCredentialRequest.ts +6 -3
  243. package/src/retry/IHttpRetryPolicy.ts +18 -0
  244. package/src/retry/LinearRetryPolicy.ts +71 -0
  245. package/src/utils/Constants.ts +47 -10
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
1
+ /*! @azure/msal-node v2.7.1-alpha.0 2024-05-01 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -7,80 +7,80 @@ var EncodingUtils = require('../utils/EncodingUtils.cjs');
7
7
  var PkceGenerator = require('./PkceGenerator.cjs');
8
8
  var HashUtils = require('./HashUtils.cjs');
9
9
 
10
- /*
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License.
13
- */
14
- /**
15
- * This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
16
- * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
17
- * @public
18
- */
19
- class CryptoProvider {
20
- constructor() {
21
- // Browser crypto needs to be validated first before any other classes can be set.
22
- this.pkceGenerator = new PkceGenerator.PkceGenerator();
23
- this.guidGenerator = new GuidGenerator.GuidGenerator();
24
- this.hashUtils = new HashUtils.HashUtils();
25
- }
26
- /**
27
- * Creates a new random GUID - used to populate state and nonce.
28
- * @returns string (GUID)
29
- */
30
- createNewGuid() {
31
- return this.guidGenerator.generateGuid();
32
- }
33
- /**
34
- * Encodes input string to base64.
35
- * @param input - string to be encoded
36
- */
37
- base64Encode(input) {
38
- return EncodingUtils.EncodingUtils.base64Encode(input);
39
- }
40
- /**
41
- * Decodes input string from base64.
42
- * @param input - string to be decoded
43
- */
44
- base64Decode(input) {
45
- return EncodingUtils.EncodingUtils.base64Decode(input);
46
- }
47
- /**
48
- * Generates PKCE codes used in Authorization Code Flow.
49
- */
50
- generatePkceCodes() {
51
- return this.pkceGenerator.generatePkceCodes();
52
- }
53
- /**
54
- * Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
55
- */
56
- getPublicKeyThumbprint() {
57
- throw new Error("Method not implemented.");
58
- }
59
- /**
60
- * Removes cryptographic keypair from key store matching the keyId passed in
61
- * @param kid
62
- */
63
- removeTokenBindingKey() {
64
- throw new Error("Method not implemented.");
65
- }
66
- /**
67
- * Removes all cryptographic keys from Keystore
68
- */
69
- clearKeystore() {
70
- throw new Error("Method not implemented.");
71
- }
72
- /**
73
- * Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
74
- */
75
- signJwt() {
76
- throw new Error("Method not implemented.");
77
- }
78
- /**
79
- * Returns the SHA-256 hash of an input string
80
- */
81
- async hashString(plainText) {
82
- return EncodingUtils.EncodingUtils.base64EncodeUrl(this.hashUtils.sha256(plainText).toString("base64"), "base64");
83
- }
10
+ /*
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Licensed under the MIT License.
13
+ */
14
+ /**
15
+ * This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
16
+ * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
17
+ * @public
18
+ */
19
+ class CryptoProvider {
20
+ constructor() {
21
+ // Browser crypto needs to be validated first before any other classes can be set.
22
+ this.pkceGenerator = new PkceGenerator.PkceGenerator();
23
+ this.guidGenerator = new GuidGenerator.GuidGenerator();
24
+ this.hashUtils = new HashUtils.HashUtils();
25
+ }
26
+ /**
27
+ * Creates a new random GUID - used to populate state and nonce.
28
+ * @returns string (GUID)
29
+ */
30
+ createNewGuid() {
31
+ return this.guidGenerator.generateGuid();
32
+ }
33
+ /**
34
+ * Encodes input string to base64.
35
+ * @param input - string to be encoded
36
+ */
37
+ base64Encode(input) {
38
+ return EncodingUtils.EncodingUtils.base64Encode(input);
39
+ }
40
+ /**
41
+ * Decodes input string from base64.
42
+ * @param input - string to be decoded
43
+ */
44
+ base64Decode(input) {
45
+ return EncodingUtils.EncodingUtils.base64Decode(input);
46
+ }
47
+ /**
48
+ * Generates PKCE codes used in Authorization Code Flow.
49
+ */
50
+ generatePkceCodes() {
51
+ return this.pkceGenerator.generatePkceCodes();
52
+ }
53
+ /**
54
+ * Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
55
+ */
56
+ getPublicKeyThumbprint() {
57
+ throw new Error("Method not implemented.");
58
+ }
59
+ /**
60
+ * Removes cryptographic keypair from key store matching the keyId passed in
61
+ * @param kid
62
+ */
63
+ removeTokenBindingKey() {
64
+ throw new Error("Method not implemented.");
65
+ }
66
+ /**
67
+ * Removes all cryptographic keys from Keystore
68
+ */
69
+ clearKeystore() {
70
+ throw new Error("Method not implemented.");
71
+ }
72
+ /**
73
+ * Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
74
+ */
75
+ signJwt() {
76
+ throw new Error("Method not implemented.");
77
+ }
78
+ /**
79
+ * Returns the SHA-256 hash of an input string
80
+ */
81
+ async hashString(plainText) {
82
+ return EncodingUtils.EncodingUtils.base64EncodeUrl(this.hashUtils.sha256(plainText).toString("base64"), "base64");
83
+ }
84
84
  }
85
85
 
86
86
  exports.CryptoProvider = CryptoProvider;
@@ -1,53 +1,53 @@
1
- import { ICrypto, PkceCodes } from "@azure/msal-common";
2
- /**
3
- * This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
4
- * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
5
- * @public
6
- */
7
- export declare class CryptoProvider implements ICrypto {
8
- private pkceGenerator;
9
- private guidGenerator;
10
- private hashUtils;
11
- constructor();
12
- /**
13
- * Creates a new random GUID - used to populate state and nonce.
14
- * @returns string (GUID)
15
- */
16
- createNewGuid(): string;
17
- /**
18
- * Encodes input string to base64.
19
- * @param input - string to be encoded
20
- */
21
- base64Encode(input: string): string;
22
- /**
23
- * Decodes input string from base64.
24
- * @param input - string to be decoded
25
- */
26
- base64Decode(input: string): string;
27
- /**
28
- * Generates PKCE codes used in Authorization Code Flow.
29
- */
30
- generatePkceCodes(): Promise<PkceCodes>;
31
- /**
32
- * Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
33
- */
34
- getPublicKeyThumbprint(): Promise<string>;
35
- /**
36
- * Removes cryptographic keypair from key store matching the keyId passed in
37
- * @param kid
38
- */
39
- removeTokenBindingKey(): Promise<boolean>;
40
- /**
41
- * Removes all cryptographic keys from Keystore
42
- */
43
- clearKeystore(): Promise<boolean>;
44
- /**
45
- * Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
46
- */
47
- signJwt(): Promise<string>;
48
- /**
49
- * Returns the SHA-256 hash of an input string
50
- */
51
- hashString(plainText: string): Promise<string>;
52
- }
1
+ import { ICrypto, PkceCodes } from "@azure/msal-common";
2
+ /**
3
+ * This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
4
+ * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
5
+ * @public
6
+ */
7
+ export declare class CryptoProvider implements ICrypto {
8
+ private pkceGenerator;
9
+ private guidGenerator;
10
+ private hashUtils;
11
+ constructor();
12
+ /**
13
+ * Creates a new random GUID - used to populate state and nonce.
14
+ * @returns string (GUID)
15
+ */
16
+ createNewGuid(): string;
17
+ /**
18
+ * Encodes input string to base64.
19
+ * @param input - string to be encoded
20
+ */
21
+ base64Encode(input: string): string;
22
+ /**
23
+ * Decodes input string from base64.
24
+ * @param input - string to be decoded
25
+ */
26
+ base64Decode(input: string): string;
27
+ /**
28
+ * Generates PKCE codes used in Authorization Code Flow.
29
+ */
30
+ generatePkceCodes(): Promise<PkceCodes>;
31
+ /**
32
+ * Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
33
+ */
34
+ getPublicKeyThumbprint(): Promise<string>;
35
+ /**
36
+ * Removes cryptographic keypair from key store matching the keyId passed in
37
+ * @param kid
38
+ */
39
+ removeTokenBindingKey(): Promise<boolean>;
40
+ /**
41
+ * Removes all cryptographic keys from Keystore
42
+ */
43
+ clearKeystore(): Promise<boolean>;
44
+ /**
45
+ * Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
46
+ */
47
+ signJwt(): Promise<string>;
48
+ /**
49
+ * Returns the SHA-256 hash of an input string
50
+ */
51
+ hashString(plainText: string): Promise<string>;
52
+ }
53
53
  //# sourceMappingURL=CryptoProvider.d.ts.map
@@ -1,84 +1,84 @@
1
- /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
1
+ /*! @azure/msal-node v2.7.1-alpha.0 2024-05-01 */
2
2
  'use strict';
3
3
  import { GuidGenerator } from './GuidGenerator.mjs';
4
4
  import { EncodingUtils } from '../utils/EncodingUtils.mjs';
5
5
  import { PkceGenerator } from './PkceGenerator.mjs';
6
6
  import { HashUtils } from './HashUtils.mjs';
7
7
 
8
- /*
9
- * Copyright (c) Microsoft Corporation. All rights reserved.
10
- * Licensed under the MIT License.
11
- */
12
- /**
13
- * This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
14
- * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
15
- * @public
16
- */
17
- class CryptoProvider {
18
- constructor() {
19
- // Browser crypto needs to be validated first before any other classes can be set.
20
- this.pkceGenerator = new PkceGenerator();
21
- this.guidGenerator = new GuidGenerator();
22
- this.hashUtils = new HashUtils();
23
- }
24
- /**
25
- * Creates a new random GUID - used to populate state and nonce.
26
- * @returns string (GUID)
27
- */
28
- createNewGuid() {
29
- return this.guidGenerator.generateGuid();
30
- }
31
- /**
32
- * Encodes input string to base64.
33
- * @param input - string to be encoded
34
- */
35
- base64Encode(input) {
36
- return EncodingUtils.base64Encode(input);
37
- }
38
- /**
39
- * Decodes input string from base64.
40
- * @param input - string to be decoded
41
- */
42
- base64Decode(input) {
43
- return EncodingUtils.base64Decode(input);
44
- }
45
- /**
46
- * Generates PKCE codes used in Authorization Code Flow.
47
- */
48
- generatePkceCodes() {
49
- return this.pkceGenerator.generatePkceCodes();
50
- }
51
- /**
52
- * Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
53
- */
54
- getPublicKeyThumbprint() {
55
- throw new Error("Method not implemented.");
56
- }
57
- /**
58
- * Removes cryptographic keypair from key store matching the keyId passed in
59
- * @param kid
60
- */
61
- removeTokenBindingKey() {
62
- throw new Error("Method not implemented.");
63
- }
64
- /**
65
- * Removes all cryptographic keys from Keystore
66
- */
67
- clearKeystore() {
68
- throw new Error("Method not implemented.");
69
- }
70
- /**
71
- * Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
72
- */
73
- signJwt() {
74
- throw new Error("Method not implemented.");
75
- }
76
- /**
77
- * Returns the SHA-256 hash of an input string
78
- */
79
- async hashString(plainText) {
80
- return EncodingUtils.base64EncodeUrl(this.hashUtils.sha256(plainText).toString("base64"), "base64");
81
- }
8
+ /*
9
+ * Copyright (c) Microsoft Corporation. All rights reserved.
10
+ * Licensed under the MIT License.
11
+ */
12
+ /**
13
+ * This class implements MSAL node's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
14
+ * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
15
+ * @public
16
+ */
17
+ class CryptoProvider {
18
+ constructor() {
19
+ // Browser crypto needs to be validated first before any other classes can be set.
20
+ this.pkceGenerator = new PkceGenerator();
21
+ this.guidGenerator = new GuidGenerator();
22
+ this.hashUtils = new HashUtils();
23
+ }
24
+ /**
25
+ * Creates a new random GUID - used to populate state and nonce.
26
+ * @returns string (GUID)
27
+ */
28
+ createNewGuid() {
29
+ return this.guidGenerator.generateGuid();
30
+ }
31
+ /**
32
+ * Encodes input string to base64.
33
+ * @param input - string to be encoded
34
+ */
35
+ base64Encode(input) {
36
+ return EncodingUtils.base64Encode(input);
37
+ }
38
+ /**
39
+ * Decodes input string from base64.
40
+ * @param input - string to be decoded
41
+ */
42
+ base64Decode(input) {
43
+ return EncodingUtils.base64Decode(input);
44
+ }
45
+ /**
46
+ * Generates PKCE codes used in Authorization Code Flow.
47
+ */
48
+ generatePkceCodes() {
49
+ return this.pkceGenerator.generatePkceCodes();
50
+ }
51
+ /**
52
+ * Generates a keypair, stores it and returns a thumbprint - not yet implemented for node
53
+ */
54
+ getPublicKeyThumbprint() {
55
+ throw new Error("Method not implemented.");
56
+ }
57
+ /**
58
+ * Removes cryptographic keypair from key store matching the keyId passed in
59
+ * @param kid
60
+ */
61
+ removeTokenBindingKey() {
62
+ throw new Error("Method not implemented.");
63
+ }
64
+ /**
65
+ * Removes all cryptographic keys from Keystore
66
+ */
67
+ clearKeystore() {
68
+ throw new Error("Method not implemented.");
69
+ }
70
+ /**
71
+ * Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
72
+ */
73
+ signJwt() {
74
+ throw new Error("Method not implemented.");
75
+ }
76
+ /**
77
+ * Returns the SHA-256 hash of an input string
78
+ */
79
+ async hashString(plainText) {
80
+ return EncodingUtils.base64EncodeUrl(this.hashUtils.sha256(plainText).toString("base64"), "base64");
81
+ }
82
82
  }
83
83
 
84
84
  export { CryptoProvider };
@@ -1,30 +1,30 @@
1
- /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
1
+ /*! @azure/msal-node v2.7.1-alpha.0 2024-05-01 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
5
  var uuid = require('uuid');
6
6
 
7
- /*
8
- * Copyright (c) Microsoft Corporation. All rights reserved.
9
- * Licensed under the MIT License.
10
- */
11
- class GuidGenerator {
12
- /**
13
- *
14
- * RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or pseudo-random numbers.
15
- * uuidv4 generates guids from cryprtographically-string random
16
- */
17
- generateGuid() {
18
- return uuid.v4();
19
- }
20
- /**
21
- * verifies if a string is GUID
22
- * @param guid
23
- */
24
- isGuid(guid) {
25
- const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
26
- return regexGuid.test(guid);
27
- }
7
+ /*
8
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9
+ * Licensed under the MIT License.
10
+ */
11
+ class GuidGenerator {
12
+ /**
13
+ *
14
+ * RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or pseudo-random numbers.
15
+ * uuidv4 generates guids from cryprtographically-string random
16
+ */
17
+ generateGuid() {
18
+ return uuid.v4();
19
+ }
20
+ /**
21
+ * verifies if a string is GUID
22
+ * @param guid
23
+ */
24
+ isGuid(guid) {
25
+ const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
26
+ return regexGuid.test(guid);
27
+ }
28
28
  }
29
29
 
30
30
  exports.GuidGenerator = GuidGenerator;
@@ -1,15 +1,15 @@
1
- import { IGuidGenerator } from "@azure/msal-common";
2
- export declare class GuidGenerator implements IGuidGenerator {
3
- /**
4
- *
5
- * RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or pseudo-random numbers.
6
- * uuidv4 generates guids from cryprtographically-string random
7
- */
8
- generateGuid(): string;
9
- /**
10
- * verifies if a string is GUID
11
- * @param guid
12
- */
13
- isGuid(guid: string): boolean;
14
- }
1
+ import { IGuidGenerator } from "@azure/msal-common";
2
+ export declare class GuidGenerator implements IGuidGenerator {
3
+ /**
4
+ *
5
+ * RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or pseudo-random numbers.
6
+ * uuidv4 generates guids from cryprtographically-string random
7
+ */
8
+ generateGuid(): string;
9
+ /**
10
+ * verifies if a string is GUID
11
+ * @param guid
12
+ */
13
+ isGuid(guid: string): boolean;
14
+ }
15
15
  //# sourceMappingURL=GuidGenerator.d.ts.map
@@ -1,28 +1,28 @@
1
- /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
1
+ /*! @azure/msal-node v2.7.1-alpha.0 2024-05-01 */
2
2
  'use strict';
3
3
  import { v4 } from 'uuid';
4
4
 
5
- /*
6
- * Copyright (c) Microsoft Corporation. All rights reserved.
7
- * Licensed under the MIT License.
8
- */
9
- class GuidGenerator {
10
- /**
11
- *
12
- * RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or pseudo-random numbers.
13
- * uuidv4 generates guids from cryprtographically-string random
14
- */
15
- generateGuid() {
16
- return v4();
17
- }
18
- /**
19
- * verifies if a string is GUID
20
- * @param guid
21
- */
22
- isGuid(guid) {
23
- const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
24
- return regexGuid.test(guid);
25
- }
5
+ /*
6
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7
+ * Licensed under the MIT License.
8
+ */
9
+ class GuidGenerator {
10
+ /**
11
+ *
12
+ * RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or pseudo-random numbers.
13
+ * uuidv4 generates guids from cryprtographically-string random
14
+ */
15
+ generateGuid() {
16
+ return v4();
17
+ }
18
+ /**
19
+ * verifies if a string is GUID
20
+ * @param guid
21
+ */
22
+ isGuid(guid) {
23
+ const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
24
+ return regexGuid.test(guid);
25
+ }
26
26
  }
27
27
 
28
28
  export { GuidGenerator };
@@ -1,22 +1,22 @@
1
- /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
1
+ /*! @azure/msal-node v2.7.1-alpha.0 2024-05-01 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
5
  var Constants = require('../utils/Constants.cjs');
6
6
  var crypto = require('crypto');
7
7
 
8
- /*
9
- * Copyright (c) Microsoft Corporation. All rights reserved.
10
- * Licensed under the MIT License.
11
- */
12
- class HashUtils {
13
- /**
14
- * generate 'SHA256' hash
15
- * @param buffer
16
- */
17
- sha256(buffer) {
18
- return crypto.createHash(Constants.Hash.SHA256).update(buffer).digest();
19
- }
8
+ /*
9
+ * Copyright (c) Microsoft Corporation. All rights reserved.
10
+ * Licensed under the MIT License.
11
+ */
12
+ class HashUtils {
13
+ /**
14
+ * generate 'SHA256' hash
15
+ * @param buffer
16
+ */
17
+ sha256(buffer) {
18
+ return crypto.createHash(Constants.Hash.SHA256).update(buffer).digest();
19
+ }
20
20
  }
21
21
 
22
22
  exports.HashUtils = HashUtils;
@@ -1,9 +1,9 @@
1
- /// <reference types="node" />
2
- export declare class HashUtils {
3
- /**
4
- * generate 'SHA256' hash
5
- * @param buffer
6
- */
7
- sha256(buffer: string): Buffer;
8
- }
1
+ /// <reference types="node" />
2
+ export declare class HashUtils {
3
+ /**
4
+ * generate 'SHA256' hash
5
+ * @param buffer
6
+ */
7
+ sha256(buffer: string): Buffer;
8
+ }
9
9
  //# sourceMappingURL=HashUtils.d.ts.map
@@ -1,20 +1,20 @@
1
- /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
1
+ /*! @azure/msal-node v2.7.1-alpha.0 2024-05-01 */
2
2
  'use strict';
3
3
  import { Hash } from '../utils/Constants.mjs';
4
4
  import crypto from 'crypto';
5
5
 
6
- /*
7
- * Copyright (c) Microsoft Corporation. All rights reserved.
8
- * Licensed under the MIT License.
9
- */
10
- class HashUtils {
11
- /**
12
- * generate 'SHA256' hash
13
- * @param buffer
14
- */
15
- sha256(buffer) {
16
- return crypto.createHash(Hash.SHA256).update(buffer).digest();
17
- }
6
+ /*
7
+ * Copyright (c) Microsoft Corporation. All rights reserved.
8
+ * Licensed under the MIT License.
9
+ */
10
+ class HashUtils {
11
+ /**
12
+ * generate 'SHA256' hash
13
+ * @param buffer
14
+ */
15
+ sha256(buffer) {
16
+ return crypto.createHash(Hash.SHA256).update(buffer).digest();
17
+ }
18
18
  }
19
19
 
20
20
  export { HashUtils };