openvibers/openvibe.host Commits

account-data: pin openvibe-sdk 0.74.0 and guard every table with a person column (#207)

OP OpenVibers committed 14 days ago · ce6525b35c · 6 files, +40 −11

* account-data: pin openvibe-sdk 0.74.0 and guard every table with a person column

* Merge remote-tracking branch 'origin/main' into adr033-account-data

# Conflicts:
#	README.md
#	STATUS.json
#	package-lock.json
#	package.json

* account-data: sync the lockfile with openvibe-sdk 0.74.0

* account-data: cover the tables the guard found with a person column

Changes

ddiff --git a/README.md b/README.md
iindex f6e7505..046e782 100644
---- a/README.md
++++ b/README.md
@@@ -380,7 +380,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.0
<!-- versions:end -->
ddiff --git a/STATUS.json b/STATUS.json
iindex 04d1e07..bc06740 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -14,11 +14,11 @@
"port": 4910,
"domain": "openvibe.host",
"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-sdk v0.73.0",
++ "openvibe-sdk v0.74.0",
"openvibe-shared v4.48.0"
],
"capabilities": [
ddiff --git a/package-lock.json b/package-lock.json
iindex 5e9bff1..52accb8 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -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.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"
},
@@@ -1568,9 +1568,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"
ddiff --git a/package.json b/package.json
iindex 414dc2e..7ad20ba 100644
---- a/package.json
++++ b/package.json
@@@ -33,7 +33,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.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"
},
ddiff --git a/server/account-data.js b/server/account-data.js
iindex f7a8661..cc77f73 100644
---- a/server/account-data.js
++++ b/server/account-data.js
@@@ -7,10 +7,11 @@
* tokens are gone from OpenVibe.Host.
* benchmarks the results they submitted (migration 0012) and their one-time links (never the link's token).
* Deletion removes the links and detaches the results, which stay as anonymous measurements.
-- * catalog rows providers, plans and promotions a staff member entered: shared rows, so deletion keeps them and
-- * erases only who entered them.
++ * catalog rows providers, plans, promotions and the prices of a TLD a staff member entered: shared rows, so
++ * deletion keeps them and erases only who entered them.
*
-- * Discussion lives on OpenVibe.Community. A table a held migration has not created yet is skipped.
++ * Discussion lives on OpenVibe.Community. A table a held migration has not created yet is skipped. The hosting tables
++ * (sites, domains, deploys) were dropped in migration 0008: static hosting is OpenVibe.Space's now.
*/
const { createAccountData, TOPICS } = require('openvibe-sdk/account-data');
@@@ -22,6 +23,9 @@ const TABLES = [
{ table: 'catalog_providers', subject: 'created_by', file: 'catalog-providers.json', erase: { anonymize: {} } },
{ table: 'catalog_plans', subject: 'created_by', file: 'catalog-plans.json', erase: { anonymize: {} } },
{ table: 'catalog_promos', subject: 'created_by', file: 'catalog-promos.json', erase: { anonymize: {} } },
++ // A price a staff member entered is a public observation of what a registrar charges: the row stays, the person who
++ // entered it is erased from it, as with the other catalog rows.
++ { table: 'catalog_tld_prices', subject: 'created_by', file: 'catalog-tld-prices.json', columns: ['id', 'provider_id', 'tld', 'currency', 'register', 'renew', 'transfer', 'origin', 'source_url', 'checked_at', 'status', 'created_at'], erase: { anonymize: {} } },
];
function create({ db, log = console } = {}) {
ddiff --git a/test/account-data.test.js b/test/account-data.test.js
nnew file mode 100644
iindex 0000000..9c6fb63
---- /dev/null
++++ b/test/account-data.test.js
@@@ -0,0 +1,25 @@
++'use strict';
++/**
++ * ADR-033: every table in this service with a person column is either in the account-data map, keyed under the
++ * row that owns it, or exempted with a reason. A new table with one fails here until it is answered for.
++ */
++const assert = require('assert');
++const { uncovered } = require('openvibe-sdk/account-data');
++const { TABLES } = require('../server//account-data');
++const { testDb } = require('./helpers/db');
++
++(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 host applied',
++ host_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(', ')}`);
++ console.log(' ✓ every table that names a person is covered or exempted with a reason');
++ } finally { await d.close(); }
++})();