openvibers/openvibe.trade Commits
account-data: pin openvibe-sdk 0.74.0 and guard every table with a person column (#147)
Changes
@@@ -278,7 +278,7 @@ services need to call Trade, is under [Grants the Network must hold](#grants-the`openvibe-sdk/db`; Valkey holds the per-actor limit counters (optional: without `VALKEY_URL` they count per process).- **Packages** (pinned by release tarball): `openvibe-contracts` v0.97.0, `openvibe-publishing`v1.3.0 (revisions, authorship, seo, index-hooks, ssr, ingest, publication), `openvibe-shared` v4.48.0 (Frame, app icon,-- footer, legal, release, metrics, ready), `openvibe-sdk` v0.35.0 (events outbox and inbox, webhook++ footer, legal, release, metrics, ready), `openvibe-sdk` v0.74.0 (events outbox and inbox, webhooksignatures v2, service tokens, per-actor limits, service kit lifecycle).- **OpenVibe.Network:** SSO (OAuth client `trade`, redirect `https://openvibe.trade/auth/callback`),JWKS, client-credentials tokens.@@@ -457,7 +457,7 @@ Part of the [OpenVibe network](https://openvibe.network). Built in the open by [<!-- versions:start -->- openvibe-contracts: v0.222.0--- openvibe-sdk: v0.73.0++- openvibe-sdk: v0.74.0- openvibe-shared: v4.48.0- openvibe-publishing: v1.3.0<!-- versions:end -->@@@ -9,13 +9,13 @@"domain": "openvibe.trade","scope": "informational only (ADR-025): no custody, no order execution, no escrow, no listings between users, no personalised advice","contracts": "openvibe-contracts v0.222.0",-- "sdk": "openvibe-sdk v0.73.0",++ "sdk": "openvibe-sdk v0.74.0","shared": "openvibe-shared v4.48.0","packages": ["openvibe-contracts v0.222.0","openvibe-publishing v1.3.0","openvibe-shared v4.48.0",-- "openvibe-sdk v0.73.0"++ "openvibe-sdk v0.74.0"],"capabilities": ["trade.instrument.resolve",@@@ -17,7 +17,7 @@"iovalkey": "^0.4.0","openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.222.0","openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.3.0",-- "openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.73.0",++ "openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.74.0","openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.48.0","pg": "^8.23.0"},@@@ -1182,9 +1182,9 @@}},"node_modules/openvibe-sdk": {-- "version": "0.73.0",-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.73.0",-- "integrity": "sha512-XClxoVm9M6RA8eXlGgYZ0u6q9n5h79mCXqAAEg9fX21KgcqP69RmG+cX+6wrOf7TaEj7eSBWMxHjiIeIa9N7Dg==",++ "version": "0.74.0",++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.74.0",++ "integrity": "sha512-DO9KVPnUriY/I4lX6ZEJtXaUvRDbJyqnqJxvlpl+zkNGFILpmuBXVJogNOCfK071Qci1gg7C4Iw1Xrseklcajg==","license": "MIT","bin": {"openvibe-download": "bin/openvibe-download.js"@@@ -29,7 +29,7 @@"iovalkey": "^0.4.0","openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.222.0","openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.3.0",-- "openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.73.0",++ "openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.74.0","openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.48.0","pg": "^8.23.0"},@@@ -9,8 +9,10 @@const assert = require('assert');const http = require('http');const { boot, check, done } = require('./helpers/boot');--const { createNetworkSender } = require('openvibe-sdk/account-data');++const { createNetworkSender, uncovered } = require('openvibe-sdk/account-data');const { signDeliveryHeaders } = require('openvibe-sdk/events');++const { TABLES } = require('../server/domain/account-data');++const { testDb } = require('./helpers/db');const MIN = 60e3;const EXP = 'exp_01JZ0000000000000000000EXP';@@@ -35,6 +37,17 @@ async function startNetworkStub() {const envelope = (id, type, payload) => ({ event: { event_id: id, event_type: type, source: 'network', version: 1, timestamp: new Date().toISOString(), actor: { type: 'service', id: 'network' }, subject: { type: 'account', id: payload.subject }, visibility: 'internal', payload }, seq: 1 });(async () => {++ await check('every table that names a person is covered or exempted with a reason', async () => {++ const d = await testDb();++ try {++ const missing = await uncovered(d.db, {++ tables: TABLES,++ exempt: {"account_data_events":"the ledger of requests itself: which export and deletion trade applied","trade_index_revisions":"owner is the search-index document's owner (type/id), not a person; the row holds a revision and hash"},++ });++ assert.deepStrictEqual(missing, [], `a table with a person column is neither covered nor exempted: ${missing.join(', ')}`);++ } finally { await d.close(); }++ });++const stub = await startNetworkStub();const t = await boot({ accountSend: createNetworkSender({ networkInternalUrl: stub.url, clientId: 'trade', clientSecret: 'shh' }) });const { alice, bob } = t;
@@ -278,7 +278,7 @@ services need to call Trade, is under [Grants the Network must hold](#grants-the
@@ -278,7 +278,7 @@ services need to call Trade, is under [Grants the Network must hold](#grants-the
`openvibe-sdk/db`; Valkey holds the per-actor limit counters (optional: without `VALKEY_URL` they count per process).
`openvibe-sdk/db`; Valkey holds the per-actor limit counters (optional: without `VALKEY_URL` they count per process).
- **Packages** (pinned by release tarball): `openvibe-contracts` v0.97.0, `openvibe-publishing`
- **Packages** (pinned by release tarball): `openvibe-contracts` v0.97.0, `openvibe-publishing`
v1.3.0 (revisions, authorship, seo, index-hooks, ssr, ingest, publication), `openvibe-shared` v4.48.0 (Frame, app icon,
v1.3.0 (revisions, authorship, seo, index-hooks, ssr, ingest, publication), `openvibe-shared` v4.48.0 (Frame, app icon,
- footer, legal, release, metrics, ready), `openvibe-sdk` v0.35.0 (events outbox and inbox, webhook
+ footer, legal, release, metrics, ready), `openvibe-sdk` v0.74.0 (events outbox and inbox, webhook
signatures v2, service tokens, per-actor limits, service kit lifecycle).
signatures v2, service tokens, per-actor limits, service kit lifecycle).
- **OpenVibe.Network:** SSO (OAuth client `trade`, redirect `https://openvibe.trade/auth/callback`),
- **OpenVibe.Network:** SSO (OAuth client `trade`, redirect `https://openvibe.trade/auth/callback`),
JWKS, client-credentials tokens.
JWKS, client-credentials tokens.
@@ -457,7 +457,7 @@ Part of the [OpenVibe network](https://openvibe.network). Built in the open by [
@@ -457,7 +457,7 @@ Part of the [OpenVibe network](https://openvibe.network). Built in the open by [
<!-- versions:start -->
<!-- versions:start -->
- openvibe-contracts: v0.222.0
- openvibe-contracts: v0.222.0
-- openvibe-sdk: v0.73.0
+- openvibe-sdk: v0.74.0
- openvibe-shared: v4.48.0
- openvibe-shared: v4.48.0
- openvibe-publishing: v1.3.0
- openvibe-publishing: v1.3.0
<!-- versions:end -->
<!-- versions:end -->
@@ -9,13 +9,13 @@
@@ -9,13 +9,13 @@
"domain": "openvibe.trade",
"domain": "openvibe.trade",
"scope": "informational only (ADR-025): no custody, no order execution, no escrow, no listings between users, no personalised advice",
"scope": "informational only (ADR-025): no custody, no order execution, no escrow, no listings between users, no personalised advice",
"contracts": "openvibe-contracts v0.222.0",
"contracts": "openvibe-contracts v0.222.0",
- "sdk": "openvibe-sdk v0.73.0",
+ "sdk": "openvibe-sdk v0.74.0",
"shared": "openvibe-shared v4.48.0",
"shared": "openvibe-shared v4.48.0",
"packages": [
"packages": [
"openvibe-contracts v0.222.0",
"openvibe-contracts v0.222.0",
"openvibe-publishing v1.3.0",
"openvibe-publishing v1.3.0",
"openvibe-shared v4.48.0",
"openvibe-shared v4.48.0",
- "openvibe-sdk v0.73.0"
+ "openvibe-sdk v0.74.0"
],
],
"capabilities": [
"capabilities": [
"trade.instrument.resolve",
"trade.instrument.resolve",
@@ -17,7 +17,7 @@
@@ -17,7 +17,7 @@
"iovalkey": "^0.4.0",
"iovalkey": "^0.4.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.222.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.222.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.3.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.3.0",
- "openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.73.0",
+ "openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.74.0",
"openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.48.0",
"openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.48.0",
"pg": "^8.23.0"
"pg": "^8.23.0"
},
},
@@ -1182,9 +1182,9 @@
@@ -1182,9 +1182,9 @@
}
}
},
},
"node_modules/openvibe-sdk": {
"node_modules/openvibe-sdk": {
- "version": "0.73.0",
- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.73.0",
- "integrity": "sha512-XClxoVm9M6RA8eXlGgYZ0u6q9n5h79mCXqAAEg9fX21KgcqP69RmG+cX+6wrOf7TaEj7eSBWMxHjiIeIa9N7Dg==",
+ "version": "0.74.0",
+ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.74.0",
+ "integrity": "sha512-DO9KVPnUriY/I4lX6ZEJtXaUvRDbJyqnqJxvlpl+zkNGFILpmuBXVJogNOCfK071Qci1gg7C4Iw1Xrseklcajg==",
"license": "MIT",
"license": "MIT",
"bin": {
"bin": {
"openvibe-download": "bin/openvibe-download.js"
"openvibe-download": "bin/openvibe-download.js"
@@ -29,7 +29,7 @@
@@ -29,7 +29,7 @@
"iovalkey": "^0.4.0",
"iovalkey": "^0.4.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.222.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.222.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.3.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.3.0",
- "openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.73.0",
+ "openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.74.0",
"openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.48.0",
"openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.48.0",
"pg": "^8.23.0"
"pg": "^8.23.0"
},
},
@@ -9,8 +9,10 @@
@@ -9,8 +9,10 @@
const assert = require('assert');
const assert = require('assert');
const http = require('http');
const http = require('http');
const { boot, check, done } = require('./helpers/boot');
const { boot, check, done } = require('./helpers/boot');
-const { createNetworkSender } = require('openvibe-sdk/account-data');
+const { createNetworkSender, uncovered } = require('openvibe-sdk/account-data');
const { signDeliveryHeaders } = require('openvibe-sdk/events');
const { signDeliveryHeaders } = require('openvibe-sdk/events');
+const { TABLES } = require('../server/domain/account-data');
+const { testDb } = require('./helpers/db');
const MIN = 60e3;
const MIN = 60e3;
const EXP = 'exp_01JZ0000000000000000000EXP';
const EXP = 'exp_01JZ0000000000000000000EXP';
@@ -35,6 +37,17 @@ async function startNetworkStub() {
@@ -35,6 +37,17 @@ async function startNetworkStub() {
const envelope = (id, type, payload) => ({ event: { event_id: id, event_type: type, source: 'network', version: 1, timestamp: new Date().toISOString(), actor: { type: 'service', id: 'network' }, subject: { type: 'account', id: payload.subject }, visibility: 'internal', payload }, seq: 1 });
const envelope = (id, type, payload) => ({ event: { event_id: id, event_type: type, source: 'network', version: 1, timestamp: new Date().toISOString(), actor: { type: 'service', id: 'network' }, subject: { type: 'account', id: payload.subject }, visibility: 'internal', payload }, seq: 1 });
(async () => {
(async () => {
+ await check('every table that names a person is covered or exempted with a reason', async () => {
+ const d = await testDb();
+ try {
+ const missing = await uncovered(d.db, {
+ tables: TABLES,
+ exempt: {"account_data_events":"the ledger of requests itself: which export and deletion trade applied","trade_index_revisions":"owner is the search-index document's owner (type/id), not a person; the row holds a revision and hash"},
+ });
+ assert.deepStrictEqual(missing, [], `a table with a person column is neither covered nor exempted: ${missing.join(', ')}`);
+ } finally { await d.close(); }
+ });
+
const stub = await startNetworkStub();
const stub = await startNetworkStub();
const t = await boot({ accountSend: createNetworkSender({ networkInternalUrl: stub.url, clientId: 'trade', clientSecret: 'shh' }) });
const t = await boot({ accountSend: createNetworkSender({ networkInternalUrl: stub.url, clientId: 'trade', clientSecret: 'shh' }) });
const { alice, bob } = t;
const { alice, bob } = t;