openvibers/openvibe.studio Commits
CSP: let the release watch reach openvibe.events (#6)
Changes
@@@ -44,7 +44,7 @@ function createApp(opts = {}) {styleSrc: ["'self'", "'unsafe-inline'", 'https://openvibe.network', 'https://fonts.googleapis.com'],fontSrc: ["'self'", 'data:', 'https://fonts.gstatic.com'],imgSrc: ["'self'", 'data:', 'https://openvibe.network'],-- connectSrc: ["'self'", 'https://openvibe.network', 'https://openvibe.download', 'https://openvibe.pics', 'https://cloudflareinsights.com'],++ connectSrc: ["'self'", 'https://openvibe.network', 'https://openvibe.download', 'https://openvibe.pics', 'https://cloudflareinsights.com', 'https://openvibe.events'],frameSrc: ["'self'"],frameAncestors: ["'none'"],objectSrc: ["'none'"],@@@ -204,5 +204,7 @@ test('the app catalogue, the attribution page and the small endpoints answer', aassert.equal(manifest.openapi, 'https://openvibe.studio/openapi.json');assert.equal((await fetch(s.base + '/robots.txt')).status, 200);{ const r = await fetch(s.base + '/release.json'); assert.equal(r.status, 200, 'the navbar release watch polls /release.json'); assert.equal((await r.json()).service, 'studio'); }++ // The release watch then listens on openvibe.events for new releases: the page's CSP must let it (11-09 sweep).++ assert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /connect-src[^;]*https:\/\/openvibe\.events/);assert.equal((await fetch(s.base + '/nope')).status, 404);});
@@ -44,7 +44,7 @@ function createApp(opts = {}) {
@@ -44,7 +44,7 @@ function createApp(opts = {}) {
styleSrc: ["'self'", "'unsafe-inline'", 'https://openvibe.network', 'https://fonts.googleapis.com'],
styleSrc: ["'self'", "'unsafe-inline'", 'https://openvibe.network', 'https://fonts.googleapis.com'],
fontSrc: ["'self'", 'data:', 'https://fonts.gstatic.com'],
fontSrc: ["'self'", 'data:', 'https://fonts.gstatic.com'],
imgSrc: ["'self'", 'data:', 'https://openvibe.network'],
imgSrc: ["'self'", 'data:', 'https://openvibe.network'],
- connectSrc: ["'self'", 'https://openvibe.network', 'https://openvibe.download', 'https://openvibe.pics', 'https://cloudflareinsights.com'],
+ connectSrc: ["'self'", 'https://openvibe.network', 'https://openvibe.download', 'https://openvibe.pics', 'https://cloudflareinsights.com', 'https://openvibe.events'],
frameSrc: ["'self'"],
frameSrc: ["'self'"],
frameAncestors: ["'none'"],
frameAncestors: ["'none'"],
objectSrc: ["'none'"],
objectSrc: ["'none'"],
@@ -204,5 +204,7 @@ test('the app catalogue, the attribution page and the small endpoints answer', a
@@ -204,5 +204,7 @@ test('the app catalogue, the attribution page and the small endpoints answer', a
assert.equal(manifest.openapi, 'https://openvibe.studio/openapi.json');
assert.equal(manifest.openapi, 'https://openvibe.studio/openapi.json');
assert.equal((await fetch(s.base + '/robots.txt')).status, 200);
assert.equal((await fetch(s.base + '/robots.txt')).status, 200);
{ const r = await fetch(s.base + '/release.json'); assert.equal(r.status, 200, 'the navbar release watch polls /release.json'); assert.equal((await r.json()).service, 'studio'); }
{ const r = await fetch(s.base + '/release.json'); assert.equal(r.status, 200, 'the navbar release watch polls /release.json'); assert.equal((await r.json()).service, 'studio'); }
+ // The release watch then listens on openvibe.events for new releases: the page's CSP must let it (11-09 sweep).
+ assert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /connect-src[^;]*https:\/\/openvibe\.events/);
assert.equal((await fetch(s.base + '/nope')).status, 404);
assert.equal((await fetch(s.base + '/nope')).status, 404);
});
});