@azure/msal-node 2.6.0 → 2.7.0-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.
- package/dist/cache/ITokenCache.d.ts +15 -15
- package/dist/cache/NodeStorage.cjs +423 -423
- package/dist/cache/NodeStorage.cjs.map +1 -1
- package/dist/cache/NodeStorage.d.ts +193 -193
- package/dist/cache/NodeStorage.d.ts.map +1 -1
- package/dist/cache/NodeStorage.mjs +424 -424
- package/dist/cache/NodeStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.cjs +265 -265
- package/dist/cache/TokenCache.d.ts +90 -90
- package/dist/cache/TokenCache.mjs +265 -265
- package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
- package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
- package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
- package/dist/cache/distributed/ICacheClient.d.ts +17 -17
- package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
- package/dist/cache/serializer/Deserializer.cjs +170 -170
- package/dist/cache/serializer/Deserializer.d.ts +42 -42
- package/dist/cache/serializer/Deserializer.mjs +170 -170
- package/dist/cache/serializer/Serializer.cjs +137 -137
- package/dist/cache/serializer/Serializer.d.ts +39 -39
- package/dist/cache/serializer/Serializer.mjs +137 -137
- package/dist/cache/serializer/SerializerTypes.d.ts +102 -102
- package/dist/client/ClientApplication.cjs +333 -333
- package/dist/client/ClientApplication.d.ts +142 -142
- package/dist/client/ClientApplication.mjs +333 -333
- package/dist/client/ClientAssertion.cjs +116 -116
- package/dist/client/ClientAssertion.d.ts +46 -46
- package/dist/client/ClientAssertion.mjs +116 -116
- package/dist/client/ClientCredentialClient.cjs +194 -190
- package/dist/client/ClientCredentialClient.cjs.map +1 -1
- package/dist/client/ClientCredentialClient.d.ts +33 -33
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +195 -191
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.cjs +163 -163
- package/dist/client/ConfidentialClientApplication.d.ts +58 -58
- package/dist/client/ConfidentialClientApplication.mjs +163 -163
- package/dist/client/DeviceCodeClient.cjs +207 -207
- package/dist/client/DeviceCodeClient.d.ts +53 -53
- package/dist/client/DeviceCodeClient.mjs +207 -207
- package/dist/client/IConfidentialClientApplication.d.ts +39 -39
- package/dist/client/IPublicClientApplication.d.ts +42 -42
- package/dist/client/ManagedIdentityApplication.cjs +96 -0
- package/dist/client/ManagedIdentityApplication.cjs.map +1 -0
- package/dist/client/ManagedIdentityApplication.d.ts +24 -0
- package/dist/client/ManagedIdentityApplication.d.ts.map +1 -0
- package/dist/client/ManagedIdentityApplication.mjs +94 -0
- package/dist/client/ManagedIdentityApplication.mjs.map +1 -0
- package/dist/client/ManagedIdentityClient.cjs +49 -0
- package/dist/client/ManagedIdentityClient.cjs.map +1 -0
- package/dist/client/ManagedIdentityClient.d.ts +25 -0
- package/dist/client/ManagedIdentityClient.d.ts.map +1 -0
- package/dist/client/ManagedIdentityClient.mjs +47 -0
- package/dist/client/ManagedIdentityClient.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/AppService.cjs +79 -0
- package/dist/client/ManagedIdentitySources/AppService.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/AppService.d.ts +17 -0
- package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/AppService.mjs +77 -0
- package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/AzureArc.cjs +107 -0
- package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts +19 -0
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +104 -0
- package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +87 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +19 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +85 -0
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts +7 -0
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/Imds.cjs +63 -0
- package/dist/client/ManagedIdentitySources/Imds.cjs.map +1 -0
- package/dist/client/ManagedIdentitySources/Imds.d.ts +13 -0
- package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/Imds.mjs +61 -0
- package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +7 -0
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -0
- package/dist/client/OnBehalfOfClient.cjs +202 -202
- package/dist/client/OnBehalfOfClient.d.ts +47 -47
- package/dist/client/OnBehalfOfClient.mjs +202 -202
- package/dist/client/PublicClientApplication.cjs +229 -229
- package/dist/client/PublicClientApplication.d.ts +71 -71
- package/dist/client/PublicClientApplication.mjs +229 -229
- package/dist/client/UsernamePasswordClient.cjs +95 -95
- package/dist/client/UsernamePasswordClient.d.ts +25 -25
- package/dist/client/UsernamePasswordClient.mjs +95 -95
- package/dist/config/Configuration.cjs +88 -72
- package/dist/config/Configuration.cjs.map +1 -1
- package/dist/config/Configuration.d.ts +122 -107
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +88 -73
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/config/ManagedIdentityId.cjs +59 -0
- package/dist/config/ManagedIdentityId.cjs.map +1 -0
- package/dist/config/ManagedIdentityId.d.ts +12 -0
- package/dist/config/ManagedIdentityId.d.ts.map +1 -0
- package/dist/config/ManagedIdentityId.mjs +57 -0
- package/dist/config/ManagedIdentityId.mjs.map +1 -0
- package/dist/config/ManagedIdentityRequestParameters.cjs +38 -0
- package/dist/config/ManagedIdentityRequestParameters.cjs.map +1 -0
- package/dist/config/ManagedIdentityRequestParameters.d.ts +12 -0
- package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -0
- package/dist/config/ManagedIdentityRequestParameters.mjs +36 -0
- package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -0
- package/dist/crypto/CryptoProvider.cjs +75 -75
- package/dist/crypto/CryptoProvider.d.ts +52 -52
- package/dist/crypto/CryptoProvider.mjs +75 -75
- package/dist/crypto/GuidGenerator.cjs +22 -22
- package/dist/crypto/GuidGenerator.d.ts +14 -14
- package/dist/crypto/GuidGenerator.mjs +22 -22
- package/dist/crypto/HashUtils.cjs +13 -13
- package/dist/crypto/HashUtils.d.ts +8 -8
- package/dist/crypto/HashUtils.mjs +13 -13
- package/dist/crypto/PkceGenerator.cjs +49 -49
- package/dist/crypto/PkceGenerator.d.ts +22 -22
- package/dist/crypto/PkceGenerator.mjs +49 -49
- package/dist/error/ManagedIdentityError.cjs +40 -0
- package/dist/error/ManagedIdentityError.cjs.map +1 -0
- package/dist/error/ManagedIdentityError.d.ts +22 -0
- package/dist/error/ManagedIdentityError.d.ts.map +1 -0
- package/dist/error/ManagedIdentityError.mjs +36 -0
- package/dist/error/ManagedIdentityError.mjs.map +1 -0
- package/dist/error/ManagedIdentityErrorCodes.cjs +28 -0
- package/dist/error/ManagedIdentityErrorCodes.cjs.map +1 -0
- package/dist/error/ManagedIdentityErrorCodes.d.ts +10 -0
- package/dist/error/ManagedIdentityErrorCodes.d.ts.map +1 -0
- package/dist/error/ManagedIdentityErrorCodes.mjs +18 -0
- package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -0
- package/dist/error/NodeAuthError.cjs +85 -85
- package/dist/error/NodeAuthError.d.ts +65 -65
- package/dist/error/NodeAuthError.mjs +85 -85
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +44 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internals.cjs +8 -8
- package/dist/internals.d.ts +6 -6
- package/dist/internals.mjs +8 -8
- package/dist/network/HttpClient.cjs +283 -276
- package/dist/network/HttpClient.cjs.map +1 -1
- package/dist/network/HttpClient.d.ts +26 -25
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/network/HttpClient.mjs +283 -276
- package/dist/network/HttpClient.mjs.map +1 -1
- package/dist/network/ILoopbackClient.d.ts +10 -10
- package/dist/network/LoopbackClient.cjs +77 -77
- package/dist/network/LoopbackClient.d.ts +21 -21
- package/dist/network/LoopbackClient.mjs +77 -77
- package/dist/packageMetadata.cjs +4 -4
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +4 -4
- package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
- package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
- package/dist/request/ClientCredentialRequest.d.ts +14 -14
- package/dist/request/DeviceCodeRequest.d.ts +15 -15
- package/dist/request/InteractiveRequest.d.ts +22 -22
- package/dist/request/ManagedIdentityRequest.d.ts +9 -0
- package/dist/request/ManagedIdentityRequest.d.ts.map +1 -0
- package/dist/request/ManagedIdentityRequestParams.d.ts +10 -0
- package/dist/request/ManagedIdentityRequestParams.d.ts.map +1 -0
- package/dist/request/OnBehalfOfRequest.d.ts +14 -14
- package/dist/request/RefreshTokenRequest.d.ts +17 -17
- package/dist/request/SignOutRequest.d.ts +5 -5
- package/dist/request/SilentFlowRequest.d.ts +16 -16
- package/dist/request/UsernamePasswordRequest.d.ts +19 -19
- package/dist/response/ManagedIdentityTokenResponse.d.ts +25 -0
- package/dist/response/ManagedIdentityTokenResponse.d.ts.map +1 -0
- package/dist/utils/Constants.cjs +109 -80
- package/dist/utils/Constants.cjs.map +1 -1
- package/dist/utils/Constants.d.ts +106 -86
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +100 -81
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/EncodingUtils.cjs +44 -44
- package/dist/utils/EncodingUtils.d.ts +26 -26
- package/dist/utils/EncodingUtils.mjs +44 -44
- package/dist/utils/NetworkUtils.cjs +38 -38
- package/dist/utils/NetworkUtils.d.ts +5 -5
- package/dist/utils/NetworkUtils.mjs +38 -38
- package/package.json +3 -3
- package/src/cache/NodeStorage.ts +1 -4
- package/src/client/ClientCredentialClient.ts +65 -25
- package/src/client/ManagedIdentityApplication.ts +194 -0
- package/src/client/ManagedIdentityClient.ts +111 -0
- package/src/client/ManagedIdentitySources/AppService.ts +151 -0
- package/src/client/ManagedIdentitySources/AzureArc.ts +208 -0
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +169 -0
- package/src/client/ManagedIdentitySources/CloudShell.ts +19 -0
- package/src/client/ManagedIdentitySources/Imds.ts +112 -0
- package/src/client/ManagedIdentitySources/ServiceFabric.ts +19 -0
- package/src/config/Configuration.ts +47 -1
- package/src/config/ManagedIdentityId.ts +73 -0
- package/src/config/ManagedIdentityRequestParameters.ts +53 -0
- package/src/error/ManagedIdentityError.ts +46 -0
- package/src/error/ManagedIdentityErrorCodes.ts +15 -0
- package/src/index.ts +4 -0
- package/src/network/HttpClient.ts +17 -5
- package/src/packageMetadata.ts +1 -1
- package/src/request/ManagedIdentityRequest.ts +15 -0
- package/src/request/ManagedIdentityRequestParams.ts +14 -0
- package/src/response/ManagedIdentityTokenResponse.ts +33 -0
- package/src/utils/Constants.ts +27 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.
|
|
1
|
+
/*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { HttpStatus } from '@azure/msal-common';
|
|
4
4
|
import { ProxyStatus, Constants, HttpMethod } from '../utils/Constants.mjs';
|
|
@@ -6,281 +6,288 @@ import { NetworkUtils } from '../utils/NetworkUtils.mjs';
|
|
|
6
6
|
import http from 'http';
|
|
7
7
|
import https from 'https';
|
|
8
8
|
|
|
9
|
-
/*
|
|
10
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11
|
-
* Licensed under the MIT License.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* This class implements the API for network requests.
|
|
15
|
-
*/
|
|
16
|
-
class HttpClient {
|
|
17
|
-
constructor(proxyUrl, customAgentOptions) {
|
|
18
|
-
this.proxyUrl = proxyUrl || "";
|
|
19
|
-
this.customAgentOptions = customAgentOptions || {};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
* @param
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
* @param
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
socket.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
.
|
|
123
|
-
.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
if
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
const
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
9
|
+
/*
|
|
10
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11
|
+
* Licensed under the MIT License.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* This class implements the API for network requests.
|
|
15
|
+
*/
|
|
16
|
+
class HttpClient {
|
|
17
|
+
constructor(proxyUrl, customAgentOptions, managedIdentity) {
|
|
18
|
+
this.proxyUrl = proxyUrl || "";
|
|
19
|
+
this.customAgentOptions = customAgentOptions || {};
|
|
20
|
+
this.managedIdentity = managedIdentity || false;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Http Get request
|
|
24
|
+
* @param url
|
|
25
|
+
* @param options
|
|
26
|
+
*/
|
|
27
|
+
async sendGetRequestAsync(url, options) {
|
|
28
|
+
if (this.proxyUrl) {
|
|
29
|
+
return networkRequestViaProxy(url, this.proxyUrl, HttpMethod.GET, options, this.customAgentOptions);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return networkRequestViaHttps(url, HttpMethod.GET, options, this.customAgentOptions, undefined, this.managedIdentity);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Http Post request
|
|
37
|
+
* @param url
|
|
38
|
+
* @param options
|
|
39
|
+
*/
|
|
40
|
+
async sendPostRequestAsync(url, options, cancellationToken) {
|
|
41
|
+
if (this.proxyUrl) {
|
|
42
|
+
return networkRequestViaProxy(url, this.proxyUrl, HttpMethod.POST, options, this.customAgentOptions, cancellationToken);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return networkRequestViaHttps(url, HttpMethod.POST, options, this.customAgentOptions, cancellationToken, this.managedIdentity);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const networkRequestViaProxy = (destinationUrlString, proxyUrlString, httpMethod, options, agentOptions, timeout) => {
|
|
50
|
+
const destinationUrl = new URL(destinationUrlString);
|
|
51
|
+
const proxyUrl = new URL(proxyUrlString);
|
|
52
|
+
// "method: connect" must be used to establish a connection to the proxy
|
|
53
|
+
const headers = options?.headers || {};
|
|
54
|
+
const tunnelRequestOptions = {
|
|
55
|
+
host: proxyUrl.hostname,
|
|
56
|
+
port: proxyUrl.port,
|
|
57
|
+
method: "CONNECT",
|
|
58
|
+
path: destinationUrl.hostname,
|
|
59
|
+
headers: headers,
|
|
60
|
+
};
|
|
61
|
+
if (timeout) {
|
|
62
|
+
tunnelRequestOptions.timeout = timeout;
|
|
63
|
+
}
|
|
64
|
+
if (agentOptions && Object.keys(agentOptions).length) {
|
|
65
|
+
tunnelRequestOptions.agent = new http.Agent(agentOptions);
|
|
66
|
+
}
|
|
67
|
+
// compose a request string for the socket
|
|
68
|
+
let postRequestStringContent = "";
|
|
69
|
+
if (httpMethod === HttpMethod.POST) {
|
|
70
|
+
const body = options?.body || "";
|
|
71
|
+
postRequestStringContent =
|
|
72
|
+
"Content-Type: application/x-www-form-urlencoded\r\n" +
|
|
73
|
+
`Content-Length: ${body.length}\r\n` +
|
|
74
|
+
`\r\n${body}`;
|
|
75
|
+
}
|
|
76
|
+
const outgoingRequestString = `${httpMethod.toUpperCase()} ${destinationUrl.href} HTTP/1.1\r\n` +
|
|
77
|
+
`Host: ${destinationUrl.host}\r\n` +
|
|
78
|
+
"Connection: close\r\n" +
|
|
79
|
+
postRequestStringContent +
|
|
80
|
+
"\r\n";
|
|
81
|
+
return new Promise((resolve, reject) => {
|
|
82
|
+
const request = http.request(tunnelRequestOptions);
|
|
83
|
+
if (tunnelRequestOptions.timeout) {
|
|
84
|
+
request.on("timeout", () => {
|
|
85
|
+
request.destroy();
|
|
86
|
+
reject(new Error("Request time out"));
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
request.end();
|
|
90
|
+
// establish connection to the proxy
|
|
91
|
+
request.on("connect", (response, socket) => {
|
|
92
|
+
const proxyStatusCode = response?.statusCode || ProxyStatus.SERVER_ERROR;
|
|
93
|
+
if (proxyStatusCode < ProxyStatus.SUCCESS_RANGE_START ||
|
|
94
|
+
proxyStatusCode > ProxyStatus.SUCCESS_RANGE_END) {
|
|
95
|
+
request.destroy();
|
|
96
|
+
socket.destroy();
|
|
97
|
+
reject(new Error(`Error connecting to proxy. Http status code: ${response.statusCode}. Http status message: ${response?.statusMessage || "Unknown"}`));
|
|
98
|
+
}
|
|
99
|
+
if (tunnelRequestOptions.timeout) {
|
|
100
|
+
socket.setTimeout(tunnelRequestOptions.timeout);
|
|
101
|
+
socket.on("timeout", () => {
|
|
102
|
+
request.destroy();
|
|
103
|
+
socket.destroy();
|
|
104
|
+
reject(new Error("Request time out"));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
// make a request over an HTTP tunnel
|
|
108
|
+
socket.write(outgoingRequestString);
|
|
109
|
+
const data = [];
|
|
110
|
+
socket.on("data", (chunk) => {
|
|
111
|
+
data.push(chunk);
|
|
112
|
+
});
|
|
113
|
+
socket.on("end", () => {
|
|
114
|
+
// combine all received buffer streams into one buffer, and then into a string
|
|
115
|
+
const dataString = Buffer.concat([...data]).toString();
|
|
116
|
+
// separate each line into it's own entry in an arry
|
|
117
|
+
const dataStringArray = dataString.split("\r\n");
|
|
118
|
+
// the first entry will contain the statusCode and statusMessage
|
|
119
|
+
const httpStatusCode = parseInt(dataStringArray[0].split(" ")[1]);
|
|
120
|
+
// remove "HTTP/1.1" and the status code to get the status message
|
|
121
|
+
const statusMessage = dataStringArray[0]
|
|
122
|
+
.split(" ")
|
|
123
|
+
.slice(2)
|
|
124
|
+
.join(" ");
|
|
125
|
+
// the last entry will contain the body
|
|
126
|
+
const body = dataStringArray[dataStringArray.length - 1];
|
|
127
|
+
// everything in between the first and last entries are the headers
|
|
128
|
+
const headersArray = dataStringArray.slice(1, dataStringArray.length - 2);
|
|
129
|
+
// build an object out of all the headers
|
|
130
|
+
const entries = new Map();
|
|
131
|
+
headersArray.forEach((header) => {
|
|
132
|
+
/**
|
|
133
|
+
* the header might look like "Content-Length: 1531", but that is just a string
|
|
134
|
+
* it needs to be converted to a key/value pair
|
|
135
|
+
* split the string at the first instance of ":"
|
|
136
|
+
* there may be more than one ":" if the value of the header is supposed to be a JSON object
|
|
137
|
+
*/
|
|
138
|
+
const headerKeyValue = header.split(new RegExp(/:\s(.*)/s));
|
|
139
|
+
const headerKey = headerKeyValue[0];
|
|
140
|
+
let headerValue = headerKeyValue[1];
|
|
141
|
+
// check if the value of the header is supposed to be a JSON object
|
|
142
|
+
try {
|
|
143
|
+
const object = JSON.parse(headerValue);
|
|
144
|
+
// if it is, then convert it from a string to a JSON object
|
|
145
|
+
if (object && typeof object === "object") {
|
|
146
|
+
headerValue = object;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
// otherwise, leave it as a string
|
|
151
|
+
}
|
|
152
|
+
entries.set(headerKey, headerValue);
|
|
153
|
+
});
|
|
154
|
+
const headers = Object.fromEntries(entries);
|
|
155
|
+
const parsedHeaders = headers;
|
|
156
|
+
const networkResponse = NetworkUtils.getNetworkResponse(parsedHeaders, parseBody(httpStatusCode, statusMessage, parsedHeaders, body), httpStatusCode);
|
|
157
|
+
if ((httpStatusCode < HttpStatus.SUCCESS_RANGE_START ||
|
|
158
|
+
httpStatusCode > HttpStatus.SUCCESS_RANGE_END) &&
|
|
159
|
+
// do not destroy the request for the device code flow
|
|
160
|
+
networkResponse.body["error"] !==
|
|
161
|
+
Constants.AUTHORIZATION_PENDING) {
|
|
162
|
+
request.destroy();
|
|
163
|
+
}
|
|
164
|
+
resolve(networkResponse);
|
|
165
|
+
});
|
|
166
|
+
socket.on("error", (chunk) => {
|
|
167
|
+
request.destroy();
|
|
168
|
+
socket.destroy();
|
|
169
|
+
reject(new Error(chunk.toString()));
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
request.on("error", (chunk) => {
|
|
173
|
+
request.destroy();
|
|
174
|
+
reject(new Error(chunk.toString()));
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
const networkRequestViaHttps = (urlString, httpMethod, options, agentOptions, timeout, managedIdentity) => {
|
|
179
|
+
const isPostRequest = httpMethod === HttpMethod.POST;
|
|
180
|
+
const body = options?.body || "";
|
|
181
|
+
const url = new URL(urlString);
|
|
182
|
+
const headers = options?.headers || {};
|
|
183
|
+
const customOptions = {
|
|
184
|
+
method: httpMethod,
|
|
185
|
+
headers: headers,
|
|
186
|
+
...NetworkUtils.urlToHttpOptions(url),
|
|
187
|
+
};
|
|
188
|
+
if (timeout) {
|
|
189
|
+
customOptions.timeout = timeout;
|
|
190
|
+
}
|
|
191
|
+
if (agentOptions && Object.keys(agentOptions).length) {
|
|
192
|
+
customOptions.agent = new https.Agent(agentOptions);
|
|
193
|
+
}
|
|
194
|
+
if (isPostRequest) {
|
|
195
|
+
// needed for post request to work
|
|
196
|
+
customOptions.headers = {
|
|
197
|
+
...customOptions.headers,
|
|
198
|
+
"Content-Length": body.length,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
return new Promise((resolve, reject) => {
|
|
202
|
+
let request;
|
|
203
|
+
if (managedIdentity) {
|
|
204
|
+
request = http.request(customOptions);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
request = https.request(customOptions);
|
|
208
|
+
}
|
|
209
|
+
if (timeout) {
|
|
210
|
+
request.on("timeout", () => {
|
|
211
|
+
request.destroy();
|
|
212
|
+
reject(new Error("Request time out"));
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
if (isPostRequest) {
|
|
216
|
+
request.write(body);
|
|
217
|
+
}
|
|
218
|
+
request.end();
|
|
219
|
+
request.on("response", (response) => {
|
|
220
|
+
const headers = response.headers;
|
|
221
|
+
const statusCode = response.statusCode;
|
|
222
|
+
const statusMessage = response.statusMessage;
|
|
223
|
+
const data = [];
|
|
224
|
+
response.on("data", (chunk) => {
|
|
225
|
+
data.push(chunk);
|
|
226
|
+
});
|
|
227
|
+
response.on("end", () => {
|
|
228
|
+
// combine all received buffer streams into one buffer, and then into a string
|
|
229
|
+
const body = Buffer.concat([...data]).toString();
|
|
230
|
+
const parsedHeaders = headers;
|
|
231
|
+
const networkResponse = NetworkUtils.getNetworkResponse(parsedHeaders, parseBody(statusCode, statusMessage, parsedHeaders, body), statusCode);
|
|
232
|
+
if ((statusCode < HttpStatus.SUCCESS_RANGE_START ||
|
|
233
|
+
statusCode > HttpStatus.SUCCESS_RANGE_END) &&
|
|
234
|
+
// do not destroy the request for the device code flow
|
|
235
|
+
networkResponse.body["error"] !==
|
|
236
|
+
Constants.AUTHORIZATION_PENDING) {
|
|
237
|
+
request.destroy();
|
|
238
|
+
}
|
|
239
|
+
resolve(networkResponse);
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
request.on("error", (chunk) => {
|
|
243
|
+
request.destroy();
|
|
244
|
+
reject(new Error(chunk.toString()));
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Check if extra parsing is needed on the repsonse from the server
|
|
250
|
+
* @param statusCode {number} the status code of the response from the server
|
|
251
|
+
* @param statusMessage {string | undefined} the status message of the response from the server
|
|
252
|
+
* @param headers {Record<string, string>} the headers of the response from the server
|
|
253
|
+
* @param body {string} the body from the response of the server
|
|
254
|
+
* @returns {Object} JSON parsed body or error object
|
|
255
|
+
*/
|
|
256
|
+
const parseBody = (statusCode, statusMessage, headers, body) => {
|
|
257
|
+
/*
|
|
258
|
+
* Informational responses (100 – 199)
|
|
259
|
+
* Successful responses (200 – 299)
|
|
260
|
+
* Redirection messages (300 – 399)
|
|
261
|
+
* Client error responses (400 – 499)
|
|
262
|
+
* Server error responses (500 – 599)
|
|
263
|
+
*/
|
|
264
|
+
let parsedBody;
|
|
265
|
+
try {
|
|
266
|
+
parsedBody = JSON.parse(body);
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
let errorType;
|
|
270
|
+
let errorDescriptionHelper;
|
|
271
|
+
if (statusCode >= HttpStatus.CLIENT_ERROR_RANGE_START &&
|
|
272
|
+
statusCode <= HttpStatus.CLIENT_ERROR_RANGE_END) {
|
|
273
|
+
errorType = "client_error";
|
|
274
|
+
errorDescriptionHelper = "A client";
|
|
275
|
+
}
|
|
276
|
+
else if (statusCode >= HttpStatus.SERVER_ERROR_RANGE_START &&
|
|
277
|
+
statusCode <= HttpStatus.SERVER_ERROR_RANGE_END) {
|
|
278
|
+
errorType = "server_error";
|
|
279
|
+
errorDescriptionHelper = "A server";
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
errorType = "unknown_error";
|
|
283
|
+
errorDescriptionHelper = "An unknown";
|
|
284
|
+
}
|
|
285
|
+
parsedBody = {
|
|
286
|
+
error: errorType,
|
|
287
|
+
error_description: `${errorDescriptionHelper} error occured.\nHttp status code: ${statusCode}\nHttp status message: ${statusMessage || "Unknown"}\nHeaders: ${JSON.stringify(headers)}`,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
return parsedBody;
|
|
284
291
|
};
|
|
285
292
|
|
|
286
293
|
export { HttpClient };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClient.mjs","sources":["../../src/network/HttpClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAAA;;;AAGG;AAaH;;AAEG;MACU,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"HttpClient.mjs","sources":["../../src/network/HttpClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAAA;;;AAGG;AAaH;;AAEG;MACU,UAAU,CAAA;AAKnB,IAAA,WAAA,CACI,QAAiB,EACjB,kBAA2D,EAC3D,eAAyB,EAAA;AAEzB,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,EAAE,CAAC;AAC/B,QAAA,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,IAAI,EAAE,CAAC;AACnD,QAAA,IAAI,CAAC,eA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