openvibers/openvibe.chat Commits

Pin openvibe-contracts v0.315.0 and read chat.config.manage literally (#373)

OP OpenVibers committed 6 days ago · bd2dee63d4 · 3 files, +6 −7

* Pin openvibe-contracts v0.315.0 and read chat.config.manage literally

Contracts 0.315.0 lists chat.config.manage in the chat manifest. Name the capability as the literal string the guard checks, so openvibe-contracts-check reads it instead of the const it cannot see.

* Merge remote-tracking branch 'origin/main' into cfgm/config-manage-literal

# Conflicts:
#	package-lock.json
#	package.json

Changes

ddiff --git a/package-lock.json b/package-lock.json
iindex 086e718..8e3b05a 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -17,7 +17,7 @@
"express-rate-limit": "^7.5.0",
"iovalkey": "^0.4.0",
"multer": "^2.0.2",
-- "openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.312.0",
++ "openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.315.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.93.0",
"openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.124.0",
"pg": "^8.23.0",
@@@ -1557,9 +1557,9 @@
}
},
"node_modules/openvibe-contracts": {
-- "version": "0.312.0",
-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.312.0",
-- "integrity": "sha512-2GsD53zuIedL3eW2LBlYQ68ODTHzoZJHrAmVnZCpiL7ZWnAXGwPW9dpQagLI9Zdkh3LQuuU5ae1YJI0K+acXbA==",
++ "version": "0.315.0",
++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.315.0",
++ "integrity": "sha512-m1bWT4/sF6Hc7lia6FjAR+880r9SBRhO/v819Lr5ldxlSkFYiKMXTtt7MDbJ4FCgQ7Dkt+2OJaKanlvk2vNPlg==",
"license": "AGPL-3.0-only",
"dependencies": {
"ajv": "^8.17.1",
ddiff --git a/package.json b/package.json
iindex 6502dcb..06b6684 100644
---- a/package.json
++++ b/package.json
@@@ -29,7 +29,7 @@
"express-rate-limit": "^7.5.0",
"iovalkey": "^0.4.0",
"multer": "^2.0.2",
-- "openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.312.0",
++ "openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.315.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.93.0",
"openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.124.0",
"pg": "^8.23.0",
ddiff --git a/server/app.js b/server/app.js
iindex cef2829..56c450a 100644
---- a/server/app.js
++++ b/server/app.js
@@@ -11,7 +11,6 @@
'use strict';
const express = require('express');
--const CONFIG_CAPABILITY = 'chat.config.manage';
const cookieParser = require('cookie-parser');
const cors = require('cors');
const rateLimit = require('express-rate-limit');
@@@ -137,7 +136,7 @@ function createApp({ chatServer, relay, events = null, callServer = null, settin
// chat.apps (the Telegram, Discord and Slack bots) is served by the same routes; its Test button is mounted first,
// because the voices' test route answers 404 for every other namespace.
if (settings || chatAppSettings) {
-- const guard = serviceAuth.guard(CONFIG_CAPABILITY);
++ const guard = serviceAuth.guard('chat.config.manage');
app.use('/internal/config', express.json({ limit: '64kb' }));
if (chatAppSettings) app.post(`/internal/config/${chatAppSettings.namespace}/test/:key`, guard, require('./chat-apps/owner-settings').testRoute(chatAppSettings));
const also = chatAppSettings ? [chatAppSettings.store] : [];