openvibers/openvibe.network Commits
OAuth client ai gets its redirect URI (roadmap WS-O task 4): https://ai.openvibe.network/auth/callback for OpenVibe.AI's operator console (merged into the existing client's list at boot, as for every contract client)
Changes
@@@ -524,6 +524,8 @@ function initDb(dbPath) {{ client_id: 'codes', name: 'OpenVibe.Codes', redirect_uris: ['https://openvibe.codes/auth/callback'] },// Billing's staff console (Wave 8): Network admins listed in BILLING_STAFF_SUBJECTS.{ client_id: 'billing', name: 'OpenVibe.Billing', redirect_uris: ['https://billing.openvibe.network/auth/callback'] },++ // OpenVibe.AI's operator console (WS-O task 4): Network staff, capabilities from the staff role map.++ { client_id: 'ai', name: 'OpenVibe.AI', redirect_uris: ['https://ai.openvibe.network/auth/callback'] },];const insert = db.prepare('INSERT INTO oauth_clients (client_id, client_secret, name, redirect_uris, is_first_party) VALUES (?, ?, ?, ?, 1)'@@@ -16,10 +16,10 @@ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'ov-modules-'));const log = console.log; console.log = () => {};const db = initDb(path.join(dir, 'network.db'));console.log = log;--// chat and ai are registered on the host, not seeded: add them as copies of tools, then seed their grants again.++// chat is registered on the host, not seeded (ai is seeded since its console, WS-O task 4): add a missing one as a copy of tools, then seed the grants again.for (const c of ['chat', 'ai']) {const cols = db.prepare('PRAGMA table_info(oauth_clients)').all().map(x => x.name).filter(n => n !== 'client_id' && n !== 'id');-- db.prepare(`INSERT INTO oauth_clients (client_id, ${cols.join(', ')}) SELECT ?, ${cols.join(', ')} FROM oauth_clients WHERE client_id = 'tools'`).run(c);++ db.prepare(`INSERT OR IGNORE INTO oauth_clients (client_id, ${cols.join(', ')}) SELECT ?, ${cols.join(', ')} FROM oauth_clients WHERE client_id = 'tools'`).run(c);}require('../server/identity/principals').ensureSchema(db);for (const [c, s] of [['live', 'live-secret'], ['tools', 'tools-secret'], ['games', 'games-secret'], ['chat', 'chat-secret'], ['ai', 'ai-secret']]) db.prepare('UPDATE oauth_clients SET client_secret = ? WHERE client_id = ?').run(s, c);
@@ -524,6 +524,8 @@ function initDb(dbPath) {
@@ -524,6 +524,8 @@ function initDb(dbPath) {
{ client_id: 'codes', name: 'OpenVibe.Codes', redirect_uris: ['https://openvibe.codes/auth/callback'] },
{ client_id: 'codes', name: 'OpenVibe.Codes', redirect_uris: ['https://openvibe.codes/auth/callback'] },
// Billing's staff console (Wave 8): Network admins listed in BILLING_STAFF_SUBJECTS.
// Billing's staff console (Wave 8): Network admins listed in BILLING_STAFF_SUBJECTS.
{ client_id: 'billing', name: 'OpenVibe.Billing', redirect_uris: ['https://billing.openvibe.network/auth/callback'] },
{ client_id: 'billing', name: 'OpenVibe.Billing', redirect_uris: ['https://billing.openvibe.network/auth/callback'] },
+ // OpenVibe.AI's operator console (WS-O task 4): Network staff, capabilities from the staff role map.
+ { client_id: 'ai', name: 'OpenVibe.AI', redirect_uris: ['https://ai.openvibe.network/auth/callback'] },
];
];
const insert = db.prepare(
const insert = db.prepare(
'INSERT INTO oauth_clients (client_id, client_secret, name, redirect_uris, is_first_party) VALUES (?, ?, ?, ?, 1)'
'INSERT INTO oauth_clients (client_id, client_secret, name, redirect_uris, is_first_party) VALUES (?, ?, ?, ?, 1)'
@@ -16,10 +16,10 @@ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'ov-modules-'));
@@ -16,10 +16,10 @@ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'ov-modules-'));
const log = console.log; console.log = () => {};
const log = console.log; console.log = () => {};
const db = initDb(path.join(dir, 'network.db'));
const db = initDb(path.join(dir, 'network.db'));
console.log = log;
console.log = log;
-// chat and ai are registered on the host, not seeded: add them as copies of tools, then seed their grants again.
+// chat is registered on the host, not seeded (ai is seeded since its console, WS-O task 4): add a missing one as a copy of tools, then seed the grants again.
for (const c of ['chat', 'ai']) {
for (const c of ['chat', 'ai']) {
const cols = db.prepare('PRAGMA table_info(oauth_clients)').all().map(x => x.name).filter(n => n !== 'client_id' && n !== 'id');
const cols = db.prepare('PRAGMA table_info(oauth_clients)').all().map(x => x.name).filter(n => n !== 'client_id' && n !== 'id');
- db.prepare(`INSERT INTO oauth_clients (client_id, ${cols.join(', ')}) SELECT ?, ${cols.join(', ')} FROM oauth_clients WHERE client_id = 'tools'`).run(c);
+ db.prepare(`INSERT OR IGNORE INTO oauth_clients (client_id, ${cols.join(', ')}) SELECT ?, ${cols.join(', ')} FROM oauth_clients WHERE client_id = 'tools'`).run(c);
}
}
require('../server/identity/principals').ensureSchema(db);
require('../server/identity/principals').ensureSchema(db);
for (const [c, s] of [['live', 'live-secret'], ['tools', 'tools-secret'], ['games', 'games-secret'], ['chat', 'chat-secret'], ['ai', 'ai-secret']]) db.prepare('UPDATE oauth_clients SET client_secret = ? WHERE client_id = ?').run(s, c);
for (const [c, s] of [['live', 'live-secret'], ['tools', 'tools-secret'], ['games', 'games-secret'], ['chat', 'chat-secret'], ['ai', 'ai-secret']]) db.prepare('UPDATE oauth_clients SET client_secret = ? WHERE client_id = ?').run(s, c);