@dotrino/identity 0.65.0 → 0.65.1

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 +1 -1
  2. package/vault/acta.js +7 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotrino/identity",
3
- "version": "0.65.0",
3
+ "version": "0.65.1",
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",
package/vault/acta.js CHANGED
@@ -568,10 +568,14 @@ export function effectiveCaps (acta, pub, extraRenounces = []) {
568
568
  */
569
569
  export function memberCanSign (acta, pub, ns = null) {
570
570
  if (!memberCan(acta, pub, 'sign')) return false
571
- if (ns == null) return true
572
571
  const m = (acta?.members || []).find((x) => x.pub === pub)
573
- // Un aparato tuyo (sin `cn`) firma como tú. Uno de servicio, solo lo de su cajón.
574
- return !m?.cn || m.cn === ns
572
+ // SIN `cn` = un aparato TUYO: firma como tú, y no hay nada que preguntarle a nadie.
573
+ if (!m?.cn) return true
574
+ // CON `cn` = un servicio, y el cajón lo dice EL ACTA. Así que no hace falta —ni vale—
575
+ // preguntarle al contenido de qué es: quien pregunta sin decir cajón está pidiendo
576
+ // «firma por la identidad, en general», y eso un servicio no lo hace. Solo se le
577
+ // reconoce la firma dentro del suyo.
578
+ return ns != null && m.cn === ns
575
579
  }
576
580
 
577
581
  export function memberCanReadSecrets (acta, pub, ns) {