@dotrino/identity 0.140.1 → 0.140.2

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.
Files changed (2) hide show
  1. package/package.json +6 -1
  2. package/vault/vaultSeal.js +12 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotrino/identity",
3
- "version": "0.140.1",
3
+ "version": "0.140.2",
4
4
  "description": "Identidad y rating de usuarios compartidos entre apps de Dotrino (vault iframe + postMessage)",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -100,5 +100,10 @@
100
100
  },
101
101
  "peerDependencies": {
102
102
  "@dotrino/proxy-client": ">=0.20.0"
103
+ },
104
+ "dotrino": {
105
+ "site": "id",
106
+ "dist": "vault",
107
+ "build": "bash scripts/build-vault-site.sh"
103
108
  }
104
109
  }
@@ -103,14 +103,21 @@ export async function sendToVault (client, { dest, to = null, acta = null, paylo
103
103
  // esconderle nada, y ahí la bóveda no tiene llave de cifrado que anunciar.
104
104
  if (client?.local) { client.sendByPubkey(dest, payload, opts); return { sealed: 0, why: 'local' } }
105
105
  const keys = to ? [to] : vaultKeysOf(await latestActa(client, acta))
106
- const encPubs = []
106
+ /** @type {{ key: string, peerEncPub: string }[]} */
107
+ const sealed = []
107
108
  let lastError = null
108
109
  for (const k of keys) {
109
- try { encPubs.push(await client.encPubOf(k)) } catch (e) { lastError = e }
110
+ try { sealed.push({ key: k, peerEncPub: await client.encPubOf(k) }) } catch (e) { lastError = e }
110
111
  }
111
- if (encPubs.length) {
112
- for (const peerEncPub of encPubs) await client.sendSealed([dest], payload, { peerEncPub, ...opts })
113
- return { sealed: encPubs.length }
112
+ // CADA SOBRE A LA LLAVE DE SU BÓVEDA, no todos a `dest`. `dest` es la maestra de la bóveda que
113
+ // firmó el papel, y una bóveda se ata en el proxio con su llave de comunicación y con el
114
+ // `profileId` (la maestra de la PRIMERA): la maestra de una hermana no la escucha nadie. Un
115
+ // aparato con el papel renovado por una hermana (la Nube, otra máquina) mandaba todo a una
116
+ // dirección muerta y la cuenta no contestaba con las bóvedas encendidas (la tableta de
117
+ // Seyacat, 2026-12-05). Regla del dueño: contesta la bóveda que esté encendida.
118
+ if (sealed.length) {
119
+ for (const { key, peerEncPub } of sealed) await client.sendSealed([key], payload, { peerEncPub, ...opts })
120
+ return { sealed: sealed.length }
114
121
  }
115
122
  const why = keys.length ? (/** @type {{ code?: string } | null} */ (lastError)?.code || 'no-encpub') : 'no-vault-key'
116
123
  if (!plainAllowed(now)) {