openvibers/openvibe.deals Commits
account-data: pin openvibe-sdk 0.74.0 and guard every table with a person column (#148)
Changes
@@@ -333,7 +333,7 @@ render time, so the cache stays short); signed-in views, forms, API responses, esitemaps, index-hooks, discussion, ssr, and the shared ingest/publication chassis — the Sourcesclient, change cursor and pull loop, signed event consumer, common normalisers, and the publicationglue Deals' indexing uses), `openvibe-contracts` v0.97.0, `openvibe-shared` v4.33.0-- (Frame, app icon, footer, legal, release, metrics, ready), `openvibe-sdk` v0.35.0 (sso, outbox,++ (Frame, app icon, footer, legal, release, metrics, ready), `openvibe-sdk` v0.74.0 (sso, outbox,inbox, webhook signatures v2, service tokens, per-actor limits).- **OpenVibe.Network:** SSO (OAuth client `deals`, registered in production), JWKS,`identity.subject.resolve`.@@@ -498,7 +498,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.4.1<!-- versions:end -->@@@ -8,13 +8,13 @@"port": 4840,"domain": "openvibe.deals","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-publishing v1.4.1","openvibe-contracts v0.222.0","openvibe-shared v4.48.0",-- "openvibe-sdk v0.73.0"++ "openvibe-sdk v0.74.0"],"capabilities": ["deals.offer.submit",@@@ -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.4.1",-- "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"@@@ -28,7 +28,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.4.1",-- "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"},@@@ -8,8 +8,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 EXP = 'exp_01JZ0000000000000000000EXP';const DEL = 'del_01JZ0000000000000000000DEX';@@@ -34,6 +36,19 @@ 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,++++ taskKeyed: ["deal_watches"],++ exempt: {"account_data_events":"the ledger of requests itself: which export and deletion Deals applied","deal_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: 'deals', clientSecret: 'shh' }) });const [alice, bob] = ['alice', 'bob'].map((n) => t.network.addUser(n));
@@ -333,7 +333,7 @@ render time, so the cache stays short); signed-in views, forms, API responses, e
@@ -333,7 +333,7 @@ render time, so the cache stays short); signed-in views, forms, API responses, e
sitemaps, index-hooks, discussion, ssr, and the shared ingest/publication chassis — the Sources
sitemaps, index-hooks, discussion, ssr, and the shared ingest/publication chassis — the Sources
client, change cursor and pull loop, signed event consumer, common normalisers, and the publication
client, change cursor and pull loop, signed event consumer, common normalisers, and the publication
glue Deals' indexing uses), `openvibe-contracts` v0.97.0, `openvibe-shared` v4.33.0
glue Deals' indexing uses), `openvibe-contracts` v0.97.0, `openvibe-shared` v4.33.0
- (Frame, app icon, footer, legal, release, metrics, ready), `openvibe-sdk` v0.35.0 (sso, outbox,
+ (Frame, app icon, footer, legal, release, metrics, ready), `openvibe-sdk` v0.74.0 (sso, outbox,
inbox, webhook signatures v2, service tokens, per-actor limits).
inbox, webhook signatures v2, service tokens, per-actor limits).
- **OpenVibe.Network:** SSO (OAuth client `deals`, registered in production), JWKS,
- **OpenVibe.Network:** SSO (OAuth client `deals`, registered in production), JWKS,
`identity.subject.resolve`.
`identity.subject.resolve`.
@@ -498,7 +498,7 @@ Part of the [OpenVibe network](https://openvibe.network). Built in the open by [
@@ -498,7 +498,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.4.1
- openvibe-publishing: v1.4.1
<!-- versions:end -->
<!-- versions:end -->
@@ -8,13 +8,13 @@
@@ -8,13 +8,13 @@
"port": 4840,
"port": 4840,
"domain": "openvibe.deals",
"domain": "openvibe.deals",
"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-publishing v1.4.1",
"openvibe-publishing v1.4.1",
"openvibe-contracts v0.222.0",
"openvibe-contracts v0.222.0",
"openvibe-shared v4.48.0",
"openvibe-shared v4.48.0",
- "openvibe-sdk v0.73.0"
+ "openvibe-sdk v0.74.0"
],
],
"capabilities": [
"capabilities": [
"deals.offer.submit",
"deals.offer.submit",
@@ -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.4.1",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.4.1",
- "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"
@@ -28,7 +28,7 @@
@@ -28,7 +28,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.4.1",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.4.1",
- "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"
},
},
@@ -8,8 +8,10 @@
@@ -8,8 +8,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 EXP = 'exp_01JZ0000000000000000000EXP';
const EXP = 'exp_01JZ0000000000000000000EXP';
const DEL = 'del_01JZ0000000000000000000DEX';
const DEL = 'del_01JZ0000000000000000000DEX';
@@ -34,6 +36,19 @@ async function startNetworkStub() {
@@ -34,6 +36,19 @@ 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,
+
+ taskKeyed: ["deal_watches"],
+ exempt: {"account_data_events":"the ledger of requests itself: which export and deletion Deals applied","deal_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: 'deals', clientSecret: 'shh' }) });
const t = await boot({ accountSend: createNetworkSender({ networkInternalUrl: stub.url, clientId: 'deals', clientSecret: 'shh' }) });
const [alice, bob] = ['alice', 'bob'].map((n) => t.network.addUser(n));
const [alice, bob] = ['alice', 'bob'].map((n) => t.network.addUser(n));