openvibers/openvibe.locker Commits
Serve /release.json for the navbar's release watch (#6)
Changes
@@@ -177,6 +177,9 @@ async function createApp(options = {}) {});res.json({ restricted: req.body.restricted });}));++ // GET /release.json (ADR-016): the navbar's release watch polls it so open tabs learn of a new release (the 11-09++ // browser sweep found it answering 404 here).++ require('openvibe-shared/release').createRelease({ service: 'locker', root: path.join(__dirname, '..') }).mount(app);app.use('/shared', require('openvibe-shared/serve').handler());app.use(express.static(path.join(__dirname, '..', 'public'), { index: false, maxAge: '1h' }));app.use(require('./pages').createPages({ config }));@@@ -21,6 +21,9 @@ test('password login items use people locks and remain opaque in storage', asyncassert.equal(new TextDecoder().decode(bytes).includes('secret-password'), false);assert.equal(new TextDecoder().decode(await locker.open(bytes, { person: t.people.get(SUBJECT) })), secret);assert.equal((await t.request('GET', '/api/v1/files')).status, 200);++ const release = await t.request('GET', '/release.json');++ assert.equal(release.status, 200, 'the navbar release watch polls /release.json');++ assert.equal((await release.json()).service, 'locker');});test('WebCrypto stream → ciphertext API → download → authenticated opening, with private metadata', async () => {const file = new Blob([Buffer.alloc(2 * 1048576 + 93, 71)]);
@@ -177,6 +177,9 @@ async function createApp(options = {}) {
@@ -177,6 +177,9 @@ async function createApp(options = {}) {
});
});
res.json({ restricted: req.body.restricted });
res.json({ restricted: req.body.restricted });
}));
}));
+ // GET /release.json (ADR-016): the navbar's release watch polls it so open tabs learn of a new release (the 11-09
+ // browser sweep found it answering 404 here).
+ require('openvibe-shared/release').createRelease({ service: 'locker', root: path.join(__dirname, '..') }).mount(app);
app.use('/shared', require('openvibe-shared/serve').handler());
app.use('/shared', require('openvibe-shared/serve').handler());
app.use(express.static(path.join(__dirname, '..', 'public'), { index: false, maxAge: '1h' }));
app.use(express.static(path.join(__dirname, '..', 'public'), { index: false, maxAge: '1h' }));
app.use(require('./pages').createPages({ config }));
app.use(require('./pages').createPages({ config }));
@@ -21,6 +21,9 @@ test('password login items use people locks and remain opaque in storage', async
@@ -21,6 +21,9 @@ test('password login items use people locks and remain opaque in storage', async
assert.equal(new TextDecoder().decode(bytes).includes('secret-password'), false);
assert.equal(new TextDecoder().decode(bytes).includes('secret-password'), false);
assert.equal(new TextDecoder().decode(await locker.open(bytes, { person: t.people.get(SUBJECT) })), secret);
assert.equal(new TextDecoder().decode(await locker.open(bytes, { person: t.people.get(SUBJECT) })), secret);
assert.equal((await t.request('GET', '/api/v1/files')).status, 200);
assert.equal((await t.request('GET', '/api/v1/files')).status, 200);
+ const release = await t.request('GET', '/release.json');
+ assert.equal(release.status, 200, 'the navbar release watch polls /release.json');
+ assert.equal((await release.json()).service, 'locker');
});
});
test('WebCrypto stream → ciphertext API → download → authenticated opening, with private metadata', async () => {
test('WebCrypto stream → ciphertext API → download → authenticated opening, with private metadata', async () => {
const file = new Blob([Buffer.alloc(2 * 1048576 + 93, 71)]);
const file = new Blob([Buffer.alloc(2 * 1048576 + 93, 71)]);