openvibers/openvibe.tools Commits
Allow Network session checks on Maps (#291)
Changes
@@@ -85,7 +85,8 @@ app.use(helmet({// The navbar's Messages count asks Chat (openvibe-shared 4.130.0).connectSrc: ["'self'", "https://openvibe.chat", "nominatim.openstreetmap.org", "api.weather.gov", "api.open-meteo.com", "*.tile.openstreetmap.org", "*.basemaps.cartocdn.com", "server.arcgisonline.com", "https://openvibe.network", "https://openvibe.events", "https://cloudflareinsights.com"],fontSrc: ["'self'", "fonts.gstatic.com", "cdn.jsdelivr.net"],-- frameSrc: ["'none'"],++ // The navbar checks Network's session in a hidden /sso/check frame on typed arrivals.++ frameSrc: ["https://openvibe.network"],scriptSrcAttr: ["'unsafe-inline'"],},},@@@ -9,6 +9,7 @@ const { startApp } = require('../../_shared/test/spawn');try {const csp = (await fetch(`${maps.base}/`)).headers.get('content-security-policy') || '';assert.match(csp, /img-src[^;]*https:\/\/openvibe\.media(?:[ ;]|$)/, csp);++ assert.match(csp, /(?:^|;)frame-src https:\/\/openvibe\.network(?:;|$)/, 'only Network may supply the silent session frame');console.log(' ✓ img-src allows https://openvibe.media');} finally {maps.kill('SIGTERM');nnew file mode 100644@@@ -0,0 +1,3 @@++'use strict';++// Expose the Maps HTTP policy check to ov test's root-level test discovery.++require('../apps/maps/test/csp.test.js');
@@ -85,7 +85,8 @@ app.use(helmet({
@@ -85,7 +85,8 @@ app.use(helmet({
// The navbar's Messages count asks Chat (openvibe-shared 4.130.0).
// The navbar's Messages count asks Chat (openvibe-shared 4.130.0).
connectSrc: ["'self'", "https://openvibe.chat", "nominatim.openstreetmap.org", "api.weather.gov", "api.open-meteo.com", "*.tile.openstreetmap.org", "*.basemaps.cartocdn.com", "server.arcgisonline.com", "https://openvibe.network", "https://openvibe.events", "https://cloudflareinsights.com"],
connectSrc: ["'self'", "https://openvibe.chat", "nominatim.openstreetmap.org", "api.weather.gov", "api.open-meteo.com", "*.tile.openstreetmap.org", "*.basemaps.cartocdn.com", "server.arcgisonline.com", "https://openvibe.network", "https://openvibe.events", "https://cloudflareinsights.com"],
fontSrc: ["'self'", "fonts.gstatic.com", "cdn.jsdelivr.net"],
fontSrc: ["'self'", "fonts.gstatic.com", "cdn.jsdelivr.net"],
- frameSrc: ["'none'"],
+ // The navbar checks Network's session in a hidden /sso/check frame on typed arrivals.
+ frameSrc: ["https://openvibe.network"],
scriptSrcAttr: ["'unsafe-inline'"],
scriptSrcAttr: ["'unsafe-inline'"],
},
},
},
},
@@ -9,6 +9,7 @@ const { startApp } = require('../../_shared/test/spawn');
@@ -9,6 +9,7 @@ const { startApp } = require('../../_shared/test/spawn');
try {
try {
const csp = (await fetch(`${maps.base}/`)).headers.get('content-security-policy') || '';
const csp = (await fetch(`${maps.base}/`)).headers.get('content-security-policy') || '';
assert.match(csp, /img-src[^;]*https:\/\/openvibe\.media(?:[ ;]|$)/, csp);
assert.match(csp, /img-src[^;]*https:\/\/openvibe\.media(?:[ ;]|$)/, csp);
+ assert.match(csp, /(?:^|;)frame-src https:\/\/openvibe\.network(?:;|$)/, 'only Network may supply the silent session frame');
console.log(' ✓ img-src allows https://openvibe.media');
console.log(' ✓ img-src allows https://openvibe.media');
} finally {
} finally {
maps.kill('SIGTERM');
maps.kill('SIGTERM');
new file mode 100644
new file mode 100644
@@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
+'use strict';
+// Expose the Maps HTTP policy check to ov test's root-level test discovery.
+require('../apps/maps/test/csp.test.js');