openvibers/openvibe.network Commits
Vision may publish its events (#537)
Changes
@@@ -631,6 +631,9 @@ const DEFAULT_GRANTS = [// its account-event subscriptions, and the export/deletion pair above. It has no public records, so no Search grant.['vision', 'ai.run.create', 'openvibe.ai', ['ai.complete']],['vision', 'events.subscription.manage', 'openvibe.events', []],++ // Vision publishes vision.result.ready and vision.alert (VIS-5, contracts manifests/services/vision.json): without this++ // its outbox retried every event (found 11-02 with Events' sources check).++ ['vision', 'events.event.publish', 'openvibe.events', []],// F1: Vision asks the consent check and sends a consent request to a named person who has an account.['vision', 'network.notifications.push', SELF_AUDIENCE, ['vision']],// OpenVibe.Exchange (contracts 0.235.0): its public listings in Search through the owner API (owner exchange), and@@@ -123,7 +123,8 @@ const server = http.createServer(app);const networkCaps = ['network.account.deletion.confirm', 'network.account.export.contribute', ...(client === 'vision' ? ['network.consent.read', 'network.notifications.push'] : [])];assert.deepStrictEqual(t.body.scope.split(' '), networkCaps, `${client} answers account export and deletion, and holds no identity.subject.resolve`);t = await token({ client_id: client, client_secret: secret, audience: 'openvibe.events' });-- assert.strictEqual(t.body.scope, 'events.subscription.manage', `${client} subscribes to the account events at boot`);++ // Vision also publishes its own vision.result.ready and vision.alert (VIS-5; granted 11-02).++ assert.strictEqual(t.body.scope, client === 'vision' ? 'events.event.publish events.subscription.manage' : 'events.subscription.manage', `${client} subscribes to the account events at boot`);}t = await token({ client_id: 'vision', client_secret: 'vision-secret', audience: 'openvibe.ai' });assert.strictEqual(t.status, 200, JSON.stringify(t.body));
@@ -631,6 +631,9 @@ const DEFAULT_GRANTS = [
@@ -631,6 +631,9 @@ const DEFAULT_GRANTS = [
// its account-event subscriptions, and the export/deletion pair above. It has no public records, so no Search grant.
// its account-event subscriptions, and the export/deletion pair above. It has no public records, so no Search grant.
['vision', 'ai.run.create', 'openvibe.ai', ['ai.complete']],
['vision', 'ai.run.create', 'openvibe.ai', ['ai.complete']],
['vision', 'events.subscription.manage', 'openvibe.events', []],
['vision', 'events.subscription.manage', 'openvibe.events', []],
+ // Vision publishes vision.result.ready and vision.alert (VIS-5, contracts manifests/services/vision.json): without this
+ // its outbox retried every event (found 11-02 with Events' sources check).
+ ['vision', 'events.event.publish', 'openvibe.events', []],
// F1: Vision asks the consent check and sends a consent request to a named person who has an account.
// F1: Vision asks the consent check and sends a consent request to a named person who has an account.
['vision', 'network.notifications.push', SELF_AUDIENCE, ['vision']],
['vision', 'network.notifications.push', SELF_AUDIENCE, ['vision']],
// OpenVibe.Exchange (contracts 0.235.0): its public listings in Search through the owner API (owner exchange), and
// OpenVibe.Exchange (contracts 0.235.0): its public listings in Search through the owner API (owner exchange), and
@@ -123,7 +123,8 @@ const server = http.createServer(app);
@@ -123,7 +123,8 @@ const server = http.createServer(app);
const networkCaps = ['network.account.deletion.confirm', 'network.account.export.contribute', ...(client === 'vision' ? ['network.consent.read', 'network.notifications.push'] : [])];
const networkCaps = ['network.account.deletion.confirm', 'network.account.export.contribute', ...(client === 'vision' ? ['network.consent.read', 'network.notifications.push'] : [])];
assert.deepStrictEqual(t.body.scope.split(' '), networkCaps, `${client} answers account export and deletion, and holds no identity.subject.resolve`);
assert.deepStrictEqual(t.body.scope.split(' '), networkCaps, `${client} answers account export and deletion, and holds no identity.subject.resolve`);
t = await token({ client_id: client, client_secret: secret, audience: 'openvibe.events' });
t = await token({ client_id: client, client_secret: secret, audience: 'openvibe.events' });
- assert.strictEqual(t.body.scope, 'events.subscription.manage', `${client} subscribes to the account events at boot`);
+ // Vision also publishes its own vision.result.ready and vision.alert (VIS-5; granted 11-02).
+ assert.strictEqual(t.body.scope, client === 'vision' ? 'events.event.publish events.subscription.manage' : 'events.subscription.manage', `${client} subscribes to the account events at boot`);
}
}
t = await token({ client_id: 'vision', client_secret: 'vision-secret', audience: 'openvibe.ai' });
t = await token({ client_id: 'vision', client_secret: 'vision-secret', audience: 'openvibe.ai' });
assert.strictEqual(t.status, 200, JSON.stringify(t.body));
assert.strictEqual(t.status, 200, JSON.stringify(t.body));