@kontent-ai/core-sdk 10.12.6 → 10.12.8
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/cjs/http/http.functions.js +113 -23
- package/dist/cjs/http/http.functions.js.map +1 -1
- package/dist/cjs/sdk-info.generated.js +1 -1
- package/dist/es6/http/http.functions.js +113 -23
- package/dist/es6/http/http.functions.js.map +1 -1
- package/dist/es6/sdk-info.generated.js +1 -1
- package/dist/esnext/http/http.functions.js +113 -23
- package/dist/esnext/http/http.functions.js.map +1 -1
- package/dist/esnext/sdk-info.generated.js +1 -1
- package/dist/umd/kontent-core.umd.js +113 -23
- package/dist/umd/kontent-core.umd.js.map +1 -1
- package/dist/umd/kontent-core.umd.min.js +1 -1
- package/dist/umd/kontent-core.umd.min.js.map +1 -1
- package/dist/umd/report.json +1 -1
- package/dist/umd/report.min.json +1 -1
- package/dist/umd/stats.json +22 -22
- package/dist/umd/stats.min.json +34 -34
- package/lib/http/http.functions.ts +110 -3
- package/lib/sdk-info.generated.ts +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import { extractHeadersFromAxiosResponse } from '../helpers/headers-helper';
|
|
|
12
12
|
import { httpDebugger } from './http.debugger';
|
|
13
13
|
import { retryHelper } from '../helpers/retry-helper';
|
|
14
14
|
export function getWithRetryAsync(instance, call, functionsConfig, options) {
|
|
15
|
-
var _a;
|
|
15
|
+
var _a, _b;
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retryHelper.defaultRetryStrategy;
|
|
18
18
|
return yield runWithRetryAsync({
|
|
@@ -20,13 +20,14 @@ export function getWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
20
20
|
url: call.url,
|
|
21
21
|
retryStrategy: retryStrategyOptions,
|
|
22
22
|
functionsConfig: functionsConfig,
|
|
23
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
23
24
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
var
|
|
25
|
+
var _c, _d;
|
|
25
26
|
httpDebugger.debugStartHttpRequest();
|
|
26
27
|
const axiosResponse = yield instance.get(call.url, {
|
|
27
|
-
headers: getHeadersJson((
|
|
28
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
28
29
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
29
|
-
cancelToken: (
|
|
30
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
30
31
|
});
|
|
31
32
|
const response = {
|
|
32
33
|
data: axiosResponse.data,
|
|
@@ -45,7 +46,7 @@ export function getWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
export function postWithRetryAsync(instance, call, functionsConfig, options) {
|
|
48
|
-
var _a;
|
|
49
|
+
var _a, _b;
|
|
49
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
51
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retryHelper.defaultRetryStrategy;
|
|
51
52
|
return yield runWithRetryAsync({
|
|
@@ -53,17 +54,18 @@ export function postWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
53
54
|
url: call.url,
|
|
54
55
|
retryStrategy: retryStrategyOptions,
|
|
55
56
|
functionsConfig: functionsConfig,
|
|
57
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
56
58
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
var
|
|
59
|
+
var _c, _d;
|
|
58
60
|
httpDebugger.debugStartHttpRequest();
|
|
59
61
|
const axiosResponse = yield instance.post(call.url, call.body, {
|
|
60
|
-
headers: getHeadersJson((
|
|
62
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
61
63
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
62
64
|
// required for uploading large files
|
|
63
65
|
// https://github.com/axios/axios/issues/1362
|
|
64
66
|
maxContentLength: 'Infinity',
|
|
65
67
|
maxBodyLength: 'Infinity',
|
|
66
|
-
cancelToken: (
|
|
68
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
67
69
|
});
|
|
68
70
|
const response = {
|
|
69
71
|
data: axiosResponse.data,
|
|
@@ -82,7 +84,7 @@ export function postWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
86
|
export function putWithRetryAsync(instance, call, functionsConfig, options) {
|
|
85
|
-
var _a;
|
|
87
|
+
var _a, _b;
|
|
86
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
89
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retryHelper.defaultRetryStrategy;
|
|
88
90
|
return yield runWithRetryAsync({
|
|
@@ -90,17 +92,18 @@ export function putWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
90
92
|
url: call.url,
|
|
91
93
|
retryStrategy: retryStrategyOptions,
|
|
92
94
|
functionsConfig: functionsConfig,
|
|
95
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
93
96
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
var
|
|
97
|
+
var _c, _d;
|
|
95
98
|
httpDebugger.debugStartHttpRequest();
|
|
96
99
|
const axiosResponse = yield instance.put(call.url, call.body, {
|
|
97
|
-
headers: getHeadersJson((
|
|
100
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
98
101
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
99
102
|
// required for uploading large files
|
|
100
103
|
// https://github.com/axios/axios/issues/1362
|
|
101
104
|
maxContentLength: 'Infinity',
|
|
102
105
|
maxBodyLength: 'Infinity',
|
|
103
|
-
cancelToken: (
|
|
106
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
104
107
|
});
|
|
105
108
|
const response = {
|
|
106
109
|
data: axiosResponse.data,
|
|
@@ -119,7 +122,7 @@ export function putWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
119
122
|
});
|
|
120
123
|
}
|
|
121
124
|
export function patchWithRetryAsync(instance, call, functionsConfig, options) {
|
|
122
|
-
var _a;
|
|
125
|
+
var _a, _b;
|
|
123
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
127
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retryHelper.defaultRetryStrategy;
|
|
125
128
|
return yield runWithRetryAsync({
|
|
@@ -127,17 +130,18 @@ export function patchWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
127
130
|
url: call.url,
|
|
128
131
|
retryStrategy: retryStrategyOptions,
|
|
129
132
|
functionsConfig: functionsConfig,
|
|
133
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
130
134
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
131
|
-
var
|
|
135
|
+
var _c, _d;
|
|
132
136
|
httpDebugger.debugStartHttpRequest();
|
|
133
137
|
const axiosResponse = yield instance.patch(call.url, call.body, {
|
|
134
|
-
headers: getHeadersJson((
|
|
138
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
135
139
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
136
140
|
// required for uploading large files
|
|
137
141
|
// https://github.com/axios/axios/issues/1362
|
|
138
142
|
maxContentLength: 'Infinity',
|
|
139
143
|
maxBodyLength: 'Infinity',
|
|
140
|
-
cancelToken: (
|
|
144
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
141
145
|
});
|
|
142
146
|
const response = {
|
|
143
147
|
data: axiosResponse.data,
|
|
@@ -156,7 +160,7 @@ export function patchWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
156
160
|
});
|
|
157
161
|
}
|
|
158
162
|
export function deleteWithRetryAsync(instance, call, functionsConfig, options) {
|
|
159
|
-
var _a;
|
|
163
|
+
var _a, _b;
|
|
160
164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
161
165
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retryHelper.defaultRetryStrategy;
|
|
162
166
|
return yield runWithRetryAsync({
|
|
@@ -164,17 +168,18 @@ export function deleteWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
164
168
|
url: call.url,
|
|
165
169
|
retryStrategy: retryStrategyOptions,
|
|
166
170
|
functionsConfig: functionsConfig,
|
|
171
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
167
172
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
168
|
-
var
|
|
173
|
+
var _c, _d;
|
|
169
174
|
httpDebugger.debugStartHttpRequest();
|
|
170
175
|
const axiosResponse = yield instance.delete(call.url, {
|
|
171
|
-
headers: getHeadersJson((
|
|
176
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
172
177
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
173
178
|
// required for uploading large files
|
|
174
179
|
// https://github.com/axios/axios/issues/1362
|
|
175
180
|
maxContentLength: 'Infinity',
|
|
176
181
|
maxBodyLength: 'Infinity',
|
|
177
|
-
cancelToken: (
|
|
182
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
178
183
|
});
|
|
179
184
|
const response = {
|
|
180
185
|
data: axiosResponse.data,
|
|
@@ -227,16 +232,101 @@ function runWithRetryAsync(data) {
|
|
|
227
232
|
retryStrategy: data.retryStrategy,
|
|
228
233
|
retryAttempt: data.retryAttempt + 1,
|
|
229
234
|
url: data.url,
|
|
230
|
-
functionsConfig: data.functionsConfig
|
|
235
|
+
functionsConfig: data.functionsConfig,
|
|
236
|
+
headers: data.headers
|
|
231
237
|
});
|
|
232
238
|
}
|
|
239
|
+
// sanitize the error before logging / re-throwing so the authorization token is not leaked
|
|
240
|
+
const sanitizedError = sanitizeError(error, data.headers);
|
|
233
241
|
if (data.functionsConfig.logErrorsToConsole) {
|
|
234
|
-
console.error(`Executing '${data.url}' failed. Request was retried '${data.retryAttempt}' times
|
|
242
|
+
console.error(`Executing '${data.url}' failed. Request was retried '${data.retryAttempt}' times.`, sanitizedError);
|
|
235
243
|
}
|
|
236
|
-
throw
|
|
244
|
+
throw sanitizedError;
|
|
237
245
|
}
|
|
238
246
|
});
|
|
239
247
|
}
|
|
248
|
+
const redactedValue = 'redacted';
|
|
249
|
+
const maxRedactionDepth = 10;
|
|
250
|
+
/**
|
|
251
|
+
* Returns the caller-supplied 'authorization' header value(s), which are the secret token(s) to
|
|
252
|
+
* scrub from errors. Note: if a consumer sets the authorization token on the axios instance defaults
|
|
253
|
+
* instead of passing it via 'options.headers', it is not known here and cannot be redacted.
|
|
254
|
+
*/
|
|
255
|
+
function getSecretHeaderValues(headers) {
|
|
256
|
+
return headers
|
|
257
|
+
.filter((header) => header.header.toLowerCase() === 'authorization')
|
|
258
|
+
.map((header) => header.value)
|
|
259
|
+
// skip empty values - splitting on an empty string would corrupt every string
|
|
260
|
+
.filter((value) => typeof value === 'string' && value.length > 0);
|
|
261
|
+
}
|
|
262
|
+
function redactStringValue(value, secrets) {
|
|
263
|
+
let result = value;
|
|
264
|
+
for (const secret of secrets) {
|
|
265
|
+
if (result.includes(secret)) {
|
|
266
|
+
result = result.split(secret).join(redactedValue);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return result;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Walks the object graph (cycle- and depth-guarded) replacing every occurrence of a secret with the
|
|
273
|
+
* redacted placeholder in place.
|
|
274
|
+
*/
|
|
275
|
+
function redactSecretsInPlace(target, secrets, seen, depth) {
|
|
276
|
+
if (depth > maxRedactionDepth || target === null || typeof target !== 'object') {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
if (seen.has(target)) {
|
|
280
|
+
// break cycles (config.headers, request.socket, response.request, ...)
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
seen.add(target);
|
|
284
|
+
const container = target;
|
|
285
|
+
// Reflect.ownKeys (not Object.keys) so symbol-keyed and non-enumerable properties are also
|
|
286
|
+
// scrubbed - e.g. Node's ClientRequest keeps the outgoing headers (incl. the token) under the
|
|
287
|
+
// Symbol(kOutHeaders) property, which Object.keys does not enumerate.
|
|
288
|
+
for (const key of Reflect.ownKeys(target)) {
|
|
289
|
+
let value;
|
|
290
|
+
try {
|
|
291
|
+
value = container[key];
|
|
292
|
+
}
|
|
293
|
+
catch (_a) {
|
|
294
|
+
// accessing the property threw (e.g. a getter) - skip it
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
if (typeof value === 'string') {
|
|
298
|
+
const redacted = redactStringValue(value, secrets);
|
|
299
|
+
if (redacted !== value) {
|
|
300
|
+
try {
|
|
301
|
+
container[key] = redacted;
|
|
302
|
+
}
|
|
303
|
+
catch (_b) {
|
|
304
|
+
// property is read-only - skip it
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
else if (value && typeof value === 'object') {
|
|
309
|
+
redactSecretsInPlace(value, secrets, seen, depth + 1);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* If 'error' is an axios error, redacts every occurrence of the caller's authorization token (taken
|
|
315
|
+
* from 'headers') throughout the error, replacing it with a redacted placeholder. Non-axios errors
|
|
316
|
+
* and errors with no known token are returned unchanged. This prevents the authorization token from
|
|
317
|
+
* leaking via console logs or the re-thrown error. All other axios properties are preserved.
|
|
318
|
+
*/
|
|
319
|
+
function sanitizeError(error, headers) {
|
|
320
|
+
if (!axios.isAxiosError(error)) {
|
|
321
|
+
return error;
|
|
322
|
+
}
|
|
323
|
+
const secrets = getSecretHeaderValues(headers);
|
|
324
|
+
if (secrets.length === 0) {
|
|
325
|
+
return error;
|
|
326
|
+
}
|
|
327
|
+
redactSecretsInPlace(error, secrets, new WeakSet(), 0);
|
|
328
|
+
return error;
|
|
329
|
+
}
|
|
240
330
|
function getHeadersJson(headers, addContentTypeHeader) {
|
|
241
331
|
const headerJson = {};
|
|
242
332
|
headers.forEach((header) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.functions.js","sourceRoot":"","sources":["../../../lib/http/http.functions.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAa/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,MAAM,UAAgB,iBAAiB,CACnC,QAAuB,EACvB,IAAuB,EACvB,eAAqC,EACrC,OAAwC;;;QAExC,MAAM,oBAAoB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,mCAAI,WAAW,CAAC,oBAAoB,CAAC;QAExF,OAAO,MAAM,iBAAiB,CAA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ACjB,CAAC;AAED,SAAS,cAAc,CAAC,OAAkB,EAAE,oBAA6B;IACrE,MAAM,UAAU,GAAiC,EAAE,CAAC;IAEpD,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACvB,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,IAAI,oBAAoB,EAAE;QACtB,iDAAiD;QACjD,MAAM,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC;QAEvG,IAAI,CAAC,iBAAiB,EAAE;YACpB,UAAU,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;SACnD;KACJ;IAED,OAAO,UAAU,CAAC;AACtB,CAAC"}
|
|
@@ -347,7 +347,7 @@ const headers_helper_1 = __webpack_require__(/*! ../helpers/headers-helper */ ".
|
|
|
347
347
|
const http_debugger_1 = __webpack_require__(/*! ./http.debugger */ "./lib/http/http.debugger.ts");
|
|
348
348
|
const retry_helper_1 = __webpack_require__(/*! ../helpers/retry-helper */ "./lib/helpers/retry-helper.ts");
|
|
349
349
|
function getWithRetryAsync(instance, call, functionsConfig, options) {
|
|
350
|
-
var _a;
|
|
350
|
+
var _a, _b;
|
|
351
351
|
return __awaiter(this, void 0, void 0, function* () {
|
|
352
352
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retry_helper_1.retryHelper.defaultRetryStrategy;
|
|
353
353
|
return yield runWithRetryAsync({
|
|
@@ -355,13 +355,14 @@ function getWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
355
355
|
url: call.url,
|
|
356
356
|
retryStrategy: retryStrategyOptions,
|
|
357
357
|
functionsConfig: functionsConfig,
|
|
358
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
358
359
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
359
|
-
var
|
|
360
|
+
var _c, _d;
|
|
360
361
|
http_debugger_1.httpDebugger.debugStartHttpRequest();
|
|
361
362
|
const axiosResponse = yield instance.get(call.url, {
|
|
362
|
-
headers: getHeadersJson((
|
|
363
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
363
364
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
364
|
-
cancelToken: (
|
|
365
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
365
366
|
});
|
|
366
367
|
const response = {
|
|
367
368
|
data: axiosResponse.data,
|
|
@@ -381,7 +382,7 @@ function getWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
381
382
|
}
|
|
382
383
|
exports.getWithRetryAsync = getWithRetryAsync;
|
|
383
384
|
function postWithRetryAsync(instance, call, functionsConfig, options) {
|
|
384
|
-
var _a;
|
|
385
|
+
var _a, _b;
|
|
385
386
|
return __awaiter(this, void 0, void 0, function* () {
|
|
386
387
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retry_helper_1.retryHelper.defaultRetryStrategy;
|
|
387
388
|
return yield runWithRetryAsync({
|
|
@@ -389,17 +390,18 @@ function postWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
389
390
|
url: call.url,
|
|
390
391
|
retryStrategy: retryStrategyOptions,
|
|
391
392
|
functionsConfig: functionsConfig,
|
|
393
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
392
394
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
393
|
-
var
|
|
395
|
+
var _c, _d;
|
|
394
396
|
http_debugger_1.httpDebugger.debugStartHttpRequest();
|
|
395
397
|
const axiosResponse = yield instance.post(call.url, call.body, {
|
|
396
|
-
headers: getHeadersJson((
|
|
398
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
397
399
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
398
400
|
// required for uploading large files
|
|
399
401
|
// https://github.com/axios/axios/issues/1362
|
|
400
402
|
maxContentLength: 'Infinity',
|
|
401
403
|
maxBodyLength: 'Infinity',
|
|
402
|
-
cancelToken: (
|
|
404
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
403
405
|
});
|
|
404
406
|
const response = {
|
|
405
407
|
data: axiosResponse.data,
|
|
@@ -419,7 +421,7 @@ function postWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
419
421
|
}
|
|
420
422
|
exports.postWithRetryAsync = postWithRetryAsync;
|
|
421
423
|
function putWithRetryAsync(instance, call, functionsConfig, options) {
|
|
422
|
-
var _a;
|
|
424
|
+
var _a, _b;
|
|
423
425
|
return __awaiter(this, void 0, void 0, function* () {
|
|
424
426
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retry_helper_1.retryHelper.defaultRetryStrategy;
|
|
425
427
|
return yield runWithRetryAsync({
|
|
@@ -427,17 +429,18 @@ function putWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
427
429
|
url: call.url,
|
|
428
430
|
retryStrategy: retryStrategyOptions,
|
|
429
431
|
functionsConfig: functionsConfig,
|
|
432
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
430
433
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
431
|
-
var
|
|
434
|
+
var _c, _d;
|
|
432
435
|
http_debugger_1.httpDebugger.debugStartHttpRequest();
|
|
433
436
|
const axiosResponse = yield instance.put(call.url, call.body, {
|
|
434
|
-
headers: getHeadersJson((
|
|
437
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
435
438
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
436
439
|
// required for uploading large files
|
|
437
440
|
// https://github.com/axios/axios/issues/1362
|
|
438
441
|
maxContentLength: 'Infinity',
|
|
439
442
|
maxBodyLength: 'Infinity',
|
|
440
|
-
cancelToken: (
|
|
443
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
441
444
|
});
|
|
442
445
|
const response = {
|
|
443
446
|
data: axiosResponse.data,
|
|
@@ -457,7 +460,7 @@ function putWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
457
460
|
}
|
|
458
461
|
exports.putWithRetryAsync = putWithRetryAsync;
|
|
459
462
|
function patchWithRetryAsync(instance, call, functionsConfig, options) {
|
|
460
|
-
var _a;
|
|
463
|
+
var _a, _b;
|
|
461
464
|
return __awaiter(this, void 0, void 0, function* () {
|
|
462
465
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retry_helper_1.retryHelper.defaultRetryStrategy;
|
|
463
466
|
return yield runWithRetryAsync({
|
|
@@ -465,17 +468,18 @@ function patchWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
465
468
|
url: call.url,
|
|
466
469
|
retryStrategy: retryStrategyOptions,
|
|
467
470
|
functionsConfig: functionsConfig,
|
|
471
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
468
472
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
469
|
-
var
|
|
473
|
+
var _c, _d;
|
|
470
474
|
http_debugger_1.httpDebugger.debugStartHttpRequest();
|
|
471
475
|
const axiosResponse = yield instance.patch(call.url, call.body, {
|
|
472
|
-
headers: getHeadersJson((
|
|
476
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
473
477
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
474
478
|
// required for uploading large files
|
|
475
479
|
// https://github.com/axios/axios/issues/1362
|
|
476
480
|
maxContentLength: 'Infinity',
|
|
477
481
|
maxBodyLength: 'Infinity',
|
|
478
|
-
cancelToken: (
|
|
482
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
479
483
|
});
|
|
480
484
|
const response = {
|
|
481
485
|
data: axiosResponse.data,
|
|
@@ -495,7 +499,7 @@ function patchWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
495
499
|
}
|
|
496
500
|
exports.patchWithRetryAsync = patchWithRetryAsync;
|
|
497
501
|
function deleteWithRetryAsync(instance, call, functionsConfig, options) {
|
|
498
|
-
var _a;
|
|
502
|
+
var _a, _b;
|
|
499
503
|
return __awaiter(this, void 0, void 0, function* () {
|
|
500
504
|
const retryStrategyOptions = (_a = options === null || options === void 0 ? void 0 : options.retryStrategy) !== null && _a !== void 0 ? _a : retry_helper_1.retryHelper.defaultRetryStrategy;
|
|
501
505
|
return yield runWithRetryAsync({
|
|
@@ -503,17 +507,18 @@ function deleteWithRetryAsync(instance, call, functionsConfig, options) {
|
|
|
503
507
|
url: call.url,
|
|
504
508
|
retryStrategy: retryStrategyOptions,
|
|
505
509
|
functionsConfig: functionsConfig,
|
|
510
|
+
headers: (_b = options === null || options === void 0 ? void 0 : options.headers) !== null && _b !== void 0 ? _b : [],
|
|
506
511
|
call: (retryAttempt) => __awaiter(this, void 0, void 0, function* () {
|
|
507
|
-
var
|
|
512
|
+
var _c, _d;
|
|
508
513
|
http_debugger_1.httpDebugger.debugStartHttpRequest();
|
|
509
514
|
const axiosResponse = yield instance.delete(call.url, {
|
|
510
|
-
headers: getHeadersJson((
|
|
515
|
+
headers: getHeadersJson((_c = options === null || options === void 0 ? void 0 : options.headers) !== null && _c !== void 0 ? _c : [], false),
|
|
511
516
|
responseType: options === null || options === void 0 ? void 0 : options.responseType,
|
|
512
517
|
// required for uploading large files
|
|
513
518
|
// https://github.com/axios/axios/issues/1362
|
|
514
519
|
maxContentLength: 'Infinity',
|
|
515
520
|
maxBodyLength: 'Infinity',
|
|
516
|
-
cancelToken: (
|
|
521
|
+
cancelToken: (_d = options === null || options === void 0 ? void 0 : options.cancelToken) === null || _d === void 0 ? void 0 : _d.token
|
|
517
522
|
});
|
|
518
523
|
const response = {
|
|
519
524
|
data: axiosResponse.data,
|
|
@@ -568,16 +573,101 @@ function runWithRetryAsync(data) {
|
|
|
568
573
|
retryStrategy: data.retryStrategy,
|
|
569
574
|
retryAttempt: data.retryAttempt + 1,
|
|
570
575
|
url: data.url,
|
|
571
|
-
functionsConfig: data.functionsConfig
|
|
576
|
+
functionsConfig: data.functionsConfig,
|
|
577
|
+
headers: data.headers
|
|
572
578
|
});
|
|
573
579
|
}
|
|
580
|
+
// sanitize the error before logging / re-throwing so the authorization token is not leaked
|
|
581
|
+
const sanitizedError = sanitizeError(error, data.headers);
|
|
574
582
|
if (data.functionsConfig.logErrorsToConsole) {
|
|
575
|
-
console.error(`Executing '${data.url}' failed. Request was retried '${data.retryAttempt}' times
|
|
583
|
+
console.error(`Executing '${data.url}' failed. Request was retried '${data.retryAttempt}' times.`, sanitizedError);
|
|
576
584
|
}
|
|
577
|
-
throw
|
|
585
|
+
throw sanitizedError;
|
|
578
586
|
}
|
|
579
587
|
});
|
|
580
588
|
}
|
|
589
|
+
const redactedValue = 'redacted';
|
|
590
|
+
const maxRedactionDepth = 10;
|
|
591
|
+
/**
|
|
592
|
+
* Returns the caller-supplied 'authorization' header value(s), which are the secret token(s) to
|
|
593
|
+
* scrub from errors. Note: if a consumer sets the authorization token on the axios instance defaults
|
|
594
|
+
* instead of passing it via 'options.headers', it is not known here and cannot be redacted.
|
|
595
|
+
*/
|
|
596
|
+
function getSecretHeaderValues(headers) {
|
|
597
|
+
return headers
|
|
598
|
+
.filter((header) => header.header.toLowerCase() === 'authorization')
|
|
599
|
+
.map((header) => header.value)
|
|
600
|
+
// skip empty values - splitting on an empty string would corrupt every string
|
|
601
|
+
.filter((value) => typeof value === 'string' && value.length > 0);
|
|
602
|
+
}
|
|
603
|
+
function redactStringValue(value, secrets) {
|
|
604
|
+
let result = value;
|
|
605
|
+
for (const secret of secrets) {
|
|
606
|
+
if (result.includes(secret)) {
|
|
607
|
+
result = result.split(secret).join(redactedValue);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return result;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Walks the object graph (cycle- and depth-guarded) replacing every occurrence of a secret with the
|
|
614
|
+
* redacted placeholder in place.
|
|
615
|
+
*/
|
|
616
|
+
function redactSecretsInPlace(target, secrets, seen, depth) {
|
|
617
|
+
if (depth > maxRedactionDepth || target === null || typeof target !== 'object') {
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
if (seen.has(target)) {
|
|
621
|
+
// break cycles (config.headers, request.socket, response.request, ...)
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
seen.add(target);
|
|
625
|
+
const container = target;
|
|
626
|
+
// Reflect.ownKeys (not Object.keys) so symbol-keyed and non-enumerable properties are also
|
|
627
|
+
// scrubbed - e.g. Node's ClientRequest keeps the outgoing headers (incl. the token) under the
|
|
628
|
+
// Symbol(kOutHeaders) property, which Object.keys does not enumerate.
|
|
629
|
+
for (const key of Reflect.ownKeys(target)) {
|
|
630
|
+
let value;
|
|
631
|
+
try {
|
|
632
|
+
value = container[key];
|
|
633
|
+
}
|
|
634
|
+
catch (_a) {
|
|
635
|
+
// accessing the property threw (e.g. a getter) - skip it
|
|
636
|
+
continue;
|
|
637
|
+
}
|
|
638
|
+
if (typeof value === 'string') {
|
|
639
|
+
const redacted = redactStringValue(value, secrets);
|
|
640
|
+
if (redacted !== value) {
|
|
641
|
+
try {
|
|
642
|
+
container[key] = redacted;
|
|
643
|
+
}
|
|
644
|
+
catch (_b) {
|
|
645
|
+
// property is read-only - skip it
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
else if (value && typeof value === 'object') {
|
|
650
|
+
redactSecretsInPlace(value, secrets, seen, depth + 1);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* If 'error' is an axios error, redacts every occurrence of the caller's authorization token (taken
|
|
656
|
+
* from 'headers') throughout the error, replacing it with a redacted placeholder. Non-axios errors
|
|
657
|
+
* and errors with no known token are returned unchanged. This prevents the authorization token from
|
|
658
|
+
* leaking via console logs or the re-thrown error. All other axios properties are preserved.
|
|
659
|
+
*/
|
|
660
|
+
function sanitizeError(error, headers) {
|
|
661
|
+
if (!axios_1.default.isAxiosError(error)) {
|
|
662
|
+
return error;
|
|
663
|
+
}
|
|
664
|
+
const secrets = getSecretHeaderValues(headers);
|
|
665
|
+
if (secrets.length === 0) {
|
|
666
|
+
return error;
|
|
667
|
+
}
|
|
668
|
+
redactSecretsInPlace(error, secrets, new WeakSet(), 0);
|
|
669
|
+
return error;
|
|
670
|
+
}
|
|
581
671
|
function getHeadersJson(headers, addContentTypeHeader) {
|
|
582
672
|
const headerJson = {};
|
|
583
673
|
headers.forEach((header) => {
|