@vulkano/core 1.6.0 → 1.7.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/bootstrap/express.js +2 -0
- package/bootstrap/server.js +63 -0
- package/package.json +11 -11
package/bootstrap/express.js
CHANGED
|
@@ -41,7 +41,9 @@ module.exports = function getExpressConfiguration() {
|
|
|
41
41
|
port: ENV_NODE_PORT || ENV_PORT || expressUserPort || expressSettingsPort || 8000,
|
|
42
42
|
cors: {},
|
|
43
43
|
cookies: {},
|
|
44
|
+
csp: {},
|
|
44
45
|
jwt: {},
|
|
46
|
+
permissionPolicy: {},
|
|
45
47
|
sockets: {},
|
|
46
48
|
redis: {},
|
|
47
49
|
multer: {
|
package/bootstrap/server.js
CHANGED
|
@@ -232,6 +232,69 @@ module.exports = function loadServer() {
|
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
// ---------------
|
|
236
|
+
// Content Security Policy - File: app/config/express/csp.js
|
|
237
|
+
// ---------------
|
|
238
|
+
const {
|
|
239
|
+
enabled: cspEnabled,
|
|
240
|
+
report: cspReportTo,
|
|
241
|
+
rules: cspRules
|
|
242
|
+
} = expressConfig.csp || {};
|
|
243
|
+
|
|
244
|
+
if (cspEnabled) {
|
|
245
|
+
|
|
246
|
+
if (!Array.isArray(cspRules)) {
|
|
247
|
+
console.error('Vulkano Error: ', 'The Content Security Policy Rules must be an array');
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (cspRules.length > 0) {
|
|
252
|
+
|
|
253
|
+
vulkano.use( (req, res, next) => {
|
|
254
|
+
|
|
255
|
+
if (cspReportTo) {
|
|
256
|
+
res.setHeader('Report-To', JSON.stringify(cspReportTo));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
res.setHeader('Content-Security-Policy', cspRules.join('; '));
|
|
260
|
+
|
|
261
|
+
next();
|
|
262
|
+
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// ---------------
|
|
270
|
+
// Permission Policy - File: app/config/express/permissionPolicy.js
|
|
271
|
+
// ---------------
|
|
272
|
+
const {
|
|
273
|
+
enabled: ppEnabled,
|
|
274
|
+
permissions: ppPermissions
|
|
275
|
+
} = expressConfig.permissionPolicy || {};
|
|
276
|
+
|
|
277
|
+
if (ppEnabled) {
|
|
278
|
+
|
|
279
|
+
if (!Array.isArray(ppPermissions)) {
|
|
280
|
+
console.error('Vulkano Error: ', 'The Permission Policy values must be an array');
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (ppPermissions.length > 0) {
|
|
285
|
+
|
|
286
|
+
vulkano.use( (req, res, next) => {
|
|
287
|
+
|
|
288
|
+
res.setHeader('Permissions-Policy', ppPermissions.join(', '));
|
|
289
|
+
|
|
290
|
+
next();
|
|
291
|
+
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
}
|
|
297
|
+
|
|
235
298
|
// ---------------
|
|
236
299
|
// VIEWS
|
|
237
300
|
// ---------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulkano/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "A MVC framework using Express 4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vulkano Team",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@socket.io/mongo-adapter": "^0.3.2",
|
|
32
32
|
"@socket.io/redis-adapter": "^8.3.0",
|
|
33
|
-
"axios": "^1.
|
|
33
|
+
"axios": "^1.7.2",
|
|
34
34
|
"bluebird": "^3.7.2",
|
|
35
35
|
"body-parser": "^1.20.2",
|
|
36
36
|
"compression": "^1.7.4",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"fs": "^0.0.1-security",
|
|
47
47
|
"fs-extra": "^11.2.0",
|
|
48
48
|
"helmet": "^7.1.0",
|
|
49
|
-
"i18next": "^23.11.
|
|
49
|
+
"i18next": "^23.11.5",
|
|
50
50
|
"include-all": "^4.0.3",
|
|
51
51
|
"jwt-simple": "^0.5.6",
|
|
52
52
|
"moment": "^2.30.1",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
"mongoose-paginate": "^5.0.3",
|
|
56
56
|
"morgan": "^1.10.0",
|
|
57
57
|
"multer": "^1.4.5-lts.1",
|
|
58
|
-
"nodemon": "^3.1.
|
|
58
|
+
"nodemon": "^3.1.3",
|
|
59
59
|
"nunjucks": "^3.2.4",
|
|
60
60
|
"path": "^0.12.7",
|
|
61
61
|
"promise.prototype.finally": "^3.1.8",
|
|
62
|
-
"redis": "^4.6.
|
|
62
|
+
"redis": "^4.6.14",
|
|
63
63
|
"socket.io": "^4.7.5",
|
|
64
64
|
"socket.io-adapter": "^2.5.4",
|
|
65
65
|
"socket.io-client": "4.7.5",
|
|
@@ -67,18 +67,18 @@
|
|
|
67
67
|
"yargs": "^17.7.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@babel/core": "^7.24.
|
|
71
|
-
"@babel/eslint-parser": "^7.24.
|
|
70
|
+
"@babel/core": "^7.24.7",
|
|
71
|
+
"@babel/eslint-parser": "^7.24.7",
|
|
72
72
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
73
|
-
"@babel/plugin-syntax-jsx": "^7.24.
|
|
74
|
-
"@babel/preset-env": "^7.24.
|
|
75
|
-
"@babel/preset-react": "^7.24.
|
|
73
|
+
"@babel/plugin-syntax-jsx": "^7.24.7",
|
|
74
|
+
"@babel/preset-env": "^7.24.7",
|
|
75
|
+
"@babel/preset-react": "^7.24.7",
|
|
76
76
|
"@babel/preset-stage-1": "^7.8.3",
|
|
77
77
|
"eslint": "^8.57.0",
|
|
78
78
|
"eslint-config-airbnb": "^19.0.4",
|
|
79
79
|
"eslint-plugin-import": "^2.29.1",
|
|
80
80
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
81
|
-
"eslint-plugin-react": "^7.34.
|
|
81
|
+
"eslint-plugin-react": "^7.34.2",
|
|
82
82
|
"eslint-plugin-react-hooks": "^4.6.2"
|
|
83
83
|
}
|
|
84
84
|
}
|