@dotrino/remote-agent 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/agent.js +13 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/remote-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Middleware compartido del ecosistema Dotrino para apps de agente remoto cifrado punto a punto (handshake E2E, emparejamiento SAS con vault, revocación, descubrimiento). Lo consumen dotrino-terminal (PTY) y dotrino-ia (chat con IA).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
package/src/agent.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import fs from 'node:fs'
|
|
23
23
|
import path from 'node:path'
|
|
24
24
|
import { verifyChain, signWithDevice, verifyDeviceSig, verifyDelegation, pubkeyId } from '@dotrino/identity/capabilities'
|
|
25
|
-
import { sealersOf,
|
|
25
|
+
import { sealersOf, memberCan } from '@dotrino/identity/acta'
|
|
26
26
|
import { installNodeGlobals } from '../node-globals.js'
|
|
27
27
|
import { makeEphemeral, deriveKey, seal, open } from '../e2e.js'
|
|
28
28
|
import { HS, ACK, DATA, PING, PONG, ERROR, VMSG, SIGN_SCOPE, SESSION_TTL_MS, REVOKE_REFRESH_MS } from '../protocol.js'
|
|
@@ -263,8 +263,18 @@ export async function startRemoteAgent (opts = {}) {
|
|
|
263
263
|
// papel bien firmado por una selladora abría sesión aunque el acta no nombrara a ese
|
|
264
264
|
// aparato — o ya no lo nombrara. Bajo el modelo viejo daba igual, porque el papel ERA la
|
|
265
265
|
// autoridad y caducaba; con el papel atado al acta, el acta tiene que decidir.
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
//
|
|
267
|
+
// SE PREGUNTA POR EL PERMISO, NO POR «FIRMA POR LA PERSONA». Aquí se usaba
|
|
268
|
+
// `memberCanSign`, que a un miembro CON `cn` le dice que no salvo que se le nombre su
|
|
269
|
+
// cajón — y con razón: un servicio habla por la bóveda, no por su dueño. Pero eso es la
|
|
270
|
+
// pregunta de OTRO mostrador. Lo que pasa aquí es un saludo, y lo que prueba es «soy
|
|
271
|
+
// este aparato», no «hablo por ti»: exigirle lo segundo dejaba a TODO servicio sin poder
|
|
272
|
+
// abrir sesión con otro agente. El bot social se pasó así el 1 de septiembre, con un
|
|
273
|
+
// node de contenido encendido a su lado que le contestaba «ese aparato no firma por este
|
|
274
|
+
// perfil». Se le pide lo que corresponde: que el acta lo nombre y le reconozca `sign`.
|
|
275
|
+
const miembro = (link.acta?.members || []).some((m) => m?.pub === chk.device)
|
|
276
|
+
if (!miembro || !memberCan(link.acta, chk.device, 'sign')) {
|
|
277
|
+
return send(from, { type: ERROR, error: 'no autorizado: acta — este perfil no reconoce a ese aparato' })
|
|
268
278
|
}
|
|
269
279
|
if (data.op !== HS || typeof data.eph !== 'string') return send(from, { type: ERROR, error: 'handshake inválido' })
|
|
270
280
|
|