@noy-db/hub 0.6.0-pre.9 → 0.7.0-pre.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/CHANGELOG.md +7127 -0
- package/README.md +1 -1
- package/codemods/0.4.0-pre.json +24 -0
- package/codemods/0.6.0-pre.json +229 -0
- package/codemods/0.7.0-pre.json +258 -0
- package/dist/api-EQYRTZO2.js +20 -0
- package/dist/as/index.js +146 -0
- package/dist/as/index.js.map +1 -0
- package/dist/at/index.js +23 -0
- package/dist/attestation/index.js +19 -19
- package/dist/{backup-KULFZ2T4.js → backup-Z7ZBTAQ6.js} +36 -18
- package/dist/backup-Z7ZBTAQ6.js.map +1 -0
- package/dist/blobs/index.js +22 -20
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +12 -12
- package/dist/by/index.js +11 -0
- package/dist/cargo/index.js +40 -36
- package/dist/{chunk-YAWK6AWF.js → chunk-225O5CXQ.js} +2 -2
- package/dist/{chunk-MSWYQLMQ.js → chunk-2GXEQUEX.js} +2 -2
- package/dist/chunk-2GXEQUEX.js.map +1 -0
- package/dist/{chunk-3URQC7EH.js → chunk-2LPVI4PX.js} +355 -132
- package/dist/chunk-2LPVI4PX.js.map +1 -0
- package/dist/{chunk-JJNOLSG5.js → chunk-3L2MVE36.js} +15 -16
- package/dist/chunk-3L2MVE36.js.map +1 -0
- package/dist/{chunk-OF3L2SD6.js → chunk-3QARDAYW.js} +2 -2
- package/dist/{chunk-WLZ47GSL.js → chunk-467SKJ65.js} +12 -10
- package/dist/{chunk-WLZ47GSL.js.map → chunk-467SKJ65.js.map} +1 -1
- package/dist/{chunk-W3TVWF6N.js → chunk-4A4TYISP.js} +2 -2
- package/dist/{chunk-ZJADGNYF.js → chunk-4AOERLTV.js} +1 -1
- package/dist/chunk-4AOERLTV.js.map +1 -0
- package/dist/{chunk-CCZJJ4I2.js → chunk-4G25SDQL.js} +6 -6
- package/dist/{chunk-4I72F5DF.js → chunk-4LPF226H.js} +11 -14
- package/dist/chunk-4LPF226H.js.map +1 -0
- package/dist/{chunk-7F4DBNSP.js → chunk-4ZPE6SKS.js} +135 -18
- package/dist/chunk-4ZPE6SKS.js.map +1 -0
- package/dist/{chunk-7TSYBD3E.js → chunk-5263OEM3.js} +2 -2
- package/dist/{chunk-WFUIE565.js → chunk-57JTHWLQ.js} +17 -14
- package/dist/chunk-57JTHWLQ.js.map +1 -0
- package/dist/{chunk-FNSMZQS4.js → chunk-5ACAVJUI.js} +2 -2
- package/dist/{chunk-PDLLCOGD.js → chunk-5AFMP532.js} +20 -17
- package/dist/chunk-5AFMP532.js.map +1 -0
- package/dist/{chunk-JRKZTEZZ.js → chunk-5W7YXFV5.js} +444 -73
- package/dist/chunk-5W7YXFV5.js.map +1 -0
- package/dist/chunk-6EW2UCVF.js +190 -0
- package/dist/chunk-6EW2UCVF.js.map +1 -0
- package/dist/{chunk-4VUPLMZ6.js → chunk-6FOGTKBY.js} +68 -73
- package/dist/chunk-6FOGTKBY.js.map +1 -0
- package/dist/{chunk-VMCCGUQB.js → chunk-7LYUJNU3.js} +2 -2
- package/dist/{chunk-52JPHN5N.js → chunk-A2YW5EMU.js} +27 -149
- package/dist/chunk-A2YW5EMU.js.map +1 -0
- package/dist/{chunk-WLYIROCJ.js → chunk-AB5P32RE.js} +2 -2
- package/dist/{chunk-PL2GHSCM.js → chunk-ALB64CZM.js} +157 -90
- package/dist/chunk-ALB64CZM.js.map +1 -0
- package/dist/{chunk-SUFG5E73.js → chunk-ALUNQEBY.js} +2 -2
- package/dist/{chunk-CADUYBQD.js → chunk-ATL3ZVXT.js} +2 -2
- package/dist/{chunk-BWVKEOPE.js → chunk-ATV637J7.js} +7 -11
- package/dist/chunk-ATV637J7.js.map +1 -0
- package/dist/{chunk-DG27IUVI.js → chunk-CBRS2NEK.js} +2 -11
- package/dist/chunk-CBRS2NEK.js.map +1 -0
- package/dist/{chunk-7MNBICB5.js → chunk-CN6B5PEN.js} +16 -14
- package/dist/chunk-CN6B5PEN.js.map +1 -0
- package/dist/{chunk-6FJWSWFT.js → chunk-DBNYPLWY.js} +3 -3
- package/dist/{chunk-5JY5TSVY.js → chunk-DFAUMLD7.js} +25 -31
- package/dist/chunk-DFAUMLD7.js.map +1 -0
- package/dist/{chunk-FFDNKRCY.js → chunk-DKWPJOYH.js} +2 -2
- package/dist/chunk-DKWPJOYH.js.map +1 -0
- package/dist/{chunk-VJFMXYKP.js → chunk-E6YA6UAP.js} +2 -2
- package/dist/{chunk-WASHZV34.js → chunk-F23WQK3G.js} +65 -27
- package/dist/chunk-F23WQK3G.js.map +1 -0
- package/dist/{chunk-JIUVJ4M7.js → chunk-F7ZFRPGQ.js} +3 -3
- package/dist/{chunk-HXGUIPQB.js → chunk-FOG7YEJP.js} +3 -3
- package/dist/{chunk-QULVCV3M.js → chunk-GK4DRVUD.js} +6 -6
- package/dist/chunk-GK4DRVUD.js.map +1 -0
- package/dist/{chunk-BRVW2GS5.js → chunk-H36KSN6X.js} +87 -34
- package/dist/chunk-H36KSN6X.js.map +1 -0
- package/dist/{chunk-O2ERS4UJ.js → chunk-H4M7ADXY.js} +81 -52
- package/dist/chunk-H4M7ADXY.js.map +1 -0
- package/dist/{chunk-FZ6NYJ7L.js → chunk-H7HP56F6.js} +11 -8
- package/dist/chunk-H7HP56F6.js.map +1 -0
- package/dist/chunk-HK67PX4J.js +27 -0
- package/dist/chunk-HK67PX4J.js.map +1 -0
- package/dist/{chunk-X56RTUK3.js → chunk-HM4JSXX2.js} +3 -3
- package/dist/{chunk-AHLJSVRL.js → chunk-HTGRQZFB.js} +5 -7
- package/dist/chunk-HTGRQZFB.js.map +1 -0
- package/dist/{chunk-GQ3BX5EA.js → chunk-I3ISCYT7.js} +2 -2
- package/dist/{chunk-Q6TEJXBX.js → chunk-IESNYJXZ.js} +31 -49
- package/dist/chunk-IESNYJXZ.js.map +1 -0
- package/dist/{chunk-FUHKW252.js → chunk-J4MN6XIU.js} +2 -2
- package/dist/{chunk-ADW22QSB.js → chunk-J4UJ5FRV.js} +4 -4
- package/dist/{chunk-HNGSV2YC.js → chunk-JBIV4FLR.js} +67 -10
- package/dist/chunk-JBIV4FLR.js.map +1 -0
- package/dist/{chunk-HVQGCKY4.js → chunk-JVLSU7S2.js} +2 -2
- package/dist/{chunk-AR2JDFAE.js → chunk-KDJGJR7F.js} +2 -2
- package/dist/{chunk-NPP5R7FF.js → chunk-KN4W2OQ4.js} +22 -18
- package/dist/chunk-KN4W2OQ4.js.map +1 -0
- package/dist/{chunk-G6S5VVHP.js → chunk-L6GTLZRK.js} +10 -10
- package/dist/chunk-L6GTLZRK.js.map +1 -0
- package/dist/{chunk-2BMRJ6LQ.js → chunk-LF6DMX4C.js} +8 -11
- package/dist/{chunk-2BMRJ6LQ.js.map → chunk-LF6DMX4C.js.map} +1 -1
- package/dist/chunk-LFUID7OW.js +163 -0
- package/dist/chunk-LFUID7OW.js.map +1 -0
- package/dist/{chunk-747LRSOO.js → chunk-LKFKXS5K.js} +2 -2
- package/dist/{chunk-U5O6GIWZ.js → chunk-LR4Z47QD.js} +3 -3
- package/dist/{chunk-VZ3XFUQ7.js → chunk-MTBXJAS4.js} +16 -22
- package/dist/chunk-MTBXJAS4.js.map +1 -0
- package/dist/chunk-N4CNVSUF.js +66 -0
- package/dist/chunk-N4CNVSUF.js.map +1 -0
- package/dist/{chunk-RTAMLDWP.js → chunk-NLKLXXTO.js} +2 -2
- package/dist/{chunk-IGJCYUT5.js → chunk-NSITFOCJ.js} +1 -1
- package/dist/chunk-NSITFOCJ.js.map +1 -0
- package/dist/{chunk-FDX7OWWI.js → chunk-OPXR4PB2.js} +2 -2
- package/dist/{chunk-4GZ6XOVW.js → chunk-OWLVBOWO.js} +44 -42
- package/dist/chunk-OWLVBOWO.js.map +1 -0
- package/dist/{chunk-Z45YRGFO.js → chunk-P6ASQOZR.js} +2 -2
- package/dist/{chunk-5O5HRRTV.js → chunk-PCQDY6QN.js} +7 -7
- package/dist/{chunk-5O5HRRTV.js.map → chunk-PCQDY6QN.js.map} +1 -1
- package/dist/{chunk-BEFVYAR5.js → chunk-PGFKIOR3.js} +4 -4
- package/dist/chunk-PGFKIOR3.js.map +1 -0
- package/dist/{chunk-3FSX6LDG.js → chunk-POS53FG6.js} +18 -3
- package/dist/{chunk-3FSX6LDG.js.map → chunk-POS53FG6.js.map} +1 -1
- package/dist/{chunk-3IXIU6FP.js → chunk-PQ6Z2TAP.js} +7 -10
- package/dist/chunk-PQ6Z2TAP.js.map +1 -0
- package/dist/{chunk-CEJWMBXO.js → chunk-PUJTKLPL.js} +6 -2
- package/dist/chunk-PUJTKLPL.js.map +1 -0
- package/dist/{chunk-GAG7QOVO.js → chunk-QGJ4XIA7.js} +53 -18
- package/dist/chunk-QGJ4XIA7.js.map +1 -0
- package/dist/{chunk-2DHSSLOD.js → chunk-QHJKK77B.js} +13 -15
- package/dist/chunk-QHJKK77B.js.map +1 -0
- package/dist/{chunk-2Z3NCLNX.js → chunk-QI5NWLVW.js} +7 -7
- package/dist/{chunk-6SAFL5YE.js → chunk-RC4BROYR.js} +3 -3
- package/dist/{chunk-NJDQ4YSV.js → chunk-RDHUZ674.js} +4 -4
- package/dist/{chunk-YPYHVOXP.js → chunk-RK7N4OQ5.js} +2 -2
- package/dist/chunk-RK7N4OQ5.js.map +1 -0
- package/dist/{chunk-3737A6EA.js → chunk-S2VG3ABP.js} +127 -31
- package/dist/chunk-S2VG3ABP.js.map +1 -0
- package/dist/{chunk-3JVXVJ7L.js → chunk-S35S77YU.js} +10 -10
- package/dist/{chunk-KUDZVJKQ.js → chunk-SHILAQH5.js} +2 -2
- package/dist/{chunk-4UVDI4XE.js → chunk-T3PHCEN4.js} +4 -4
- package/dist/{chunk-55LKVALY.js → chunk-T7IR4N2S.js} +1 -3
- package/dist/chunk-T7IR4N2S.js.map +1 -0
- package/dist/{chunk-RXYYFSBB.js → chunk-TOV6VMHF.js} +6 -6
- package/dist/chunk-TOV6VMHF.js.map +1 -0
- package/dist/{chunk-W77KZHCW.js → chunk-TVIFAHZR.js} +16 -17
- package/dist/chunk-TVIFAHZR.js.map +1 -0
- package/dist/chunk-UBSFPGVJ.js +1 -0
- package/dist/{chunk-FAXZQ5UF.js → chunk-UCUALOSM.js} +2 -2
- package/dist/{chunk-4HDYQL3J.js → chunk-VAG47QHV.js} +2 -2
- package/dist/{chunk-35EBKWQU.js → chunk-VFIWDPXZ.js} +4 -4
- package/dist/{chunk-5ZKS6ZE2.js → chunk-VTG7327U.js} +4 -4
- package/dist/chunk-VTG7327U.js.map +1 -0
- package/dist/{chunk-VCETL77O.js → chunk-W5LHQXZU.js} +36 -7
- package/dist/chunk-W5LHQXZU.js.map +1 -0
- package/dist/{chunk-6NVPFKN3.js → chunk-WK5FSW7T.js} +92 -35
- package/dist/chunk-WK5FSW7T.js.map +1 -0
- package/dist/{chunk-HNHCQ556.js → chunk-WLLUM35R.js} +2 -2
- package/dist/{chunk-YJ6IONGA.js → chunk-X62MEF2O.js} +13 -5
- package/dist/chunk-X62MEF2O.js.map +1 -0
- package/dist/{chunk-7G6VDWXB.js → chunk-X67FCULK.js} +5 -5
- package/dist/chunk-X67FCULK.js.map +1 -0
- package/dist/{chunk-UHXCLPGC.js → chunk-XDVVBETV.js} +2 -2
- package/dist/chunk-XDVVBETV.js.map +1 -0
- package/dist/chunk-XJ3FEKEY.js +15 -0
- package/dist/chunk-XJ3FEKEY.js.map +1 -0
- package/dist/{chunk-E6427JU2.js → chunk-XSN63FUS.js} +19 -3
- package/dist/chunk-XSN63FUS.js.map +1 -0
- package/dist/{chunk-JRCYZEHU.js → chunk-XVU7J43V.js} +2 -2
- package/dist/{chunk-2GAJGUNM.js → chunk-Y3YLJORD.js} +408 -260
- package/dist/chunk-Y3YLJORD.js.map +1 -0
- package/dist/{chunk-6BU3L4UE.js → chunk-Y6GZ2P4M.js} +7 -10
- package/dist/chunk-Y6GZ2P4M.js.map +1 -0
- package/dist/{chunk-DMQCLZ4Z.js → chunk-YCSM3GZU.js} +2 -2
- package/dist/{chunk-RV3ARMPN.js → chunk-YKPGQJFU.js} +30 -180
- package/dist/chunk-YKPGQJFU.js.map +1 -0
- package/dist/{chunk-FMQJZH4R.js → chunk-YMLQBZFJ.js} +6 -6
- package/dist/{chunk-6HFM7EIT.js → chunk-YPSOHDNC.js} +2 -2
- package/dist/{chunk-CDB2HVQW.js → chunk-YXA2TCTZ.js} +14 -15
- package/dist/chunk-YXA2TCTZ.js.map +1 -0
- package/dist/{chunk-N35NC4JH.js → chunk-Z2PWOSCJ.js} +2 -2
- package/dist/{chunk-XWX7GL56.js → chunk-Z2WK53N6.js} +47 -23
- package/dist/chunk-Z2WK53N6.js.map +1 -0
- package/dist/{chunk-HPLWFNG4.js → chunk-Z7ZXZL6Y.js} +2 -2
- package/dist/{chunk-PNKHAKQ7.js → chunk-ZO252Q5S.js} +17 -10
- package/dist/chunk-ZO252Q5S.js.map +1 -0
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-2KJAXRRO.js → classified-marker-BSQHU4JT.js} +3 -3
- package/dist/collection-facade-LG3NYZVB.js +45 -0
- package/dist/{computed-6G5M3UPH.js → computed-ASBNTLOK.js} +3 -3
- package/dist/consent/index.js +10 -10
- package/dist/cover/index.js +10 -3
- package/dist/custody/index.js +12 -11
- package/dist/{dead-filter-DCB62VWW.js → dead-filter-QKU56XTQ.js} +2 -2
- package/dist/debug/index.js +1 -1
- package/dist/{delegation-MO7YZYJS.js → delegation-XWRPYODW.js} +24 -23
- package/dist/delegation-XWRPYODW.js.map +1 -0
- package/dist/derivations/index.js +12 -12
- package/dist/derive-CXHCY46K.js +22 -0
- package/dist/directory/index.js +10 -10
- package/dist/{dispatch-MJ6SHB3Y.js → dispatch-4AP4PUZU.js} +18 -18
- package/dist/{dispatch-FZEAWKVM.js → dispatch-VR4LRXZ7.js} +9 -6
- package/dist/dispatch-VR4LRXZ7.js.map +1 -0
- package/dist/{enclave-JU4YIEPB.js → enclave-NYPT7WA7.js} +31 -9
- package/dist/executor-3KFRQETS.js +29 -0
- package/dist/executor-AFHQYRAU.js +9 -0
- package/dist/executor-YYDW6XQI.js +9 -0
- package/dist/export-accessible-BX2ILB4C.js +23 -0
- package/dist/extract-partition-UPOVITFI.js +38 -0
- package/dist/{fanout-sidecar-NNAJQXMX.js → fanout-sidecar-IWP3R4RC.js} +18 -27
- package/dist/fanout-sidecar-IWP3R4RC.js.map +1 -0
- package/dist/{fence-watcher-DHQ775JB.js → fence-watcher-ZVSMLKQD.js} +1 -1
- package/dist/fence-watcher-ZVSMLKQD.js.map +1 -0
- package/dist/find-SZBL2HPB.js +11 -0
- package/dist/forget/index.js +9 -9
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +23 -20
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +14 -14
- package/dist/index.d.ts +35 -18
- package/dist/index.js +199 -204
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +4 -4
- package/dist/introspection/index.js +12 -11
- package/dist/issue-G53NB6EW.js +19 -0
- package/dist/kernel/collection-config.d.ts +9 -9
- package/dist/kernel/collection.d.ts +9 -3
- package/dist/kernel/constants.d.ts +36 -0
- package/dist/kernel/enclave/crypto.d.ts +52 -4
- package/dist/kernel/enclave/index.d.ts +10 -3
- package/dist/kernel/enclave/record-aad.d.ts +131 -0
- package/dist/kernel/enclave/record-envelope.d.ts +76 -0
- package/dist/kernel/enclave/record-keys/envelope-body.d.ts +34 -2
- package/dist/kernel/enclave/record-keys/lifecycle.d.ts +22 -5
- package/dist/kernel/enclave/record-keys/record-codec.d.ts +47 -14
- package/dist/kernel/enclave/record-keys/rekey-blob.d.ts +88 -0
- package/dist/kernel/enclave/record-keys/rekey.d.ts +91 -0
- package/dist/kernel/enclave/record-keys/tombstone.d.ts +3 -2
- package/dist/kernel/errors.d.ts +134 -14
- package/dist/kernel/merge-authority.d.ts +25 -0
- package/dist/kernel/noydb.d.ts +33 -10
- package/dist/kernel/query/builder.d.ts +51 -4
- package/dist/kernel/query/join.d.ts +27 -0
- package/dist/kernel/query/live.d.ts +31 -9
- package/dist/kernel/query/predicate.d.ts +9 -0
- package/dist/kernel/refs.d.ts +3 -1
- package/dist/kernel/secret-mode.d.ts +1 -1
- package/dist/kernel/sync-policy.d.ts +0 -2
- package/dist/kernel/tier-visibility.d.ts +34 -0
- package/dist/kernel/types.d.ts +145 -28
- package/dist/kernel/vault.d.ts +16 -7
- package/dist/kernel/via/compose.d.ts +3 -3
- package/dist/kernel/via/index.d.ts +15 -6
- package/dist/kernel/via/pipeline.d.ts +6 -6
- package/dist/kernel/via/reconcile.d.ts +14 -2
- package/dist/kernel/via/taint-binding.d.ts +3 -3
- package/dist/{ledger-AETNF4OM.js → ledger-T5K4P2D7.js} +11 -11
- package/dist/liberate-VEOZRESE.js +25 -0
- package/dist/{link-set-E5HNY67I.js → link-set-76JZ6YB4.js} +11 -11
- package/dist/{managed-secret-CWQ6PND5.js → managed-secret-6YC32VXG.js} +13 -5
- package/dist/materialized-views/index.js +27 -27
- package/dist/migrate-cek-LBRKYUZZ.js +19 -0
- package/dist/migrate-cek-LBRKYUZZ.js.map +1 -0
- package/dist/money/index.js +5 -5
- package/dist/noydb-EDJA4JNJ.js +86 -0
- package/dist/on/index.js +1 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +12 -12
- package/dist/pod/index.js +79 -88
- package/dist/pod-handle-P6DPBM5U.js +41 -0
- package/dist/pod-handle-P6DPBM5U.js.map +1 -0
- package/dist/policy/index.js +11 -4
- package/dist/port/as/active.d.ts +10 -0
- package/dist/port/as/index.d.ts +32 -0
- package/dist/port/as/types.d.ts +113 -0
- package/dist/port/at/index.d.ts +37 -0
- package/dist/port/by/default-provider.d.ts +3 -3
- package/dist/port/by/index.d.ts +32 -10
- package/dist/port/by/types.d.ts +29 -11
- package/dist/port/on/index.d.ts +50 -0
- package/dist/port/to/index.d.ts +4 -4
- package/dist/port/to/locator.d.ts +54 -8
- package/dist/port/with/computed-strategy.d.ts +1 -1
- package/dist/port/with/device-seal-strategy.d.ts +2 -2
- package/dist/port/with/formats-strategy.d.ts +76 -0
- package/dist/port/with/i18n-strategy.d.ts +4 -1
- package/dist/port/with/lookup-strategy.d.ts +4 -1
- package/dist/port/with/merge-authority.d.ts +52 -0
- package/dist/port/with/service-bus.d.ts +0 -4
- package/dist/port/with/strategies.d.ts +13 -5
- package/dist/port/with/team-strategy.d.ts +5 -1
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-2XSSMGEQ.js → post-register-53O7AJRZ.js} +6 -6
- package/dist/query/index.js +6 -6
- package/dist/reduce/index.js +6 -6
- package/dist/register-6TCBR6XD.js +32 -0
- package/dist/registry-DH2L4O2V.js +18 -0
- package/dist/registry-IWFMXCHX.js +9 -0
- package/dist/registry-Q3FG3OAX.js +9 -0
- package/dist/registry-YC3IFG3A.js +19 -0
- package/dist/request-withdrawal-NM5VYR6F.js +31 -0
- package/dist/{reveal-BW36KCOQ.js → reveal-XBIMHAXR.js} +6 -6
- package/dist/revoke-MJNYWO72.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +20 -13
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +4 -4
- package/dist/{seed-GDV5PT4R.js → seed-NSNIGYXE.js} +20 -22
- package/dist/seed-NSNIGYXE.js.map +1 -0
- package/dist/sequence/index.js +9 -9
- package/dist/session/index.js +10 -10
- package/dist/shadow/index.js +2 -2
- package/dist/share-link/index.js +1 -1
- package/dist/signer-6XVS2AU3.js +25 -0
- package/dist/snapshots/index.js +10 -10
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-ARHFVL5U.js → stale-MCS46TFO.js} +10 -10
- package/dist/storage-ZXUT476I.js +23 -0
- package/dist/storage-ZXUT476I.js.map +1 -0
- package/dist/{store-coordination-provider-GFCUOBR6.js → store-coordination-provider-6FM26VQM.js} +22 -15
- package/dist/store-coordination-provider-6FM26VQM.js.map +1 -0
- package/dist/sync/index.js +11 -11
- package/dist/team/index.js +17 -16
- package/dist/tiers/index.js +11 -10
- package/dist/to/index.js +17 -9
- package/dist/to/index.js.map +1 -1
- package/dist/transactions/index.js +4 -4
- package/dist/{ulid-PTAIMDG4.js → ulid-VQW6ERQN.js} +2 -2
- package/dist/ulid-VQW6ERQN.js.map +1 -0
- package/dist/util/index.js +1 -1
- package/dist/vault-diff-FE5J35NJ.js +9 -0
- package/dist/vault-diff-FE5J35NJ.js.map +1 -0
- package/dist/vault-head/index.js +115 -0
- package/dist/vault-head/index.js.map +1 -0
- package/dist/{verify-RO5RTZOJ.js → verify-WYOFLSNA.js} +5 -5
- package/dist/via/blob/binding.d.ts +6 -6
- package/dist/via/blob/index.d.ts +3 -0
- package/dist/via/classified/binding.d.ts +9 -9
- package/dist/via/computed/binding.d.ts +2 -2
- package/dist/via/i18n/binding.d.ts +4 -4
- package/dist/via/lookup/binding.d.ts +5 -5
- package/dist/via/lookup/handle.d.ts +4 -1
- package/dist/via/lookup/index.d.ts +1 -1
- package/dist/via/lookup/snapshot.d.ts +1 -1
- package/dist/via/money/binding.d.ts +3 -3
- package/dist/via/money/normalize.d.ts +1 -1
- package/dist/via/money/where.d.ts +3 -3
- package/dist/walk-JNEOYCAU.js +21 -0
- package/dist/walk-JNEOYCAU.js.map +1 -0
- package/dist/with-audit/periods/periods.d.ts +1 -1
- package/dist/with-audit/periods/strategy.d.ts +1 -1
- package/dist/with-audit/sealed-record/index.d.ts +13 -0
- package/dist/with-audit/tiers/index.d.ts +17 -2
- package/dist/with-cargo/adopt-partition.d.ts +7 -7
- package/dist/with-cargo/extract-partition.d.ts +1 -1
- package/dist/with-cargo/floor.d.ts +1 -1
- package/dist/with-cargo/index.d.ts +2 -2
- package/dist/with-commit/history/history.d.ts +26 -0
- package/dist/with-commit/history/index.d.ts +2 -1
- package/dist/with-commit/history/ledger/store.d.ts +7 -1
- package/dist/with-commit/history/strategy.d.ts +11 -1
- package/dist/with-commit/numbering/index.d.ts +0 -5
- package/dist/with-commit/vault-head/active.d.ts +2 -0
- package/dist/with-commit/vault-head/head.d.ts +28 -0
- package/dist/with-commit/vault-head/index.d.ts +10 -0
- package/dist/with-commit/vault-head/strategy.d.ts +127 -0
- package/dist/with-commit/vault-head/verify.d.ts +90 -0
- package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +4 -0
- package/dist/with-formula/materialized-views/projection-legs.d.ts +59 -0
- package/dist/with-formula/materialized-views/registry.d.ts +50 -0
- package/dist/with-formula/materialized-views/types.d.ts +68 -10
- package/dist/with-party/directory/cover/storage.d.ts +0 -8
- package/dist/with-party/directory/storage.d.ts +0 -11
- package/dist/with-party/directory/visibility.d.ts +0 -21
- package/dist/with-party/policy/storage.d.ts +0 -10
- package/dist/with-party/team/deed.d.ts +4 -4
- package/dist/with-party/team/device-seal.d.ts +5 -5
- package/dist/with-party/team/echo-ceremony.d.ts +2 -2
- package/dist/with-party/team/echo-secret.d.ts +4 -4
- package/dist/with-party/team/index.d.ts +3 -3
- package/dist/with-party/team/keyring.d.ts +141 -4
- package/dist/with-party/team/managed-secret.d.ts +21 -11
- package/dist/with-party/team/noydb-facade.d.ts +7 -3
- package/dist/with-party/team/{shamir-recovery-provider.d.ts → noydb-shamir.d.ts} +1 -1
- package/dist/with-party/team/recovery.d.ts +3 -3
- package/dist/with-party/team/roster-tag.d.ts +101 -0
- package/dist/with-party/team/rotate-recover.d.ts +5 -5
- package/dist/with-party/team/tiers.d.ts +2 -1
- package/dist/with-pod/format.d.ts +11 -13
- package/dist/with-pod/index.d.ts +10 -10
- package/dist/with-pod/open.d.ts +2 -2
- package/dist/with-pod/pod-handle.d.ts +19 -0
- package/dist/with-pod/pod-store.d.ts +0 -8
- package/dist/with-pod/{bundle.d.ts → pod.d.ts} +17 -25
- package/dist/with-pod/ulid.d.ts +1 -1
- package/dist/with-shape/blobs/blob-compaction.d.ts +13 -0
- package/dist/with-shape/blobs/blob-set.d.ts +83 -11
- package/dist/with-shape/blobs/orphan-report.d.ts +62 -0
- package/dist/with-shape/introspection/describe.d.ts +2 -2
- package/dist/with-shape/schema-update/fence-controller.d.ts +4 -4
- package/dist/with-shape/schema-update/fence-watcher.d.ts +4 -4
- package/dist/with-shape/schema-update/store-coordination-provider.d.ts +7 -6
- package/dist/with-sync/engine.d.ts +54 -5
- package/dist/with-sync/strategy.d.ts +3 -0
- package/dist/withdraw-accessible-ILTSXTIE.js +28 -0
- package/dist/withdraw-accessible-ILTSXTIE.js.map +1 -0
- package/package.json +29 -5
- package/dist/api-RXUMEKT3.js +0 -20
- package/dist/backup-KULFZ2T4.js.map +0 -1
- package/dist/bundle-handle-GFNHT52M.js +0 -36
- package/dist/bundle-handle-GFNHT52M.js.map +0 -1
- package/dist/chunk-2DHSSLOD.js.map +0 -1
- package/dist/chunk-2GAJGUNM.js.map +0 -1
- package/dist/chunk-3737A6EA.js.map +0 -1
- package/dist/chunk-3IXIU6FP.js.map +0 -1
- package/dist/chunk-3URQC7EH.js.map +0 -1
- package/dist/chunk-4GZ6XOVW.js.map +0 -1
- package/dist/chunk-4I72F5DF.js.map +0 -1
- package/dist/chunk-4VUPLMZ6.js.map +0 -1
- package/dist/chunk-52JPHN5N.js.map +0 -1
- package/dist/chunk-55LKVALY.js.map +0 -1
- package/dist/chunk-5JY5TSVY.js.map +0 -1
- package/dist/chunk-5ZKS6ZE2.js.map +0 -1
- package/dist/chunk-6BU3L4UE.js.map +0 -1
- package/dist/chunk-6NVPFKN3.js.map +0 -1
- package/dist/chunk-7F4DBNSP.js.map +0 -1
- package/dist/chunk-7G6VDWXB.js.map +0 -1
- package/dist/chunk-7H73RIE3.js +0 -45
- package/dist/chunk-7H73RIE3.js.map +0 -1
- package/dist/chunk-7MNBICB5.js.map +0 -1
- package/dist/chunk-AFHQATY4.js +0 -47
- package/dist/chunk-AFHQATY4.js.map +0 -1
- package/dist/chunk-AHLJSVRL.js.map +0 -1
- package/dist/chunk-BEFVYAR5.js.map +0 -1
- package/dist/chunk-BRVW2GS5.js.map +0 -1
- package/dist/chunk-BWVKEOPE.js.map +0 -1
- package/dist/chunk-CDB2HVQW.js.map +0 -1
- package/dist/chunk-CEJWMBXO.js.map +0 -1
- package/dist/chunk-DG27IUVI.js.map +0 -1
- package/dist/chunk-E6427JU2.js.map +0 -1
- package/dist/chunk-FFDNKRCY.js.map +0 -1
- package/dist/chunk-FZ6NYJ7L.js.map +0 -1
- package/dist/chunk-G6S5VVHP.js.map +0 -1
- package/dist/chunk-GAG7QOVO.js.map +0 -1
- package/dist/chunk-HNGSV2YC.js.map +0 -1
- package/dist/chunk-IGJCYUT5.js.map +0 -1
- package/dist/chunk-JJNOLSG5.js.map +0 -1
- package/dist/chunk-JRKZTEZZ.js.map +0 -1
- package/dist/chunk-MSWYQLMQ.js.map +0 -1
- package/dist/chunk-NPP5R7FF.js.map +0 -1
- package/dist/chunk-O2ERS4UJ.js.map +0 -1
- package/dist/chunk-PDLLCOGD.js.map +0 -1
- package/dist/chunk-PL2GHSCM.js.map +0 -1
- package/dist/chunk-PNKHAKQ7.js.map +0 -1
- package/dist/chunk-Q6TEJXBX.js.map +0 -1
- package/dist/chunk-QULVCV3M.js.map +0 -1
- package/dist/chunk-RV3ARMPN.js.map +0 -1
- package/dist/chunk-RXYYFSBB.js.map +0 -1
- package/dist/chunk-UHXCLPGC.js.map +0 -1
- package/dist/chunk-VCETL77O.js.map +0 -1
- package/dist/chunk-VZ3XFUQ7.js.map +0 -1
- package/dist/chunk-W77KZHCW.js.map +0 -1
- package/dist/chunk-WASHZV34.js.map +0 -1
- package/dist/chunk-WFUIE565.js.map +0 -1
- package/dist/chunk-XWX7GL56.js.map +0 -1
- package/dist/chunk-YJ6IONGA.js.map +0 -1
- package/dist/chunk-YPYHVOXP.js.map +0 -1
- package/dist/chunk-ZJADGNYF.js.map +0 -1
- package/dist/collection-facade-QEJIM6BC.js +0 -45
- package/dist/delegation-MO7YZYJS.js.map +0 -1
- package/dist/derive-IUA6JFLB.js +0 -22
- package/dist/dispatch-FZEAWKVM.js.map +0 -1
- package/dist/executor-CYJQLKKI.js +0 -9
- package/dist/executor-S4QIKEHW.js +0 -9
- package/dist/executor-YIQB2S6N.js +0 -29
- package/dist/export-accessible-4S36PQNR.js +0 -23
- package/dist/extract-partition-IO7FDZ2P.js +0 -38
- package/dist/fanout-sidecar-NNAJQXMX.js.map +0 -1
- package/dist/fence-watcher-DHQ775JB.js.map +0 -1
- package/dist/find-RBBYKXI7.js +0 -11
- package/dist/issue-RIVHSY2S.js +0 -19
- package/dist/liberate-GFN4C7RR.js +0 -24
- package/dist/noydb-ASEXNJS6.js +0 -83
- package/dist/register-4EFJCVYD.js +0 -32
- package/dist/registry-4SDHHOJ7.js +0 -18
- package/dist/registry-CZVINVQH.js +0 -9
- package/dist/registry-IKUR2MXD.js +0 -9
- package/dist/registry-OYTFGWVK.js +0 -19
- package/dist/request-withdrawal-KGXGDPVQ.js +0 -31
- package/dist/revoke-JFN773KF.js +0 -24
- package/dist/seed-GDV5PT4R.js.map +0 -1
- package/dist/signer-TA55QB6R.js +0 -25
- package/dist/storage-V7MTFAQJ.js +0 -23
- package/dist/store-coordination-provider-GFCUOBR6.js.map +0 -1
- package/dist/walk-3ZECBFDA.js +0 -21
- package/dist/with-pod/bundle-handle.d.ts +0 -9
- package/dist/withdraw-accessible-7PG4DYQK.js +0 -28
- /package/dist/{api-RXUMEKT3.js.map → api-EQYRTZO2.js.map} +0 -0
- /package/dist/{collection-facade-QEJIM6BC.js.map → at/index.js.map} +0 -0
- /package/dist/{computed-6G5M3UPH.js.map → by/index.js.map} +0 -0
- /package/dist/{chunk-YAWK6AWF.js.map → chunk-225O5CXQ.js.map} +0 -0
- /package/dist/{chunk-OF3L2SD6.js.map → chunk-3QARDAYW.js.map} +0 -0
- /package/dist/{chunk-W3TVWF6N.js.map → chunk-4A4TYISP.js.map} +0 -0
- /package/dist/{chunk-CCZJJ4I2.js.map → chunk-4G25SDQL.js.map} +0 -0
- /package/dist/{chunk-7TSYBD3E.js.map → chunk-5263OEM3.js.map} +0 -0
- /package/dist/{chunk-FNSMZQS4.js.map → chunk-5ACAVJUI.js.map} +0 -0
- /package/dist/{chunk-VMCCGUQB.js.map → chunk-7LYUJNU3.js.map} +0 -0
- /package/dist/{chunk-WLYIROCJ.js.map → chunk-AB5P32RE.js.map} +0 -0
- /package/dist/{chunk-SUFG5E73.js.map → chunk-ALUNQEBY.js.map} +0 -0
- /package/dist/{chunk-CADUYBQD.js.map → chunk-ATL3ZVXT.js.map} +0 -0
- /package/dist/{chunk-6FJWSWFT.js.map → chunk-DBNYPLWY.js.map} +0 -0
- /package/dist/{chunk-VJFMXYKP.js.map → chunk-E6YA6UAP.js.map} +0 -0
- /package/dist/{chunk-JIUVJ4M7.js.map → chunk-F7ZFRPGQ.js.map} +0 -0
- /package/dist/{chunk-HXGUIPQB.js.map → chunk-FOG7YEJP.js.map} +0 -0
- /package/dist/{chunk-X56RTUK3.js.map → chunk-HM4JSXX2.js.map} +0 -0
- /package/dist/{chunk-GQ3BX5EA.js.map → chunk-I3ISCYT7.js.map} +0 -0
- /package/dist/{chunk-FUHKW252.js.map → chunk-J4MN6XIU.js.map} +0 -0
- /package/dist/{chunk-ADW22QSB.js.map → chunk-J4UJ5FRV.js.map} +0 -0
- /package/dist/{chunk-HVQGCKY4.js.map → chunk-JVLSU7S2.js.map} +0 -0
- /package/dist/{chunk-AR2JDFAE.js.map → chunk-KDJGJR7F.js.map} +0 -0
- /package/dist/{chunk-747LRSOO.js.map → chunk-LKFKXS5K.js.map} +0 -0
- /package/dist/{chunk-U5O6GIWZ.js.map → chunk-LR4Z47QD.js.map} +0 -0
- /package/dist/{chunk-RTAMLDWP.js.map → chunk-NLKLXXTO.js.map} +0 -0
- /package/dist/{chunk-FDX7OWWI.js.map → chunk-OPXR4PB2.js.map} +0 -0
- /package/dist/{chunk-Z45YRGFO.js.map → chunk-P6ASQOZR.js.map} +0 -0
- /package/dist/{chunk-2Z3NCLNX.js.map → chunk-QI5NWLVW.js.map} +0 -0
- /package/dist/{chunk-6SAFL5YE.js.map → chunk-RC4BROYR.js.map} +0 -0
- /package/dist/{chunk-NJDQ4YSV.js.map → chunk-RDHUZ674.js.map} +0 -0
- /package/dist/{chunk-3JVXVJ7L.js.map → chunk-S35S77YU.js.map} +0 -0
- /package/dist/{chunk-KUDZVJKQ.js.map → chunk-SHILAQH5.js.map} +0 -0
- /package/dist/{chunk-4UVDI4XE.js.map → chunk-T3PHCEN4.js.map} +0 -0
- /package/dist/{derive-IUA6JFLB.js.map → chunk-UBSFPGVJ.js.map} +0 -0
- /package/dist/{chunk-FAXZQ5UF.js.map → chunk-UCUALOSM.js.map} +0 -0
- /package/dist/{chunk-4HDYQL3J.js.map → chunk-VAG47QHV.js.map} +0 -0
- /package/dist/{chunk-35EBKWQU.js.map → chunk-VFIWDPXZ.js.map} +0 -0
- /package/dist/{chunk-HNHCQ556.js.map → chunk-WLLUM35R.js.map} +0 -0
- /package/dist/{chunk-JRCYZEHU.js.map → chunk-XVU7J43V.js.map} +0 -0
- /package/dist/{chunk-DMQCLZ4Z.js.map → chunk-YCSM3GZU.js.map} +0 -0
- /package/dist/{chunk-FMQJZH4R.js.map → chunk-YMLQBZFJ.js.map} +0 -0
- /package/dist/{chunk-6HFM7EIT.js.map → chunk-YPSOHDNC.js.map} +0 -0
- /package/dist/{chunk-N35NC4JH.js.map → chunk-Z2PWOSCJ.js.map} +0 -0
- /package/dist/{chunk-HPLWFNG4.js.map → chunk-Z7ZXZL6Y.js.map} +0 -0
- /package/dist/{classified-marker-2KJAXRRO.js.map → classified-marker-BSQHU4JT.js.map} +0 -0
- /package/dist/{enclave-JU4YIEPB.js.map → collection-facade-LG3NYZVB.js.map} +0 -0
- /package/dist/{executor-CYJQLKKI.js.map → computed-ASBNTLOK.js.map} +0 -0
- /package/dist/{dead-filter-DCB62VWW.js.map → dead-filter-QKU56XTQ.js.map} +0 -0
- /package/dist/{executor-S4QIKEHW.js.map → derive-CXHCY46K.js.map} +0 -0
- /package/dist/{dispatch-MJ6SHB3Y.js.map → dispatch-4AP4PUZU.js.map} +0 -0
- /package/dist/{executor-YIQB2S6N.js.map → enclave-NYPT7WA7.js.map} +0 -0
- /package/dist/{export-accessible-4S36PQNR.js.map → executor-3KFRQETS.js.map} +0 -0
- /package/dist/{extract-partition-IO7FDZ2P.js.map → executor-AFHQYRAU.js.map} +0 -0
- /package/dist/{find-RBBYKXI7.js.map → executor-YYDW6XQI.js.map} +0 -0
- /package/dist/{issue-RIVHSY2S.js.map → export-accessible-BX2ILB4C.js.map} +0 -0
- /package/dist/{ledger-AETNF4OM.js.map → extract-partition-UPOVITFI.js.map} +0 -0
- /package/dist/{liberate-GFN4C7RR.js.map → find-SZBL2HPB.js.map} +0 -0
- /package/dist/{link-set-E5HNY67I.js.map → issue-G53NB6EW.js.map} +0 -0
- /package/dist/{managed-secret-CWQ6PND5.js.map → ledger-T5K4P2D7.js.map} +0 -0
- /package/dist/{noydb-ASEXNJS6.js.map → liberate-VEOZRESE.js.map} +0 -0
- /package/dist/{register-4EFJCVYD.js.map → link-set-76JZ6YB4.js.map} +0 -0
- /package/dist/{registry-4SDHHOJ7.js.map → managed-secret-6YC32VXG.js.map} +0 -0
- /package/dist/{registry-CZVINVQH.js.map → noydb-EDJA4JNJ.js.map} +0 -0
- /package/dist/{registry-IKUR2MXD.js.map → on/index.js.map} +0 -0
- /package/dist/{post-register-2XSSMGEQ.js.map → post-register-53O7AJRZ.js.map} +0 -0
- /package/dist/{registry-OYTFGWVK.js.map → register-6TCBR6XD.js.map} +0 -0
- /package/dist/{request-withdrawal-KGXGDPVQ.js.map → registry-DH2L4O2V.js.map} +0 -0
- /package/dist/{revoke-JFN773KF.js.map → registry-IWFMXCHX.js.map} +0 -0
- /package/dist/{signer-TA55QB6R.js.map → registry-Q3FG3OAX.js.map} +0 -0
- /package/dist/{stale-ARHFVL5U.js.map → registry-YC3IFG3A.js.map} +0 -0
- /package/dist/{storage-V7MTFAQJ.js.map → request-withdrawal-NM5VYR6F.js.map} +0 -0
- /package/dist/{reveal-BW36KCOQ.js.map → reveal-XBIMHAXR.js.map} +0 -0
- /package/dist/{ulid-PTAIMDG4.js.map → revoke-MJNYWO72.js.map} +0 -0
- /package/dist/{walk-3ZECBFDA.js.map → signer-6XVS2AU3.js.map} +0 -0
- /package/dist/{withdraw-accessible-7PG4DYQK.js.map → stale-MCS46TFO.js.map} +0 -0
- /package/dist/{verify-RO5RTZOJ.js.map → verify-WYOFLSNA.js.map} +0 -0
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
* - envelope body — `record-keys/envelope-body.ts`: the C1 protected-body
|
|
35
35
|
* access contract (`openEnvelopeJson`,
|
|
36
36
|
* `writeEnvelopeBody`, `hasPerRecordKey`,
|
|
37
|
-
* `envelopeBodyForHash`) — the
|
|
37
|
+
* `hasSealedBody`, `envelopeBodyForHash`) — the
|
|
38
|
+
* sanctioned door onto
|
|
38
39
|
* `_iv`/`_data`/`_cek`/`_sealed` for everyone outside
|
|
39
40
|
* this folder.
|
|
40
41
|
* - reserved envelopes — `record-keys/sealed-slots.ts`: `makeReservedEnvelopes`,
|
|
@@ -55,12 +56,18 @@
|
|
|
55
56
|
* enclave supports every group, so it never throws this error.
|
|
56
57
|
*/
|
|
57
58
|
export type { EnclaveKey, EncryptResult } from './crypto.js';
|
|
58
|
-
export { encrypt, decrypt, encryptBytes, decryptBytes, encryptBytesWithAAD, decryptBytesWithAAD, encryptDeterministic, decryptDeterministic, sha256Hex, hmacSha256Hex, } from './crypto.js';
|
|
59
|
+
export { encrypt, decrypt, encryptBytes, decryptBytes, encryptBytesWithAAD, decryptBytesWithAAD, encryptDeterministic, decryptDeterministic, sha256Hex, hmacSha256Hex, deriveBlobAddressKey, } from './crypto.js';
|
|
59
60
|
export { deriveKey, deriveSecretKey, generateDEK, generateSalt, generateIV, wrapKey, unwrapKey, bufferToBase64, base64ToBuffer, derivePresenceKey, deriveDeterministicKey, deriveSealedFieldKey, deriveSealedFieldKeyFromCek, wrapCek, unwrapCek, importCek, encodeEchoParts, deriveEchoKey, } from './crypto.js';
|
|
60
61
|
export type { SecretKeyUsage } from './crypto.js';
|
|
61
62
|
export type { EchoSecretParts } from './crypto.js';
|
|
62
63
|
export { resolveStableCek, rewrapBodyToDek, rewrapEnvelope, applyRewrappedBody, isRewrappedUnder } from './record-keys/lifecycle.js';
|
|
63
64
|
export type { RewrappedBody } from './record-keys/lifecycle.js';
|
|
65
|
+
export { rekeyEnvelopeToDek, rekeyEnvelopeIfNeeded, envelopeOpensUnderAny } from './record-keys/rekey.js';
|
|
66
|
+
export { rekeyBlobSet } from './record-keys/rekey-blob.js';
|
|
67
|
+
export { buildRecordEnvelope, buildSealedRecordEnvelope } from './record-envelope.js';
|
|
68
|
+
export type { RecordEnvelopeBody } from './record-envelope.js';
|
|
69
|
+
export { buildRecordAad, recordAadFor } from './record-aad.js';
|
|
70
|
+
export type { RecordIdentity, RecordRef } from './record-aad.js';
|
|
64
71
|
export { RecordCodec } from './record-keys/record-codec.js';
|
|
65
72
|
export type { SealedShredSlot } from './record-keys/record-codec.js';
|
|
66
73
|
export { SEALED_CEK_NS, sealRecordToHost, revokeSealedRecord, rotateRecordCek } from './record-keys/sealing.js';
|
|
@@ -68,7 +75,7 @@ export type { SealingContext } from './record-keys/sealing.js';
|
|
|
68
75
|
export { findByDet, queryByDet } from './record-keys/deterministic.js';
|
|
69
76
|
export type { DeterministicContext } from './record-keys/deterministic.js';
|
|
70
77
|
export { isTombstone, isTombstoneShape, buildTombstone, isDeleteMarker, buildDeleteMarker } from './record-keys/tombstone.js';
|
|
71
|
-
export { openEnvelopeJson, writeEnvelopeBody, hasPerRecordKey, envelopeBodyForHash, envelopeBodySize } from './record-keys/envelope-body.js';
|
|
78
|
+
export { openEnvelopeJson, writeEnvelopeBody, hasPerRecordKey, hasSealedBody, envelopeBodyForHash, envelopeBodySize, verifyRecordIdentity } from './record-keys/envelope-body.js';
|
|
72
79
|
export { makeReservedEnvelopes } from './record-keys/sealed-slots.js';
|
|
73
80
|
export { deriveVdigSlotKey } from './classify/vdig.js';
|
|
74
81
|
export { pbkdf2VerifyDigest } from './classify/digest.js';
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Record-identity AAD (#1041).
|
|
3
|
+
*
|
|
4
|
+
* AES-GCM authenticates its *additional authenticated data* alongside the
|
|
5
|
+
* ciphertext without encrypting it. Binding a record's identity here is what
|
|
6
|
+
* stops an untrusted store from silently **relocating** an envelope — moving
|
|
7
|
+
* it to another collection or id, re-tiering it, or rewriting who
|
|
8
|
+
* wrote it — while keeping a body whose auth tag still verifies.
|
|
9
|
+
*
|
|
10
|
+
* Scope, stated plainly: this closes cross-COLLECTION relocation, the `_tier`
|
|
11
|
+
* silent-hide, provenance forgery — and, since #1093, **version rollback**.
|
|
12
|
+
*
|
|
13
|
+
* ## `_v` is bound, and what it took to get there
|
|
14
|
+
*
|
|
15
|
+
* `_v` was deliberately left out at first, for a reason that was real rather
|
|
16
|
+
* than cautious: the sync engine re-stamped `_v` on existing ciphertext without
|
|
17
|
+
* holding a DEK (`advancePastRemote`), so binding it would have made every
|
|
18
|
+
* conflict-superseded record undecryptable. #1042's `MergeAuthority` removed
|
|
19
|
+
* that obstacle by giving the merge a DEK-holding capability, so advancing a
|
|
20
|
+
* version became a **re-seal** instead of a metadata edit — and only then could
|
|
21
|
+
* `_v` join the tuple.
|
|
22
|
+
*
|
|
23
|
+
* ⚠️ **What that buys, stated exactly** — the harness measured this, and the
|
|
24
|
+
* loose version ("rollback is prevented") is wrong.
|
|
25
|
+
*
|
|
26
|
+
* A body can no longer be presented at a version it was not sealed at. So the
|
|
27
|
+
* *restamped* rollback — take v1's bytes, label them v9, win the convergence
|
|
28
|
+
* comparison, overwrite the newer copy — is refused, and refused **before**
|
|
29
|
+
* `local.put`, so nothing is lost.
|
|
30
|
+
*
|
|
31
|
+
* A store re-serving the genuine v1 **at its own `_v: 1`** is still served, and
|
|
32
|
+
* has to be: that envelope is internally consistent, and a reader arriving
|
|
33
|
+
* fresh has nothing to compare it against. AAD binds a body to the version it
|
|
34
|
+
* claims; it cannot know which version *should* have arrived.
|
|
35
|
+
*
|
|
36
|
+
* So rollback stops being forgery and becomes **withholding** — hiding the newer
|
|
37
|
+
* version rather than faking one — which is `withVaultHead()`'s job (#1044).
|
|
38
|
+
*
|
|
39
|
+
* ## Why `vault` is not bound
|
|
40
|
+
*
|
|
41
|
+
* It was, briefly, and it broke `adoptPartition`. That path re-homes a whole
|
|
42
|
+
* partition into a new vault name by moving envelopes **verbatim** —
|
|
43
|
+
* `with-cargo/adopt-partition.ts:140` is a bare
|
|
44
|
+
* `destinationStore.saveAll(vaultName, backup.collections)` with no
|
|
45
|
+
* re-encryption, because it does not hold the keys to re-encrypt at that
|
|
46
|
+
* point. Binding the vault name makes every adopted record undecryptable.
|
|
47
|
+
*
|
|
48
|
+
* The uncomfortable truth behind that: **relocation is not purely an attack.**
|
|
49
|
+
* Adoption is a legitimate, supported relocation, and AAD cannot tell the two
|
|
50
|
+
* apart. So the vault boundary has to be defended by something that can
|
|
51
|
+
* distinguish intent — an authenticated head or an explicit re-key — rather
|
|
52
|
+
* than by sealing a name the product deliberately changes.
|
|
53
|
+
*
|
|
54
|
+
* Cross-*collection* relocation has no such legitimate counterpart, so it stays
|
|
55
|
+
* bound.
|
|
56
|
+
*
|
|
57
|
+
* @packageDocumentation
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* Where an envelope was fetched from — the **read** side's half of identity.
|
|
61
|
+
*
|
|
62
|
+
* A reader supplies only the address, because that is genuinely all it knows:
|
|
63
|
+
* `_tier`, `_by` and `_v` are read back off the envelope itself
|
|
64
|
+
* ({@link recordAadFor}). Splitting this out of {@link RecordIdentity} is what
|
|
65
|
+
* lets `version` be *required* on the write side without forcing dozens of read
|
|
66
|
+
* call sites to invent one.
|
|
67
|
+
*/
|
|
68
|
+
export interface RecordRef {
|
|
69
|
+
readonly collection: string;
|
|
70
|
+
readonly id: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The identity an envelope's body is sealed against — the **write** side.
|
|
74
|
+
*
|
|
75
|
+
* Every field here is stamped onto the envelope by `buildRecordEnvelope` from
|
|
76
|
+
* this one object, so what a writer *seals* and what it *stamps* cannot drift.
|
|
77
|
+
*/
|
|
78
|
+
export interface RecordIdentity extends RecordRef {
|
|
79
|
+
/**
|
|
80
|
+
* The `_v` this body is sealed at (#1093).
|
|
81
|
+
*
|
|
82
|
+
* Required, and required is the point: a version that could be omitted would
|
|
83
|
+
* be a version some writer forgets, and a record sealed at a version nobody
|
|
84
|
+
* chose is one a reader cannot open. The compiler asks the question at every
|
|
85
|
+
* write site instead of leaving it to review.
|
|
86
|
+
*/
|
|
87
|
+
readonly version: number;
|
|
88
|
+
/** Absent is identical to `0` — the read paths treat them as one record. */
|
|
89
|
+
readonly tier?: number | undefined;
|
|
90
|
+
/** Absent (no `_by` on the envelope) is distinct from an empty string. */
|
|
91
|
+
readonly by?: string | undefined;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Length-prefixed, order-fixed encoding.
|
|
95
|
+
*
|
|
96
|
+
* The obvious `${collection}:${id}` is unsafe: an attacker who
|
|
97
|
+
* controls a collection name can choose one that re-splits the same joined
|
|
98
|
+
* string a different way, so two different identities produce identical AAD
|
|
99
|
+
* and the relocation this exists to prevent goes through. Every field is
|
|
100
|
+
* therefore written as a 4-byte big-endian length followed by its UTF-8 bytes,
|
|
101
|
+
* which no field content can imitate.
|
|
102
|
+
*
|
|
103
|
+
* A one-byte presence flag precedes `by` so that "no author recorded" and
|
|
104
|
+
* "author recorded as the empty string" cannot be swapped for one another.
|
|
105
|
+
*/
|
|
106
|
+
export declare function buildRecordAad(identity: RecordIdentity): Uint8Array;
|
|
107
|
+
/**
|
|
108
|
+
* The AAD a **reader** must supply to open `envelope`, given where it fetched
|
|
109
|
+
* it from.
|
|
110
|
+
*
|
|
111
|
+
* This is the read-side counterpart of {@link buildRecordAad}, and the split
|
|
112
|
+
* exists because of one asymmetry: **a writer always knows what it is writing;
|
|
113
|
+
* a reader often does not.** Query execution, sync merge and backup restore
|
|
114
|
+
* hold an envelope that arrived from a map or a batch, having discarded the
|
|
115
|
+
* address it came from.
|
|
116
|
+
*
|
|
117
|
+
* What makes the read side tractable is that only `{collection, id}` has to be
|
|
118
|
+
* threaded — precisely what the caller passed to `store.get`. `_tier`, `_by`
|
|
119
|
+
* and `_v` are read back **off the envelope**, so no extra plumbing carries
|
|
120
|
+
* them.
|
|
121
|
+
*
|
|
122
|
+
* That is not a weakening. An attacker who edits `_tier` to hide a record,
|
|
123
|
+
* `_by` to forge provenance, or `_v` to pass an old body off as the current
|
|
124
|
+
* one, changes the AAD the reader computes — and AES-GCM then fails to
|
|
125
|
+
* authenticate. The tampered field defeats itself.
|
|
126
|
+
*/
|
|
127
|
+
export declare function recordAadFor(ref: RecordRef, envelope: {
|
|
128
|
+
readonly _v: number;
|
|
129
|
+
readonly _tier?: number | undefined;
|
|
130
|
+
readonly _by?: string | undefined;
|
|
131
|
+
}): Uint8Array;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { EncryptedEnvelope } from '../types.js';
|
|
2
|
+
import type { RecordIdentity } from './record-aad.js';
|
|
3
|
+
/** The body an envelope carries, independent of who is writing it. */
|
|
4
|
+
export interface RecordEnvelopeBody {
|
|
5
|
+
/** AES-GCM IV, base64. Empty string for a plaintext or tombstone envelope. */
|
|
6
|
+
readonly iv: string;
|
|
7
|
+
/** Ciphertext (or plaintext JSON when the collection stores plaintext). */
|
|
8
|
+
readonly data: string;
|
|
9
|
+
/** ISO timestamp. Defaults to now — pass it when the caller has a real one. */
|
|
10
|
+
readonly ts?: string | undefined;
|
|
11
|
+
/** Wrapped per-record CEK, when the record has one. */
|
|
12
|
+
readonly cek?: string | undefined;
|
|
13
|
+
readonly provenance?: {
|
|
14
|
+
readonly source: string;
|
|
15
|
+
readonly sourceTs: string;
|
|
16
|
+
} | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Slots the envelope may additionally carry.
|
|
19
|
+
*
|
|
20
|
+
* `_tier`, `_by` and `_v` are deliberately NOT here — they come from
|
|
21
|
+
* `identity`, which is the single source for all three. See
|
|
22
|
+
* {@link buildRecordEnvelope}.
|
|
23
|
+
*/
|
|
24
|
+
readonly extra?: Partial<Pick<EncryptedEnvelope, '_det' | '_sealed' | '_vdig' | '_bidx'>> | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Build an envelope for `identity`.
|
|
28
|
+
*
|
|
29
|
+
* ## `identity` is the SINGLE SOURCE for `_by`, `_tier` and `_v`
|
|
30
|
+
*
|
|
31
|
+
* All three are stamped from it, and `RecordEnvelopeBody` deliberately cannot
|
|
32
|
+
* carry them. That is not tidiness — it is what makes the AAD binding safe.
|
|
33
|
+
*
|
|
34
|
+
* The caller encrypts the body under AAD derived from `{collection, id, tier,
|
|
35
|
+
* by, version}`. A reader recomputes that AAD from the address it fetched from
|
|
36
|
+
* plus `_tier`/`_by`/`_v` read back **off the envelope** (`recordAadFor`). So if the
|
|
37
|
+
* identity a writer *declares* could differ from the fields it *stamps*, the
|
|
38
|
+
* AAD would not reproduce and the record would be undecryptable — silently, at
|
|
39
|
+
* write time, discoverable only on the next read, and invisible to every gate
|
|
40
|
+
* because the envelope is perfectly well-formed.
|
|
41
|
+
*
|
|
42
|
+
* An earlier draft took both and asserted they agreed. The assertion fired 230
|
|
43
|
+
* times on the existing tree, which is the argument against it: a rule that can
|
|
44
|
+
* be violated is a rule someone must remember. Taking one source removes the
|
|
45
|
+
* violation instead of reporting it.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildRecordEnvelope(identity: RecordIdentity, body: RecordEnvelopeBody): EncryptedEnvelope;
|
|
48
|
+
/**
|
|
49
|
+
* Build an envelope from an already-sealed body — the output of
|
|
50
|
+
* `writeEnvelopeBody` — **without the caller ever naming `_iv`/`_data`/`_cek`**.
|
|
51
|
+
*
|
|
52
|
+
* This exists because of a guard, and the guard was right. Migrating
|
|
53
|
+
* `writeEnvelopeBody` callers to {@link buildRecordEnvelope} meant rewriting
|
|
54
|
+
* `...body` (a spread, which names nothing) into `iv: body._iv, data:
|
|
55
|
+
* body._data, cek: body._cek` — and `enclave-body-only` failed it: three new
|
|
56
|
+
* protected-body accesses in files that previously had zero.
|
|
57
|
+
*
|
|
58
|
+
* That is the correct outcome rather than an obstacle. #1051 exists to move
|
|
59
|
+
* knowledge of the envelope's shape *inward*; a migration that spreads the
|
|
60
|
+
* protected field names outward to every caller would have defeated its own
|
|
61
|
+
* purpose while looking like progress. The pairing belongs here.
|
|
62
|
+
*
|
|
63
|
+
* ## It takes a SEALER, not a sealed body — and that is load-bearing (#1041)
|
|
64
|
+
*
|
|
65
|
+
* The obvious shape is `(identity, alreadySealedBody, rest)`. That requires the
|
|
66
|
+
* caller to name the identity TWICE — once for `writeEnvelopeBody` and once
|
|
67
|
+
* here — and the two must agree byte for byte or the record is sealed under
|
|
68
|
+
* AAD no reader can reproduce.
|
|
69
|
+
*
|
|
70
|
+
* They did not agree. `with-party/broker/seed.ts` sealed against
|
|
71
|
+
* `{collection, id}` and stamped `{collection, id, by}`, so every broker seed
|
|
72
|
+
* became unreadable the moment AAD switched on. Taking the sealer means the
|
|
73
|
+
* identity is written once and handed to both — divergence stops being
|
|
74
|
+
* possible rather than being something to remember.
|
|
75
|
+
*/
|
|
76
|
+
export declare function buildSealedRecordEnvelope(identity: RecordIdentity, seal: (identity: RecordIdentity) => Promise<Pick<EncryptedEnvelope, '_iv' | '_data' | '_cek'>>, body: Omit<RecordEnvelopeBody, 'iv' | 'data' | 'cek'>): Promise<EncryptedEnvelope>;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* per-function doc for its oracle call site) — this file introduces no new
|
|
14
14
|
* crypto or semantics, only a narrower door onto what already runs.
|
|
15
15
|
*/
|
|
16
|
+
import { type RecordIdentity, type RecordRef } from '../record-aad.js';
|
|
16
17
|
import { type EnclaveKey } from '../crypto.js';
|
|
17
18
|
import type { EncryptedEnvelope } from '../../types.js';
|
|
18
19
|
/**
|
|
@@ -27,7 +28,7 @@ import type { EncryptedEnvelope } from '../../types.js';
|
|
|
27
28
|
* (the collection DEK), decrypt the body under the unwrapped CEK.
|
|
28
29
|
* - `env._cek` absent → legacy path, decrypt the body directly under `key`.
|
|
29
30
|
*/
|
|
30
|
-
export declare function openEnvelopeJson(env: EncryptedEnvelope, key: EnclaveKey, opts?: {
|
|
31
|
+
export declare function openEnvelopeJson(ref: RecordRef, env: EncryptedEnvelope, key: EnclaveKey, opts?: {
|
|
31
32
|
encrypted?: boolean;
|
|
32
33
|
}): Promise<string>;
|
|
33
34
|
/**
|
|
@@ -43,7 +44,7 @@ export declare function openEnvelopeJson(env: EncryptedEnvelope, key: EnclaveKey
|
|
|
43
44
|
* generated here rather than supplied by the caller).
|
|
44
45
|
* - otherwise → legacy path, body encrypted directly under `key`.
|
|
45
46
|
*/
|
|
46
|
-
export declare function writeEnvelopeBody(json: string, key: EnclaveKey, opts?: {
|
|
47
|
+
export declare function writeEnvelopeBody(identity: RecordIdentity, json: string, key: EnclaveKey, opts?: {
|
|
47
48
|
encrypted?: boolean;
|
|
48
49
|
perRecordKey?: boolean;
|
|
49
50
|
}): Promise<Pick<EncryptedEnvelope, '_iv' | '_data' | '_cek'>>;
|
|
@@ -85,3 +86,34 @@ export declare function hasPerRecordKey(env: EncryptedEnvelope): boolean;
|
|
|
85
86
|
* `envelope-body.test.ts`).
|
|
86
87
|
*/
|
|
87
88
|
export declare function envelopeBodyForHash(env: EncryptedEnvelope): string;
|
|
89
|
+
/**
|
|
90
|
+
* Does `env` carry an AEAD-sealed body at all?
|
|
91
|
+
*
|
|
92
|
+
* The one question callers outside the enclave legitimately need to ask about
|
|
93
|
+
* `_iv` — a tombstone and a plaintext-collection record have none, so there is
|
|
94
|
+
* nothing to authenticate and nothing to re-seal. Both {@link
|
|
95
|
+
* verifyRecordIdentity} (which treats them as vacuously authentic) and the
|
|
96
|
+
* merge authority's `advance` (which stamps them without re-sealing) turn on
|
|
97
|
+
* it, and asking it here keeps `_iv` from leaking back out to the callers —
|
|
98
|
+
* which `enclave-body-only` refused, correctly, when `advance` tested it inline.
|
|
99
|
+
*/
|
|
100
|
+
export declare function hasSealedBody(env: Pick<EncryptedEnvelope, '_iv'>): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Does `env` authenticate at the identity `ref` claims, under `key`? (#1042)
|
|
103
|
+
*
|
|
104
|
+
* The merge's fail-closed check, living here because it is envelope surgery:
|
|
105
|
+
* deciding "is there a sealed body at all" reads `_iv`, which
|
|
106
|
+
* `enclave-body-only` reserves to this folder. An earlier draft did that test
|
|
107
|
+
* in `kernel/noydb.ts` and the guard refused it — correctly, since a caller
|
|
108
|
+
* outside the enclave inspecting protected fields is how envelope knowledge
|
|
109
|
+
* leaks back out.
|
|
110
|
+
*
|
|
111
|
+
* Returns a boolean rather than throwing: `applyRemote` must be able to reject
|
|
112
|
+
* one poisoned record without halting an entire sync, and a hostile store
|
|
113
|
+
* would very much like the opposite.
|
|
114
|
+
*
|
|
115
|
+
* **A record with no sealed body is vacuously authentic** — a tombstone carries
|
|
116
|
+
* none, and a plaintext collection has no AEAD to verify. Those are pass-through
|
|
117
|
+
* by construction, not by omission.
|
|
118
|
+
*/
|
|
119
|
+
export declare function verifyRecordIdentity(ref: RecordRef, env: EncryptedEnvelope, key: EnclaveKey): Promise<boolean>;
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { type EnclaveKey } from '../crypto.js';
|
|
23
23
|
import type { EncryptedEnvelope } from '../../types.js';
|
|
24
|
+
import { type RecordIdentity } from '../record-aad.js';
|
|
24
25
|
import type { Lru } from '../../cache/index.js';
|
|
25
26
|
/** Dependencies {@link resolveStableCek} needs from its collection. */
|
|
26
27
|
export interface StableCekDeps {
|
|
@@ -46,15 +47,31 @@ export interface RewrappedBody {
|
|
|
46
47
|
readonly cek: EnclaveKey | null;
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
49
|
-
* Move a record body from `fromDek` to `toDek`.
|
|
50
|
+
* Move a record body from `fromDek`/`from` to `toDek`/`to`.
|
|
50
51
|
*
|
|
51
52
|
* - Per-record-key record (`_cek` present): unwrap the CEK under `fromDek`,
|
|
52
53
|
* re-encrypt the body under the SAME CEK, re-wrap the CEK under `toDek`. The
|
|
53
54
|
* body key is unchanged → history-chain identity preserved.
|
|
54
55
|
* - Legacy record (no `_cek`): decrypt under `fromDek`, re-encrypt under `toDek`
|
|
55
|
-
* directly
|
|
56
|
+
* directly.
|
|
57
|
+
*
|
|
58
|
+
* ## Why it takes TWO identities (#1041)
|
|
59
|
+
*
|
|
60
|
+
* A rewrap is the one operation where the identity genuinely **changes**. A
|
|
61
|
+
* tier move rewrites `_tier`; a history snapshot lands at a different
|
|
62
|
+
* `(collection, id)` entirely. Since AAD binds both, the body must be opened
|
|
63
|
+
* under the identity it currently has and re-sealed under the one it is moving
|
|
64
|
+
* to. A single identity would be wrong for one end or the other.
|
|
65
|
+
*
|
|
66
|
+
* ⚠️ **This retires an optimisation, deliberately.** Callers used to compute
|
|
67
|
+
* ONE rewrap and reuse the bytes for both a tier move's live write and its
|
|
68
|
+
* `_history` snapshot (#728). Those now have different destination identities,
|
|
69
|
+
* so they need different AAD and therefore different ciphertext — the same
|
|
70
|
+
* bytes cannot satisfy both. Reusing one rewrap for two destinations is now a
|
|
71
|
+
* silent corruption, not a saving: it produces a record that opens at one
|
|
72
|
+
* address and not the other.
|
|
56
73
|
*/
|
|
57
|
-
export declare function rewrapBodyToDek(envelope: Pick<EncryptedEnvelope, '_iv' | '_data' | '_cek'>, fromDek: EnclaveKey, toDek: EnclaveKey): Promise<RewrappedBody>;
|
|
74
|
+
export declare function rewrapBodyToDek(from: RecordIdentity, to: RecordIdentity, envelope: Pick<EncryptedEnvelope, '_iv' | '_data' | '_cek' | '_tier' | '_by'>, fromDek: EnclaveKey, toDek: EnclaveKey): Promise<RewrappedBody>;
|
|
58
75
|
/**
|
|
59
76
|
* Merge an ALREADY-rewrapped {@link RewrappedBody} into `envelope`, keeping
|
|
60
77
|
* every field but the re-keyed body (`_iv`/`_data`/`_cek`) unchanged.
|
|
@@ -76,7 +93,7 @@ export declare function applyRewrappedBody(envelope: EncryptedEnvelope, body: Re
|
|
|
76
93
|
* envelope, generalized to any envelope shape (history callers don't bump
|
|
77
94
|
* `_v`/`_ts`/`_tier` the way a tier move does).
|
|
78
95
|
*/
|
|
79
|
-
export declare function rewrapEnvelope(envelope: EncryptedEnvelope, fromDek: EnclaveKey, toDek: EnclaveKey): Promise<EncryptedEnvelope>;
|
|
96
|
+
export declare function rewrapEnvelope(identity: RecordIdentity, envelope: EncryptedEnvelope, fromDek: EnclaveKey, toDek: EnclaveKey): Promise<EncryptedEnvelope>;
|
|
80
97
|
/**
|
|
81
98
|
* Is `envelope` ALREADY wrapped under `dek` (a per-record CEK wrapped under
|
|
82
99
|
* `dek`, or — legacy, no `_cek` — the body itself decryptable under `dek`)?
|
|
@@ -104,4 +121,4 @@ export declare function rewrapEnvelope(envelope: EncryptedEnvelope, fromDek: Enc
|
|
|
104
121
|
* those fields themselves, preserving the check-architecture body-access
|
|
105
122
|
* ratchet.
|
|
106
123
|
*/
|
|
107
|
-
export declare function isRewrappedUnder(envelope: Pick<EncryptedEnvelope, '_iv' | '_data' | '_cek'>, dek: EnclaveKey): Promise<boolean>;
|
|
124
|
+
export declare function isRewrappedUnder(identity: RecordIdentity, envelope: Pick<EncryptedEnvelope, '_iv' | '_data' | '_cek'>, dek: EnclaveKey): Promise<boolean>;
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type EnclaveKey } from '../crypto.js';
|
|
20
20
|
import { type EncryptedEnvelope, type CrdtMode, type CrdtStrategy, type VdigFieldPolicy, type SealedHandle } from '../../types.js';
|
|
21
|
+
import { type RecordIdentity, type RecordRef } from '../record-aad.js';
|
|
21
22
|
import { type StandardSchemaV1 } from '../../schema.js';
|
|
22
23
|
import type { Lru } from '../../cache/index.js';
|
|
23
24
|
import type { ViaCryptoCtx } from '../../via/index.js';
|
|
@@ -127,11 +128,9 @@ export declare class RecordCodec<T> {
|
|
|
127
128
|
* parts. Pure, no crypto. Each call stamps its own `_ts` — provenance carries
|
|
128
129
|
* a SEPARATE timestamp (computed by the caller), so the two never share one.
|
|
129
130
|
*/
|
|
130
|
-
static buildEnvelope(p: {
|
|
131
|
-
version: number;
|
|
131
|
+
static buildEnvelope(identity: RecordIdentity, p: {
|
|
132
132
|
iv: string;
|
|
133
133
|
data: string;
|
|
134
|
-
by?: string;
|
|
135
134
|
cek?: string;
|
|
136
135
|
provenance?: {
|
|
137
136
|
source: string;
|
|
@@ -140,10 +139,8 @@ export declare class RecordCodec<T> {
|
|
|
140
139
|
extra?: Partial<Pick<EncryptedEnvelope, '_tier' | '_det' | '_sealed'>>;
|
|
141
140
|
}): EncryptedEnvelope;
|
|
142
141
|
/** Plaintext (`_iv:''`) body envelope — the `!storeCiphertext` shape. */
|
|
143
|
-
static buildPlaintextEnvelope(p: {
|
|
144
|
-
version: number;
|
|
142
|
+
static buildPlaintextEnvelope(identity: RecordIdentity, p: {
|
|
145
143
|
data: string;
|
|
146
|
-
by?: string;
|
|
147
144
|
provenance?: {
|
|
148
145
|
source: string;
|
|
149
146
|
sourceTs: string;
|
|
@@ -157,7 +154,7 @@ export declare class RecordCodec<T> {
|
|
|
157
154
|
* (see {@link encryptRecord}). Rejects `_`-prefixed record fields, which
|
|
158
155
|
* would collide with the reserved metadata namespace.
|
|
159
156
|
*/
|
|
160
|
-
buildDebugEnvelope(record: T, version: number, source?: string, sourceTs?: string): EncryptedEnvelope;
|
|
157
|
+
buildDebugEnvelope(id: string, record: T, version: number, source?: string, sourceTs?: string): EncryptedEnvelope;
|
|
161
158
|
/**
|
|
162
159
|
* Encrypt a JSON body into an envelope.
|
|
163
160
|
*
|
|
@@ -167,11 +164,41 @@ export declare class RecordCodec<T> {
|
|
|
167
164
|
* path encrypts the body directly under the collection DEK — byte-identical
|
|
168
165
|
* to pre-CEK behaviour, so non-adopting collections pay nothing.
|
|
169
166
|
*/
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
/**
|
|
168
|
+
* `ref` is the identity the envelope is sealed against, and it is **the
|
|
169
|
+
* location the bytes are stored at** — not necessarily this codec's own
|
|
170
|
+
* collection (#1051).
|
|
171
|
+
*
|
|
172
|
+
* That distinction was discovered here rather than assumed. Several callers
|
|
173
|
+
* put the result somewhere else entirely: search's vector sidecar lands in
|
|
174
|
+
* `_vec` under `encodeVecId(name, id)`, the lexical index under `_ft/<name>`,
|
|
175
|
+
* indexing's entries under a synthetic `idxId`. A codec that supplied
|
|
176
|
+
* `this.ctx.name` for those would seal them against a collection they are not
|
|
177
|
+
* in, and once AAD binds identity every one of them would fail to verify.
|
|
178
|
+
*
|
|
179
|
+
* ⚠️ **`_history` is the open case, and it is #1041's to settle.** Snapshots
|
|
180
|
+
* are produced with the LIVE record's identity here and then re-homed by
|
|
181
|
+
* `saveHistory` into `_history/<historyId(collection,id,_v)>`. Both readings
|
|
182
|
+
* are defensible — bind where it lives, or bind what it is a copy of — and
|
|
183
|
+
* the choice must be made before AAD is switched on, not inferred from this
|
|
184
|
+
* migration.
|
|
185
|
+
*/
|
|
186
|
+
encryptJsonString(ref: RecordRef, json: string, version: number, cek?: EnclaveKey, source?: string, sourceTs?: string): Promise<EncryptedEnvelope>;
|
|
187
|
+
/**
|
|
188
|
+
* `ref` is FIRST and required (#1051). It was previously a trailing optional
|
|
189
|
+
* `id?: string`, which TypeScript cannot promote to required because it sits
|
|
190
|
+
* after other optionals — so the migration would have needed an `id ?? ''`
|
|
191
|
+
* fallback. That is exactly the silent default this issue exists to remove:
|
|
192
|
+
* once identity is bound into the AEAD, every record written with an empty id
|
|
193
|
+
* binds to the SAME identity and becomes interchangeable with the others.
|
|
194
|
+
* An object, not a bare string, so a swap with `version`/`source` cannot
|
|
195
|
+
* compile on the hottest write path. Carries the collection too — see
|
|
196
|
+
* {@link encryptJsonString} for why the codec must not assume its own.
|
|
197
|
+
*/
|
|
198
|
+
encryptRecord(ref: RecordRef, record: T, version: number, cek?: EnclaveKey, source?: string, sourceTs?: string, vdig?: {
|
|
172
199
|
readonly id: string;
|
|
173
200
|
readonly prev: EncryptedEnvelope | null;
|
|
174
|
-
}
|
|
201
|
+
}): Promise<EncryptedEnvelope>;
|
|
175
202
|
/**
|
|
176
203
|
* Resolve the per-record CEK for a stored envelope, or `undefined` for a
|
|
177
204
|
* legacy (`_cek`-absent) envelope. Unwraps `_cek` under the collection DEK and
|
|
@@ -195,7 +222,14 @@ export declare class RecordCodec<T> {
|
|
|
195
222
|
* The optional `id` lets reads populate the CEK cache; it is omitted by
|
|
196
223
|
* callers (history, conflict merge) that have only the envelope.
|
|
197
224
|
*/
|
|
198
|
-
|
|
225
|
+
/**
|
|
226
|
+
* `ref` must be the SAME identity the writer sealed against — which is the
|
|
227
|
+
* storage address, not necessarily this codec's own collection. Search's
|
|
228
|
+
* vector sidecar lives in `_vec`, its lexical index in `_ft`; passing
|
|
229
|
+
* `this.ctx.name` for those would recompute the wrong AAD and fail to open a
|
|
230
|
+
* perfectly good record (#1041).
|
|
231
|
+
*/
|
|
232
|
+
decryptJsonString(ref: RecordRef, envelope: EncryptedEnvelope): Promise<string | null>;
|
|
199
233
|
/**
|
|
200
234
|
* Unseal a single `_sealed[field]` slot to its plaintext value: derive the
|
|
201
235
|
* per-field key off the collection DEK, AES-GCM-decrypt the `iv:data` blob,
|
|
@@ -304,7 +338,7 @@ export declare class RecordCodec<T> {
|
|
|
304
338
|
* output-recompute path, not the public per-record read surface schema
|
|
305
339
|
* validation guards.
|
|
306
340
|
*/
|
|
307
|
-
decryptRecordAtDek(envelope: EncryptedEnvelope, dek: EnclaveKey
|
|
341
|
+
decryptRecordAtDek(ref: RecordRef, envelope: EncryptedEnvelope, dek: EnclaveKey): Promise<T | null>;
|
|
308
342
|
/**
|
|
309
343
|
* Decrypt an envelope into a record of type `T`.
|
|
310
344
|
*
|
|
@@ -320,9 +354,8 @@ export declare class RecordCodec<T> {
|
|
|
320
354
|
* that may predate a schema change, so validating it would be a
|
|
321
355
|
* false positive. Every non-history read leaves this flag `false`.
|
|
322
356
|
*/
|
|
323
|
-
decryptRecord(envelope: EncryptedEnvelope, opts?: {
|
|
357
|
+
decryptRecord(ref: RecordRef, envelope: EncryptedEnvelope, opts?: {
|
|
324
358
|
skipValidation?: boolean;
|
|
325
|
-
id?: string;
|
|
326
359
|
sealedAsHandles?: boolean;
|
|
327
360
|
}): Promise<T | null>;
|
|
328
361
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-key a vault's blob set from an old `_blob` DEK to a new one (#1122).
|
|
3
|
+
*
|
|
4
|
+
* ## The defect this closes
|
|
5
|
+
*
|
|
6
|
+
* `rotateKeys` re-keys `store.list(vault, <slot>)` plus the derived refs
|
|
7
|
+
* `derivedRefsFor` declares. That assumes a DEK slot named `X` protects data
|
|
8
|
+
* filed under collection `X`. For `_blob` it is false: the slot is `_blob`, but
|
|
9
|
+
* every byte it protects lives in `_blob_index` and `_blob_chunks`. So rotating
|
|
10
|
+
* `_blob` minted a fresh DEK, re-encrypted **nothing**, and made every blob in
|
|
11
|
+
* the vault permanently unreadable — reported to the user as `TamperedError`,
|
|
12
|
+
* i.e. as an attack, when it was self-inflicted. An ordinary `revoke` of a
|
|
13
|
+
* whole-vault grantee reaches it, because such a grantee's DEK map contains
|
|
14
|
+
* `_blob`.
|
|
15
|
+
*
|
|
16
|
+
* ## Why this cannot be done by `rekeyEnvelopeIfNeeded` alone
|
|
17
|
+
*
|
|
18
|
+
* Two of the three surfaces do not have the shape that helper assumes:
|
|
19
|
+
*
|
|
20
|
+
* - a **chunk** envelope is sealed over raw bytes under a bespoke AAD
|
|
21
|
+
* (`{eTag}:{index}:{count}`), not under the record AAD, so the generic
|
|
22
|
+
* helper cannot open it;
|
|
23
|
+
* - an **index** envelope's body is JSON that may itself carry a wrapped
|
|
24
|
+
* per-blob content CEK (`_cek` / `_cekPending`). Re-encrypting the body under
|
|
25
|
+
* the new DEK without re-wrapping that CEK leaves a blob whose metadata opens
|
|
26
|
+
* and whose bytes never will.
|
|
27
|
+
*
|
|
28
|
+
* ## Why it lives in the enclave
|
|
29
|
+
*
|
|
30
|
+
* It reads and writes protected body slots and it unwraps/re-wraps keys — the
|
|
31
|
+
* two things `enclave-body-only` reserves to `kernel/enclave/**`, and the same
|
|
32
|
+
* reason `rekeyEnvelopeToDek` moved here in #1074. `with-party` orchestrates
|
|
33
|
+
* the rotation and must not touch a body to do it.
|
|
34
|
+
*
|
|
35
|
+
* The blob layout below is duplicated from its owner rather than imported:
|
|
36
|
+
* `with-shape/blobs/blob-set.ts` already imports `with-party/team/tiers.js`, so
|
|
37
|
+
* a `with-party → with-shape` import would close a cycle, and the kernel may
|
|
38
|
+
* not depend on a service. `BlobObject` itself is a kernel type, so only the
|
|
39
|
+
* three collection/id string layouts are copied, with their owner named.
|
|
40
|
+
*
|
|
41
|
+
* @packageDocumentation
|
|
42
|
+
*/
|
|
43
|
+
import { type EnclaveKey } from '../crypto.js';
|
|
44
|
+
import type { NoydbStore } from '../../types.js';
|
|
45
|
+
/**
|
|
46
|
+
* What a rotation did to the blob set.
|
|
47
|
+
*
|
|
48
|
+
* Deliberately NOT on the enclave barrel: no caller outside this module binds
|
|
49
|
+
* it, and that surface is the fork-swap trust boundary, so exporting a type
|
|
50
|
+
* nobody consumes is pure widening.
|
|
51
|
+
*
|
|
52
|
+
* It is a return value rather than a log line because `foreign` and `blobs`
|
|
53
|
+
* are the only way to tell "left alone, correctly" from "left alone, because
|
|
54
|
+
* the caller passed a wrong `otherDeks` set". Both re-key nothing and both
|
|
55
|
+
* return successfully. `rotate-preserves-blobs.test.ts` asserts these counts
|
|
56
|
+
* against a direct call for exactly that reason.
|
|
57
|
+
*/
|
|
58
|
+
export interface BlobRekeyReport {
|
|
59
|
+
/** Index envelopes moved onto the new DEK. */
|
|
60
|
+
readonly blobs: number;
|
|
61
|
+
/** Chunk envelopes re-encrypted under the new DEK. */
|
|
62
|
+
readonly chunks: number;
|
|
63
|
+
/**
|
|
64
|
+
* Index envelopes left alone because they open under a DEK the caller holds
|
|
65
|
+
* for a DIFFERENT slot — an elevated blob, sealed under `_blob#<tier>`. Those
|
|
66
|
+
* are that slot's rotation to do, not this one's.
|
|
67
|
+
*/
|
|
68
|
+
readonly foreign: number;
|
|
69
|
+
/** Index envelopes already under the new DEK — a resumed rotation. */
|
|
70
|
+
readonly alreadyMoved: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Move every blob sealed under `oldDek` onto `newDek`.
|
|
74
|
+
*
|
|
75
|
+
* Chunks are re-encrypted BEFORE their index entry is re-sealed, and that order
|
|
76
|
+
* is the resume property: an index entry still readable under `oldDek` means
|
|
77
|
+
* its chunks may be half-moved (each one is probed individually), and an index
|
|
78
|
+
* entry readable under `newDek` means its chunks are already done. An
|
|
79
|
+
* interrupted rotation is finished by re-running it with the same `newDek`.
|
|
80
|
+
*
|
|
81
|
+
* `otherDeks` is what keeps a tier-elevated blob from being mistaken for a
|
|
82
|
+
* damaged one. Membership in `_blob_index` is by DEK, not by collection name:
|
|
83
|
+
* a record elevated to tier N has its blob metadata sealed under `_blob#N`. An
|
|
84
|
+
* envelope that opens under NONE of the keys the caller holds is genuinely
|
|
85
|
+
* unreadable and throws, exactly as `rekeyEnvelopeIfNeeded` does — silently
|
|
86
|
+
* walking past it would turn a loud failure into permanent quiet loss.
|
|
87
|
+
*/
|
|
88
|
+
export declare function rekeyBlobSet(adapter: NoydbStore, vault: string, oldDek: EnclaveKey, newDek: EnclaveKey, otherDeks?: readonly EnclaveKey[]): Promise<BlobRekeyReport>;
|