@codefresh-io/service-base 7.3.2 → 7.4.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/infra/config.js +10 -0
- package/infra/express.js +2 -0
- package/infra/index.js +0 -1
- package/package.json +4 -3
package/infra/config.js
CHANGED
|
@@ -72,6 +72,10 @@ if (process.env.MTLS_CERT_PATH) {
|
|
|
72
72
|
base.mongo.options.tlsInsecure = process.env.MONGO_MTLS_VALIDATE === 'false';
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
if (process.env.MONGO_ENABLE_ZSTD_NETWORK_COMPRESSION === 'true') {
|
|
76
|
+
base.mongo.options.compressors = ['zstd'];
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
base.logger = {
|
|
76
80
|
filePath: process.env.LOGS_PATH || path.join(__dirname, '../../logs', 'kubernetes-logs.log'),
|
|
77
81
|
console: true,
|
|
@@ -129,6 +133,12 @@ base.httpLogger = {
|
|
|
129
133
|
format: 'dev',
|
|
130
134
|
};
|
|
131
135
|
|
|
136
|
+
base.httpQueryParser = {
|
|
137
|
+
allowPrototypes: true,
|
|
138
|
+
arrayLimit: process.env.URI_QUERY_ARRAY_MAX_LENGTH || 100,
|
|
139
|
+
parameterLimit: process.env.URI_QUERY_MAX_ITEMS || 200,
|
|
140
|
+
};
|
|
141
|
+
|
|
132
142
|
base.newrelic = { license_key: process.env.NEWRELIC_LICENSE_KEY };
|
|
133
143
|
|
|
134
144
|
base.safe = { secret: process.env.SAFE_SECRET || 'secret' };
|
package/infra/express.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const Promise = require('bluebird');
|
|
2
2
|
const express = require('express');
|
|
3
|
+
const qs = require('qs');
|
|
3
4
|
const compression = require('compression');
|
|
4
5
|
const bodyParser = require('body-parser');
|
|
5
6
|
const methodOverride = require('method-override');
|
|
@@ -51,6 +52,7 @@ class Express {
|
|
|
51
52
|
return Promise.resolve()
|
|
52
53
|
.then(() => {
|
|
53
54
|
const app = this.expressApp;
|
|
55
|
+
app.set('query parser', (str) => qs.parse(str, this.config.httpQueryParser));
|
|
54
56
|
|
|
55
57
|
app.use(newDomainMiddleware());
|
|
56
58
|
|
package/infra/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefresh-io/service-base",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "",
|
|
6
6
|
"bin": {
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"eslint/**/ansi-regex": "^4.0.0",
|
|
33
33
|
"js-yaml": "^3.13.1",
|
|
34
34
|
"json-schema": "^0.4.0",
|
|
35
|
-
"request/qs": "6.5.3",
|
|
36
35
|
"get-func-name": "^2.0.1"
|
|
37
36
|
},
|
|
38
37
|
"homepage": "https://github.com/codefresh-io/service-base#readme",
|
|
@@ -43,6 +42,7 @@
|
|
|
43
42
|
"@codefresh-io/eventbus": "^2.4.0",
|
|
44
43
|
"@codefresh-io/http-infra": "^1.8.15",
|
|
45
44
|
"@codefresh-io/internal-service-config": "^1.0.3",
|
|
45
|
+
"@mongodb-js/zstd": "^2.0.1",
|
|
46
46
|
"@wegolook/joi-objectid": "^2.4.0",
|
|
47
47
|
"ajv": "^6.10.0",
|
|
48
48
|
"bluebird": "^3.5.3",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"chai": "4.3.10",
|
|
53
53
|
"compression": "^1.7.4",
|
|
54
54
|
"cookie-parser": "^1.4.4",
|
|
55
|
-
"express": "^4.
|
|
55
|
+
"express": "^4.22.1",
|
|
56
56
|
"joi": "^13.0.2",
|
|
57
57
|
"js-yaml": "^3.13.1",
|
|
58
58
|
"lodash": "4.17.21",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"morgan": "^1.9.1",
|
|
62
62
|
"proxyquire": "^1.8.0",
|
|
63
63
|
"queue": "^4.2.1",
|
|
64
|
+
"qs":"^6.14.1",
|
|
64
65
|
"redis": "^3.1.0",
|
|
65
66
|
"request": "2.88.2",
|
|
66
67
|
"request-promise": "4.2.6"
|