@dotrino/identity 0.121.6 → 0.121.7
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/vault/acta.js +1 -1
- package/vault/capabilities.js +1 -1
- package/vault/core.js +2 -2
package/package.json
CHANGED
package/vault/acta.js
CHANGED
|
@@ -467,7 +467,7 @@ export function genesisActa ({ pub, encPub = null, sealPub = null, label = '', c
|
|
|
467
467
|
|
|
468
468
|
/** Comprobaciones de FORMA (sin cripto): que el acta sea un acta. */
|
|
469
469
|
export function checkShape (acta) {
|
|
470
|
-
if (!acta || typeof acta !== 'object') return 'no-
|
|
470
|
+
if (!acta || typeof acta !== 'object') return 'no-record'
|
|
471
471
|
if (!ACTA_LEIBLES.includes(acta.v)) return 'version'
|
|
472
472
|
if (!isPub(acta.profileId) || !isPub(acta.sealedBy)) return 'shape'
|
|
473
473
|
if (acta.chainUrl != null && !isChainUrl(acta.chainUrl)) return 'chainurl'
|
package/vault/capabilities.js
CHANGED
|
@@ -252,7 +252,7 @@ export async function verifyDelegation ({ cert, expectedScope, expectedSub, acta
|
|
|
252
252
|
// Sin esos datos no se puede juzgar, y se dice en vez de contestar «vale» a solas:
|
|
253
253
|
// devolver `ok` sin haber comprobado nada es exactamente cómo un papel viejo seguía
|
|
254
254
|
// entrando.
|
|
255
|
-
if (typeof actaSeq !== 'number' || !Array.isArray(sealers)) return { ok: false, reason: 'no-
|
|
255
|
+
if (typeof actaSeq !== 'number' || !Array.isArray(sealers)) return { ok: false, reason: 'no-record' }
|
|
256
256
|
// SOLO SE RECHAZA EL PAPEL DEL FUTURO. Si el cert nombra un acta MÁS NUEVA que la que
|
|
257
257
|
// tengo, no puedo juzgarlo: mi política está atrasada y decir que sí sería fiarme de algo
|
|
258
258
|
// que no he visto. Al revés no: un papel viejo es normal —el aparato estuvo apagado— y lo
|
package/vault/core.js
CHANGED
|
@@ -1140,7 +1140,7 @@ export async function createIdentityCore ({ kv: hostKv, peers, makeSync = null,
|
|
|
1140
1140
|
// es suya: que la llave que se va a instalar SEA de esta cuenta. Sin ello, el navegador
|
|
1141
1141
|
// se quedaría con una identidad que ningún acta reconoce — y sin forma de notarlo.
|
|
1142
1142
|
const v = await Acta.verifyActa({ acta: entrada?.acta })
|
|
1143
|
-
if (!v.ok) throw Object.assign(new Error('the account record does not verify: ' + v.reason), { code: 'bad-
|
|
1143
|
+
if (!v.ok) throw Object.assign(new Error('the account record does not verify: ' + v.reason), { code: 'bad-record' })
|
|
1144
1144
|
if (!(entrada.acta.members || []).some((m) => m?.pub === entrada.publickey)) {
|
|
1145
1145
|
throw Object.assign(new Error('that key is not a member of the account record'), { code: 'not-a-member' })
|
|
1146
1146
|
}
|
|
@@ -1416,7 +1416,7 @@ export async function createIdentityCore ({ kv: hostKv, peers, makeSync = null,
|
|
|
1416
1416
|
// Ya no hay ventana de caducidad: el papel no vence. Lo único que obliga a pedir uno
|
|
1417
1417
|
// nuevo es que el ACTA diga algo distinto de lo que lleva escrito.
|
|
1418
1418
|
/** Rechazos de la bóveda que se arreglan con un papel nuevo (el mismo juego que la app nativa). */
|
|
1419
|
-
const PAPER_REASONS = new Set(['scope', 'stale-record', 'untrusted-issuer', 'expired', 'legacy-cert-retired', 'no-
|
|
1419
|
+
const PAPER_REASONS = new Set(['scope', 'stale-record', 'untrusted-issuer', 'expired', 'legacy-cert-retired', 'no-record'])
|
|
1420
1420
|
const RENEW_RETRY_MS = 60 * 60 * 1000 // si falla (vault apagado), no insistir >1 vez/hora
|
|
1421
1421
|
let renewLastTry = 0
|
|
1422
1422
|
/**
|