openvibers/openvibe.network Commits
Allow Network session checks on Link and My (#793)
Changes
@@@ -151,7 +151,8 @@ app.use(helmet({// The machine's live screen on the Link hub: OpenRestream's viewer signaling socket."wss://ingest.openre.stream",],-- frameSrc: ["'none'"],++ // Link and My share this app on separate origins; their navbar checks Network's session.++ frameSrc: ["https://openvibe.network"],scriptSrcAttr: ["'unsafe-inline'"],},},@@@ -17,6 +17,7 @@ const { bootServer } = require('./helpers/boot-server');// The machine hub's live screen (/machines) imports mediasoup-client's pinned ESM build and opens// OpenRestream's viewer signaling socket: exactly those two, in the two directives that gate them.const directive = (name) => csp.split(';').map((d) => d.trim()).find((d) => d.startsWith(name)) || '';++ assert.strictEqual(directive('frame-src'), 'frame-src https://openvibe.network', 'the shared Link/My shell permits only Network session frames');assert.ok(directive('script-src').includes('https://esm.sh'), 'script-src lets the mediasoup client through');assert.ok(directive('connect-src').includes('wss://ingest.openre.stream'), 'connect-src lets the screen signaling through');console.log('CSP: home images, and the machine hub\'s live screen sources');
@@ -151,7 +151,8 @@ app.use(helmet({
@@ -151,7 +151,8 @@ app.use(helmet({
// The machine's live screen on the Link hub: OpenRestream's viewer signaling socket.
// The machine's live screen on the Link hub: OpenRestream's viewer signaling socket.
"wss://ingest.openre.stream",
"wss://ingest.openre.stream",
],
],
- frameSrc: ["'none'"],
+ // Link and My share this app on separate origins; their navbar checks Network's session.
+ frameSrc: ["https://openvibe.network"],
scriptSrcAttr: ["'unsafe-inline'"],
scriptSrcAttr: ["'unsafe-inline'"],
},
},
},
},
@@ -17,6 +17,7 @@ const { bootServer } = require('./helpers/boot-server');
@@ -17,6 +17,7 @@ const { bootServer } = require('./helpers/boot-server');
// The machine hub's live screen (/machines) imports mediasoup-client's pinned ESM build and opens
// The machine hub's live screen (/machines) imports mediasoup-client's pinned ESM build and opens
// OpenRestream's viewer signaling socket: exactly those two, in the two directives that gate them.
// OpenRestream's viewer signaling socket: exactly those two, in the two directives that gate them.
const directive = (name) => csp.split(';').map((d) => d.trim()).find((d) => d.startsWith(name)) || '';
const directive = (name) => csp.split(';').map((d) => d.trim()).find((d) => d.startsWith(name)) || '';
+ assert.strictEqual(directive('frame-src'), 'frame-src https://openvibe.network', 'the shared Link/My shell permits only Network session frames');
assert.ok(directive('script-src').includes('https://esm.sh'), 'script-src lets the mediasoup client through');
assert.ok(directive('script-src').includes('https://esm.sh'), 'script-src lets the mediasoup client through');
assert.ok(directive('connect-src').includes('wss://ingest.openre.stream'), 'connect-src lets the screen signaling through');
assert.ok(directive('connect-src').includes('wss://ingest.openre.stream'), 'connect-src lets the screen signaling through');
console.log('CSP: home images, and the machine hub\'s live screen sources');
console.log('CSP: home images, and the machine hub\'s live screen sources');