openvibers/openvibe.food Commits

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

OP OpenVibers committed 14 days ago · 5ceae79dae · 5 files, +24 −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

Changes

ddiff --git a/README.md b/README.md
iindex dbd4e36..6843e02 100644
---- a/README.md
++++ b/README.md
@@@ -87,7 +87,7 @@ Its own PostgreSQL tables, created by [migrations/](migrations/) and written by
`FOOD_GEO_CACHE_TTL_MS`.
- **PostgreSQL** (`DATABASE_URL`, `DATABASE_DIRECT_URL`) and **Valkey** for shared limit counters (`VALKEY_URL`,
`VALKEY_PREFIX`).
--- **Packages**: `openvibe-contracts` v0.122.1, `openvibe-sdk` v0.67.0 (`db`, `auth`, `account-data`, `limits`,
++- **Packages**: `openvibe-contracts` v0.122.1, `openvibe-sdk` v0.74.0 (`db`, `auth`, `account-data`, `limits`,
`valkey`, `service`), `openvibe-publishing` (`ai`) and `openvibe-shared` v4.19.0 (`frame`, `legal`, `serve`,
`release`, `metrics`, `ready`, `seo`, `shell`, `cache-policy`, `showcase`, `app-icon`).
@@@ -271,7 +271,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 d4efed4..df98009 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -8,11 +8,11 @@
"port": "4970",
"domain": "openvibe.food",
"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"
],
"summary": "OpenVibe.Food — What should we eat? Food near you (food banks, pantries and budget grocery stores from OpenStreetMap, paced and cached to stay inside the OSM usage policies), a deterministic meal planner with a shopping list and an estimated cost, a 42-item food database with nutrition per serving and per 100 g, and a pantry with a plain 'what can I make' against ten basic recipes. Server-rendered pages, an API at /api/v1, per-caller limits on the place search, and a test suite that never calls the internet.",
ddiff --git a/package-lock.json b/package-lock.json
iindex cfe0325..8558db4 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"
},
@@@ -1181,9 +1181,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 1c1ea72..9fcfcf2 100644
---- a/package.json
++++ b/package.json
@@@ -2,7 +2,7 @@
"name": "openvibe-food",
"version": "0.1.0",
"private": true,
-- "description": "OpenVibe.Food — What should we eat?",
++ "description": "OpenVibe.Food \u2014 What should we eat?",
"main": "server/index.js",
"scripts": {
"start": "node server/index.js",
@@@ -24,7 +24,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/test/account-data.test.js b/test/account-data.test.js
iindex bbde7f6..3897fea 100644
---- a/test/account-data.test.js
++++ b/test/account-data.test.js
@@@ -8,9 +8,11 @@
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 foodStore = require('../server/food/store');
++const { TABLES } = require('../server/identity/account-data');
++const { testDb } = require('./helpers/db');
const A = 'usr_01JZ0000000000000000000AAA';
const B = 'usr_01JZ0000000000000000000BBB';
@@@ -62,6 +64,17 @@ async function joinB(t) {
}
(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 Food applied' },
++ });
++ assert.deepStrictEqual(missing, [], `a table with a person column is neither covered nor exempted: ${missing.join(', ')}`);
++ } finally { await d.close(); }
++ });
++
await check('an export part carries only the person\'s plans and pantry, and no secret', async () => {
const stub = await startNetworkStub();
const sender = createNetworkSender({ networkInternalUrl: stub.url, clientId: 'food', clientSecret: 'food-secret' });