openvibers/openvibe.network Commits
Design may publish a person's design on Space (open item D8) (#532)
Changes
@@@ -702,6 +702,10 @@ const DEFAULT_GRANTS = [['design', 'bench.judgement.cast', 'openvibe.bench', []],['design', 'bench.board.read', 'openvibe.bench', []],['design', 'bench.entry.create', 'openvibe.bench', []],++ // Open item D8 (11-02): Design publishes a person's design as a static site on Space, acting for them++ // (X-OV-Subject): the person's "Designs" project and its sites, and the deploy of the page.++ ['design', 'space.site.manage', 'openvibe.space', []],++ ['design', 'space.deploy.create', 'openvibe.space', []],// Games submits each AI duel as a Bench task, two priced seat entries, and one automatic outcome....['bench.task.create', 'bench.round.create', 'bench.entry.create', 'bench.judgement.cast'].map((cap) => ['games', cap, 'openvibe.bench', []]),@@@ -188,6 +188,10 @@ const server = http.createServer(app);t = await token({ client_id: 'design', client_secret: 'design-secret', audience: 'openvibe.bench' });assert.strictEqual(t.status, 200, JSON.stringify(t.body));assert.deepStrictEqual(t.body.scope.split(' '), ['bench.board.read', 'bench.entry.create', 'bench.judgement.cast', 'bench.round.create', 'bench.round.read', 'bench.task.create'], "Design creates and reads Bench tasks and rounds, reads boards and casts judgements");++ // Open item D8: Design publishes a person's design on Space, acting for them.++ t = await token({ client_id: 'design', client_secret: 'design-secret', audience: 'openvibe.space' });++ assert.strictEqual(t.status, 200, JSON.stringify(t.body));++ assert.deepStrictEqual(t.body.scope.split(' ').sort(), ['space.deploy.create', 'space.site.manage'], 'Design makes the site and deploys the page, nothing else on Space');await db.prepare("UPDATE oauth_clients SET client_secret = 'games-secret' WHERE client_id = 'games'").run();t = await token({ client_id: 'games', client_secret: 'games-secret', audience: 'openvibe.bench' });assert.strictEqual(t.status, 200, JSON.stringify(t.body));
@@ -702,6 +702,10 @@ const DEFAULT_GRANTS = [
@@ -702,6 +702,10 @@ const DEFAULT_GRANTS = [
['design', 'bench.judgement.cast', 'openvibe.bench', []],
['design', 'bench.judgement.cast', 'openvibe.bench', []],
['design', 'bench.board.read', 'openvibe.bench', []],
['design', 'bench.board.read', 'openvibe.bench', []],
['design', 'bench.entry.create', 'openvibe.bench', []],
['design', 'bench.entry.create', 'openvibe.bench', []],
+ // Open item D8 (11-02): Design publishes a person's design as a static site on Space, acting for them
+ // (X-OV-Subject): the person's "Designs" project and its sites, and the deploy of the page.
+ ['design', 'space.site.manage', 'openvibe.space', []],
+ ['design', 'space.deploy.create', 'openvibe.space', []],
// Games submits each AI duel as a Bench task, two priced seat entries, and one automatic outcome.
// Games submits each AI duel as a Bench task, two priced seat entries, and one automatic outcome.
...['bench.task.create', 'bench.round.create', 'bench.entry.create', 'bench.judgement.cast']
...['bench.task.create', 'bench.round.create', 'bench.entry.create', 'bench.judgement.cast']
.map((cap) => ['games', cap, 'openvibe.bench', []]),
.map((cap) => ['games', cap, 'openvibe.bench', []]),
@@ -188,6 +188,10 @@ const server = http.createServer(app);
@@ -188,6 +188,10 @@ const server = http.createServer(app);
t = await token({ client_id: 'design', client_secret: 'design-secret', audience: 'openvibe.bench' });
t = await token({ client_id: 'design', client_secret: 'design-secret', audience: 'openvibe.bench' });
assert.strictEqual(t.status, 200, JSON.stringify(t.body));
assert.strictEqual(t.status, 200, JSON.stringify(t.body));
assert.deepStrictEqual(t.body.scope.split(' '), ['bench.board.read', 'bench.entry.create', 'bench.judgement.cast', 'bench.round.create', 'bench.round.read', 'bench.task.create'], "Design creates and reads Bench tasks and rounds, reads boards and casts judgements");
assert.deepStrictEqual(t.body.scope.split(' '), ['bench.board.read', 'bench.entry.create', 'bench.judgement.cast', 'bench.round.create', 'bench.round.read', 'bench.task.create'], "Design creates and reads Bench tasks and rounds, reads boards and casts judgements");
+ // Open item D8: Design publishes a person's design on Space, acting for them.
+ t = await token({ client_id: 'design', client_secret: 'design-secret', audience: 'openvibe.space' });
+ assert.strictEqual(t.status, 200, JSON.stringify(t.body));
+ assert.deepStrictEqual(t.body.scope.split(' ').sort(), ['space.deploy.create', 'space.site.manage'], 'Design makes the site and deploys the page, nothing else on Space');
await db.prepare("UPDATE oauth_clients SET client_secret = 'games-secret' WHERE client_id = 'games'").run();
await db.prepare("UPDATE oauth_clients SET client_secret = 'games-secret' WHERE client_id = 'games'").run();
t = await token({ client_id: 'games', client_secret: 'games-secret', audience: 'openvibe.bench' });
t = await token({ client_id: 'games', client_secret: 'games-secret', audience: 'openvibe.bench' });
assert.strictEqual(t.status, 200, JSON.stringify(t.body));
assert.strictEqual(t.status, 200, JSON.stringify(t.body));