@swal/edge-mesh 0.0.0-stage → 0.1.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/LICENSE +128 -0
- package/NOTICE +37 -0
- package/README.md +470 -2
- package/dist/adapters/gpu-agent/index.d.ts +61 -0
- package/dist/adapters/gpu-agent/index.d.ts.map +1 -0
- package/dist/adapters/gpu-agent/index.js +364 -0
- package/dist/adapters/gpu-agent/index.js.map +1 -0
- package/dist/adapters/maloca-salud/citas-distribuidas.d.ts +19 -0
- package/dist/adapters/maloca-salud/citas-distribuidas.d.ts.map +1 -0
- package/dist/adapters/maloca-salud/citas-distribuidas.js +51 -0
- package/dist/adapters/maloca-salud/citas-distribuidas.js.map +1 -0
- package/dist/adapters/maloca-salud/eps-bridge.d.ts +15 -0
- package/dist/adapters/maloca-salud/eps-bridge.d.ts.map +1 -0
- package/dist/adapters/maloca-salud/eps-bridge.js +27 -0
- package/dist/adapters/maloca-salud/eps-bridge.js.map +1 -0
- package/dist/adapters/maloca-salud/patient-profile.d.ts +20 -0
- package/dist/adapters/maloca-salud/patient-profile.d.ts.map +1 -0
- package/dist/adapters/maloca-salud/patient-profile.js +36 -0
- package/dist/adapters/maloca-salud/patient-profile.js.map +1 -0
- package/dist/adapters/maloca-salud/types.d.ts +40 -0
- package/dist/adapters/maloca-salud/types.d.ts.map +1 -0
- package/dist/adapters/maloca-salud/types.js +2 -0
- package/dist/adapters/maloca-salud/types.js.map +1 -0
- package/dist/adapters/maloca-veeduria/contract-bridge.d.ts +31 -0
- package/dist/adapters/maloca-veeduria/contract-bridge.d.ts.map +1 -0
- package/dist/adapters/maloca-veeduria/contract-bridge.js +103 -0
- package/dist/adapters/maloca-veeduria/contract-bridge.js.map +1 -0
- package/dist/adapters/maloca-veeduria/evidentia-veeduria.d.ts +14 -0
- package/dist/adapters/maloca-veeduria/evidentia-veeduria.d.ts.map +1 -0
- package/dist/adapters/maloca-veeduria/evidentia-veeduria.js +40 -0
- package/dist/adapters/maloca-veeduria/evidentia-veeduria.js.map +1 -0
- package/dist/adapters/maloca-veeduria/licitante-profile.d.ts +21 -0
- package/dist/adapters/maloca-veeduria/licitante-profile.d.ts.map +1 -0
- package/dist/adapters/maloca-veeduria/licitante-profile.js +58 -0
- package/dist/adapters/maloca-veeduria/licitante-profile.js.map +1 -0
- package/dist/adapters/maloca-veeduria/types.d.ts +30 -0
- package/dist/adapters/maloca-veeduria/types.d.ts.map +1 -0
- package/dist/adapters/maloca-veeduria/types.js +2 -0
- package/dist/adapters/maloca-veeduria/types.js.map +1 -0
- package/dist/adapters/maloca-xavier/agent-profile.d.ts +32 -0
- package/dist/adapters/maloca-xavier/agent-profile.d.ts.map +1 -0
- package/dist/adapters/maloca-xavier/agent-profile.js +56 -0
- package/dist/adapters/maloca-xavier/agent-profile.js.map +1 -0
- package/dist/adapters/maloca-xavier/codegraph-bridge.d.ts +27 -0
- package/dist/adapters/maloca-xavier/codegraph-bridge.d.ts.map +1 -0
- package/dist/adapters/maloca-xavier/codegraph-bridge.js +58 -0
- package/dist/adapters/maloca-xavier/codegraph-bridge.js.map +1 -0
- package/dist/adapters/maloca-xavier/llm-router.d.ts +25 -0
- package/dist/adapters/maloca-xavier/llm-router.d.ts.map +1 -0
- package/dist/adapters/maloca-xavier/llm-router.js +58 -0
- package/dist/adapters/maloca-xavier/llm-router.js.map +1 -0
- package/dist/authz/index.d.ts +81 -0
- package/dist/authz/index.d.ts.map +1 -0
- package/dist/authz/index.js +271 -0
- package/dist/authz/index.js.map +1 -0
- package/dist/chat/index.d.ts +138 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +394 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/offline-queue.d.ts +32 -0
- package/dist/chat/offline-queue.d.ts.map +1 -0
- package/dist/chat/offline-queue.js +93 -0
- package/dist/chat/offline-queue.js.map +1 -0
- package/dist/core/DefaultEdgeMeshNode.d.ts +17 -0
- package/dist/core/DefaultEdgeMeshNode.d.ts.map +1 -0
- package/dist/core/DefaultEdgeMeshNode.js +57 -0
- package/dist/core/DefaultEdgeMeshNode.js.map +1 -0
- package/dist/core/node.d.ts +26 -0
- package/dist/core/node.d.ts.map +1 -0
- package/dist/core/node.js +16 -0
- package/dist/core/node.js.map +1 -0
- package/dist/edge-mesh.d.ts +139 -0
- package/dist/edge-mesh.d.ts.map +1 -0
- package/dist/edge-mesh.js +1146 -0
- package/dist/edge-mesh.js.map +1 -0
- package/dist/gos/GosBridge.d.ts +49 -0
- package/dist/gos/GosBridge.d.ts.map +1 -0
- package/dist/gos/GosBridge.js +133 -0
- package/dist/gos/GosBridge.js.map +1 -0
- package/dist/governance/authority.d.ts +44 -0
- package/dist/governance/authority.d.ts.map +1 -0
- package/dist/governance/authority.js +123 -0
- package/dist/governance/authority.js.map +1 -0
- package/dist/governance/index.d.ts +66 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +210 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/merge.d.ts +31 -0
- package/dist/governance/merge.d.ts.map +1 -0
- package/dist/governance/merge.js +167 -0
- package/dist/governance/merge.js.map +1 -0
- package/dist/identity/index.d.ts +199 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +415 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/maloca/backoffice.d.ts +31 -0
- package/dist/maloca/backoffice.d.ts.map +1 -0
- package/dist/maloca/backoffice.js +40 -0
- package/dist/maloca/backoffice.js.map +1 -0
- package/dist/maloca/event-bus.d.ts +60 -0
- package/dist/maloca/event-bus.d.ts.map +1 -0
- package/dist/maloca/event-bus.js +175 -0
- package/dist/maloca/event-bus.js.map +1 -0
- package/dist/maloca/evidentia.d.ts +136 -0
- package/dist/maloca/evidentia.d.ts.map +1 -0
- package/dist/maloca/evidentia.js +447 -0
- package/dist/maloca/evidentia.js.map +1 -0
- package/dist/maloca/gateway/api.d.ts +146 -0
- package/dist/maloca/gateway/api.d.ts.map +1 -0
- package/dist/maloca/gateway/api.js +228 -0
- package/dist/maloca/gateway/api.js.map +1 -0
- package/dist/maloca/gateway/auth.d.ts +20 -0
- package/dist/maloca/gateway/auth.d.ts.map +1 -0
- package/dist/maloca/gateway/auth.js +115 -0
- package/dist/maloca/gateway/auth.js.map +1 -0
- package/dist/maloca/gateway/dashboard.d.ts +42 -0
- package/dist/maloca/gateway/dashboard.d.ts.map +1 -0
- package/dist/maloca/gateway/dashboard.js +67 -0
- package/dist/maloca/gateway/dashboard.js.map +1 -0
- package/dist/maloca/gateway/websocket.d.ts +34 -0
- package/dist/maloca/gateway/websocket.d.ts.map +1 -0
- package/dist/maloca/gateway/websocket.js +71 -0
- package/dist/maloca/gateway/websocket.js.map +1 -0
- package/dist/maloca/karma.d.ts +165 -0
- package/dist/maloca/karma.d.ts.map +1 -0
- package/dist/maloca/karma.js +307 -0
- package/dist/maloca/karma.js.map +1 -0
- package/dist/maloca/kernel.d.ts +20 -0
- package/dist/maloca/kernel.d.ts.map +1 -0
- package/dist/maloca/kernel.js +76 -0
- package/dist/maloca/kernel.js.map +1 -0
- package/dist/maloca/metadata.d.ts +30 -0
- package/dist/maloca/metadata.d.ts.map +1 -0
- package/dist/maloca/metadata.js +80 -0
- package/dist/maloca/metadata.js.map +1 -0
- package/dist/maloca/perfil.d.ts +57 -0
- package/dist/maloca/perfil.d.ts.map +1 -0
- package/dist/maloca/perfil.js +113 -0
- package/dist/maloca/perfil.js.map +1 -0
- package/dist/maloca/plugin-registry.d.ts +27 -0
- package/dist/maloca/plugin-registry.d.ts.map +1 -0
- package/dist/maloca/plugin-registry.js +76 -0
- package/dist/maloca/plugin-registry.js.map +1 -0
- package/dist/maloca/polygon-bridge.d.ts +63 -0
- package/dist/maloca/polygon-bridge.d.ts.map +1 -0
- package/dist/maloca/polygon-bridge.js +198 -0
- package/dist/maloca/polygon-bridge.js.map +1 -0
- package/dist/maloca/types.d.ts +44 -0
- package/dist/maloca/types.d.ts.map +1 -0
- package/dist/maloca/types.js +2 -0
- package/dist/maloca/types.js.map +1 -0
- package/dist/medico/aval.d.ts +149 -0
- package/dist/medico/aval.d.ts.map +1 -0
- package/dist/medico/aval.js +281 -0
- package/dist/medico/aval.js.map +1 -0
- package/dist/medico/canonica.d.ts +96 -0
- package/dist/medico/canonica.d.ts.map +1 -0
- package/dist/medico/canonica.js +148 -0
- package/dist/medico/canonica.js.map +1 -0
- package/dist/medico/credencial.d.ts +160 -0
- package/dist/medico/credencial.d.ts.map +1 -0
- package/dist/medico/credencial.js +240 -0
- package/dist/medico/credencial.js.map +1 -0
- package/dist/medico/index.d.ts +36 -0
- package/dist/medico/index.d.ts.map +1 -0
- package/dist/medico/index.js +39 -0
- package/dist/medico/index.js.map +1 -0
- package/dist/medico/malla.d.ts +218 -0
- package/dist/medico/malla.d.ts.map +1 -0
- package/dist/medico/malla.js +347 -0
- package/dist/medico/malla.js.map +1 -0
- package/dist/medico/registro-profesional.d.ts +84 -0
- package/dist/medico/registro-profesional.d.ts.map +1 -0
- package/dist/medico/registro-profesional.js +135 -0
- package/dist/medico/registro-profesional.js.map +1 -0
- package/dist/medico/registro.d.ts +149 -0
- package/dist/medico/registro.d.ts.map +1 -0
- package/dist/medico/registro.js +173 -0
- package/dist/medico/registro.js.map +1 -0
- package/dist/medico/types.d.ts +287 -0
- package/dist/medico/types.d.ts.map +1 -0
- package/dist/medico/types.js +135 -0
- package/dist/medico/types.js.map +1 -0
- package/dist/medico/verificacion-registro.d.ts +300 -0
- package/dist/medico/verificacion-registro.d.ts.map +1 -0
- package/dist/medico/verificacion-registro.js +319 -0
- package/dist/medico/verificacion-registro.js.map +1 -0
- package/dist/mesh/index.d.ts +457 -0
- package/dist/mesh/index.d.ts.map +1 -0
- package/dist/mesh/index.js +929 -0
- package/dist/mesh/index.js.map +1 -0
- package/dist/namespaces/encrypted-plugin.d.ts +56 -0
- package/dist/namespaces/encrypted-plugin.d.ts.map +1 -0
- package/dist/namespaces/encrypted-plugin.js +173 -0
- package/dist/namespaces/encrypted-plugin.js.map +1 -0
- package/dist/namespaces/index.d.ts +52 -0
- package/dist/namespaces/index.d.ts.map +1 -0
- package/dist/namespaces/index.js +134 -0
- package/dist/namespaces/index.js.map +1 -0
- package/dist/namespaces/ivn-proofs.d.ts +54 -0
- package/dist/namespaces/ivn-proofs.d.ts.map +1 -0
- package/dist/namespaces/ivn-proofs.js +162 -0
- package/dist/namespaces/ivn-proofs.js.map +1 -0
- package/dist/namespaces/offers-gossip.d.ts +95 -0
- package/dist/namespaces/offers-gossip.d.ts.map +1 -0
- package/dist/namespaces/offers-gossip.js +213 -0
- package/dist/namespaces/offers-gossip.js.map +1 -0
- package/dist/node-memory/idb-store.d.ts +22 -0
- package/dist/node-memory/idb-store.d.ts.map +1 -0
- package/dist/node-memory/idb-store.js +154 -0
- package/dist/node-memory/idb-store.js.map +1 -0
- package/dist/node-memory/index.d.ts +14 -0
- package/dist/node-memory/index.d.ts.map +1 -0
- package/dist/node-memory/index.js +159 -0
- package/dist/node-memory/index.js.map +1 -0
- package/dist/node-memory/sync-flush.d.ts +11 -0
- package/dist/node-memory/sync-flush.d.ts.map +1 -0
- package/dist/node-memory/sync-flush.js +37 -0
- package/dist/node-memory/sync-flush.js.map +1 -0
- package/dist/node-memory/types.d.ts +34 -0
- package/dist/node-memory/types.d.ts.map +1 -0
- package/dist/node-memory/types.js +2 -0
- package/dist/node-memory/types.js.map +1 -0
- package/dist/node-memory/xavier-store.d.ts +12 -0
- package/dist/node-memory/xavier-store.d.ts.map +1 -0
- package/dist/node-memory/xavier-store.js +75 -0
- package/dist/node-memory/xavier-store.js.map +1 -0
- package/dist/op-log/index.d.ts +49 -0
- package/dist/op-log/index.d.ts.map +1 -0
- package/dist/op-log/index.js +190 -0
- package/dist/op-log/index.js.map +1 -0
- package/dist/presence/health.d.ts +54 -0
- package/dist/presence/health.d.ts.map +1 -0
- package/dist/presence/health.js +139 -0
- package/dist/presence/health.js.map +1 -0
- package/dist/presence/index.d.ts +85 -0
- package/dist/presence/index.d.ts.map +1 -0
- package/dist/presence/index.js +255 -0
- package/dist/presence/index.js.map +1 -0
- package/dist/presence/peer-health.d.ts +40 -0
- package/dist/presence/peer-health.d.ts.map +1 -0
- package/dist/presence/peer-health.js +118 -0
- package/dist/presence/peer-health.js.map +1 -0
- package/dist/protocol/canonical.d.ts +10 -0
- package/dist/protocol/canonical.d.ts.map +1 -0
- package/dist/protocol/canonical.js +32 -0
- package/dist/protocol/canonical.js.map +1 -0
- package/dist/protocol/crypto.d.ts +299 -0
- package/dist/protocol/crypto.d.ts.map +1 -0
- package/dist/protocol/crypto.js +739 -0
- package/dist/protocol/crypto.js.map +1 -0
- package/dist/protocol/index.d.ts +30 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +116 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/utils.d.ts +5 -0
- package/dist/protocol/utils.d.ts.map +1 -0
- package/dist/protocol/utils.js +27 -0
- package/dist/protocol/utils.js.map +1 -0
- package/dist/salones/manager.d.ts +100 -0
- package/dist/salones/manager.d.ts.map +1 -0
- package/dist/salones/manager.js +240 -0
- package/dist/salones/manager.js.map +1 -0
- package/dist/security/rate-limiter.d.ts +13 -0
- package/dist/security/rate-limiter.d.ts.map +1 -0
- package/dist/security/rate-limiter.js +32 -0
- package/dist/security/rate-limiter.js.map +1 -0
- package/dist/snapshot/index.d.ts +90 -0
- package/dist/snapshot/index.d.ts.map +1 -0
- package/dist/snapshot/index.js +189 -0
- package/dist/snapshot/index.js.map +1 -0
- package/dist/storage/index.d.ts +49 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +176 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/optimizer.d.ts +28 -0
- package/dist/storage/optimizer.d.ts.map +1 -0
- package/dist/storage/optimizer.js +50 -0
- package/dist/storage/optimizer.js.map +1 -0
- package/dist/storage/ydoc-persistence.d.ts +27 -0
- package/dist/storage/ydoc-persistence.d.ts.map +1 -0
- package/dist/storage/ydoc-persistence.js +128 -0
- package/dist/storage/ydoc-persistence.js.map +1 -0
- package/dist/sync/ChunkSyncManager.d.ts +41 -0
- package/dist/sync/ChunkSyncManager.d.ts.map +1 -0
- package/dist/sync/ChunkSyncManager.js +115 -0
- package/dist/sync/ChunkSyncManager.js.map +1 -0
- package/dist/sync/conflict-resolver.d.ts +33 -0
- package/dist/sync/conflict-resolver.d.ts.map +1 -0
- package/dist/sync/conflict-resolver.js +54 -0
- package/dist/sync/conflict-resolver.js.map +1 -0
- package/dist/sync/engine.d.ts +168 -0
- package/dist/sync/engine.d.ts.map +1 -0
- package/dist/sync/engine.js +315 -0
- package/dist/sync/engine.js.map +1 -0
- package/dist/sync/index.d.ts +3 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +3 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/transport/TorTransportAdapter.d.ts +70 -0
- package/dist/transport/TorTransportAdapter.d.ts.map +1 -0
- package/dist/transport/TorTransportAdapter.js +192 -0
- package/dist/transport/TorTransportAdapter.js.map +1 -0
- package/dist/transport/memory.d.ts +31 -0
- package/dist/transport/memory.d.ts.map +1 -0
- package/dist/transport/memory.js +114 -0
- package/dist/transport/memory.js.map +1 -0
- package/dist/transport/peerjs.d.ts +45 -0
- package/dist/transport/peerjs.d.ts.map +1 -0
- package/dist/transport/peerjs.js +301 -0
- package/dist/transport/peerjs.js.map +1 -0
- package/dist/transport/pqc-handshake.d.ts +72 -0
- package/dist/transport/pqc-handshake.d.ts.map +1 -0
- package/dist/transport/pqc-handshake.js +129 -0
- package/dist/transport/pqc-handshake.js.map +1 -0
- package/dist/transport/relay-config.d.ts +11 -0
- package/dist/transport/relay-config.d.ts.map +1 -0
- package/dist/transport/relay-config.js +48 -0
- package/dist/transport/relay-config.js.map +1 -0
- package/dist/transport/relay-server.d.ts +37 -0
- package/dist/transport/relay-server.d.ts.map +1 -0
- package/dist/transport/relay-server.js +230 -0
- package/dist/transport/relay-server.js.map +1 -0
- package/dist/transport/tor.d.ts +47 -0
- package/dist/transport/tor.d.ts.map +1 -0
- package/dist/transport/tor.js +158 -0
- package/dist/transport/tor.js.map +1 -0
- package/dist/transport/types.d.ts +34 -0
- package/dist/transport/types.d.ts.map +1 -0
- package/dist/transport/types.js +2 -0
- package/dist/transport/types.js.map +1 -0
- package/dist/types/index.d.ts +293 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +73 -0
- package/dist/types/index.js.map +1 -0
- package/dist/web/admission.d.ts +24 -0
- package/dist/web/admission.d.ts.map +1 -0
- package/dist/web/admission.js +41 -0
- package/dist/web/admission.js.map +1 -0
- package/dist/web/crypto.d.ts +18 -0
- package/dist/web/crypto.d.ts.map +1 -0
- package/dist/web/crypto.js +78 -0
- package/dist/web/crypto.js.map +1 -0
- package/dist/web/exchange.d.ts +23 -0
- package/dist/web/exchange.d.ts.map +1 -0
- package/dist/web/exchange.js +54 -0
- package/dist/web/exchange.js.map +1 -0
- package/dist/web/fragment.d.ts +58 -0
- package/dist/web/fragment.d.ts.map +1 -0
- package/dist/web/fragment.js +198 -0
- package/dist/web/fragment.js.map +1 -0
- package/dist/web/index.d.ts +25 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +14 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/merge/index.d.ts +104 -0
- package/dist/web/merge/index.d.ts.map +1 -0
- package/dist/web/merge/index.js +236 -0
- package/dist/web/merge/index.js.map +1 -0
- package/dist/web/oplog/hlc.d.ts +19 -0
- package/dist/web/oplog/hlc.d.ts.map +1 -0
- package/dist/web/oplog/hlc.js +39 -0
- package/dist/web/oplog/hlc.js.map +1 -0
- package/dist/web/oplog/index.d.ts +10 -0
- package/dist/web/oplog/index.d.ts.map +1 -0
- package/dist/web/oplog/index.js +6 -0
- package/dist/web/oplog/index.js.map +1 -0
- package/dist/web/oplog/log.d.ts +182 -0
- package/dist/web/oplog/log.d.ts.map +1 -0
- package/dist/web/oplog/log.js +693 -0
- package/dist/web/oplog/log.js.map +1 -0
- package/dist/web/oplog/store.d.ts +40 -0
- package/dist/web/oplog/store.d.ts.map +1 -0
- package/dist/web/oplog/store.js +85 -0
- package/dist/web/oplog/store.js.map +1 -0
- package/dist/web/oplog/sync.d.ts +54 -0
- package/dist/web/oplog/sync.d.ts.map +1 -0
- package/dist/web/oplog/sync.js +162 -0
- package/dist/web/oplog/sync.js.map +1 -0
- package/dist/web/oplog/types.d.ts +119 -0
- package/dist/web/oplog/types.d.ts.map +1 -0
- package/dist/web/oplog/types.js +2 -0
- package/dist/web/oplog/types.js.map +1 -0
- package/dist/web/pairing.d.ts +186 -0
- package/dist/web/pairing.d.ts.map +1 -0
- package/dist/web/pairing.js +395 -0
- package/dist/web/pairing.js.map +1 -0
- package/dist/web/pq.d.ts +36 -0
- package/dist/web/pq.d.ts.map +1 -0
- package/dist/web/pq.js +59 -0
- package/dist/web/pq.js.map +1 -0
- package/dist/web/provider.d.ts +188 -0
- package/dist/web/provider.d.ts.map +1 -0
- package/dist/web/provider.js +2042 -0
- package/dist/web/provider.js.map +1 -0
- package/dist/web/rooms.d.ts +20 -0
- package/dist/web/rooms.d.ts.map +1 -0
- package/dist/web/rooms.js +51 -0
- package/dist/web/rooms.js.map +1 -0
- package/dist/web/rotation.d.ts +73 -0
- package/dist/web/rotation.d.ts.map +1 -0
- package/dist/web/rotation.js +130 -0
- package/dist/web/rotation.js.map +1 -0
- package/dist/web/secstate.d.ts +213 -0
- package/dist/web/secstate.d.ts.map +1 -0
- package/dist/web/secstate.js +789 -0
- package/dist/web/secstate.js.map +1 -0
- package/dist/web/store.d.ts +9 -0
- package/dist/web/store.d.ts.map +1 -0
- package/dist/web/store.js +32 -0
- package/dist/web/store.js.map +1 -0
- package/dist/web/transports/loopback.d.ts +11 -0
- package/dist/web/transports/loopback.d.ts.map +1 -0
- package/dist/web/transports/loopback.js +97 -0
- package/dist/web/transports/loopback.js.map +1 -0
- package/dist/web/transports/qr-sdp.d.ts +27 -0
- package/dist/web/transports/qr-sdp.d.ts.map +1 -0
- package/dist/web/transports/qr-sdp.js +131 -0
- package/dist/web/transports/qr-sdp.js.map +1 -0
- package/dist/web/transports/ws.d.ts +12 -0
- package/dist/web/transports/ws.d.ts.map +1 -0
- package/dist/web/transports/ws.js +139 -0
- package/dist/web/transports/ws.js.map +1 -0
- package/dist/web/trust/canonical.d.ts +8 -0
- package/dist/web/trust/canonical.d.ts.map +1 -0
- package/dist/web/trust/canonical.js +27 -0
- package/dist/web/trust/canonical.js.map +1 -0
- package/dist/web/trust/docs.d.ts +51 -0
- package/dist/web/trust/docs.d.ts.map +1 -0
- package/dist/web/trust/docs.js +170 -0
- package/dist/web/trust/docs.js.map +1 -0
- package/dist/web/trust/index.d.ts +10 -0
- package/dist/web/trust/index.d.ts.map +1 -0
- package/dist/web/trust/index.js +7 -0
- package/dist/web/trust/index.js.map +1 -0
- package/dist/web/trust/keys.d.ts +37 -0
- package/dist/web/trust/keys.d.ts.map +1 -0
- package/dist/web/trust/keys.js +75 -0
- package/dist/web/trust/keys.js.map +1 -0
- package/dist/web/trust/store.d.ts +150 -0
- package/dist/web/trust/store.d.ts.map +1 -0
- package/dist/web/trust/store.js +587 -0
- package/dist/web/trust/store.js.map +1 -0
- package/dist/web/trust/types.d.ts +134 -0
- package/dist/web/trust/types.d.ts.map +1 -0
- package/dist/web/trust/types.js +4 -0
- package/dist/web/trust/types.js.map +1 -0
- package/dist/web/types.d.ts +115 -0
- package/dist/web/types.d.ts.map +1 -0
- package/dist/web/types.js +2 -0
- package/dist/web/types.js.map +1 -0
- package/dist/web/util.d.ts +12 -0
- package/dist/web/util.d.ts.map +1 -0
- package/dist/web/util.js +54 -0
- package/dist/web/util.js.map +1 -0
- package/dist/web/webrtc.d.ts +35 -0
- package/dist/web/webrtc.d.ts.map +1 -0
- package/dist/web/webrtc.js +304 -0
- package/dist/web/webrtc.js.map +1 -0
- package/package.json +138 -4
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
// TrustStore: ingests signed grants/revocations from any source in any order, keeps only documents whose
|
|
2
|
+
// signature chain reaches the configured root, enforces delegation rules and answers `can(...)`.
|
|
3
|
+
//
|
|
4
|
+
// Invariants
|
|
5
|
+
// - `grants` holds only grants whose signature verified against the root (issuer = root) or against the subject key
|
|
6
|
+
// of an accepted parent grant, and whose delegation rules hold w.r.t. that parent. So every accepted grant has a
|
|
7
|
+
// fully verified chain to the root.
|
|
8
|
+
// - Documents whose parent is unknown wait in `pending` (bounded in total, per issuer AND per sending peer, and they
|
|
9
|
+
// expire) and are re-processed when the parent arrives.
|
|
10
|
+
// - Revocations are accepted on signature; whether they are *effective* (issuer is the root or a STRICT ancestor of
|
|
11
|
+
// the target: never the target grant itself) is decided at query time, so the target may arrive later. A
|
|
12
|
+
// revocation whose issuer grant is its own target is rejected outright: a device cannot retract its own accepted
|
|
13
|
+
// history (leaving is simply stopping; it never rewrites what peers already accepted).
|
|
14
|
+
// - Revocations always cascade: descendants of a revoked grant are cut at `upTo[grantId]` (missing = 0, so a grant
|
|
15
|
+
// the revoked issuer mints later never inherits a cut-off).
|
|
16
|
+
// - Times are compared with the op's HLC wall time (`At.time`), seqs with the subject's own log seq (`At.seq`).
|
|
17
|
+
import { checkGrantShape, checkIntegrity, checkRevocationShape, verifyDocSignature, } from "./docs.js";
|
|
18
|
+
import { isPublicKey, keyFingerprint } from "./keys.js";
|
|
19
|
+
import { levelRank, } from "./types.js";
|
|
20
|
+
export async function createTrustStore(opts) {
|
|
21
|
+
if (!isPublicKey(opts.root))
|
|
22
|
+
throw new Error("root is not an ML-DSA-65 public key");
|
|
23
|
+
const rootFp = await keyFingerprint(opts.root);
|
|
24
|
+
if (opts.rootFingerprint && opts.rootFingerprint !== rootFp)
|
|
25
|
+
throw new Error("root fingerprint mismatch");
|
|
26
|
+
return new TrustStore(opts, rootFp);
|
|
27
|
+
}
|
|
28
|
+
const MAX_REJECTED = 10_000;
|
|
29
|
+
/** R6-S2: waiting slots one issuer (one sending peer) may hold at once. */
|
|
30
|
+
const DEFAULT_MAX_PENDING_PER_ISSUER = 32;
|
|
31
|
+
/**
|
|
32
|
+
* R6-S2b: waiting slots one SENDING PEER may hold at once. Counted on the peer that sent the documents, not on the
|
|
33
|
+
* issuers they name, so fresh random signatures cannot buy more room.
|
|
34
|
+
*/
|
|
35
|
+
const DEFAULT_MAX_PENDING_PER_SENDER = 32;
|
|
36
|
+
/** R6-S2: a parked document whose parent has not arrived by then is dropped and its slot reclaimed. */
|
|
37
|
+
const DEFAULT_PENDING_TTL_MS = 10 * 60 * 1000;
|
|
38
|
+
const DENY_PRIORITY = [
|
|
39
|
+
"revoked",
|
|
40
|
+
"expired",
|
|
41
|
+
"not-yet-valid",
|
|
42
|
+
"insufficient-level",
|
|
43
|
+
"no-grant",
|
|
44
|
+
];
|
|
45
|
+
export class TrustStore {
|
|
46
|
+
inst;
|
|
47
|
+
rootFp;
|
|
48
|
+
schema;
|
|
49
|
+
maxDepth;
|
|
50
|
+
root;
|
|
51
|
+
now;
|
|
52
|
+
maxPending;
|
|
53
|
+
maxPendingPerIssuer;
|
|
54
|
+
maxPendingPerSender;
|
|
55
|
+
pendingTtlMs;
|
|
56
|
+
grants = new Map();
|
|
57
|
+
depth = new Map();
|
|
58
|
+
revs = new Map();
|
|
59
|
+
pending = new Map(); // parent id -> docs
|
|
60
|
+
pendingCount = 0;
|
|
61
|
+
/** R6-S2: parked documents per issuer, so no single peer can take the whole waiting set. */
|
|
62
|
+
waitingByIssuer = new Map();
|
|
63
|
+
/** R6-S2b: parked documents per SENDING PEER, so fresh random issuers cannot buy more room. */
|
|
64
|
+
waitingBySender = new Map();
|
|
65
|
+
/** R6-S2: last instant the waiting set was swept for expired documents (see `expireWaiting`). */
|
|
66
|
+
lastSweepAt = 0;
|
|
67
|
+
rejected = new Map();
|
|
68
|
+
listeners = new Set();
|
|
69
|
+
derived = null;
|
|
70
|
+
queue = Promise.resolve();
|
|
71
|
+
/** increments on every accepted document */
|
|
72
|
+
version = 0;
|
|
73
|
+
constructor(opts, rootFp) {
|
|
74
|
+
this.inst = opts.inst;
|
|
75
|
+
this.root = opts.root;
|
|
76
|
+
this.rootFp = rootFp;
|
|
77
|
+
this.schema = opts.schema;
|
|
78
|
+
this.maxDepth = opts.schema.maxDepth ?? 2;
|
|
79
|
+
this.now = opts.now ?? Date.now;
|
|
80
|
+
this.maxPending = opts.maxPending ?? 1000;
|
|
81
|
+
this.maxPendingPerIssuer =
|
|
82
|
+
opts.maxPendingPerIssuer ?? DEFAULT_MAX_PENDING_PER_ISSUER;
|
|
83
|
+
this.maxPendingPerSender =
|
|
84
|
+
opts.maxPendingPerSender ?? DEFAULT_MAX_PENDING_PER_SENDER;
|
|
85
|
+
this.pendingTtlMs = opts.pendingTtlMs ?? DEFAULT_PENDING_TTL_MS;
|
|
86
|
+
}
|
|
87
|
+
// ─── ingest ──────────────────────────────────────────────────────────────
|
|
88
|
+
add(doc, opts) {
|
|
89
|
+
return this.addMany([doc], opts).then((r) => r[0]);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Ingest documents (serialized). Listeners fire once if anything was accepted.
|
|
93
|
+
* `opts.from` is the transport-level id of the peer that sent them: it is charged the waiting slots they take
|
|
94
|
+
* (R6-S2b) and left undefined for local/own documents, which no sender can be blamed for.
|
|
95
|
+
*/
|
|
96
|
+
addMany(docs, opts) {
|
|
97
|
+
const run = this.queue.then(async () => {
|
|
98
|
+
const before = this.version;
|
|
99
|
+
const out = [];
|
|
100
|
+
for (const d of docs)
|
|
101
|
+
out.push(await this.ingest(d, opts?.from));
|
|
102
|
+
if (this.version !== before)
|
|
103
|
+
this.emit();
|
|
104
|
+
return out;
|
|
105
|
+
});
|
|
106
|
+
this.queue = run.catch(() => undefined);
|
|
107
|
+
return run;
|
|
108
|
+
}
|
|
109
|
+
reject(id, reason) {
|
|
110
|
+
if (id) {
|
|
111
|
+
if (this.rejected.size >= MAX_REJECTED) {
|
|
112
|
+
const first = this.rejected.keys().next().value;
|
|
113
|
+
if (first !== undefined)
|
|
114
|
+
this.rejected.delete(first);
|
|
115
|
+
}
|
|
116
|
+
this.rejected.set(id, reason);
|
|
117
|
+
}
|
|
118
|
+
return { status: "rejected", id, reason };
|
|
119
|
+
}
|
|
120
|
+
async ingest(x, from) {
|
|
121
|
+
const t = x?.t;
|
|
122
|
+
if (t === "grant") {
|
|
123
|
+
const bad = checkGrantShape(x, this.schema);
|
|
124
|
+
if (bad)
|
|
125
|
+
return { status: "rejected", reason: bad };
|
|
126
|
+
}
|
|
127
|
+
else if (t === "revoke") {
|
|
128
|
+
const bad = checkRevocationShape(x);
|
|
129
|
+
if (bad)
|
|
130
|
+
return { status: "rejected", reason: bad };
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
return { status: "rejected", reason: "unknown document" };
|
|
134
|
+
}
|
|
135
|
+
const doc = x;
|
|
136
|
+
if (doc.inst !== this.inst)
|
|
137
|
+
return { status: "rejected", id: doc.id, reason: "wrong instance" };
|
|
138
|
+
if (this.grants.has(doc.id) || this.revs.has(doc.id))
|
|
139
|
+
return { status: "duplicate", id: doc.id };
|
|
140
|
+
const prior = this.rejected.get(doc.id);
|
|
141
|
+
if (prior)
|
|
142
|
+
return { status: "rejected", id: doc.id, reason: prior };
|
|
143
|
+
const integrity = await checkIntegrity(doc);
|
|
144
|
+
if (integrity)
|
|
145
|
+
return { status: "rejected", reason: integrity }; // id is not trustworthy: don't remember it
|
|
146
|
+
const res = await this.verifyAndStore(doc, from);
|
|
147
|
+
if (res.status === "rejected" && this.rejected.has(doc.id))
|
|
148
|
+
this.rejectWaiting(doc.id);
|
|
149
|
+
if (res.status !== "accepted")
|
|
150
|
+
return res;
|
|
151
|
+
// drain documents that were waiting for this grant (iteratively)
|
|
152
|
+
const work = [doc.id];
|
|
153
|
+
while (work.length) {
|
|
154
|
+
const pid = work.pop();
|
|
155
|
+
const waiting = this.pending.get(pid);
|
|
156
|
+
if (!waiting)
|
|
157
|
+
continue;
|
|
158
|
+
this.pending.delete(pid);
|
|
159
|
+
for (const w of waiting.values()) {
|
|
160
|
+
this.releaseWaiting(w);
|
|
161
|
+
// R6-S2b: a document waiting for this parent re-verifies under the peer that sent it, not under
|
|
162
|
+
// whoever happens to have supplied the parent
|
|
163
|
+
const r = await this.verifyAndStore(w.doc, w.from);
|
|
164
|
+
if (r.status === "accepted" && w.doc.t === "grant")
|
|
165
|
+
work.push(w.doc.id);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return res;
|
|
169
|
+
}
|
|
170
|
+
async verifyAndStore(doc, from) {
|
|
171
|
+
if (this.grants.has(doc.id) || this.revs.has(doc.id))
|
|
172
|
+
return { status: "duplicate", id: doc.id };
|
|
173
|
+
let issuerPub;
|
|
174
|
+
let parent;
|
|
175
|
+
if (doc.issuer === this.rootFp) {
|
|
176
|
+
if (doc.parent !== undefined)
|
|
177
|
+
return this.reject(doc.id, "root-issued document must not have a parent");
|
|
178
|
+
issuerPub = this.root;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
if (doc.parent === undefined)
|
|
182
|
+
return this.reject(doc.id, "issuer is not the root and has no parent grant");
|
|
183
|
+
parent = this.grants.get(doc.parent);
|
|
184
|
+
if (!parent) {
|
|
185
|
+
const pr = this.rejected.get(doc.parent);
|
|
186
|
+
if (pr)
|
|
187
|
+
return this.reject(doc.id, "parent grant rejected");
|
|
188
|
+
return this.park(doc, from);
|
|
189
|
+
}
|
|
190
|
+
if (parent.subject.fp !== doc.issuer)
|
|
191
|
+
return this.reject(doc.id, "issuer is not the subject of parent grant");
|
|
192
|
+
issuerPub = parent.subject.pub;
|
|
193
|
+
}
|
|
194
|
+
// B5: a grant cannot revoke itself (that would retroactively erase its subject's accepted history)
|
|
195
|
+
if (doc.t === "revoke" &&
|
|
196
|
+
doc.parent !== undefined &&
|
|
197
|
+
doc.parent === doc.target)
|
|
198
|
+
return this.reject(doc.id, "self-revocation");
|
|
199
|
+
// not remembered by id: a forged copy of a legit body must not block the real document
|
|
200
|
+
if (!(await verifyDocSignature(doc, issuerPub)))
|
|
201
|
+
return { status: "rejected", id: doc.id, reason: "bad signature" };
|
|
202
|
+
if (doc.t === "grant") {
|
|
203
|
+
const why = this.checkDelegation(doc, parent);
|
|
204
|
+
if (why)
|
|
205
|
+
return this.reject(doc.id, why);
|
|
206
|
+
this.grants.set(doc.id, doc);
|
|
207
|
+
this.depth.set(doc.id, parent ? (this.depth.get(parent.id) ?? 1) + 1 : 1);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
this.revs.set(doc.id, doc);
|
|
211
|
+
}
|
|
212
|
+
this.version++;
|
|
213
|
+
this.derived = null;
|
|
214
|
+
return { status: "accepted", id: doc.id };
|
|
215
|
+
}
|
|
216
|
+
/** A parent was rejected for a body-determined reason: its waiting descendants can never be valid. */
|
|
217
|
+
rejectWaiting(parentId) {
|
|
218
|
+
const work = [parentId];
|
|
219
|
+
while (work.length) {
|
|
220
|
+
const pid = work.pop();
|
|
221
|
+
const waiting = this.pending.get(pid);
|
|
222
|
+
if (!waiting)
|
|
223
|
+
continue;
|
|
224
|
+
this.pending.delete(pid);
|
|
225
|
+
for (const w of waiting.values()) {
|
|
226
|
+
this.releaseWaiting(w);
|
|
227
|
+
this.reject(w.doc.id, "parent grant rejected");
|
|
228
|
+
work.push(w.doc.id);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* R6-S4: forget accepted documents (`ids`) so a per-issuer cap can be applied as a rule on the SET held instead
|
|
234
|
+
* of on the arrival order (web/secstate keeps the cap-N smallest ids of each bucket and evicts the rest).
|
|
235
|
+
* Documents are still only ever ADDED from the network: nothing here reads the wire, and the only caller is the
|
|
236
|
+
* cap enforcement, which evicts one document per accepted one, so the store never loses ground.
|
|
237
|
+
* Returns the ids that were actually dropped.
|
|
238
|
+
*/
|
|
239
|
+
dropAccepted(ids) {
|
|
240
|
+
const dropped = [];
|
|
241
|
+
for (const id of ids) {
|
|
242
|
+
if (this.grants.delete(id))
|
|
243
|
+
this.depth.delete(id);
|
|
244
|
+
else if (!this.revs.delete(id))
|
|
245
|
+
continue;
|
|
246
|
+
dropped.push(id);
|
|
247
|
+
}
|
|
248
|
+
if (dropped.length) {
|
|
249
|
+
this.version++;
|
|
250
|
+
this.derived = null;
|
|
251
|
+
}
|
|
252
|
+
return dropped;
|
|
253
|
+
}
|
|
254
|
+
park(doc, from) {
|
|
255
|
+
const pid = doc.parent;
|
|
256
|
+
const key = `${doc.id}.${doc.sig}`; // by id+sig: a forged copy must not shadow the real one
|
|
257
|
+
const now = this.now();
|
|
258
|
+
// R6-S2: before anything else, give back the slots held by documents whose parent never arrived, so an orphan
|
|
259
|
+
// flood cannot make the waiting set unusable for good
|
|
260
|
+
this.expireWaiting(now);
|
|
261
|
+
let m = this.pending.get(pid);
|
|
262
|
+
if (m?.has(key))
|
|
263
|
+
return {
|
|
264
|
+
status: "pending",
|
|
265
|
+
id: doc.id,
|
|
266
|
+
reason: "waiting for parent grant",
|
|
267
|
+
};
|
|
268
|
+
const held = this.waitingByIssuer.get(doc.issuer) ?? 0;
|
|
269
|
+
// R6-S2: the room was full (globally, or for this issuer alone), a property of this device and not of the
|
|
270
|
+
// document: it is NOT remembered against this id, so a peer offering it again is served and it is asked for
|
|
271
|
+
// again (`missing()` keeps it), and a single member cannot take more than its share of the waiting set
|
|
272
|
+
if (held >= this.maxPendingPerIssuer ||
|
|
273
|
+
this.pendingCount >= this.maxPending)
|
|
274
|
+
return { status: "rejected", id: doc.id, reason: "pending overflow" };
|
|
275
|
+
// R6-S2b: same thing one level up, on the SENDER instead of on the issuers they name. A peer that signed
|
|
276
|
+
// with fresh random keys holds one waiting slot per issuer and got past the check above every time; what it
|
|
277
|
+
// actually spends is its own quota of slots, so that is what is counted here. Local/own documents (no `from`)
|
|
278
|
+
// are charged to nobody. Also contextual: not remembered against the id, so it stays askable.
|
|
279
|
+
const heldBySender = from === undefined ? 0 : (this.waitingBySender.get(from) ?? 0);
|
|
280
|
+
if (heldBySender >= this.maxPendingPerSender)
|
|
281
|
+
return {
|
|
282
|
+
status: "rejected",
|
|
283
|
+
id: doc.id,
|
|
284
|
+
reason: "sender pending overflow",
|
|
285
|
+
};
|
|
286
|
+
if (!m) {
|
|
287
|
+
m = new Map();
|
|
288
|
+
this.pending.set(pid, m);
|
|
289
|
+
}
|
|
290
|
+
m.set(key, { doc, at: now, from });
|
|
291
|
+
this.pendingCount++;
|
|
292
|
+
this.waitingByIssuer.set(doc.issuer, held + 1);
|
|
293
|
+
if (from !== undefined)
|
|
294
|
+
this.waitingBySender.set(from, heldBySender + 1);
|
|
295
|
+
return {
|
|
296
|
+
status: "pending",
|
|
297
|
+
id: doc.id,
|
|
298
|
+
reason: "waiting for parent grant",
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* R6-S2: drop every parked document that has been waiting longer than the TTL. Its parent may still arrive later
|
|
303
|
+
* (the document is not remembered as bad, so it is asked for again), but the slot it held is reclaimed now.
|
|
304
|
+
*/
|
|
305
|
+
expireWaiting(now) {
|
|
306
|
+
// every stamp is the clock at insertion, so nothing can have expired since the last sweep at the same instant:
|
|
307
|
+
// a whole batch parks with one sweep instead of one per document
|
|
308
|
+
if (this.pendingCount === 0 || now <= this.lastSweepAt)
|
|
309
|
+
return;
|
|
310
|
+
this.lastSweepAt = now;
|
|
311
|
+
for (const [pid, m] of [...this.pending]) {
|
|
312
|
+
for (const [key, w] of [...m]) {
|
|
313
|
+
if (now - w.at <= this.pendingTtlMs)
|
|
314
|
+
continue;
|
|
315
|
+
m.delete(key);
|
|
316
|
+
this.releaseWaiting(w);
|
|
317
|
+
}
|
|
318
|
+
if (m.size === 0)
|
|
319
|
+
this.pending.delete(pid);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/** Give back the global, per-issuer and per-sender (R6-S2b) waiting slots of a document that leaves the waiting set. */
|
|
323
|
+
releaseWaiting(w) {
|
|
324
|
+
this.pendingCount--;
|
|
325
|
+
const left = (this.waitingByIssuer.get(w.doc.issuer) ?? 1) - 1;
|
|
326
|
+
if (left > 0)
|
|
327
|
+
this.waitingByIssuer.set(w.doc.issuer, left);
|
|
328
|
+
else
|
|
329
|
+
this.waitingByIssuer.delete(w.doc.issuer);
|
|
330
|
+
if (w.from !== undefined) {
|
|
331
|
+
const l = (this.waitingBySender.get(w.from) ?? 1) - 1;
|
|
332
|
+
if (l > 0)
|
|
333
|
+
this.waitingBySender.set(w.from, l);
|
|
334
|
+
else
|
|
335
|
+
this.waitingBySender.delete(w.from);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/** Delegation rules of a grant w.r.t. its (accepted) issuer grant; undefined parent = root-issued. */
|
|
339
|
+
checkDelegation(g, parent) {
|
|
340
|
+
if (parent) {
|
|
341
|
+
if (parent.delegate < 1)
|
|
342
|
+
return "issuer cannot delegate";
|
|
343
|
+
if (g.delegate >= parent.delegate)
|
|
344
|
+
return "escalation: delegate must be lower than issuer's";
|
|
345
|
+
for (const [mod, lvl] of Object.entries(g.permissions)) {
|
|
346
|
+
if (levelRank(lvl) > levelRank(parent.permissions[mod]))
|
|
347
|
+
return `escalation: ${mod}=${lvl} exceeds issuer`;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
const depth = parent ? (this.depth.get(parent.id) ?? 1) + 1 : 1;
|
|
351
|
+
if (depth > this.maxDepth)
|
|
352
|
+
return `chain too deep (${depth} > ${this.maxDepth})`;
|
|
353
|
+
if (g.delegate > this.maxDepth - depth)
|
|
354
|
+
return `delegate ${g.delegate} exceeds depth budget`;
|
|
355
|
+
return null;
|
|
356
|
+
}
|
|
357
|
+
// ─── derived index ───────────────────────────────────────────────────────
|
|
358
|
+
d() {
|
|
359
|
+
if (this.derived)
|
|
360
|
+
return this.derived;
|
|
361
|
+
const byFp = new Map();
|
|
362
|
+
const chain = new Map();
|
|
363
|
+
for (const g of this.grants.values()) {
|
|
364
|
+
const list = byFp.get(g.subject.fp);
|
|
365
|
+
list ? list.push(g) : byFp.set(g.subject.fp, [g]);
|
|
366
|
+
const c = [g];
|
|
367
|
+
let p = g.parent ? this.grants.get(g.parent) : undefined;
|
|
368
|
+
while (p) {
|
|
369
|
+
c.push(p);
|
|
370
|
+
p = p.parent ? this.grants.get(p.parent) : undefined;
|
|
371
|
+
}
|
|
372
|
+
chain.set(g.id, c);
|
|
373
|
+
}
|
|
374
|
+
const revsByTarget = new Map();
|
|
375
|
+
for (const r of this.revs.values()) {
|
|
376
|
+
const target = this.grants.get(r.target);
|
|
377
|
+
if (!target)
|
|
378
|
+
continue; // inert until the target arrives
|
|
379
|
+
if (r.issuer !== this.rootFp) {
|
|
380
|
+
// B5: only a STRICT ancestor of the target (chain[1..]) may revoke it, never the target itself
|
|
381
|
+
const ancestors = (chain.get(target.id) ?? []).slice(1);
|
|
382
|
+
if (!ancestors.some((a) => a.id === r.parent))
|
|
383
|
+
continue; // not the issuer chain of the target: ignored
|
|
384
|
+
}
|
|
385
|
+
const list = revsByTarget.get(r.target);
|
|
386
|
+
list ? list.push(r) : revsByTarget.set(r.target, [r]);
|
|
387
|
+
}
|
|
388
|
+
const cut = new Map();
|
|
389
|
+
const anchors = new Map();
|
|
390
|
+
const addAnchor = (fp, seq, id) => {
|
|
391
|
+
if (id === undefined || seq < 1)
|
|
392
|
+
return;
|
|
393
|
+
const list = anchors.get(fp) ?? [];
|
|
394
|
+
if (!list.some((a) => a.seq === seq && a.id === id))
|
|
395
|
+
list.push({ seq, id });
|
|
396
|
+
anchors.set(fp, list);
|
|
397
|
+
};
|
|
398
|
+
for (const g of this.grants.values()) {
|
|
399
|
+
let c = g.seqCutoff ?? Number.POSITIVE_INFINITY;
|
|
400
|
+
const links = chain.get(g.id) ?? [g];
|
|
401
|
+
links.forEach((link, i) => {
|
|
402
|
+
for (const r of revsByTarget.get(link.id) ?? []) {
|
|
403
|
+
if (i === 0)
|
|
404
|
+
addAnchor(g.subject.fp, r.lastSeq, r.lastId);
|
|
405
|
+
else if (r.upTo?.[g.id] !== undefined)
|
|
406
|
+
addAnchor(g.subject.fp, r.upTo[g.id], r.upToIds?.[g.id]);
|
|
407
|
+
// S2: cascaded cut-offs are keyed by grant id; a grant unknown to the revocation gets 0
|
|
408
|
+
const s = i === 0
|
|
409
|
+
? r.lastSeq
|
|
410
|
+
: (r.upTo?.[g.id] ??
|
|
411
|
+
(g.subject.fp === link.subject.fp ? r.lastSeq : 0));
|
|
412
|
+
if (s < c)
|
|
413
|
+
c = s;
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
cut.set(g.id, c);
|
|
417
|
+
}
|
|
418
|
+
this.derived = { byFp, chain, revsByTarget, cut, anchors };
|
|
419
|
+
return this.derived;
|
|
420
|
+
}
|
|
421
|
+
// ─── queries ─────────────────────────────────────────────────────────────
|
|
422
|
+
/** May `fp` do `level` in `module` for an op at (seq, time)? Synchronous: uses only accepted documents. */
|
|
423
|
+
can(fp, module, level, at = {}) {
|
|
424
|
+
return this.explain(fp, module, level, at).ok;
|
|
425
|
+
}
|
|
426
|
+
explain(fp, module, level, at = {}) {
|
|
427
|
+
const grants = this.d().byFp.get(fp);
|
|
428
|
+
if (!grants?.length)
|
|
429
|
+
return { ok: false, reason: "no-grant" };
|
|
430
|
+
const reasons = new Set();
|
|
431
|
+
for (const g of grants) {
|
|
432
|
+
if (levelRank(g.permissions[module]) < levelRank(level)) {
|
|
433
|
+
reasons.add("insufficient-level");
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
const why = this.grantDenial(g, at);
|
|
437
|
+
if (why)
|
|
438
|
+
reasons.add(why);
|
|
439
|
+
else
|
|
440
|
+
return { ok: true, grant: g };
|
|
441
|
+
}
|
|
442
|
+
return {
|
|
443
|
+
ok: false,
|
|
444
|
+
reason: DENY_PRIORITY.find((r) => reasons.has(r)) ?? "no-grant",
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
/** null if grant `g` is in force at `at` (ignoring module/level). */
|
|
448
|
+
grantDenial(g, at) {
|
|
449
|
+
const d = this.d();
|
|
450
|
+
const cut = d.cut.get(g.id) ?? Number.POSITIVE_INFINITY;
|
|
451
|
+
if (at.seq === undefined ? cut !== Number.POSITIVE_INFINITY : at.seq > cut)
|
|
452
|
+
return "revoked";
|
|
453
|
+
const time = at.time ?? this.now();
|
|
454
|
+
for (const link of d.chain.get(g.id) ?? [g]) {
|
|
455
|
+
if (time < link.notBefore)
|
|
456
|
+
return "not-yet-valid";
|
|
457
|
+
if (link.expiresAt !== undefined && time >= link.expiresAt)
|
|
458
|
+
return "expired";
|
|
459
|
+
}
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
/** Grants of `fp` in force at `at`. */
|
|
463
|
+
activeGrants(fp, at = {}) {
|
|
464
|
+
return (this.d().byFp.get(fp) ?? []).filter((g) => !this.grantDenial(g, at));
|
|
465
|
+
}
|
|
466
|
+
/** Has at least one grant in force (e.g. provider `authorizeDevice`). */
|
|
467
|
+
isMember(fp, at = {}) {
|
|
468
|
+
return this.activeGrants(fp, at).length > 0;
|
|
469
|
+
}
|
|
470
|
+
/** Union (max level per module) of the grants in force. */
|
|
471
|
+
effectivePermissions(fp, at = {}) {
|
|
472
|
+
const out = {};
|
|
473
|
+
for (const g of this.activeGrants(fp, at)) {
|
|
474
|
+
for (const [m, l] of Object.entries(g.permissions)) {
|
|
475
|
+
if (levelRank(l) > levelRank(out[m]))
|
|
476
|
+
out[m] = l;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return out;
|
|
480
|
+
}
|
|
481
|
+
/** Public signing key of a device with any accepted grant (also revoked ones: old ops still verify). */
|
|
482
|
+
keyOf(fp) {
|
|
483
|
+
return this.d().byFp.get(fp)?.[0]?.subject.pub;
|
|
484
|
+
}
|
|
485
|
+
grantsOf(fp) {
|
|
486
|
+
return [...(this.d().byFp.get(fp) ?? [])];
|
|
487
|
+
}
|
|
488
|
+
getGrant(id) {
|
|
489
|
+
return this.grants.get(id);
|
|
490
|
+
}
|
|
491
|
+
/** S3: anchors of a subject (from effective revocations), highest seq first. */
|
|
492
|
+
anchorsOf(fp) {
|
|
493
|
+
return [...(this.d().anchors.get(fp) ?? [])].sort((a, b) => b.seq - a.seq);
|
|
494
|
+
}
|
|
495
|
+
/** Effective seq cut-off of a grant (Infinity = not revoked). */
|
|
496
|
+
cutOf(grantId) {
|
|
497
|
+
return this.d().cut.get(grantId) ?? Number.POSITIVE_INFINITY;
|
|
498
|
+
}
|
|
499
|
+
/** Chain length root -> grant (1 = issued by the root). */
|
|
500
|
+
depthOf(grantId) {
|
|
501
|
+
return this.depth.get(grantId);
|
|
502
|
+
}
|
|
503
|
+
/** Grants issued (transitively) under `grantId`. */
|
|
504
|
+
descendants(grantId) {
|
|
505
|
+
const d = this.d();
|
|
506
|
+
return [...this.grants.values()].filter((g) => g.id !== grantId &&
|
|
507
|
+
(d.chain.get(g.id) ?? []).some((a) => a.id === grantId));
|
|
508
|
+
}
|
|
509
|
+
/** Would a revocation of `targetId` signed by `fp` (with grant `parentId`, or as root) be effective? */
|
|
510
|
+
canRevoke(fp, targetId, parentId) {
|
|
511
|
+
if (fp === this.rootFp)
|
|
512
|
+
return true;
|
|
513
|
+
const parent = parentId ? this.grants.get(parentId) : undefined;
|
|
514
|
+
if (!parent || parent.subject.fp !== fp)
|
|
515
|
+
return false;
|
|
516
|
+
return (this.d().chain.get(targetId) ?? [])
|
|
517
|
+
.slice(1)
|
|
518
|
+
.some((a) => a.id === parent.id);
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Build the revocation input for `targetId` with cut-offs taken from the revoker's log heads
|
|
522
|
+
* (`heads[fp]` = last seq the revoker has seen from that device, or `{ seq, id }` from `OpLog.headIds()` to also
|
|
523
|
+
* anchor the history, S3), including every cascaded grant (by grant id).
|
|
524
|
+
*/
|
|
525
|
+
prepareRevocation(targetId, heads, reason) {
|
|
526
|
+
const target = this.grants.get(targetId);
|
|
527
|
+
if (!target)
|
|
528
|
+
throw new Error("unknown target grant");
|
|
529
|
+
const seqOf = (fp) => {
|
|
530
|
+
const h = heads[fp];
|
|
531
|
+
return typeof h === "number" ? h : (h?.seq ?? 0);
|
|
532
|
+
};
|
|
533
|
+
const idOf = (fp) => {
|
|
534
|
+
const h = heads[fp];
|
|
535
|
+
return typeof h === "object" && h.seq > 0 ? h.id : undefined;
|
|
536
|
+
};
|
|
537
|
+
const upTo = {};
|
|
538
|
+
const upToIds = {};
|
|
539
|
+
for (const g of this.descendants(targetId)) {
|
|
540
|
+
upTo[g.id] = seqOf(g.subject.fp);
|
|
541
|
+
const id = idOf(g.subject.fp);
|
|
542
|
+
if (id)
|
|
543
|
+
upToIds[g.id] = id;
|
|
544
|
+
}
|
|
545
|
+
const lastId = idOf(target.subject.fp);
|
|
546
|
+
return {
|
|
547
|
+
target: targetId,
|
|
548
|
+
lastSeq: seqOf(target.subject.fp),
|
|
549
|
+
...(lastId ? { lastId } : {}),
|
|
550
|
+
upTo,
|
|
551
|
+
...(Object.keys(upToIds).length ? { upToIds } : {}),
|
|
552
|
+
reason,
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
/** Every accepted document (replicate / persist these; re-`addMany` them on boot). */
|
|
556
|
+
docs() {
|
|
557
|
+
return [...this.grants.values(), ...this.revs.values()];
|
|
558
|
+
}
|
|
559
|
+
revocations() {
|
|
560
|
+
return [...this.revs.values()];
|
|
561
|
+
}
|
|
562
|
+
/** Reason a document id was rejected for a body-determined cause (bounded memory; bad signatures are not kept). */
|
|
563
|
+
rejection(id) {
|
|
564
|
+
return this.rejected.get(id);
|
|
565
|
+
}
|
|
566
|
+
pendingIds() {
|
|
567
|
+
return [
|
|
568
|
+
...new Set([...this.pending.values()].flatMap((m) => [...m.values()].map((w) => w.doc.id))),
|
|
569
|
+
];
|
|
570
|
+
}
|
|
571
|
+
/** Called after documents are accepted (e.g. web/oplog re-evaluates quarantined/pending ops). */
|
|
572
|
+
onChange(cb) {
|
|
573
|
+
this.listeners.add(cb);
|
|
574
|
+
return () => this.listeners.delete(cb);
|
|
575
|
+
}
|
|
576
|
+
emit() {
|
|
577
|
+
for (const cb of [...this.listeners]) {
|
|
578
|
+
try {
|
|
579
|
+
cb();
|
|
580
|
+
}
|
|
581
|
+
catch {
|
|
582
|
+
// listener errors never break ingestion
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/web/trust/store.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,iGAAiG;AACjG,EAAE;AACF,aAAa;AACb,oHAAoH;AACpH,mHAAmH;AACnH,sCAAsC;AACtC,qHAAqH;AACrH,0DAA0D;AAC1D,oHAAoH;AACpH,2GAA2G;AAC3G,mHAAmH;AACnH,yFAAyF;AACzF,mHAAmH;AACnH,8DAA8D;AAC9D,gHAAgH;AAGhH,OAAO,EACN,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAON,SAAS,GAKT,MAAM,YAAY,CAAC;AAmCpB,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,IAAuB;IAEvB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,KAAK,MAAM;QAC1D,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IA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