1 |
|
2 |
|
3 |
|
4 | const self = {}
|
5 |
|
6 | 'use strict';
|
7 | var validate = (function() {
|
8 | var refVal = [];
|
9 | return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
|
10 | 'use strict';
|
11 | var vErrors = null;
|
12 | var errors = 0;
|
13 | if (rootData === undefined) rootData = data;
|
14 | if ((data && typeof data === "object" && !Array.isArray(data))) {
|
15 | if (data.connectionTimeout === undefined) data.connectionTimeout = 0;
|
16 | if (data.keepAliveTimeout === undefined) data.keepAliveTimeout = 5000;
|
17 | if (data.bodyLimit === undefined) data.bodyLimit = 1048576;
|
18 | if (data.caseSensitive === undefined) data.caseSensitive = true;
|
19 | if (data.ignoreTrailingSlash === undefined) data.ignoreTrailingSlash = false;
|
20 | if (data.disableRequestLogging === undefined) data.disableRequestLogging = false;
|
21 | if (data.maxParamLength === undefined) data.maxParamLength = 100;
|
22 | if (data.onProtoPoisoning === undefined) data.onProtoPoisoning = "error";
|
23 | if (data.onConstructorPoisoning === undefined) data.onConstructorPoisoning = "error";
|
24 | if (data.pluginTimeout === undefined) data.pluginTimeout = 10000;
|
25 | if (data.requestIdHeader === undefined) data.requestIdHeader = "request-id";
|
26 | if (data.requestIdLogLabel === undefined) data.requestIdLogLabel = "reqId";
|
27 | if (data.http2SessionTimeout === undefined) data.http2SessionTimeout = 5000;
|
28 | var errs__0 = errors;
|
29 | var valid1 = true;
|
30 | for (var key0 in data) {
|
31 | var isAdditional0 = !(false || validate.schema.properties.hasOwnProperty(key0));
|
32 | if (isAdditional0) {
|
33 | delete data[key0];
|
34 | }
|
35 | }
|
36 | if (valid1) {
|
37 | var data1 = data.connectionTimeout;
|
38 | var errs_1 = errors;
|
39 | if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
40 | var dataType1 = typeof data1;
|
41 | var coerced1 = undefined;
|
42 | if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
43 | if (coerced1 === undefined) {
|
44 | validate.errors = [{
|
45 | keyword: 'type',
|
46 | dataPath: (dataPath || '') + '.connectionTimeout',
|
47 | schemaPath: '#/properties/connectionTimeout/type',
|
48 | params: {
|
49 | type: 'integer'
|
50 | },
|
51 | message: 'should be integer'
|
52 | }];
|
53 | return false;
|
54 | } else {
|
55 | data1 = coerced1;
|
56 | data['connectionTimeout'] = coerced1;
|
57 | }
|
58 | }
|
59 | var valid1 = errors === errs_1;
|
60 | if (valid1) {
|
61 | var data1 = data.keepAliveTimeout;
|
62 | var errs_1 = errors;
|
63 | if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
64 | var dataType1 = typeof data1;
|
65 | var coerced1 = undefined;
|
66 | if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
67 | if (coerced1 === undefined) {
|
68 | validate.errors = [{
|
69 | keyword: 'type',
|
70 | dataPath: (dataPath || '') + '.keepAliveTimeout',
|
71 | schemaPath: '#/properties/keepAliveTimeout/type',
|
72 | params: {
|
73 | type: 'integer'
|
74 | },
|
75 | message: 'should be integer'
|
76 | }];
|
77 | return false;
|
78 | } else {
|
79 | data1 = coerced1;
|
80 | data['keepAliveTimeout'] = coerced1;
|
81 | }
|
82 | }
|
83 | var valid1 = errors === errs_1;
|
84 | if (valid1) {
|
85 | var data1 = data.bodyLimit;
|
86 | var errs_1 = errors;
|
87 | if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
88 | var dataType1 = typeof data1;
|
89 | var coerced1 = undefined;
|
90 | if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
91 | if (coerced1 === undefined) {
|
92 | validate.errors = [{
|
93 | keyword: 'type',
|
94 | dataPath: (dataPath || '') + '.bodyLimit',
|
95 | schemaPath: '#/properties/bodyLimit/type',
|
96 | params: {
|
97 | type: 'integer'
|
98 | },
|
99 | message: 'should be integer'
|
100 | }];
|
101 | return false;
|
102 | } else {
|
103 | data1 = coerced1;
|
104 | data['bodyLimit'] = coerced1;
|
105 | }
|
106 | }
|
107 | var valid1 = errors === errs_1;
|
108 | if (valid1) {
|
109 | var data1 = data.caseSensitive;
|
110 | var errs_1 = errors;
|
111 | if (typeof data1 !== "boolean") {
|
112 | var dataType1 = typeof data1;
|
113 | var coerced1 = undefined;
|
114 | if (data1 === 'false' || data1 === 0 || data1 === null) coerced1 = false;
|
115 | else if (data1 === 'true' || data1 === 1) coerced1 = true;
|
116 | if (coerced1 === undefined) {
|
117 | validate.errors = [{
|
118 | keyword: 'type',
|
119 | dataPath: (dataPath || '') + '.caseSensitive',
|
120 | schemaPath: '#/properties/caseSensitive/type',
|
121 | params: {
|
122 | type: 'boolean'
|
123 | },
|
124 | message: 'should be boolean'
|
125 | }];
|
126 | return false;
|
127 | } else {
|
128 | data1 = coerced1;
|
129 | data['caseSensitive'] = coerced1;
|
130 | }
|
131 | }
|
132 | var valid1 = errors === errs_1;
|
133 | if (valid1) {
|
134 | var data1 = data.http2;
|
135 | if (data1 === undefined) {
|
136 | valid1 = true;
|
137 | } else {
|
138 | var errs_1 = errors;
|
139 | if (typeof data1 !== "boolean") {
|
140 | var dataType1 = typeof data1;
|
141 | var coerced1 = undefined;
|
142 | if (data1 === 'false' || data1 === 0 || data1 === null) coerced1 = false;
|
143 | else if (data1 === 'true' || data1 === 1) coerced1 = true;
|
144 | if (coerced1 === undefined) {
|
145 | validate.errors = [{
|
146 | keyword: 'type',
|
147 | dataPath: (dataPath || '') + '.http2',
|
148 | schemaPath: '#/properties/http2/type',
|
149 | params: {
|
150 | type: 'boolean'
|
151 | },
|
152 | message: 'should be boolean'
|
153 | }];
|
154 | return false;
|
155 | } else {
|
156 | data1 = coerced1;
|
157 | data['http2'] = coerced1;
|
158 | }
|
159 | }
|
160 | var valid1 = errors === errs_1;
|
161 | }
|
162 | if (valid1) {
|
163 | var data1 = data.https;
|
164 | if (data1 === undefined) {
|
165 | valid1 = true;
|
166 | } else {
|
167 | var errs_1 = errors;
|
168 | var errs__1 = errors;
|
169 | var valid1 = true;
|
170 | var errs_2 = errors;
|
171 | var errs__2 = errors;
|
172 | var errs_3 = errors;
|
173 | var errs__3 = errors,
|
174 | prevValid3 = false,
|
175 | valid3 = false,
|
176 | passingSchemas3 = null;
|
177 | var errs_4 = errors;
|
178 | if (typeof data1 !== "boolean") {
|
179 | var dataType4 = typeof data1;
|
180 | var coerced4 = undefined;
|
181 | if (data1 === 'false' || data1 === 0 || data1 === null) coerced4 = false;
|
182 | else if (data1 === 'true' || data1 === 1) coerced4 = true;
|
183 | if (coerced4 === undefined) {
|
184 | var err = {};
|
185 | if (vErrors === null) vErrors = [err];
|
186 | else vErrors.push(err);
|
187 | errors++;
|
188 | } else {
|
189 | data1 = coerced4;
|
190 | data['https'] = coerced4;
|
191 | }
|
192 | }
|
193 | var valid4 = errors === errs_4;
|
194 | if (valid4) {
|
195 | valid3 = prevValid3 = true;
|
196 | passingSchemas3 = 0;
|
197 | }
|
198 | var errs_4 = errors;
|
199 | if (data1 !== null) {
|
200 | var dataType4 = typeof data1;
|
201 | var coerced4 = undefined;
|
202 | if (data1 === '' || data1 === 0 || data1 === false) coerced4 = null;
|
203 | if (coerced4 === undefined) {
|
204 | var err = {};
|
205 | if (vErrors === null) vErrors = [err];
|
206 | else vErrors.push(err);
|
207 | errors++;
|
208 | } else {
|
209 | data1 = coerced4;
|
210 | data['https'] = coerced4;
|
211 | }
|
212 | }
|
213 | var valid4 = errors === errs_4;
|
214 | if (valid4 && prevValid3) {
|
215 | valid3 = false;
|
216 | passingSchemas3 = [passingSchemas3, 1];
|
217 | } else {
|
218 | if (valid4) {
|
219 | valid3 = prevValid3 = true;
|
220 | passingSchemas3 = 1;
|
221 | }
|
222 | var errs_4 = errors;
|
223 | if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
|
224 | if (true) {
|
225 | var errs__4 = errors;
|
226 | var valid5 = true;
|
227 | for (var key4 in data1) {
|
228 | var isAdditional4 = !(false || key4 == 'allowHTTP1');
|
229 | if (isAdditional4) {
|
230 | delete data1[key4];
|
231 | }
|
232 | }
|
233 | if (valid5) {
|
234 | var data2 = data1.allowHTTP1;
|
235 | if (data2 === undefined) {
|
236 | valid5 = false;
|
237 | var err = {};
|
238 | if (vErrors === null) vErrors = [err];
|
239 | else vErrors.push(err);
|
240 | errors++;
|
241 | } else {
|
242 | var errs_5 = errors;
|
243 | if (typeof data2 !== "boolean") {
|
244 | var dataType5 = typeof data2;
|
245 | var coerced5 = undefined;
|
246 | if (data2 === 'false' || data2 === 0 || data2 === null) coerced5 = false;
|
247 | else if (data2 === 'true' || data2 === 1) coerced5 = true;
|
248 | if (coerced5 === undefined) {
|
249 | var err = {};
|
250 | if (vErrors === null) vErrors = [err];
|
251 | else vErrors.push(err);
|
252 | errors++;
|
253 | } else {
|
254 | data2 = coerced5;
|
255 | data1['allowHTTP1'] = coerced5;
|
256 | }
|
257 | }
|
258 | var valid5 = errors === errs_5;
|
259 | }
|
260 | }
|
261 | }
|
262 | } else {
|
263 | var err = {};
|
264 | if (vErrors === null) vErrors = [err];
|
265 | else vErrors.push(err);
|
266 | errors++;
|
267 | }
|
268 | var valid4 = errors === errs_4;
|
269 | if (valid4 && prevValid3) {
|
270 | valid3 = false;
|
271 | passingSchemas3 = [passingSchemas3, 2];
|
272 | } else {
|
273 | if (valid4) {
|
274 | valid3 = prevValid3 = true;
|
275 | passingSchemas3 = 2;
|
276 | }
|
277 | }
|
278 | }
|
279 | if (!valid3) {
|
280 | var err = {};
|
281 | if (vErrors === null) vErrors = [err];
|
282 | else vErrors.push(err);
|
283 | errors++;
|
284 | } else {
|
285 | errors = errs__3;
|
286 | if (vErrors !== null) {
|
287 | if (errs__3) vErrors.length = errs__3;
|
288 | else vErrors = null;
|
289 | }
|
290 | }
|
291 | var valid3 = errors === errs_3;
|
292 | if (valid3) {
|
293 | var err = {};
|
294 | if (vErrors === null) vErrors = [err];
|
295 | else vErrors.push(err);
|
296 | errors++;
|
297 | } else {
|
298 | errors = errs__2;
|
299 | if (vErrors !== null) {
|
300 | if (errs__2) vErrors.length = errs__2;
|
301 | else vErrors = null;
|
302 | }
|
303 | }
|
304 | var valid2 = errors === errs_2;
|
305 | errors = errs__1;
|
306 | if (vErrors !== null) {
|
307 | if (errs__1) vErrors.length = errs__1;
|
308 | else vErrors = null;
|
309 | }
|
310 | if (valid2) {
|
311 | var errs_2 = errors;
|
312 | customRule0.errors = null;
|
313 | var errs__2 = errors;
|
314 | var valid2;
|
315 | valid2 = customRule0.call(self, validate.schema.properties.https.then.setDefaultValue, data1, validate.schema.properties.https.then, (dataPath || '') + '.https', data, 'https', rootData);
|
316 | if (data) data1 = data['https'];
|
317 | if (!valid2) {
|
318 | validate.errors = [{
|
319 | keyword: 'setDefaultValue',
|
320 | dataPath: (dataPath || '') + '.https',
|
321 | schemaPath: '#/properties/https/then/setDefaultValue',
|
322 | params: {
|
323 | keyword: 'setDefaultValue'
|
324 | },
|
325 | message: 'should pass "setDefaultValue" keyword validation'
|
326 | }];
|
327 | return false;
|
328 | }
|
329 | var valid2 = errors === errs_2;
|
330 | valid1 = valid2;
|
331 | }
|
332 | if (!valid1) {
|
333 | var err = {
|
334 | keyword: 'if',
|
335 | dataPath: (dataPath || '') + '.https',
|
336 | schemaPath: '#/properties/https/if',
|
337 | params: {
|
338 | failingKeyword: 'then'
|
339 | },
|
340 | message: 'should match "' + 'then' + '" schema'
|
341 | };
|
342 | if (vErrors === null) vErrors = [err];
|
343 | else vErrors.push(err);
|
344 | errors++;
|
345 | validate.errors = vErrors;
|
346 | return false;
|
347 | }
|
348 | var valid1 = errors === errs_1;
|
349 | }
|
350 | if (valid1) {
|
351 | var data1 = data.ignoreTrailingSlash;
|
352 | var errs_1 = errors;
|
353 | if (typeof data1 !== "boolean") {
|
354 | var dataType1 = typeof data1;
|
355 | var coerced1 = undefined;
|
356 | if (data1 === 'false' || data1 === 0 || data1 === null) coerced1 = false;
|
357 | else if (data1 === 'true' || data1 === 1) coerced1 = true;
|
358 | if (coerced1 === undefined) {
|
359 | validate.errors = [{
|
360 | keyword: 'type',
|
361 | dataPath: (dataPath || '') + '.ignoreTrailingSlash',
|
362 | schemaPath: '#/properties/ignoreTrailingSlash/type',
|
363 | params: {
|
364 | type: 'boolean'
|
365 | },
|
366 | message: 'should be boolean'
|
367 | }];
|
368 | return false;
|
369 | } else {
|
370 | data1 = coerced1;
|
371 | data['ignoreTrailingSlash'] = coerced1;
|
372 | }
|
373 | }
|
374 | var valid1 = errors === errs_1;
|
375 | if (valid1) {
|
376 | var data1 = data.disableRequestLogging;
|
377 | var errs_1 = errors;
|
378 | if (typeof data1 !== "boolean") {
|
379 | var dataType1 = typeof data1;
|
380 | var coerced1 = undefined;
|
381 | if (data1 === 'false' || data1 === 0 || data1 === null) coerced1 = false;
|
382 | else if (data1 === 'true' || data1 === 1) coerced1 = true;
|
383 | if (coerced1 === undefined) {
|
384 | validate.errors = [{
|
385 | keyword: 'type',
|
386 | dataPath: (dataPath || '') + '.disableRequestLogging',
|
387 | schemaPath: '#/properties/disableRequestLogging/type',
|
388 | params: {
|
389 | type: 'boolean'
|
390 | },
|
391 | message: 'should be boolean'
|
392 | }];
|
393 | return false;
|
394 | } else {
|
395 | data1 = coerced1;
|
396 | data['disableRequestLogging'] = coerced1;
|
397 | }
|
398 | }
|
399 | var valid1 = errors === errs_1;
|
400 | if (valid1) {
|
401 | var data1 = data.maxParamLength;
|
402 | var errs_1 = errors;
|
403 | if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
404 | var dataType1 = typeof data1;
|
405 | var coerced1 = undefined;
|
406 | if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
407 | if (coerced1 === undefined) {
|
408 | validate.errors = [{
|
409 | keyword: 'type',
|
410 | dataPath: (dataPath || '') + '.maxParamLength',
|
411 | schemaPath: '#/properties/maxParamLength/type',
|
412 | params: {
|
413 | type: 'integer'
|
414 | },
|
415 | message: 'should be integer'
|
416 | }];
|
417 | return false;
|
418 | } else {
|
419 | data1 = coerced1;
|
420 | data['maxParamLength'] = coerced1;
|
421 | }
|
422 | }
|
423 | var valid1 = errors === errs_1;
|
424 | if (valid1) {
|
425 | var data1 = data.onProtoPoisoning;
|
426 | var errs_1 = errors;
|
427 | if (typeof data1 !== "string") {
|
428 | var dataType1 = typeof data1;
|
429 | var coerced1 = undefined;
|
430 | if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
431 | else if (data1 === null) coerced1 = '';
|
432 | if (coerced1 === undefined) {
|
433 | validate.errors = [{
|
434 | keyword: 'type',
|
435 | dataPath: (dataPath || '') + '.onProtoPoisoning',
|
436 | schemaPath: '#/properties/onProtoPoisoning/type',
|
437 | params: {
|
438 | type: 'string'
|
439 | },
|
440 | message: 'should be string'
|
441 | }];
|
442 | return false;
|
443 | } else {
|
444 | data1 = coerced1;
|
445 | data['onProtoPoisoning'] = coerced1;
|
446 | }
|
447 | }
|
448 | var valid1 = errors === errs_1;
|
449 | if (valid1) {
|
450 | var data1 = data.onConstructorPoisoning;
|
451 | var errs_1 = errors;
|
452 | if (typeof data1 !== "string") {
|
453 | var dataType1 = typeof data1;
|
454 | var coerced1 = undefined;
|
455 | if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
456 | else if (data1 === null) coerced1 = '';
|
457 | if (coerced1 === undefined) {
|
458 | validate.errors = [{
|
459 | keyword: 'type',
|
460 | dataPath: (dataPath || '') + '.onConstructorPoisoning',
|
461 | schemaPath: '#/properties/onConstructorPoisoning/type',
|
462 | params: {
|
463 | type: 'string'
|
464 | },
|
465 | message: 'should be string'
|
466 | }];
|
467 | return false;
|
468 | } else {
|
469 | data1 = coerced1;
|
470 | data['onConstructorPoisoning'] = coerced1;
|
471 | }
|
472 | }
|
473 | var valid1 = errors === errs_1;
|
474 | if (valid1) {
|
475 | var data1 = data.pluginTimeout;
|
476 | var errs_1 = errors;
|
477 | if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
478 | var dataType1 = typeof data1;
|
479 | var coerced1 = undefined;
|
480 | if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
481 | if (coerced1 === undefined) {
|
482 | validate.errors = [{
|
483 | keyword: 'type',
|
484 | dataPath: (dataPath || '') + '.pluginTimeout',
|
485 | schemaPath: '#/properties/pluginTimeout/type',
|
486 | params: {
|
487 | type: 'integer'
|
488 | },
|
489 | message: 'should be integer'
|
490 | }];
|
491 | return false;
|
492 | } else {
|
493 | data1 = coerced1;
|
494 | data['pluginTimeout'] = coerced1;
|
495 | }
|
496 | }
|
497 | var valid1 = errors === errs_1;
|
498 | if (valid1) {
|
499 | var data1 = data.requestIdHeader;
|
500 | var errs_1 = errors;
|
501 | if (typeof data1 !== "string") {
|
502 | var dataType1 = typeof data1;
|
503 | var coerced1 = undefined;
|
504 | if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
505 | else if (data1 === null) coerced1 = '';
|
506 | if (coerced1 === undefined) {
|
507 | validate.errors = [{
|
508 | keyword: 'type',
|
509 | dataPath: (dataPath || '') + '.requestIdHeader',
|
510 | schemaPath: '#/properties/requestIdHeader/type',
|
511 | params: {
|
512 | type: 'string'
|
513 | },
|
514 | message: 'should be string'
|
515 | }];
|
516 | return false;
|
517 | } else {
|
518 | data1 = coerced1;
|
519 | data['requestIdHeader'] = coerced1;
|
520 | }
|
521 | }
|
522 | var valid1 = errors === errs_1;
|
523 | if (valid1) {
|
524 | var data1 = data.requestIdLogLabel;
|
525 | var errs_1 = errors;
|
526 | if (typeof data1 !== "string") {
|
527 | var dataType1 = typeof data1;
|
528 | var coerced1 = undefined;
|
529 | if (dataType1 == 'number' || dataType1 == 'boolean') coerced1 = '' + data1;
|
530 | else if (data1 === null) coerced1 = '';
|
531 | if (coerced1 === undefined) {
|
532 | validate.errors = [{
|
533 | keyword: 'type',
|
534 | dataPath: (dataPath || '') + '.requestIdLogLabel',
|
535 | schemaPath: '#/properties/requestIdLogLabel/type',
|
536 | params: {
|
537 | type: 'string'
|
538 | },
|
539 | message: 'should be string'
|
540 | }];
|
541 | return false;
|
542 | } else {
|
543 | data1 = coerced1;
|
544 | data['requestIdLogLabel'] = coerced1;
|
545 | }
|
546 | }
|
547 | var valid1 = errors === errs_1;
|
548 | if (valid1) {
|
549 | var data1 = data.http2SessionTimeout;
|
550 | var errs_1 = errors;
|
551 | if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
|
552 | var dataType1 = typeof data1;
|
553 | var coerced1 = undefined;
|
554 | if (dataType1 == 'boolean' || data1 === null || (dataType1 == 'string' && data1 && data1 == +data1 && !(data1 % 1))) coerced1 = +data1;
|
555 | if (coerced1 === undefined) {
|
556 | validate.errors = [{
|
557 | keyword: 'type',
|
558 | dataPath: (dataPath || '') + '.http2SessionTimeout',
|
559 | schemaPath: '#/properties/http2SessionTimeout/type',
|
560 | params: {
|
561 | type: 'integer'
|
562 | },
|
563 | message: 'should be integer'
|
564 | }];
|
565 | return false;
|
566 | } else {
|
567 | data1 = coerced1;
|
568 | data['http2SessionTimeout'] = coerced1;
|
569 | }
|
570 | }
|
571 | var valid1 = errors === errs_1;
|
572 | }
|
573 | }
|
574 | }
|
575 | }
|
576 | }
|
577 | }
|
578 | }
|
579 | }
|
580 | }
|
581 | }
|
582 | }
|
583 | }
|
584 | }
|
585 | }
|
586 | }
|
587 | } else {
|
588 | validate.errors = [{
|
589 | keyword: 'type',
|
590 | dataPath: (dataPath || '') + "",
|
591 | schemaPath: '#/type',
|
592 | params: {
|
593 | type: 'object'
|
594 | },
|
595 | message: 'should be object'
|
596 | }];
|
597 | return false;
|
598 | }
|
599 | validate.errors = vErrors;
|
600 | return errors === 0;
|
601 | };
|
602 | })();
|
603 | validate.schema = {
|
604 | "type": "object",
|
605 | "additionalProperties": false,
|
606 | "properties": {
|
607 | "connectionTimeout": {
|
608 | "type": "integer",
|
609 | "default": 0
|
610 | },
|
611 | "keepAliveTimeout": {
|
612 | "type": "integer",
|
613 | "default": 5000
|
614 | },
|
615 | "bodyLimit": {
|
616 | "type": "integer",
|
617 | "default": 1048576
|
618 | },
|
619 | "caseSensitive": {
|
620 | "type": "boolean",
|
621 | "default": true
|
622 | },
|
623 | "http2": {
|
624 | "type": "boolean"
|
625 | },
|
626 | "https": {
|
627 | "if": {
|
628 | "not": {
|
629 | "oneOf": [{
|
630 | "type": "boolean"
|
631 | }, {
|
632 | "type": "null"
|
633 | }, {
|
634 | "type": "object",
|
635 | "additionalProperties": false,
|
636 | "required": ["allowHTTP1"],
|
637 | "properties": {
|
638 | "allowHTTP1": {
|
639 | "type": "boolean"
|
640 | }
|
641 | }
|
642 | }]
|
643 | }
|
644 | },
|
645 | "then": {
|
646 | "setDefaultValue": true
|
647 | }
|
648 | },
|
649 | "ignoreTrailingSlash": {
|
650 | "type": "boolean",
|
651 | "default": false
|
652 | },
|
653 | "disableRequestLogging": {
|
654 | "type": "boolean",
|
655 | "default": false
|
656 | },
|
657 | "maxParamLength": {
|
658 | "type": "integer",
|
659 | "default": 100
|
660 | },
|
661 | "onProtoPoisoning": {
|
662 | "type": "string",
|
663 | "default": "error"
|
664 | },
|
665 | "onConstructorPoisoning": {
|
666 | "type": "string",
|
667 | "default": "error"
|
668 | },
|
669 | "pluginTimeout": {
|
670 | "type": "integer",
|
671 | "default": 10000
|
672 | },
|
673 | "requestIdHeader": {
|
674 | "type": "string",
|
675 | "default": "request-id"
|
676 | },
|
677 | "requestIdLogLabel": {
|
678 | "type": "string",
|
679 | "default": "reqId"
|
680 | },
|
681 | "http2SessionTimeout": {
|
682 | "type": "integer",
|
683 | "default": 5000
|
684 | }
|
685 | }
|
686 | };
|
687 | validate.errors = null;
|
688 | module.exports = validate;
|
689 |
|
690 | function customRule0 (schemaParamValue, validatedParamValue, validationSchemaObject, currentDataPath, validatedParamObject, validatedParam) {
|
691 | validatedParamObject[validatedParam] = schemaParamValue
|
692 | return true
|
693 | }
|
694 |
|
695 | module.exports.defaultInitOptions = {"connectionTimeout":0,"keepAliveTimeout":5000,"bodyLimit":1048576,"caseSensitive":true,"disableRequestLogging":false,"ignoreTrailingSlash":false,"maxParamLength":100,"onProtoPoisoning":"error","onConstructorPoisoning":"error","pluginTimeout":10000,"requestIdHeader":"request-id","requestIdLogLabel":"reqId","http2SessionTimeout":5000}
|