@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.
- package/package.json +6 -1
- 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.
|
|
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
|
}
|
package/vault/vaultSeal.js
CHANGED
|
@@ -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
|
-
|
|
106
|
+
/** @type {{ key: string, peerEncPub: string }[]} */
|
|
107
|
+
const sealed = []
|
|
107
108
|
let lastError = null
|
|
108
109
|
for (const k of keys) {
|
|
109
|
-
try {
|
|
110
|
+
try { sealed.push({ key: k, peerEncPub: await client.encPubOf(k) }) } catch (e) { lastError = e }
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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)) {
|