-
Notifications
You must be signed in to change notification settings - Fork 8k
/
axios_utils_connection.test.ts
691 lines (577 loc) · 22.9 KB
/
axios_utils_connection.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import * as proxy from 'proxy';
import { readFileSync as fsReadFileSync } from 'fs';
import { resolve as pathResolve, join as pathJoin } from 'path';
import http from 'http';
import https from 'https';
import axios from 'axios';
import { duration as momentDuration } from 'moment';
import getPort from 'get-port';
import { request } from '../lib/axios_utils';
import { ByteSizeValue } from '@kbn/config-schema';
import { Logger } from '@kbn/core/server';
import { loggingSystemMock } from '@kbn/core/server/mocks';
import { createReadySignal } from '@kbn/event-log-plugin/server/lib/ready_signal';
import { ActionsConfig } from '../config';
import { ActionsConfigurationUtilities, getActionsConfigurationUtilities } from '../actions_config';
import { resolveCustomHosts } from '../lib/custom_host_settings';
const logger = loggingSystemMock.create().get() as jest.Mocked<Logger>;
const CERT_DIR = '../../../../../../packages/kbn-dev-utils/certs';
const MOCK_CERT_DIR = '../mock_certs';
const KIBANA_CRT_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'kibana.crt'));
const KIBANA_KEY_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'kibana.key'));
const KIBANA_P12_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'kibana.p12'));
const CA_FILE = pathResolve(__filename, pathJoin(CERT_DIR, 'ca.crt'));
const UNAUTHORIZED_CA_FILE = pathResolve(
__filename,
pathJoin(MOCK_CERT_DIR, 'unauthorized_ca.crt')
);
const UNAUTHORIZED_CRT_FILE = pathResolve(__filename, pathJoin(MOCK_CERT_DIR, 'unauthorized.crt'));
const UNAUTHORIZED_KEY_FILE = pathResolve(__filename, pathJoin(MOCK_CERT_DIR, 'unauthorized.key'));
const KIBANA_KEY = fsReadFileSync(KIBANA_KEY_FILE, 'utf8');
const KIBANA_CRT = fsReadFileSync(KIBANA_CRT_FILE, 'utf8');
const KIBANA_P12 = fsReadFileSync(KIBANA_P12_FILE);
const CA = fsReadFileSync(CA_FILE, 'utf8');
const UNAUTHORIZED_KEY = fsReadFileSync(UNAUTHORIZED_KEY_FILE);
const UNAUTHORIZED_CRT = fsReadFileSync(UNAUTHORIZED_CRT_FILE);
const UNAUTHORIZED_CA = fsReadFileSync(UNAUTHORIZED_CA_FILE);
const Auth = 'elastic:changeme';
const AuthB64 = Buffer.from(Auth).toString('base64');
describe('axios connections', () => {
let testServer: http.Server | https.Server | null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let savedAxiosDefaultsAdapter: any;
beforeEach(() => {
// needed to prevent the dreaded Error: Cross origin http://localhost forbidden
// see: https://github.com/axios/axios/issues/1754#issuecomment-572778305
savedAxiosDefaultsAdapter = axios.defaults.adapter;
axios.defaults.adapter = 'http';
});
afterEach(() => {
axios.defaults.adapter = savedAxiosDefaultsAdapter;
});
beforeEach(() => {
jest.resetAllMocks();
});
afterEach(() => {
testServer?.close();
testServer = null;
});
describe('http', () => {
test('it works', async () => {
const { url, server } = await createServer({ useHttps: false });
testServer = server;
const configurationUtilities = getACUfromConfig();
const res = await request({ axios, url, logger, configurationUtilities });
expect(res.status).toBe(200);
});
});
describe('https', () => {
test('it fails with self-signed cert and no overrides', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const configurationUtilities = getACUfromConfig();
const fn = async () => await request({ axios, url, logger, configurationUtilities });
await expect(fn()).rejects.toThrow('certificate');
});
test('it works with verificationMode "none" config', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const configurationUtilities = getACUfromConfig({
ssl: {
verificationMode: 'none',
},
});
const res = await request({ axios, url, logger, configurationUtilities });
expect(res.status).toBe(200);
});
test('it works with verificationMode "none" for custom host config', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const configurationUtilities = getACUfromConfig({
customHostSettings: [{ url, ssl: { verificationMode: 'none' } }],
});
const res = await request({ axios, url, logger, configurationUtilities });
expect(res.status).toBe(200);
});
test('it works with ca in custom host config', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const configurationUtilities = getACUfromConfig({
customHostSettings: [{ url, ssl: { certificateAuthoritiesData: CA } }],
});
const res = await request({ axios, url, logger, configurationUtilities });
expect(res.status).toBe(200);
});
test('it fails with incorrect ca in custom host config', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const configurationUtilities = getACUfromConfig({
customHostSettings: [{ url, ssl: { certificateAuthoritiesData: KIBANA_CRT } }],
});
const fn = async () => await request({ axios, url, logger, configurationUtilities });
await expect(fn()).rejects.toThrow('certificate');
});
test('it works with incorrect ca in custom host config but verificationMode "none"', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const configurationUtilities = getACUfromConfig({
customHostSettings: [
{
url,
ssl: {
certificateAuthoritiesData: CA,
verificationMode: 'none',
},
},
],
});
const res = await request({ axios, url, logger, configurationUtilities });
expect(res.status).toBe(200);
});
test('it works with incorrect ca in custom host config but verificationMode config "full"', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const configurationUtilities = getACUfromConfig({
ssl: {
verificationMode: 'none',
},
customHostSettings: [
{
url,
ssl: {
certificateAuthoritiesData: CA,
},
},
],
});
const res = await request({ axios, url, logger, configurationUtilities });
expect(res.status).toBe(200);
});
test('it fails with no matching custom host settings', async () => {
const { url, server } = await createServer({ useHttps: true });
const otherUrl = 'https://example.com';
testServer = server;
const configurationUtilities = getACUfromConfig({
customHostSettings: [{ url: otherUrl, ssl: { verificationMode: 'none' } }],
});
const fn = async () => await request({ axios, url, logger, configurationUtilities });
await expect(fn()).rejects.toThrow('certificate');
});
test('it fails cleanly with a garbage CA 1', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const configurationUtilities = getACUfromConfig({
customHostSettings: [{ url, ssl: { certificateAuthoritiesData: 'garbage' } }],
});
const fn = async () => await request({ axios, url, logger, configurationUtilities });
await expect(fn()).rejects.toThrow('certificate');
});
test('it fails cleanly with a garbage CA 2', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const ca = '-----BEGIN CERTIFICATE-----\ngarbage\n-----END CERTIFICATE-----\n';
const configurationUtilities = getACUfromConfig({
customHostSettings: [{ url, ssl: { certificateAuthoritiesData: ca } }],
});
const fn = async () => await request({ axios, url, logger, configurationUtilities });
await expect(fn()).rejects.toThrow('certificate');
});
test('it works with ca in SSL overrides', async () => {
const { url, server } = await createServer({ useHttps: true });
testServer = server;
const configurationUtilities = getACUfromConfig();
const sslOverrides = {
ca: Buffer.from(CA),
};
const res = await request({ axios, url, logger, configurationUtilities, sslOverrides });
expect(res.status).toBe(200);
});
test('it works with cert, key, and ca in SSL overrides', async () => {
const { url, server } = await createServer({ useHttps: true, requestCert: true });
testServer = server;
const configurationUtilities = getACUfromConfig();
const sslOverrides = {
ca: Buffer.from(CA),
cert: Buffer.from(KIBANA_CRT),
key: Buffer.from(KIBANA_KEY),
};
const res = await request({ axios, url, logger, configurationUtilities, sslOverrides });
expect(res.status).toBe(200);
});
test('it works with pfx and passphrase in SSL overrides', async () => {
const { url, server } = await createServer({ useHttps: true, requestCert: true });
testServer = server;
const configurationUtilities = getACUfromConfig();
const sslOverrides = {
pfx: KIBANA_P12,
passphrase: 'storepass',
};
const res = await request({ axios, url, logger, configurationUtilities, sslOverrides });
expect(res.status).toBe(200);
});
test('it fails with cert and key but no ca in SSL overrides', async () => {
const { url, server } = await createServer({ useHttps: true, requestCert: true });
testServer = server;
const configurationUtilities = getACUfromConfig();
const sslOverrides = {
cert: Buffer.from(KIBANA_CRT),
key: Buffer.from(KIBANA_KEY),
};
const fn = async () =>
await request({ axios, url, logger, configurationUtilities, sslOverrides });
await expect(fn()).rejects.toThrow('certificate');
});
test('it fails with pfx but no passphrase in SSL overrides', async () => {
const { url, server } = await createServer({ useHttps: true, requestCert: true });
testServer = server;
const configurationUtilities = getACUfromConfig();
const sslOverrides = {
pfx: KIBANA_P12,
};
const fn = async () =>
await request({ axios, url, logger, configurationUtilities, sslOverrides });
await expect(fn()).rejects.toThrow('mac verify');
});
test('it fails with a client-side certificate issued by an invalid ca', async () => {
const { url, server } = await createServer({ useHttps: true, requestCert: true });
testServer = server;
const configurationUtilities = getACUfromConfig();
const sslOverrides = {
ca: UNAUTHORIZED_CA,
cert: UNAUTHORIZED_CRT,
key: UNAUTHORIZED_KEY,
};
const fn = async () =>
await request({ axios, url, logger, configurationUtilities, sslOverrides });
await expect(fn()).rejects.toThrow('certificate');
});
test('it fails when requesting a client-side cert and none is provided', async () => {
const { url, server } = await createServer({ useHttps: true, requestCert: true });
testServer = server;
const configurationUtilities = getACUfromConfig();
const fn = async () => await request({ axios, url, logger, configurationUtilities });
await expect(fn()).rejects.toThrow('certificate');
});
});
// targetHttps, proxyHttps, and proxyAuth should all range over [false, true], but
// currently the true versions are not passing
describe(`proxy`, () => {
for (const targetHttps of [false]) {
for (const targetAuth of [false, true]) {
for (const proxyHttps of [false]) {
for (const proxyAuth of [false]) {
const targetLabel = testLabel('target', targetHttps, targetAuth);
const proxyLabel = testLabel('proxy', proxyHttps, proxyAuth);
const testName = `${targetLabel} :: ${proxyLabel}`;
const opts = { targetHttps, targetAuth, proxyHttps, proxyAuth };
test(`basic; ${testName}`, async () => await basicProxyTest(opts));
if (targetAuth) {
test(`wrong target password; ${testName}`, async () =>
await wrongTargetPasswordProxyTest(opts));
test(`missing target password; ${testName}`, async () =>
await missingTargetPasswordProxyTest(opts));
}
if (proxyAuth) {
test(`wrong proxy password; ${testName}`, async () =>
await wrongProxyPasswordProxyTest(opts));
test(`missing proxy password; ${testName}`, async () =>
await missingProxyPasswordProxyTest(opts));
}
if (targetHttps) {
test(`missing CA; ${testName}`, async () =>
await missingCaProxyTest(opts));
test(`rejectUnauthorized target; ${testName}`, async () =>
await rejectUnauthorizedTargetProxyTest(opts));
test(`custom CA target; ${testName}`, async () =>
await customCAProxyTest(opts));
test(`verModeNone target; ${testName}`, async () =>
await verModeNoneTargetProxyTest(opts));
}
}
}
}
}
});
});
async function basicProxyTest(opts: RunTestOptions) {
await runWithSetup(opts, async (target, proxyInstance, axiosDefaults) => {
const acu = getACUfromConfig({
proxyUrl: proxyInstance.url,
ssl: { verificationMode: 'none' },
customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }],
});
const res = await request({ ...axiosDefaults, configurationUtilities: acu });
expect(res.status).toBe(200);
});
}
async function wrongTargetPasswordProxyTest(opts: RunTestOptions) {
await runWithSetup(opts, async (target, proxyInstance, axiosDefaults) => {
const acu = getACUfromConfig({
proxyUrl: proxyInstance.url,
ssl: { verificationMode: 'none' },
customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }],
});
const wrongUrl = manglePassword(target.url);
const res = await request({ ...axiosDefaults, url: wrongUrl, configurationUtilities: acu });
expect(res.status).toBe(403);
});
}
async function missingTargetPasswordProxyTest(opts: RunTestOptions) {
await runWithSetup(opts, async (target, proxyInstance, axiosDefaults) => {
const acu = getACUfromConfig({
proxyUrl: proxyInstance.url,
ssl: { verificationMode: 'none' },
customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }],
});
const anonUrl = removePassword(target.url);
const res = await request({ ...axiosDefaults, url: anonUrl, configurationUtilities: acu });
expect(res.status).toBe(401);
});
}
async function wrongProxyPasswordProxyTest(opts: RunTestOptions) {
await runWithSetup(opts, async (target, proxyInstance, axiosDefaults) => {
const wrongUrl = manglePassword(proxyInstance.url);
const acu = getACUfromConfig({
proxyUrl: wrongUrl,
ssl: { verificationMode: 'none' },
});
try {
await request({ ...axiosDefaults, configurationUtilities: acu });
expect('request should have thrown error').toBeUndefined();
} catch (err) {
expect(err.message).toMatch('407');
}
});
}
async function missingProxyPasswordProxyTest(opts: RunTestOptions) {
await runWithSetup(opts, async (target, proxyInstance, axiosDefaults) => {
const anonUrl = removePassword(proxyInstance.url);
const acu = getACUfromConfig({
proxyUrl: anonUrl,
ssl: { verificationMode: 'none' },
});
try {
await request({ ...axiosDefaults, configurationUtilities: acu });
expect('request should have thrown error').toBeUndefined();
} catch (err) {
expect(err.message).toMatch('407');
}
});
}
async function missingCaProxyTest(opts: RunTestOptions) {
await runWithSetup(opts, async (target, proxyInstance, axiosDefaults) => {
const acu = getACUfromConfig({
proxyUrl: proxyInstance.url,
});
try {
await request({ ...axiosDefaults, configurationUtilities: acu });
expect('request should have thrown error').toBeUndefined();
} catch (err) {
expect(err.code).toEqual('UNABLE_TO_VERIFY_LEAF_SIGNATURE');
}
});
}
async function rejectUnauthorizedTargetProxyTest(opts: RunTestOptions) {
await runWithSetup(opts, async (target, proxyInstance, axiosDefaults) => {
const acu = getACUfromConfig({
proxyUrl: proxyInstance.url,
rejectUnauthorized: false,
customHostSettings: [{ url: target.url, ssl: { verificationMode: 'none' } }],
});
const res = await request({ ...axiosDefaults, configurationUtilities: acu });
expect(res.status).toBe(200);
});
}
async function customCAProxyTest(opts: RunTestOptions) {
await runWithSetup(opts, async (target, proxyInstance, axiosDefaults) => {
const acu = getACUfromConfig({
proxyUrl: proxyInstance.url,
customHostSettings: [{ url: target.url, ssl: { certificateAuthoritiesData: CA } }],
});
const res = await request({ ...axiosDefaults, configurationUtilities: acu });
expect(res.status).toBe(200);
});
}
async function verModeNoneTargetProxyTest(opts: RunTestOptions) {
await runWithSetup(opts, async (target, proxyInstance, axiosDefaults) => {
const acu = getACUfromConfig({
proxyUrl: proxyInstance.url,
customHostSettings: [{ url: target.url, ssl: { verificationMode: 'none' } }],
});
const res = await request({ ...axiosDefaults, configurationUtilities: acu });
expect(res.status).toBe(200);
});
}
interface RunTestOptions {
targetHttps: boolean;
targetAuth: boolean;
proxyHttps: boolean;
proxyAuth: boolean;
}
type AxiosParams = Parameters<typeof request>[0];
type Test = (
target: CreateServerResult,
proxy: CreateProxyResult,
axiosDefaults: AxiosParams
) => Promise<void>;
async function runWithSetup(opts: RunTestOptions, fn: Test) {
const target = await createServer({
useHttps: opts.targetHttps,
requireAuth: opts.targetAuth,
});
const proxyInstance = await createProxy({
useHttps: opts.proxyHttps,
requireAuth: opts.proxyAuth,
});
const axiosDefaults = {
axios,
logger,
validateStatus,
url: target.url,
configurationUtilities: getACUfromConfig({
proxyUrl: proxyInstance.url,
}),
};
try {
await fn(target, proxyInstance, axiosDefaults);
} catch (err) {
expect(err).toBeUndefined();
}
target.server.close();
proxyInstance.server.close();
}
function testLabel(type: string, tls: boolean, auth: boolean) {
return `${type} https ${tls ? 'X' : '-'} auth ${auth ? 'X' : '-'}`;
}
function validateStatus(status: number) {
return true;
}
function manglePassword(url: string) {
const parsed = new URL(url);
parsed.password = `nope-${parsed.password}-nope`;
return parsed.toString();
}
function removePassword(url: string) {
const parsed = new URL(url);
parsed.username = '';
parsed.password = '';
return parsed.toString();
}
const TlsOptions = {
cert: KIBANA_CRT,
key: KIBANA_KEY,
ca: CA,
};
interface CreateServerOptions {
useHttps: boolean;
requireAuth?: boolean;
requestCert?: boolean;
}
interface CreateServerResult {
url: string;
server: http.Server | https.Server;
}
async function createServer(options: CreateServerOptions): Promise<CreateServerResult> {
const { useHttps, requireAuth = false, requestCert = false } = options;
const port = await getPort();
const url = `http${useHttps ? 's' : ''}://${requireAuth ? `${Auth}@` : ''}localhost:${port}`;
function requestHandler(req: http.IncomingMessage, res: http.ServerResponse) {
if (requireAuth) {
const auth = req.headers.authorization;
if (auth == null) {
res.setHeader('WWW-Authenticate', 'Basic');
res.writeHead(401);
res.end('authorization required');
return;
}
if (auth !== `Basic ${AuthB64}`) {
res.writeHead(403);
res.end('not authorized');
return;
}
}
res.writeHead(200);
res.end('http: just testing that a connection could be made');
}
let server: http.Server | https.Server;
if (!useHttps) {
server = http.createServer(requestHandler);
} else {
server = https.createServer({ ...TlsOptions, requestCert }, requestHandler);
}
server.unref();
const readySignal = createReadySignal<CreateServerResult>();
server.listen(port, 'localhost', () => {
readySignal.signal({ url, server });
});
return readySignal.wait();
}
interface CreateProxyOptions {
useHttps: boolean;
requireAuth?: boolean;
}
interface CreateProxyResult {
url: string;
server: http.Server | https.Server;
}
type AuthenticateCallback = (err: null | Error, authenticated: boolean) => void;
interface IAuthenticate {
authenticate(req: http.IncomingMessage, callback: AuthenticateCallback): void;
}
async function createProxy(options: CreateProxyOptions): Promise<CreateProxyResult> {
const { useHttps, requireAuth = false } = options;
const port = await getPort();
const url = getUrl(useHttps, requireAuth, port);
let proxyServer: http.Server | https.Server;
if (!useHttps) {
proxyServer = http.createServer();
} else {
proxyServer = https.createServer(TlsOptions);
}
proxyServer.unref();
proxy.createProxy(proxyServer);
if (requireAuth) {
(proxyServer as unknown as IAuthenticate).authenticate = (req, callback) => {
const auth = req.headers['proxy-authorization'];
callback(null, auth === `Basic ${AuthB64}`);
};
}
const readySignal = createReadySignal<CreateProxyResult>();
proxyServer.listen(port, 'localhost', () => {
readySignal.signal({ server: proxyServer, url });
});
return readySignal.wait();
}
function getUrl(useHttps: boolean, requiresAuth: boolean, port: number) {
return `http${useHttps ? 's' : ''}://${requiresAuth ? `${Auth}@` : ''}localhost:${port}`;
}
const BaseActionsConfig: ActionsConfig = {
allowedHosts: ['*'],
enabledActionTypes: ['*'],
preconfiguredAlertHistoryEsIndex: false,
preconfigured: {},
proxyUrl: undefined,
proxyHeaders: undefined,
proxyRejectUnauthorizedCertificates: true,
ssl: {
proxyVerificationMode: 'full',
verificationMode: 'full',
},
proxyBypassHosts: undefined,
proxyOnlyHosts: undefined,
rejectUnauthorized: true,
maxResponseContentLength: ByteSizeValue.parse('1mb'),
responseTimeout: momentDuration(1000 * 30),
customHostSettings: undefined,
enableFooterInEmail: true,
};
function getACUfromConfig(config: Partial<ActionsConfig> = {}): ActionsConfigurationUtilities {
const resolvedConfig = resolveCustomHosts(logger, { ...BaseActionsConfig, ...config });
return getActionsConfigurationUtilities(resolvedConfig);
}