@noy-db/hub 0.10.0-pre.0 → 0.10.0-pre.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -0
- package/README.md +2 -2
- package/dist/api-QSEKT4KS.js +15 -0
- package/dist/as/index.js +19 -12
- package/dist/as/index.js.map +1 -1
- package/dist/at/index.js +6 -9
- package/dist/attestation/index.js +16 -19
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-E3GBMNDA.js → backup-BHKVK5SD.js} +9 -12
- package/dist/{backup-E3GBMNDA.js.map → backup-BHKVK5SD.js.map} +1 -1
- package/dist/blobs/index.js +10 -13
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +11 -14
- package/dist/broker/index.js.map +1 -1
- package/dist/by/index.js +2 -2
- package/dist/capsule/contract.d.ts +176 -16
- package/dist/capsule/contract.js +35 -30
- package/dist/capsule/enclave-aes/bound.d.ts +11 -1
- package/dist/capsule/enclave-aes/classify/digest.d.ts +4 -2
- package/dist/capsule/enclave-aes/index.d.ts +9 -0
- package/dist/capsule/enclave-aes/index.js +643 -78
- package/dist/capsule/enclave-aes/index.js.map +1 -1
- package/dist/capsule/enclave-aes/primitives.d.ts +2 -2
- package/dist/capsule/index.d.ts +1 -1
- package/dist/capsule/plumbing/classify-reveal.d.ts +29 -0
- package/dist/capsule/plumbing/classify-verify.d.ts +53 -0
- package/dist/capsule/plumbing/index.d.ts +17 -0
- package/dist/{capsule-YQKQZPH7.js → capsule-YAITMH77.js} +16 -9
- package/dist/cargo/index.js +34 -36
- package/dist/{chunk-U43RSPPX.js → chunk-23A4SBRR.js} +3 -4
- package/dist/{chunk-U43RSPPX.js.map → chunk-23A4SBRR.js.map} +1 -1
- package/dist/{chunk-PREYKC76.js → chunk-24AGG4PP.js} +3 -3
- package/dist/{chunk-ZVJKHGE5.js → chunk-24IJZA4M.js} +14 -8
- package/dist/chunk-24IJZA4M.js.map +1 -0
- package/dist/{chunk-4N4OIVK3.js → chunk-2NVQ5SEA.js} +15 -5
- package/dist/chunk-2NVQ5SEA.js.map +1 -0
- package/dist/{chunk-ZNVBCKMV.js → chunk-2SIREKBR.js} +2 -2
- package/dist/{chunk-N6EWQ5VB.js → chunk-37FOG6AE.js} +14 -7
- package/dist/chunk-37FOG6AE.js.map +1 -0
- package/dist/{chunk-UQRKAM2R.js → chunk-3M2KK7O7.js} +3 -3
- package/dist/{chunk-P6FATPXQ.js → chunk-3ZCVY3T6.js} +2 -2
- package/dist/{chunk-PBEHTFUG.js → chunk-4CGWLHPQ.js} +6 -6
- package/dist/{chunk-PFHDQY5L.js → chunk-56Z4NOC6.js} +3 -3
- package/dist/{chunk-GLSCL74M.js → chunk-5AVIUJP4.js} +13 -9
- package/dist/chunk-5AVIUJP4.js.map +1 -0
- package/dist/{chunk-F7X7MPK4.js → chunk-5BGHAVBN.js} +2 -2
- package/dist/{chunk-QHG7GQKM.js → chunk-5JNEDW7I.js} +2 -2
- package/dist/{chunk-GHMINSER.js → chunk-5OWJSDTO.js} +4 -4
- package/dist/{chunk-GHMINSER.js.map → chunk-5OWJSDTO.js.map} +1 -1
- package/dist/{chunk-DYIR6RC3.js → chunk-5Y4MO7UQ.js} +4 -4
- package/dist/{chunk-TLIFNRU5.js → chunk-63LZLRWG.js} +2 -2
- package/dist/{chunk-GZISWBCJ.js → chunk-74W56QPY.js} +4 -4
- package/dist/{chunk-CLOSXHR4.js → chunk-7KNYLHVX.js} +3 -3
- package/dist/chunk-7KNYLHVX.js.map +1 -0
- package/dist/{chunk-LFUID7OW.js → chunk-7VJ2SIEI.js} +42 -22
- package/dist/chunk-7VJ2SIEI.js.map +1 -0
- package/dist/{chunk-WVQDY3UM.js → chunk-AHA7UALU.js} +4 -4
- package/dist/{chunk-U277K5GR.js → chunk-AIHBYQHF.js} +259 -123
- package/dist/chunk-AIHBYQHF.js.map +1 -0
- package/dist/{chunk-S2ORTQGS.js → chunk-ANYX2M6P.js} +3 -3
- package/dist/{chunk-6WEPFEMJ.js → chunk-ATKYMRBC.js} +4 -4
- package/dist/{chunk-7UHLO4ZN.js → chunk-B2HU55QD.js} +2 -2
- package/dist/{chunk-Y22JWHCP.js → chunk-BEKMLYQ4.js} +4 -4
- package/dist/{chunk-27NCEPKM.js → chunk-BPFXD4EX.js} +23 -3
- package/dist/chunk-BPFXD4EX.js.map +1 -0
- package/dist/{chunk-7C7OF26T.js → chunk-C2NXAR3D.js} +5 -5
- package/dist/{chunk-Z2KP6PNF.js → chunk-CJBWJO5P.js} +6 -6
- package/dist/{chunk-Z2KP6PNF.js.map → chunk-CJBWJO5P.js.map} +1 -1
- package/dist/{chunk-6WIFF46H.js → chunk-CQLMRCKX.js} +2 -2
- package/dist/{chunk-URGHKZPL.js → chunk-CR5UPYIJ.js} +1 -1
- package/dist/chunk-CR5UPYIJ.js.map +1 -0
- package/dist/{chunk-LMC5L3MM.js → chunk-DS2JXSUA.js} +6 -6
- package/dist/{chunk-X6Z2SIRF.js → chunk-E2JIE4S3.js} +2 -2
- package/dist/{chunk-EQ6C2ZPT.js → chunk-E7Y4J4GL.js} +2 -2
- package/dist/{chunk-LZN6DTFI.js → chunk-ECDM6YRX.js} +2 -2
- package/dist/{chunk-WRLWEYHY.js → chunk-EFINFZIF.js} +11 -1
- package/dist/chunk-EFINFZIF.js.map +1 -0
- package/dist/{chunk-2T2TGRWE.js → chunk-EM56MHN5.js} +6 -6
- package/dist/{chunk-NK4LGBGQ.js → chunk-EQXOJH6O.js} +4 -4
- package/dist/{chunk-OK44MD3C.js → chunk-ET3U2C3A.js} +2 -2
- package/dist/{chunk-RF5WDM25.js → chunk-EU4G7PQH.js} +2 -2
- package/dist/{chunk-K5JNK63R.js → chunk-EUCUYK5E.js} +10 -10
- package/dist/{chunk-2ODEFG6K.js → chunk-EWSIJDWO.js} +4 -4
- package/dist/{chunk-LJ744WXU.js → chunk-F2FD4LSB.js} +2 -2
- package/dist/{chunk-L4UL4IAR.js → chunk-F7ENMZYJ.js} +2 -2
- package/dist/{chunk-KBIS64X4.js → chunk-FIIVYQOW.js} +5 -5
- package/dist/{chunk-TBVDI3LY.js → chunk-FPK2LPLR.js} +8 -8
- package/dist/chunk-FPK2LPLR.js.map +1 -0
- package/dist/{chunk-BQJ5ORU5.js → chunk-FQEUJGBV.js} +2 -2
- package/dist/{chunk-UORWAG7K.js → chunk-FY4FFNKK.js} +2 -2
- package/dist/{chunk-MMWX5OT5.js → chunk-GDCYZGPB.js} +2 -2
- package/dist/{chunk-7ONMS7QI.js → chunk-H6Q7GKLI.js} +2 -2
- package/dist/{chunk-654RE5YC.js → chunk-HDAPQF6Q.js} +3 -3
- package/dist/{chunk-5SMCBPJ2.js → chunk-HRLMUZLI.js} +5 -5
- package/dist/{chunk-R4GLRJ55.js → chunk-HRNQYGLQ.js} +2 -2
- package/dist/{chunk-HTRLQ4ZZ.js → chunk-I4S7IZSS.js} +321 -235
- package/dist/chunk-I4S7IZSS.js.map +1 -0
- package/dist/{chunk-UNAMWK2Q.js → chunk-IN4XZJYD.js} +4 -3
- package/dist/{chunk-UNAMWK2Q.js.map → chunk-IN4XZJYD.js.map} +1 -1
- package/dist/{chunk-2RH5SEY7.js → chunk-ISIXU45J.js} +2 -2
- package/dist/chunk-ISIXU45J.js.map +1 -0
- package/dist/{chunk-NHEKQWFI.js → chunk-J4L4AS2W.js} +2 -2
- package/dist/{chunk-UMV5GBTJ.js → chunk-JPSOFWJR.js} +2 -2
- package/dist/{chunk-A52BK5AY.js → chunk-JRCO67NG.js} +2 -2
- package/dist/{chunk-FVKQ5QUC.js → chunk-JW3I3NNZ.js} +2 -2
- package/dist/{chunk-BNYDOF2Q.js → chunk-JZMPSQBH.js} +4 -4
- package/dist/{chunk-ZK2WT532.js → chunk-K5TVSOPQ.js} +5 -5
- package/dist/{chunk-2IASHJPS.js → chunk-K75SL74I.js} +2 -2
- package/dist/{chunk-O3NGOHXQ.js → chunk-KA4AAUST.js} +2 -2
- package/dist/chunk-KHSBMLQE.js +161 -0
- package/dist/chunk-KHSBMLQE.js.map +1 -0
- package/dist/{chunk-QQLXKDGC.js → chunk-KUGUML7H.js} +3 -3
- package/dist/{chunk-AMSSAOOB.js → chunk-L4J5NC2Q.js} +2 -2
- package/dist/{chunk-AYOQZJDB.js → chunk-LIX4QPMM.js} +2 -2
- package/dist/{chunk-WIUH6EJ7.js → chunk-LWQFGR34.js} +3 -3
- package/dist/{chunk-QNOWNCZS.js → chunk-MMSSHMHW.js} +2 -2
- package/dist/{chunk-T5EXREMW.js → chunk-N25Z6PR4.js} +6 -5
- package/dist/chunk-N25Z6PR4.js.map +1 -0
- package/dist/{chunk-ND6S2DKC.js → chunk-N5S2BCW3.js} +2 -2
- package/dist/{chunk-X5RGG3ZW.js → chunk-NIZH2TYZ.js} +2 -2
- package/dist/{chunk-SXPLIRQH.js → chunk-NLDBQHDV.js} +2 -2
- package/dist/{chunk-AI35LNWQ.js → chunk-NQQ4MOPC.js} +4 -4
- package/dist/{chunk-B6EWMGFX.js → chunk-NUBI6PYH.js} +2 -2
- package/dist/{chunk-ID4ZBC3X.js → chunk-NYEXUZDW.js} +4 -4
- package/dist/{chunk-GU6QXHPZ.js → chunk-OIBFIWVJ.js} +4 -4
- package/dist/chunk-OIBFIWVJ.js.map +1 -0
- package/dist/{chunk-PWAMX5KU.js → chunk-OOLF5FU2.js} +2 -2
- package/dist/{chunk-WQUIJPN4.js → chunk-OQA7UF2Q.js} +3 -3
- package/dist/{chunk-7JRLCP2J.js → chunk-ORJPICJI.js} +2 -2
- package/dist/{chunk-IF2M43G4.js → chunk-PBRD75JF.js} +2 -2
- package/dist/{chunk-RKBCUP5D.js → chunk-PDCBL23X.js} +39 -17
- package/dist/chunk-PDCBL23X.js.map +1 -0
- package/dist/{chunk-BSEPI3HD.js → chunk-PR36DD2X.js} +7 -7
- package/dist/{chunk-52ZFNK46.js → chunk-PV4HIC4E.js} +2 -2
- package/dist/{chunk-TU6ZJTYT.js → chunk-PZNK4HTV.js} +3 -3
- package/dist/{chunk-LUQBG637.js → chunk-QBLPLNPE.js} +3 -3
- package/dist/{chunk-UADW5NOU.js → chunk-QZXUISRF.js} +5 -5
- package/dist/{chunk-BMAXBTYH.js → chunk-RBXYO7MD.js} +5 -5
- package/dist/{chunk-PZN76MMV.js → chunk-RIACRFWA.js} +4 -4
- package/dist/{chunk-ICHHNI5E.js → chunk-RL6RNDJQ.js} +8 -8
- package/dist/{chunk-4WLI37WK.js → chunk-SJ2P7UXD.js} +7 -7
- package/dist/{chunk-2QH3I7QC.js → chunk-SWXS4LV3.js} +11 -11
- package/dist/{chunk-4KYKRYRT.js → chunk-TOTCZFRF.js} +2 -2
- package/dist/{chunk-CSAN22QG.js → chunk-TT4D52EK.js} +6 -6
- package/dist/{chunk-VLRY2UH4.js → chunk-U7CMJY5P.js} +10 -10
- package/dist/{chunk-NIUHKKMM.js → chunk-UNKTZDA2.js} +11 -11
- package/dist/{chunk-NIUHKKMM.js.map → chunk-UNKTZDA2.js.map} +1 -1
- package/dist/{chunk-QVUMKG3Z.js → chunk-UXH4AKH3.js} +95 -151
- package/dist/chunk-UXH4AKH3.js.map +1 -0
- package/dist/{chunk-PU5ZEV65.js → chunk-UZVHSYIF.js} +2 -2
- package/dist/{chunk-3EXQXOQ2.js → chunk-VHKAW5OI.js} +29 -5
- package/dist/chunk-VHKAW5OI.js.map +1 -0
- package/dist/{chunk-XQGKS4OW.js → chunk-VKZ3TDET.js} +3 -3
- package/dist/{chunk-ZOFNZLAA.js → chunk-VLZPUG5A.js} +4 -4
- package/dist/{chunk-OR3OHKU6.js → chunk-VSN5FLMI.js} +2 -2
- package/dist/{chunk-JQMEXCUZ.js → chunk-VYBBE7RN.js} +8 -8
- package/dist/chunk-VYBBE7RN.js.map +1 -0
- package/dist/{chunk-SVXFCCSX.js → chunk-WHK4JVKF.js} +8 -8
- package/dist/{chunk-YVA6UPRN.js → chunk-X4LDBALX.js} +2 -2
- package/dist/{chunk-35CNOVQE.js → chunk-X67E7NIJ.js} +3 -3
- package/dist/{chunk-IPF5ORDI.js → chunk-XMARKBUC.js} +3 -3
- package/dist/{chunk-B3B6HV5S.js → chunk-XMBBTETD.js} +2 -2
- package/dist/{chunk-GQ4MF3CM.js → chunk-XMBTAN5E.js} +28 -14
- package/dist/chunk-XMBTAN5E.js.map +1 -0
- package/dist/{chunk-FUHUGKDN.js → chunk-XROQP6IQ.js} +4 -4
- package/dist/chunk-XWWDZKLS.js +196 -0
- package/dist/chunk-XWWDZKLS.js.map +1 -0
- package/dist/{chunk-DL4GCSTS.js → chunk-Y2RYUWSQ.js} +10 -10
- package/dist/{chunk-7IV7GVOS.js → chunk-YCTSQV7K.js} +5 -5
- package/dist/{chunk-IFUYLIEY.js → chunk-YF7P2DG7.js} +2 -2
- package/dist/{chunk-PIO6NW7O.js → chunk-ZG7DBIVX.js} +2 -2
- package/dist/{chunk-NUZ7ROUZ.js → chunk-ZGJ775X7.js} +2 -2
- package/dist/{chunk-6BEBWHNL.js → chunk-ZQQLOEWN.js} +3 -3
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-7HXDMYHI.js → classified-marker-HKMRC7SC.js} +3 -3
- package/dist/{reveal-UAPBG743.js → classify-reveal-YSJKJEIR.js} +7 -12
- package/dist/classify-reveal-YSJKJEIR.js.map +1 -0
- package/dist/{verify-QWO5UKD6.js → classify-verify-ZCTKYQ43.js} +31 -41
- package/dist/classify-verify-ZCTKYQ43.js.map +1 -0
- package/dist/collection-facade-PPKNUR2J.js +38 -0
- package/dist/{computed-LZLSYOPG.js → computed-UCYVPMZA.js} +3 -3
- package/dist/consent/index.js +6 -9
- package/dist/consent/index.js.map +1 -1
- package/dist/cover/index.js +6 -9
- package/dist/custody/index.js +11 -13
- package/dist/{dead-filter-PZIJ4F4G.js → dead-filter-YOBWRG4O.js} +8 -11
- package/dist/{dead-filter-PZIJ4F4G.js.map → dead-filter-YOBWRG4O.js.map} +1 -1
- package/dist/debug/index.js +5 -8
- package/dist/debug/index.js.map +1 -1
- package/dist/delegation-SNALWRMO.js +24 -0
- package/dist/derivations/index.js +20 -23
- package/dist/derive-4GNU4E4I.js +17 -0
- package/dist/directory/index.js +7 -10
- package/dist/{dispatch-4BUYPWMJ.js → dispatch-QW32QBLW.js} +17 -20
- package/dist/{dispatch-4BUYPWMJ.js.map → dispatch-QW32QBLW.js.map} +1 -1
- package/dist/{dispatch-KOPDDPEQ.js → dispatch-V5WLDTVX.js} +5 -5
- package/dist/executor-7QN22OKI.js +8 -0
- package/dist/executor-BJZJNVBB.js +8 -0
- package/dist/executor-JEAAEJUM.js +32 -0
- package/dist/export-accessible-TVO2KQPG.js +20 -0
- package/dist/extract-partition-43CLDRN4.js +33 -0
- package/dist/{fanout-sidecar-FYDRL7F3.js → fanout-sidecar-DDONAFJT.js} +6 -9
- package/dist/{fanout-sidecar-FYDRL7F3.js.map → fanout-sidecar-DDONAFJT.js.map} +1 -1
- package/dist/forget/index.js +6 -9
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +11 -14
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +11 -14
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +122 -123
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +5 -5
- package/dist/introspection/index.js +8 -11
- package/dist/issue-EIHEDAXM.js +16 -0
- package/dist/kernel/capsule-requirements.d.ts +84 -0
- package/dist/kernel/errors.d.ts +19 -3
- package/dist/kernel/export-scope.d.ts +28 -1
- package/dist/kernel/store-segment-guard.d.ts +29 -0
- package/dist/kernel/types.d.ts +169 -13
- package/dist/kernel/validation.d.ts +32 -0
- package/dist/kernel/vault.d.ts +5 -5
- package/dist/{ledger-UFJCB6T5.js → ledger-BMVUFQ3R.js} +8 -11
- package/dist/liberate-7KHXCLNJ.js +23 -0
- package/dist/link-set-PC2EJRKL.js +26 -0
- package/dist/{managed-secret-H5WYSJ46.js → managed-secret-RPRVEYZA.js} +7 -10
- package/dist/materialized-views/index.js +23 -26
- package/dist/{migrate-cek-SPESQAAO.js → migrate-cek-DTSCWGEF.js} +2 -2
- package/dist/money/index.js +5 -5
- package/dist/noydb-AYDNOXAX.js +98 -0
- package/dist/on/index.js +11 -13
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +9 -12
- package/dist/pod/index.js +65 -67
- package/dist/{pod-handle-GJLCOUGK.js → pod-handle-KBPQRN6Q.js} +6 -9
- package/dist/{pod-handle-GJLCOUGK.js.map → pod-handle-KBPQRN6Q.js.map} +1 -1
- package/dist/policy/index.js +7 -10
- package/dist/port/at/index.d.ts +1 -0
- package/dist/port/with/admission-authority.d.ts +2 -1
- package/dist/port/with/collection-registries.d.ts +37 -0
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-2AC2STHC.js → post-register-RITSNASO.js} +6 -6
- package/dist/query/all/index.js +15 -15
- package/dist/query/index.js +7 -7
- package/dist/query/live/index.js +7 -7
- package/dist/query/reduce/index.js +10 -10
- package/dist/query/relate/index.js +9 -9
- package/dist/reduce/index.js +8 -8
- package/dist/register-BB34SK7E.js +27 -0
- package/dist/registry-65L6V5TO.js +20 -0
- package/dist/registry-HU62GPWA.js +32 -0
- package/dist/registry-SMNK6UM4.js +8 -0
- package/dist/registry-X5VPBKCO.js +8 -0
- package/dist/request-withdrawal-4SKAH46W.js +26 -0
- package/dist/{restore-to-OOPKLAPU.js → restore-to-VQHT67OH.js} +7 -10
- package/dist/{restore-to-OOPKLAPU.js.map → restore-to-VQHT67OH.js.map} +1 -1
- package/dist/revoke-IF5PX2JY.js +21 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +9 -12
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +4 -4
- package/dist/{seed-BVYDPVIW.js → seed-F2OSDZJR.js} +11 -13
- package/dist/{seed-BVYDPVIW.js.map → seed-F2OSDZJR.js.map} +1 -1
- package/dist/sequence/index.js +6 -9
- package/dist/session/index.js +6 -9
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +2 -2
- package/dist/signer-5P7IZC2K.js +20 -0
- package/dist/snapshots/index.js +8 -10
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-CROGJBIJ.js → stale-PUCZH5GJ.js} +7 -10
- package/dist/storage-5EGY5OYE.js +18 -0
- package/dist/store/index.js +1 -1
- package/dist/{store-coordination-provider-2YD2PTTP.js → store-coordination-provider-SEQM7SHJ.js} +7 -10
- package/dist/{store-coordination-provider-2YD2PTTP.js.map → store-coordination-provider-SEQM7SHJ.js.map} +1 -1
- package/dist/sync/index.js +13 -15
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +14 -16
- package/dist/tiers/index.js +8 -11
- package/dist/to/index.js +2 -2
- package/dist/transactions/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/vault-diff-H7LT5ZBJ.js +8 -0
- package/dist/vault-head/index.js +5 -8
- package/dist/vault-head/index.js.map +1 -1
- package/dist/walk-Z4N7PCZ2.js +17 -0
- package/dist/with-audit/portability/export-accessible.d.ts +3 -1
- package/dist/with-cargo/vault-diff.d.ts +28 -0
- package/dist/with-commit/sequence/index.d.ts +22 -0
- package/dist/with-party/team/delegation.d.ts +16 -12
- package/dist/with-party/team/keyring.d.ts +77 -0
- package/dist/with-party/team/managed-secret.d.ts +40 -3
- package/dist/with-party/team/noydb-facade.d.ts +2 -2
- package/dist/with-party/team/peer-recover.d.ts +2 -2
- package/dist/with-party/team/rotate-recover.d.ts +3 -3
- package/dist/with-shape/manifest/storage.d.ts +2 -2
- package/dist/with-shape/manifest/writer.d.ts +2 -2
- package/dist/with-store/store-middleware.d.ts +18 -5
- package/dist/with-sync/engine.d.ts +0 -2
- package/dist/withdraw-accessible-CRCIQSTL.js +23 -0
- package/package.json +3 -3
- package/dist/api-H4B7ZQXP.js +0 -18
- package/dist/capsule/enclave-aes/classify/reveal.d.ts +0 -10
- package/dist/capsule/enclave-aes/classify/verify.d.ts +0 -36
- package/dist/chunk-27NCEPKM.js.map +0 -1
- package/dist/chunk-2RH5SEY7.js.map +0 -1
- package/dist/chunk-3EXQXOQ2.js.map +0 -1
- package/dist/chunk-4N4OIVK3.js.map +0 -1
- package/dist/chunk-5A3HOTP5.js +0 -591
- package/dist/chunk-5A3HOTP5.js.map +0 -1
- package/dist/chunk-CLOSXHR4.js.map +0 -1
- package/dist/chunk-EPPAEGH5.js +0 -157
- package/dist/chunk-EPPAEGH5.js.map +0 -1
- package/dist/chunk-GLSCL74M.js.map +0 -1
- package/dist/chunk-GQ4MF3CM.js.map +0 -1
- package/dist/chunk-GU6QXHPZ.js.map +0 -1
- package/dist/chunk-HTRLQ4ZZ.js.map +0 -1
- package/dist/chunk-JQMEXCUZ.js.map +0 -1
- package/dist/chunk-LFUID7OW.js.map +0 -1
- package/dist/chunk-N6EWQ5VB.js.map +0 -1
- package/dist/chunk-NH2UOV3B.js +0 -18
- package/dist/chunk-NH2UOV3B.js.map +0 -1
- package/dist/chunk-O6VOR4NH.js +0 -27
- package/dist/chunk-O6VOR4NH.js.map +0 -1
- package/dist/chunk-ODBOHPZU.js +0 -22
- package/dist/chunk-ODBOHPZU.js.map +0 -1
- package/dist/chunk-Q4DBU5RM.js +0 -78
- package/dist/chunk-Q4DBU5RM.js.map +0 -1
- package/dist/chunk-QVUMKG3Z.js.map +0 -1
- package/dist/chunk-RKBCUP5D.js.map +0 -1
- package/dist/chunk-T5EXREMW.js.map +0 -1
- package/dist/chunk-TBVDI3LY.js.map +0 -1
- package/dist/chunk-U277K5GR.js.map +0 -1
- package/dist/chunk-URGHKZPL.js.map +0 -1
- package/dist/chunk-VZFTON37.js +0 -40
- package/dist/chunk-VZFTON37.js.map +0 -1
- package/dist/chunk-WRLWEYHY.js.map +0 -1
- package/dist/chunk-ZVJKHGE5.js.map +0 -1
- package/dist/collection-facade-V63BEBGU.js +0 -41
- package/dist/delegation-7SSGIETH.js +0 -26
- package/dist/derive-IMI3BMDS.js +0 -20
- package/dist/executor-7SY3M6TZ.js +0 -8
- package/dist/executor-SNHW4ELF.js +0 -35
- package/dist/executor-Z3IKK7G3.js +0 -8
- package/dist/export-accessible-O7DIVFUO.js +0 -22
- package/dist/extract-partition-ELZEJKXM.js +0 -35
- package/dist/find-KWB2RYWJ.js +0 -10
- package/dist/issue-5ZHXK4HJ.js +0 -19
- package/dist/liberate-OEOSNNFH.js +0 -25
- package/dist/link-set-KMUBFN2L.js +0 -29
- package/dist/noydb-QDZ4QIKO.js +0 -100
- package/dist/register-PIORIMMR.js +0 -30
- package/dist/registry-BIMICFUH.js +0 -23
- package/dist/registry-JGWLW53D.js +0 -35
- package/dist/registry-SELCBYEQ.js +0 -8
- package/dist/registry-W327UNYH.js +0 -8
- package/dist/request-withdrawal-K3SXXODI.js +0 -28
- package/dist/reveal-UAPBG743.js.map +0 -1
- package/dist/revoke-6AFVXTWF.js +0 -24
- package/dist/signer-TW5MAQJP.js +0 -23
- package/dist/storage-SO2L2Z5J.js +0 -21
- package/dist/vault-diff-C6WUJFNP.js +0 -8
- package/dist/verify-QWO5UKD6.js.map +0 -1
- package/dist/walk-3KEOL7BY.js +0 -20
- package/dist/withdraw-accessible-OZU525ND.js +0 -25
- package/dist/withdraw-accessible-OZU525ND.js.map +0 -1
- /package/dist/{api-H4B7ZQXP.js.map → api-QSEKT4KS.js.map} +0 -0
- /package/dist/{capsule-YQKQZPH7.js.map → capsule-YAITMH77.js.map} +0 -0
- /package/dist/{chunk-PREYKC76.js.map → chunk-24AGG4PP.js.map} +0 -0
- /package/dist/{chunk-ZNVBCKMV.js.map → chunk-2SIREKBR.js.map} +0 -0
- /package/dist/{chunk-UQRKAM2R.js.map → chunk-3M2KK7O7.js.map} +0 -0
- /package/dist/{chunk-P6FATPXQ.js.map → chunk-3ZCVY3T6.js.map} +0 -0
- /package/dist/{chunk-PBEHTFUG.js.map → chunk-4CGWLHPQ.js.map} +0 -0
- /package/dist/{chunk-PFHDQY5L.js.map → chunk-56Z4NOC6.js.map} +0 -0
- /package/dist/{chunk-F7X7MPK4.js.map → chunk-5BGHAVBN.js.map} +0 -0
- /package/dist/{chunk-QHG7GQKM.js.map → chunk-5JNEDW7I.js.map} +0 -0
- /package/dist/{chunk-DYIR6RC3.js.map → chunk-5Y4MO7UQ.js.map} +0 -0
- /package/dist/{chunk-TLIFNRU5.js.map → chunk-63LZLRWG.js.map} +0 -0
- /package/dist/{chunk-GZISWBCJ.js.map → chunk-74W56QPY.js.map} +0 -0
- /package/dist/{chunk-WVQDY3UM.js.map → chunk-AHA7UALU.js.map} +0 -0
- /package/dist/{chunk-S2ORTQGS.js.map → chunk-ANYX2M6P.js.map} +0 -0
- /package/dist/{chunk-6WEPFEMJ.js.map → chunk-ATKYMRBC.js.map} +0 -0
- /package/dist/{chunk-7UHLO4ZN.js.map → chunk-B2HU55QD.js.map} +0 -0
- /package/dist/{chunk-Y22JWHCP.js.map → chunk-BEKMLYQ4.js.map} +0 -0
- /package/dist/{chunk-7C7OF26T.js.map → chunk-C2NXAR3D.js.map} +0 -0
- /package/dist/{chunk-6WIFF46H.js.map → chunk-CQLMRCKX.js.map} +0 -0
- /package/dist/{chunk-LMC5L3MM.js.map → chunk-DS2JXSUA.js.map} +0 -0
- /package/dist/{chunk-X6Z2SIRF.js.map → chunk-E2JIE4S3.js.map} +0 -0
- /package/dist/{chunk-EQ6C2ZPT.js.map → chunk-E7Y4J4GL.js.map} +0 -0
- /package/dist/{chunk-LZN6DTFI.js.map → chunk-ECDM6YRX.js.map} +0 -0
- /package/dist/{chunk-2T2TGRWE.js.map → chunk-EM56MHN5.js.map} +0 -0
- /package/dist/{chunk-NK4LGBGQ.js.map → chunk-EQXOJH6O.js.map} +0 -0
- /package/dist/{chunk-OK44MD3C.js.map → chunk-ET3U2C3A.js.map} +0 -0
- /package/dist/{chunk-RF5WDM25.js.map → chunk-EU4G7PQH.js.map} +0 -0
- /package/dist/{chunk-K5JNK63R.js.map → chunk-EUCUYK5E.js.map} +0 -0
- /package/dist/{chunk-2ODEFG6K.js.map → chunk-EWSIJDWO.js.map} +0 -0
- /package/dist/{chunk-LJ744WXU.js.map → chunk-F2FD4LSB.js.map} +0 -0
- /package/dist/{chunk-L4UL4IAR.js.map → chunk-F7ENMZYJ.js.map} +0 -0
- /package/dist/{chunk-KBIS64X4.js.map → chunk-FIIVYQOW.js.map} +0 -0
- /package/dist/{chunk-BQJ5ORU5.js.map → chunk-FQEUJGBV.js.map} +0 -0
- /package/dist/{chunk-UORWAG7K.js.map → chunk-FY4FFNKK.js.map} +0 -0
- /package/dist/{chunk-MMWX5OT5.js.map → chunk-GDCYZGPB.js.map} +0 -0
- /package/dist/{chunk-7ONMS7QI.js.map → chunk-H6Q7GKLI.js.map} +0 -0
- /package/dist/{chunk-654RE5YC.js.map → chunk-HDAPQF6Q.js.map} +0 -0
- /package/dist/{chunk-5SMCBPJ2.js.map → chunk-HRLMUZLI.js.map} +0 -0
- /package/dist/{chunk-R4GLRJ55.js.map → chunk-HRNQYGLQ.js.map} +0 -0
- /package/dist/{chunk-NHEKQWFI.js.map → chunk-J4L4AS2W.js.map} +0 -0
- /package/dist/{chunk-UMV5GBTJ.js.map → chunk-JPSOFWJR.js.map} +0 -0
- /package/dist/{chunk-A52BK5AY.js.map → chunk-JRCO67NG.js.map} +0 -0
- /package/dist/{chunk-FVKQ5QUC.js.map → chunk-JW3I3NNZ.js.map} +0 -0
- /package/dist/{chunk-BNYDOF2Q.js.map → chunk-JZMPSQBH.js.map} +0 -0
- /package/dist/{chunk-ZK2WT532.js.map → chunk-K5TVSOPQ.js.map} +0 -0
- /package/dist/{chunk-2IASHJPS.js.map → chunk-K75SL74I.js.map} +0 -0
- /package/dist/{chunk-O3NGOHXQ.js.map → chunk-KA4AAUST.js.map} +0 -0
- /package/dist/{chunk-QQLXKDGC.js.map → chunk-KUGUML7H.js.map} +0 -0
- /package/dist/{chunk-AMSSAOOB.js.map → chunk-L4J5NC2Q.js.map} +0 -0
- /package/dist/{chunk-AYOQZJDB.js.map → chunk-LIX4QPMM.js.map} +0 -0
- /package/dist/{chunk-WIUH6EJ7.js.map → chunk-LWQFGR34.js.map} +0 -0
- /package/dist/{chunk-QNOWNCZS.js.map → chunk-MMSSHMHW.js.map} +0 -0
- /package/dist/{chunk-ND6S2DKC.js.map → chunk-N5S2BCW3.js.map} +0 -0
- /package/dist/{chunk-X5RGG3ZW.js.map → chunk-NIZH2TYZ.js.map} +0 -0
- /package/dist/{chunk-SXPLIRQH.js.map → chunk-NLDBQHDV.js.map} +0 -0
- /package/dist/{chunk-AI35LNWQ.js.map → chunk-NQQ4MOPC.js.map} +0 -0
- /package/dist/{chunk-B6EWMGFX.js.map → chunk-NUBI6PYH.js.map} +0 -0
- /package/dist/{chunk-ID4ZBC3X.js.map → chunk-NYEXUZDW.js.map} +0 -0
- /package/dist/{chunk-PWAMX5KU.js.map → chunk-OOLF5FU2.js.map} +0 -0
- /package/dist/{chunk-WQUIJPN4.js.map → chunk-OQA7UF2Q.js.map} +0 -0
- /package/dist/{chunk-7JRLCP2J.js.map → chunk-ORJPICJI.js.map} +0 -0
- /package/dist/{chunk-IF2M43G4.js.map → chunk-PBRD75JF.js.map} +0 -0
- /package/dist/{chunk-BSEPI3HD.js.map → chunk-PR36DD2X.js.map} +0 -0
- /package/dist/{chunk-52ZFNK46.js.map → chunk-PV4HIC4E.js.map} +0 -0
- /package/dist/{chunk-TU6ZJTYT.js.map → chunk-PZNK4HTV.js.map} +0 -0
- /package/dist/{chunk-LUQBG637.js.map → chunk-QBLPLNPE.js.map} +0 -0
- /package/dist/{chunk-UADW5NOU.js.map → chunk-QZXUISRF.js.map} +0 -0
- /package/dist/{chunk-BMAXBTYH.js.map → chunk-RBXYO7MD.js.map} +0 -0
- /package/dist/{chunk-PZN76MMV.js.map → chunk-RIACRFWA.js.map} +0 -0
- /package/dist/{chunk-ICHHNI5E.js.map → chunk-RL6RNDJQ.js.map} +0 -0
- /package/dist/{chunk-4WLI37WK.js.map → chunk-SJ2P7UXD.js.map} +0 -0
- /package/dist/{chunk-2QH3I7QC.js.map → chunk-SWXS4LV3.js.map} +0 -0
- /package/dist/{chunk-4KYKRYRT.js.map → chunk-TOTCZFRF.js.map} +0 -0
- /package/dist/{chunk-CSAN22QG.js.map → chunk-TT4D52EK.js.map} +0 -0
- /package/dist/{chunk-VLRY2UH4.js.map → chunk-U7CMJY5P.js.map} +0 -0
- /package/dist/{chunk-PU5ZEV65.js.map → chunk-UZVHSYIF.js.map} +0 -0
- /package/dist/{chunk-XQGKS4OW.js.map → chunk-VKZ3TDET.js.map} +0 -0
- /package/dist/{chunk-ZOFNZLAA.js.map → chunk-VLZPUG5A.js.map} +0 -0
- /package/dist/{chunk-OR3OHKU6.js.map → chunk-VSN5FLMI.js.map} +0 -0
- /package/dist/{chunk-SVXFCCSX.js.map → chunk-WHK4JVKF.js.map} +0 -0
- /package/dist/{chunk-YVA6UPRN.js.map → chunk-X4LDBALX.js.map} +0 -0
- /package/dist/{chunk-35CNOVQE.js.map → chunk-X67E7NIJ.js.map} +0 -0
- /package/dist/{chunk-IPF5ORDI.js.map → chunk-XMARKBUC.js.map} +0 -0
- /package/dist/{chunk-B3B6HV5S.js.map → chunk-XMBBTETD.js.map} +0 -0
- /package/dist/{chunk-FUHUGKDN.js.map → chunk-XROQP6IQ.js.map} +0 -0
- /package/dist/{chunk-DL4GCSTS.js.map → chunk-Y2RYUWSQ.js.map} +0 -0
- /package/dist/{chunk-7IV7GVOS.js.map → chunk-YCTSQV7K.js.map} +0 -0
- /package/dist/{chunk-IFUYLIEY.js.map → chunk-YF7P2DG7.js.map} +0 -0
- /package/dist/{chunk-PIO6NW7O.js.map → chunk-ZG7DBIVX.js.map} +0 -0
- /package/dist/{chunk-NUZ7ROUZ.js.map → chunk-ZGJ775X7.js.map} +0 -0
- /package/dist/{chunk-6BEBWHNL.js.map → chunk-ZQQLOEWN.js.map} +0 -0
- /package/dist/{classified-marker-7HXDMYHI.js.map → classified-marker-HKMRC7SC.js.map} +0 -0
- /package/dist/{collection-facade-V63BEBGU.js.map → collection-facade-PPKNUR2J.js.map} +0 -0
- /package/dist/{computed-LZLSYOPG.js.map → computed-UCYVPMZA.js.map} +0 -0
- /package/dist/{delegation-7SSGIETH.js.map → delegation-SNALWRMO.js.map} +0 -0
- /package/dist/{derive-IMI3BMDS.js.map → derive-4GNU4E4I.js.map} +0 -0
- /package/dist/{dispatch-KOPDDPEQ.js.map → dispatch-V5WLDTVX.js.map} +0 -0
- /package/dist/{executor-7SY3M6TZ.js.map → executor-7QN22OKI.js.map} +0 -0
- /package/dist/{executor-SNHW4ELF.js.map → executor-BJZJNVBB.js.map} +0 -0
- /package/dist/{executor-Z3IKK7G3.js.map → executor-JEAAEJUM.js.map} +0 -0
- /package/dist/{export-accessible-O7DIVFUO.js.map → export-accessible-TVO2KQPG.js.map} +0 -0
- /package/dist/{extract-partition-ELZEJKXM.js.map → extract-partition-43CLDRN4.js.map} +0 -0
- /package/dist/{find-KWB2RYWJ.js.map → issue-EIHEDAXM.js.map} +0 -0
- /package/dist/{issue-5ZHXK4HJ.js.map → ledger-BMVUFQ3R.js.map} +0 -0
- /package/dist/{ledger-UFJCB6T5.js.map → liberate-7KHXCLNJ.js.map} +0 -0
- /package/dist/{liberate-OEOSNNFH.js.map → link-set-PC2EJRKL.js.map} +0 -0
- /package/dist/{link-set-KMUBFN2L.js.map → managed-secret-RPRVEYZA.js.map} +0 -0
- /package/dist/{migrate-cek-SPESQAAO.js.map → migrate-cek-DTSCWGEF.js.map} +0 -0
- /package/dist/{managed-secret-H5WYSJ46.js.map → noydb-AYDNOXAX.js.map} +0 -0
- /package/dist/{post-register-2AC2STHC.js.map → post-register-RITSNASO.js.map} +0 -0
- /package/dist/{noydb-QDZ4QIKO.js.map → register-BB34SK7E.js.map} +0 -0
- /package/dist/{register-PIORIMMR.js.map → registry-65L6V5TO.js.map} +0 -0
- /package/dist/{registry-BIMICFUH.js.map → registry-HU62GPWA.js.map} +0 -0
- /package/dist/{registry-JGWLW53D.js.map → registry-SMNK6UM4.js.map} +0 -0
- /package/dist/{registry-SELCBYEQ.js.map → registry-X5VPBKCO.js.map} +0 -0
- /package/dist/{registry-W327UNYH.js.map → request-withdrawal-4SKAH46W.js.map} +0 -0
- /package/dist/{request-withdrawal-K3SXXODI.js.map → revoke-IF5PX2JY.js.map} +0 -0
- /package/dist/{revoke-6AFVXTWF.js.map → signer-5P7IZC2K.js.map} +0 -0
- /package/dist/{signer-TW5MAQJP.js.map → stale-PUCZH5GJ.js.map} +0 -0
- /package/dist/{stale-CROGJBIJ.js.map → storage-5EGY5OYE.js.map} +0 -0
- /package/dist/{storage-SO2L2Z5J.js.map → vault-diff-H7LT5ZBJ.js.map} +0 -0
- /package/dist/{vault-diff-C6WUJFNP.js.map → walk-Z4N7PCZ2.js.map} +0 -0
- /package/dist/{walk-3KEOL7BY.js.map → withdraw-accessible-CRCIQSTL.js.map} +0 -0
|
@@ -1,135 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
buildRecordAad,
|
|
3
|
+
buildRecordEnvelope,
|
|
4
|
+
isDeleteMarker,
|
|
5
|
+
isTombstone,
|
|
6
|
+
makeEnvelopeBody,
|
|
7
|
+
recordAadFor,
|
|
8
|
+
sealedBodyArgs
|
|
9
|
+
} from "./chunk-XWWDZKLS.js";
|
|
4
10
|
import {
|
|
5
11
|
NOYDB_FORMAT_VERSION,
|
|
6
12
|
SealedHandle
|
|
7
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CR5UPYIJ.js";
|
|
8
14
|
import {
|
|
9
15
|
ClassifiedConfigError,
|
|
10
16
|
DebugReservedFieldError,
|
|
11
|
-
|
|
17
|
+
NoydbError,
|
|
12
18
|
RecordCekNotFoundError,
|
|
13
19
|
SchemaValidationError,
|
|
14
20
|
ValidationError
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
|
|
17
|
-
// src/capsule/plumbing/record-aad.ts
|
|
18
|
-
var SCHEME = "noydb-aad/2";
|
|
19
|
-
var encoder = new TextEncoder();
|
|
20
|
-
function buildRecordAad(identity) {
|
|
21
|
-
if (!Number.isFinite(identity.version)) {
|
|
22
|
-
throw new TypeError(
|
|
23
|
-
`record AAD: version must be a finite number for "${identity.collection}/${identity.id}", received ${String(identity.version)}. Sealing without one produces a record no reader can open.`
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
for (const [field, value] of [["collection", identity.collection], ["id", identity.id]]) {
|
|
27
|
-
if (typeof value !== "string") {
|
|
28
|
-
throw new TypeError(
|
|
29
|
-
`record AAD: ${field} must be a string, received ${String(value)} (${typeof value}). Sealing against a coerced address produces a record no reader can open, and the failure surfaces on the READ path.`
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const parts = [encoder.encode(SCHEME)];
|
|
34
|
-
const pushField = (value) => {
|
|
35
|
-
const bytes = encoder.encode(value);
|
|
36
|
-
const len = new Uint8Array(4);
|
|
37
|
-
new DataView(len.buffer).setUint32(0, bytes.length, false);
|
|
38
|
-
parts.push(len, bytes);
|
|
39
|
-
};
|
|
40
|
-
pushField(identity.collection);
|
|
41
|
-
pushField(identity.id);
|
|
42
|
-
pushField(String(identity.tier ?? 0));
|
|
43
|
-
parts.push(new Uint8Array([identity.by === void 0 ? 0 : 1]));
|
|
44
|
-
if (identity.by !== void 0) pushField(identity.by);
|
|
45
|
-
pushField(String(identity.version));
|
|
46
|
-
const total = parts.reduce((n, p) => n + p.length, 0);
|
|
47
|
-
const out = new Uint8Array(total);
|
|
48
|
-
let offset = 0;
|
|
49
|
-
for (const p of parts) {
|
|
50
|
-
out.set(p, offset);
|
|
51
|
-
offset += p.length;
|
|
52
|
-
}
|
|
53
|
-
return out;
|
|
54
|
-
}
|
|
55
|
-
function recordAadFor(ref, envelope) {
|
|
56
|
-
return buildRecordAad({
|
|
57
|
-
collection: ref.collection,
|
|
58
|
-
id: ref.id,
|
|
59
|
-
version: envelope._v,
|
|
60
|
-
tier: envelope._tier,
|
|
61
|
-
by: envelope._by
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// src/capsule/plumbing/envelope-body.ts
|
|
66
|
-
function requireSealedBody(env, where) {
|
|
67
|
-
if (env._iv === void 0 || env._data === void 0) throw new MissingEnvelopeBodyError(where);
|
|
68
|
-
return { iv: env._iv, data: env._data };
|
|
69
|
-
}
|
|
70
|
-
function sealedBodyArgs(env, where) {
|
|
71
|
-
const { iv, data } = requireSealedBody(env, where);
|
|
72
|
-
return [iv, data];
|
|
73
|
-
}
|
|
74
|
-
function envelopeBodySize(env) {
|
|
75
|
-
return (env._data?.length ?? 0) + (env._iv?.length ?? 0);
|
|
76
|
-
}
|
|
77
|
-
function hasPerRecordKey(env) {
|
|
78
|
-
return env._cek !== void 0;
|
|
79
|
-
}
|
|
80
|
-
function envelopeBodyForHash(env) {
|
|
81
|
-
const data = env._data ?? "";
|
|
82
|
-
if (env._sealed === void 0 && env._vdig === void 0 && env._bidx === void 0) return data;
|
|
83
|
-
const mapPart = (key, map) => {
|
|
84
|
-
const parts = Object.keys(map).sort().map(
|
|
85
|
-
(k) => `${JSON.stringify(k)}:${JSON.stringify(map[k])}`
|
|
86
|
-
);
|
|
87
|
-
return `${JSON.stringify(key)}:{${parts.join(",")}}`;
|
|
88
|
-
};
|
|
89
|
-
const segments = [`"_data":${JSON.stringify(data)}`];
|
|
90
|
-
if (env._sealed !== void 0) segments.push(mapPart("_sealed", env._sealed));
|
|
91
|
-
if (env._vdig !== void 0) segments.push(mapPart("_vdig", env._vdig));
|
|
92
|
-
if (env._bidx !== void 0) segments.push(mapPart("_bidx", env._bidx));
|
|
93
|
-
return `{${segments.join(",")}}`;
|
|
94
|
-
}
|
|
95
|
-
function hasSealedBody(env) {
|
|
96
|
-
return env._iv !== void 0 && env._iv !== "";
|
|
97
|
-
}
|
|
98
|
-
function makeEnvelopeBody(p) {
|
|
99
|
-
const { encrypt, decrypt, generateDEK, wrapCek, unwrapCek } = p;
|
|
100
|
-
async function openEnvelopeJson(ref, env, key, opts) {
|
|
101
|
-
if (opts?.encrypted === false) return env._data ?? "";
|
|
102
|
-
const aad = recordAadFor(ref, env);
|
|
103
|
-
const { iv, data } = requireSealedBody(env, "openEnvelopeJson");
|
|
104
|
-
if (env._cek !== void 0) {
|
|
105
|
-
const cek = await unwrapCek(env._cek, key);
|
|
106
|
-
return decrypt(iv, data, cek, aad);
|
|
107
|
-
}
|
|
108
|
-
return decrypt(iv, data, key, aad);
|
|
109
|
-
}
|
|
110
|
-
async function writeEnvelopeBody(identity, json, key, opts) {
|
|
111
|
-
if (opts?.encrypted === false) return { _iv: "", _data: json };
|
|
112
|
-
const aad = buildRecordAad(identity);
|
|
113
|
-
if (opts?.perRecordKey === true) {
|
|
114
|
-
const cek = await generateDEK();
|
|
115
|
-
const { iv: iv2, data: data2 } = await encrypt(json, cek, aad);
|
|
116
|
-
const wrapped = await wrapCek(cek, key);
|
|
117
|
-
return { _iv: iv2, _data: data2, _cek: wrapped };
|
|
118
|
-
}
|
|
119
|
-
const { iv, data } = await encrypt(json, key, aad);
|
|
120
|
-
return { _iv: iv, _data: data };
|
|
121
|
-
}
|
|
122
|
-
async function verifyRecordIdentity(ref, env, key) {
|
|
123
|
-
if (!hasSealedBody(env)) return true;
|
|
124
|
-
try {
|
|
125
|
-
await openEnvelopeJson(ref, env, key);
|
|
126
|
-
return true;
|
|
127
|
-
} catch {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return { openEnvelopeJson, writeEnvelopeBody, verifyRecordIdentity };
|
|
132
|
-
}
|
|
21
|
+
} from "./chunk-ISIXU45J.js";
|
|
133
22
|
|
|
134
23
|
// src/capsule/plumbing/sealed-slot.ts
|
|
135
24
|
function parseSealedSlot(blob) {
|
|
@@ -153,97 +42,6 @@ function makeSealedSlot(p) {
|
|
|
153
42
|
return { dualReadSealedSlot };
|
|
154
43
|
}
|
|
155
44
|
|
|
156
|
-
// src/capsule/plumbing/record-envelope.ts
|
|
157
|
-
function buildRecordEnvelope(identity, body) {
|
|
158
|
-
return {
|
|
159
|
-
_noydb: NOYDB_FORMAT_VERSION,
|
|
160
|
-
_v: identity.version,
|
|
161
|
-
_ts: body.ts ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
162
|
-
_iv: body.iv,
|
|
163
|
-
_data: body.data,
|
|
164
|
-
...identity.by !== void 0 ? { _by: identity.by } : {},
|
|
165
|
-
...identity.tier !== void 0 && identity.tier > 0 ? { _tier: identity.tier } : {},
|
|
166
|
-
...body.cek !== void 0 ? { _cek: body.cek } : {},
|
|
167
|
-
...body.provenance !== void 0 ? { _source: body.provenance.source, _sourceTs: body.provenance.sourceTs } : {},
|
|
168
|
-
...body.extra ?? {}
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
async function buildSealedRecordEnvelope(identity, seal, body) {
|
|
172
|
-
const sealed = await seal(identity);
|
|
173
|
-
const { iv, data } = requireSealedBody(sealed, "buildSealedRecordEnvelope");
|
|
174
|
-
return buildRecordEnvelope(identity, {
|
|
175
|
-
...body,
|
|
176
|
-
iv,
|
|
177
|
-
data,
|
|
178
|
-
cek: sealed._cek
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// src/capsule/plumbing/tombstone.ts
|
|
183
|
-
function isTombstoneShape(envelope) {
|
|
184
|
-
return envelope._data === "" && envelope._cek === void 0 && envelope._del !== true;
|
|
185
|
-
}
|
|
186
|
-
function isTombstone(envelope, encrypted) {
|
|
187
|
-
if (!encrypted) return false;
|
|
188
|
-
return isTombstoneShape(envelope);
|
|
189
|
-
}
|
|
190
|
-
function buildTombstone(ref, version, actor) {
|
|
191
|
-
return buildRecordEnvelope(
|
|
192
|
-
{ ...ref, version, ...actor ? { by: actor } : {} },
|
|
193
|
-
{ iv: "", data: "" }
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
function isDeleteMarker(envelope) {
|
|
197
|
-
return envelope._del === true;
|
|
198
|
-
}
|
|
199
|
-
function buildDeleteMarker(ref, version, actor) {
|
|
200
|
-
return {
|
|
201
|
-
...buildRecordEnvelope(
|
|
202
|
-
{ ...ref, version, ...actor ? { by: actor } : {} },
|
|
203
|
-
{ iv: "", data: "" }
|
|
204
|
-
),
|
|
205
|
-
_del: true
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// src/kernel/schema.ts
|
|
210
|
-
async function validateSchemaInput(schema, value, context) {
|
|
211
|
-
const result = await schema["~standard"].validate(value);
|
|
212
|
-
if (result.issues !== void 0 && result.issues.length > 0) {
|
|
213
|
-
throw new SchemaValidationError(
|
|
214
|
-
`Schema validation failed on ${context}: ${summarizeIssues(result.issues)}`,
|
|
215
|
-
result.issues,
|
|
216
|
-
"input"
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
return result.value;
|
|
220
|
-
}
|
|
221
|
-
async function validateSchemaOutput(schema, value, context) {
|
|
222
|
-
const result = await schema["~standard"].validate(value);
|
|
223
|
-
if (result.issues !== void 0 && result.issues.length > 0) {
|
|
224
|
-
throw new SchemaValidationError(
|
|
225
|
-
`Stored data for ${context} does not match the current schema \u2014 schema drift? ${summarizeIssues(result.issues)}`,
|
|
226
|
-
result.issues,
|
|
227
|
-
"output"
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
return result.value;
|
|
231
|
-
}
|
|
232
|
-
function summarizeIssues(issues) {
|
|
233
|
-
const shown = issues.slice(0, 3).map((issue) => {
|
|
234
|
-
const pathStr = formatPath(issue.path);
|
|
235
|
-
return `${pathStr}: ${issue.message}`;
|
|
236
|
-
});
|
|
237
|
-
const suffix = issues.length > 3 ? ` (+${issues.length - 3} more)` : "";
|
|
238
|
-
return shown.join("; ") + suffix;
|
|
239
|
-
}
|
|
240
|
-
function formatPath(path) {
|
|
241
|
-
if (!path || path.length === 0) return "root";
|
|
242
|
-
return path.map(
|
|
243
|
-
(segment) => typeof segment === "object" && segment !== null ? String(segment.key) : String(segment)
|
|
244
|
-
).join(".");
|
|
245
|
-
}
|
|
246
|
-
|
|
247
45
|
// src/capsule/plumbing/sealed-slots.ts
|
|
248
46
|
function makeSealedSlots(p, sealedSlot) {
|
|
249
47
|
const { decrypt, deriveSealedFieldKey, deriveSealedFieldKeyFromCek, encrypt } = p;
|
|
@@ -340,6 +138,51 @@ function makeSealedSlots(p, sealedSlot) {
|
|
|
340
138
|
return { sealFields, unsealOneField, makeHandleProducer, unsealFields, makeSealedSlotCapability, makeReservedEnvelopes };
|
|
341
139
|
}
|
|
342
140
|
|
|
141
|
+
// src/capsule/plumbing/normalize.ts
|
|
142
|
+
function normalizeForVerify(mode, value) {
|
|
143
|
+
const nfc = value.normalize("NFC");
|
|
144
|
+
if (mode === "password") return nfc;
|
|
145
|
+
return nfc.toLowerCase().normalize("NFC").trim().replace(/\s+/g, " ");
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/kernel/schema.ts
|
|
149
|
+
async function validateSchemaInput(schema, value, context) {
|
|
150
|
+
const result = await schema["~standard"].validate(value);
|
|
151
|
+
if (result.issues !== void 0 && result.issues.length > 0) {
|
|
152
|
+
throw new SchemaValidationError(
|
|
153
|
+
`Schema validation failed on ${context}: ${summarizeIssues(result.issues)}`,
|
|
154
|
+
result.issues,
|
|
155
|
+
"input"
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
return result.value;
|
|
159
|
+
}
|
|
160
|
+
async function validateSchemaOutput(schema, value, context) {
|
|
161
|
+
const result = await schema["~standard"].validate(value);
|
|
162
|
+
if (result.issues !== void 0 && result.issues.length > 0) {
|
|
163
|
+
throw new SchemaValidationError(
|
|
164
|
+
`Stored data for ${context} does not match the current schema \u2014 schema drift? ${summarizeIssues(result.issues)}`,
|
|
165
|
+
result.issues,
|
|
166
|
+
"output"
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
return result.value;
|
|
170
|
+
}
|
|
171
|
+
function summarizeIssues(issues) {
|
|
172
|
+
const shown = issues.slice(0, 3).map((issue) => {
|
|
173
|
+
const pathStr = formatPath(issue.path);
|
|
174
|
+
return `${pathStr}: ${issue.message}`;
|
|
175
|
+
});
|
|
176
|
+
const suffix = issues.length > 3 ? ` (+${issues.length - 3} more)` : "";
|
|
177
|
+
return shown.join("; ") + suffix;
|
|
178
|
+
}
|
|
179
|
+
function formatPath(path) {
|
|
180
|
+
if (!path || path.length === 0) return "root";
|
|
181
|
+
return path.map(
|
|
182
|
+
(segment) => typeof segment === "object" && segment !== null ? String(segment.key) : String(segment)
|
|
183
|
+
).join(".");
|
|
184
|
+
}
|
|
185
|
+
|
|
343
186
|
// src/capsule/plumbing/record-codec.ts
|
|
344
187
|
var RecordCodecBase = class _RecordCodecBase {
|
|
345
188
|
constructor(caps, ctx) {
|
|
@@ -1123,9 +966,9 @@ function makeRekeyBlob(p) {
|
|
|
1123
966
|
|
|
1124
967
|
// src/capsule/plumbing/sealing.ts
|
|
1125
968
|
function makeSealing(p, sealedSlot) {
|
|
1126
|
-
const { openVdigPayload, sealVdigPayload, bufferToBase64, decrypt, deriveSealedFieldKeyFromCek, encrypt, generateDEK, unwrapCek, wrapCek } = p;
|
|
969
|
+
const { openVdigPayload, sealVdigPayload, bufferToBase64: bufferToBase642, decrypt, deriveSealedFieldKeyFromCek, encrypt, generateDEK, unwrapCek, wrapCek } = p;
|
|
1127
970
|
const { dualReadSealedSlot } = sealedSlot;
|
|
1128
|
-
const
|
|
971
|
+
const subtle3 = globalThis.crypto.subtle;
|
|
1129
972
|
const SEALED_CEK_NS = "_sealed_cek";
|
|
1130
973
|
async function sealRecordToHost(ctx, collection, id, hostSealer, opts) {
|
|
1131
974
|
if (collection.includes("/")) throw new ValidationError(`sealRecordToHost: collection "${collection}" must not contain "/"`);
|
|
@@ -1139,8 +982,8 @@ function makeSealing(p, sealedSlot) {
|
|
|
1139
982
|
}
|
|
1140
983
|
const dek = await ctx.getDEK(collection);
|
|
1141
984
|
const cek = await unwrapCek(live._cek, dek);
|
|
1142
|
-
const rawCek = await
|
|
1143
|
-
const cekB64 =
|
|
985
|
+
const rawCek = await subtle3.exportKey("raw", cek);
|
|
986
|
+
const cekB64 = bufferToBase642(rawCek);
|
|
1144
987
|
const hint = await hostSealer.publishRecipientHint();
|
|
1145
988
|
if (hint.pid.includes("/")) throw new ValidationError(`sealRecordToHost: recipient pid "${hint.pid}" must not contain "/"`);
|
|
1146
989
|
const binding = {
|
|
@@ -1157,7 +1000,7 @@ function makeSealing(p, sealedSlot) {
|
|
|
1157
1000
|
v: 1,
|
|
1158
1001
|
_noydb_sealed_cek: 1,
|
|
1159
1002
|
pid: hint.pid,
|
|
1160
|
-
payload:
|
|
1003
|
+
payload: bufferToBase642(sealed),
|
|
1161
1004
|
expiresAt: opts.expiresAt
|
|
1162
1005
|
};
|
|
1163
1006
|
const envelopeKey = `${collection}/${id}/${hint.pid}`;
|
|
@@ -1325,7 +1168,17 @@ function makeCapsule(p) {
|
|
|
1325
1168
|
const envelopeBody = makeEnvelopeBody(p);
|
|
1326
1169
|
const sealedSlots = makeSealedSlots(p, sealedSlot);
|
|
1327
1170
|
const codec = makeRecordCodec(p, sealedSlots);
|
|
1171
|
+
const classify = {
|
|
1172
|
+
pbkdf2VerifyDigest: p.pbkdf2VerifyDigest,
|
|
1173
|
+
blindedEqual: p.blindedEqual,
|
|
1174
|
+
openVdigPayload: p.openVdigPayload,
|
|
1175
|
+
dualReadSealedSlot: sealedSlot.dualReadSealedSlot
|
|
1176
|
+
};
|
|
1328
1177
|
return {
|
|
1178
|
+
revealSealedField: (ctx, id, field) => import("./classify-reveal-YSJKJEIR.js").then((m) => m.revealSealedField(classify, ctx, id, field)),
|
|
1179
|
+
verifyDigestField: (ctx, id, field, candidate, policy) => import("./classify-verify-ZCTKYQ43.js").then((m) => m.verifyDigestField(classify, ctx, id, field, candidate, policy)),
|
|
1180
|
+
verifyTextField: (ctx, id, field, candidate, normalize) => import("./classify-verify-ZCTKYQ43.js").then((m) => m.verifyTextField(classify, ctx, id, field, candidate, normalize)),
|
|
1181
|
+
matchGroupFields: (ctx, id, answers, members, opts) => import("./classify-verify-ZCTKYQ43.js").then((m) => m.matchGroupFields(classify, ctx, id, answers, members, opts)),
|
|
1329
1182
|
...envelopeBody,
|
|
1330
1183
|
...sealedSlot,
|
|
1331
1184
|
...sealedSlots,
|
|
@@ -1338,6 +1191,161 @@ function makeCapsule(p) {
|
|
|
1338
1191
|
};
|
|
1339
1192
|
}
|
|
1340
1193
|
|
|
1194
|
+
// src/capsule/plumbing/digest.ts
|
|
1195
|
+
var subtle = globalThis.crypto.subtle;
|
|
1196
|
+
var KEY_BITS = 256;
|
|
1197
|
+
var SALT_BYTES = 32;
|
|
1198
|
+
var IV_BYTES = 12;
|
|
1199
|
+
var RECOVERY_SECRET_BYTES = 32;
|
|
1200
|
+
var PRESENCE_TAG_KEY_DOMAIN = "noydb.presence.tag.v1";
|
|
1201
|
+
var ECHO_KDF_CONTEXT = new Uint8Array([255, ...new TextEncoder().encode("noydb-echo-secret-v1")]);
|
|
1202
|
+
function encodeEchoParts(parts) {
|
|
1203
|
+
for (const name of ["prompt", "echo", "key"]) {
|
|
1204
|
+
if (typeof parts?.[name] !== "string") {
|
|
1205
|
+
throw new ValidationError("echo secret parts must be three strings: prompt, echo, key");
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
const enc = new TextEncoder();
|
|
1209
|
+
const segments = [parts.prompt, parts.echo, parts.key].map((p) => enc.encode(p));
|
|
1210
|
+
const total = ECHO_KDF_CONTEXT.length + segments.reduce((n, s) => n + 4 + s.length, 0);
|
|
1211
|
+
const out = new Uint8Array(total);
|
|
1212
|
+
out.set(ECHO_KDF_CONTEXT, 0);
|
|
1213
|
+
let offset = ECHO_KDF_CONTEXT.length;
|
|
1214
|
+
for (const s of segments) {
|
|
1215
|
+
new DataView(out.buffer).setUint32(offset, s.length, false);
|
|
1216
|
+
out.set(s, offset + 4);
|
|
1217
|
+
offset += 4 + s.length;
|
|
1218
|
+
}
|
|
1219
|
+
return out;
|
|
1220
|
+
}
|
|
1221
|
+
async function sha256Hex(data) {
|
|
1222
|
+
const hash = await subtle.digest("SHA-256", data);
|
|
1223
|
+
return Array.from(new Uint8Array(hash)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1224
|
+
}
|
|
1225
|
+
async function sha256Bytes(data) {
|
|
1226
|
+
return new Uint8Array(await subtle.digest("SHA-256", data));
|
|
1227
|
+
}
|
|
1228
|
+
async function deriveBlobAddressKey(root, tier) {
|
|
1229
|
+
const rawRoot = await subtle.exportKey("raw", root);
|
|
1230
|
+
const hkdfKey = await subtle.importKey("raw", rawRoot, "HKDF", false, ["deriveBits"]);
|
|
1231
|
+
const salt = new TextEncoder().encode("noydb-blob-address");
|
|
1232
|
+
const info = new TextEncoder().encode(`tier:${tier}`);
|
|
1233
|
+
const bits = await subtle.deriveBits({ name: "HKDF", hash: "SHA-256", salt, info }, hkdfKey, KEY_BITS);
|
|
1234
|
+
return subtle.importKey("raw", bits, { name: "AES-GCM" }, true, ["encrypt", "decrypt"]);
|
|
1235
|
+
}
|
|
1236
|
+
async function hmacSha256Hex(key, data) {
|
|
1237
|
+
const rawKey = await subtle.exportKey("raw", key);
|
|
1238
|
+
const hmacKey = await subtle.importKey(
|
|
1239
|
+
"raw",
|
|
1240
|
+
rawKey,
|
|
1241
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
1242
|
+
false,
|
|
1243
|
+
["sign"]
|
|
1244
|
+
);
|
|
1245
|
+
const sig = await subtle.sign("HMAC", hmacKey, data);
|
|
1246
|
+
return Array.from(new Uint8Array(sig)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1247
|
+
}
|
|
1248
|
+
async function derivePresenceKey(dek, collectionName) {
|
|
1249
|
+
const rawDek = await subtle.exportKey("raw", dek);
|
|
1250
|
+
const hkdfKey = await subtle.importKey(
|
|
1251
|
+
"raw",
|
|
1252
|
+
rawDek,
|
|
1253
|
+
"HKDF",
|
|
1254
|
+
false,
|
|
1255
|
+
["deriveBits"]
|
|
1256
|
+
);
|
|
1257
|
+
const salt = new TextEncoder().encode("noydb-presence");
|
|
1258
|
+
const info = new TextEncoder().encode(collectionName);
|
|
1259
|
+
const bits = await subtle.deriveBits(
|
|
1260
|
+
{ name: "HKDF", hash: "SHA-256", salt, info },
|
|
1261
|
+
hkdfKey,
|
|
1262
|
+
KEY_BITS
|
|
1263
|
+
);
|
|
1264
|
+
return subtle.importKey(
|
|
1265
|
+
"raw",
|
|
1266
|
+
bits,
|
|
1267
|
+
{ name: "AES-GCM", length: KEY_BITS },
|
|
1268
|
+
false,
|
|
1269
|
+
["encrypt", "decrypt"]
|
|
1270
|
+
);
|
|
1271
|
+
}
|
|
1272
|
+
async function derivePresenceTagKey(dek, collectionName) {
|
|
1273
|
+
const rawDek = await subtle.exportKey("raw", dek);
|
|
1274
|
+
const hkdfKey = await subtle.importKey("raw", rawDek, "HKDF", false, ["deriveBits"]);
|
|
1275
|
+
const salt = new TextEncoder().encode(PRESENCE_TAG_KEY_DOMAIN);
|
|
1276
|
+
const info = new TextEncoder().encode(collectionName);
|
|
1277
|
+
const bits = await subtle.deriveBits({ name: "HKDF", hash: "SHA-256", salt, info }, hkdfKey, KEY_BITS);
|
|
1278
|
+
return subtle.importKey("raw", bits, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
1279
|
+
}
|
|
1280
|
+
async function hmacSignHex(key, data) {
|
|
1281
|
+
const sig = await subtle.sign("HMAC", key, data);
|
|
1282
|
+
return Array.from(new Uint8Array(sig)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1283
|
+
}
|
|
1284
|
+
async function hkdfAesGcmKey(ikm, salt, info) {
|
|
1285
|
+
const key = await subtle.importKey("raw", ikm, "HKDF", false, ["deriveKey"]);
|
|
1286
|
+
return subtle.deriveKey(
|
|
1287
|
+
{ name: "HKDF", hash: "SHA-256", salt, info },
|
|
1288
|
+
key,
|
|
1289
|
+
{ name: "AES-GCM", length: KEY_BITS },
|
|
1290
|
+
false,
|
|
1291
|
+
["encrypt", "decrypt"]
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
function generateIV() {
|
|
1295
|
+
return globalThis.crypto.getRandomValues(new Uint8Array(IV_BYTES));
|
|
1296
|
+
}
|
|
1297
|
+
function generateSalt() {
|
|
1298
|
+
return globalThis.crypto.getRandomValues(new Uint8Array(SALT_BYTES));
|
|
1299
|
+
}
|
|
1300
|
+
function generateRecoverySecret() {
|
|
1301
|
+
return globalThis.crypto.getRandomValues(new Uint8Array(RECOVERY_SECRET_BYTES));
|
|
1302
|
+
}
|
|
1303
|
+
function bufferToBase64(buffer) {
|
|
1304
|
+
const bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
|
|
1305
|
+
let binary = "";
|
|
1306
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
1307
|
+
binary += String.fromCharCode(bytes[i]);
|
|
1308
|
+
}
|
|
1309
|
+
return btoa(binary);
|
|
1310
|
+
}
|
|
1311
|
+
function base64ToBuffer(base64) {
|
|
1312
|
+
const binary = atob(base64);
|
|
1313
|
+
const bytes = new Uint8Array(binary.length);
|
|
1314
|
+
for (let i = 0; i < binary.length; i++) {
|
|
1315
|
+
bytes[i] = binary.charCodeAt(i);
|
|
1316
|
+
}
|
|
1317
|
+
return bytes;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
// src/capsule/plumbing/sign.ts
|
|
1321
|
+
var ALG = "Ed25519";
|
|
1322
|
+
var subtle2 = globalThis.crypto.subtle;
|
|
1323
|
+
function toB64url(bytes) {
|
|
1324
|
+
return bufferToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
1325
|
+
}
|
|
1326
|
+
function fromB64url(s) {
|
|
1327
|
+
const pad = s.length % 4 === 0 ? "" : "=".repeat(4 - s.length % 4);
|
|
1328
|
+
return base64ToBuffer(s.replace(/-/g, "+").replace(/_/g, "/") + pad);
|
|
1329
|
+
}
|
|
1330
|
+
async function generateSigningKeyPair() {
|
|
1331
|
+
const kp = await subtle2.generateKey(ALG, true, ["sign", "verify"]);
|
|
1332
|
+
const rawPub = new Uint8Array(await subtle2.exportKey("raw", kp.publicKey));
|
|
1333
|
+
const pkcs8 = new Uint8Array(await subtle2.exportKey("pkcs8", kp.privateKey));
|
|
1334
|
+
return { publicKeyB64: toB64url(rawPub), privateKeyPkcs8B64: toB64url(pkcs8) };
|
|
1335
|
+
}
|
|
1336
|
+
async function signBytes(privateKeyPkcs8B64, message) {
|
|
1337
|
+
const key = await subtle2.importKey("pkcs8", fromB64url(privateKeyPkcs8B64), ALG, false, ["sign"]);
|
|
1338
|
+
return toB64url(new Uint8Array(await subtle2.sign(ALG, key, message)));
|
|
1339
|
+
}
|
|
1340
|
+
async function verifyBytes(publicKeyB64, sigB64url, message) {
|
|
1341
|
+
try {
|
|
1342
|
+
const key = await subtle2.importKey("raw", fromB64url(publicKeyB64), ALG, false, ["verify"]);
|
|
1343
|
+
return await subtle2.verify(ALG, key, fromB64url(sigB64url), message);
|
|
1344
|
+
} catch {
|
|
1345
|
+
return false;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1341
1349
|
// src/capsule/plumbing/ct-equal.ts
|
|
1342
1350
|
function ctEqualTags(a, b) {
|
|
1343
1351
|
if (a.length !== 32 || b.length !== 32) {
|
|
@@ -1350,26 +1358,104 @@ function ctEqualTags(a, b) {
|
|
|
1350
1358
|
return diff === 0;
|
|
1351
1359
|
}
|
|
1352
1360
|
|
|
1361
|
+
// src/capsule/plumbing/kofn.ts
|
|
1362
|
+
function evaluateKofN(results, min) {
|
|
1363
|
+
if (!Number.isInteger(min) || min < 1 || min > results.length) {
|
|
1364
|
+
throw new Error(
|
|
1365
|
+
`evaluateKofN: min ${min} out of range 1..${results.length} \u2014 caller bug (matchGroup validates bounds up front, before any PBKDF2)`
|
|
1366
|
+
);
|
|
1367
|
+
}
|
|
1368
|
+
let count = 0;
|
|
1369
|
+
for (const r of results) {
|
|
1370
|
+
if (r) count += 1;
|
|
1371
|
+
}
|
|
1372
|
+
return count >= min;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
// src/capsule/contract.ts
|
|
1376
|
+
var PRIMITIVE_GROUPS = {
|
|
1377
|
+
// ─── cipher: the capsule's actual encryption ────────────────────────
|
|
1378
|
+
encrypt: "cipher",
|
|
1379
|
+
decrypt: "cipher",
|
|
1380
|
+
encryptBytesWithAAD: "cipher",
|
|
1381
|
+
decryptBytesWithAAD: "cipher",
|
|
1382
|
+
generateDEK: "cipher",
|
|
1383
|
+
// ─── codec: encoding, identical for every capsule ───────────────────
|
|
1384
|
+
bufferToBase64: "codec",
|
|
1385
|
+
// ─── sealing: per-field key derivation ──────────────────────────────
|
|
1386
|
+
deriveSealedFieldKey: "sealing",
|
|
1387
|
+
deriveSealedFieldKeyFromCek: "sealing",
|
|
1388
|
+
// ─── deterministic: equality search needs a key ─────────────────────
|
|
1389
|
+
encryptDeterministic: "deterministic",
|
|
1390
|
+
deriveDeterministicKey: "deterministic",
|
|
1391
|
+
// ─── per-record keys: the CEK lifecycle ─────────────────────────────
|
|
1392
|
+
wrapCek: "per-record-keys",
|
|
1393
|
+
unwrapCek: "per-record-keys",
|
|
1394
|
+
// ─── classify: the verify/blind-index group ─────────────────────────
|
|
1395
|
+
mintVdigSlot: "classify",
|
|
1396
|
+
mintBidxTag: "classify",
|
|
1397
|
+
openVdigPayload: "classify",
|
|
1398
|
+
sealVdigPayload: "classify",
|
|
1399
|
+
pbkdf2VerifyDigest: "classify",
|
|
1400
|
+
blindedEqual: "classify"
|
|
1401
|
+
};
|
|
1402
|
+
var GROUPS_WITHOUT_PRIMITIVES = {
|
|
1403
|
+
authenticate: "posture group \u2014 asserted from the enclave-/exclave- package name, not from a primitive",
|
|
1404
|
+
seal: "posture group \u2014 asserted from the enclave-/exclave- package name, not from a primitive",
|
|
1405
|
+
digest: "plumbing \u2014 plumbing/digest.ts is shared verbatim; hashes are not secrets",
|
|
1406
|
+
sign: "plumbing \u2014 plumbing/sign.ts is shared verbatim"
|
|
1407
|
+
};
|
|
1408
|
+
var PRIMITIVES_NOT_ON_THE_DOOR = ["mintVdigSlot", "openVdigPayload", "sealVdigPayload"];
|
|
1409
|
+
function assertCapsuleSupports(caps, group, requirer) {
|
|
1410
|
+
if (!caps.has(group)) throw new CapsuleNotSupportedError(group, requirer);
|
|
1411
|
+
}
|
|
1412
|
+
var CapsuleNotSupportedError = class extends NoydbError {
|
|
1413
|
+
constructor(group, requirer) {
|
|
1414
|
+
super(
|
|
1415
|
+
"CAPSULE_NOT_SUPPORTED",
|
|
1416
|
+
`Capsule does not support the "${group}" group, which "${requirer}" requires. A capsule declares its groups at build time: "authenticate" and "seal" are the POSTURE groups an exclave refuses by design, and the shipped exclave also refuses "per-record-keys", "deterministic", "sealing" and "classify" \u2014 six in all, declaring only cipher/digest/sign/codec. Check capabilities(), and either drop what needs this group or bind a capsule that has it.`
|
|
1417
|
+
);
|
|
1418
|
+
this.group = group;
|
|
1419
|
+
this.requirer = requirer;
|
|
1420
|
+
this.name = "CapsuleNotSupportedError";
|
|
1421
|
+
}
|
|
1422
|
+
group;
|
|
1423
|
+
requirer;
|
|
1424
|
+
};
|
|
1425
|
+
var VDIG_ITERATIONS = 6e5;
|
|
1426
|
+
|
|
1353
1427
|
export {
|
|
1354
|
-
buildRecordAad,
|
|
1355
|
-
recordAadFor,
|
|
1356
|
-
requireSealedBody,
|
|
1357
|
-
sealedBodyArgs,
|
|
1358
|
-
envelopeBodySize,
|
|
1359
|
-
hasPerRecordKey,
|
|
1360
|
-
envelopeBodyForHash,
|
|
1361
|
-
hasSealedBody,
|
|
1362
1428
|
parseSealedSlot,
|
|
1363
|
-
|
|
1364
|
-
buildSealedRecordEnvelope,
|
|
1365
|
-
isTombstoneShape,
|
|
1366
|
-
isTombstone,
|
|
1367
|
-
buildTombstone,
|
|
1368
|
-
isDeleteMarker,
|
|
1369
|
-
buildDeleteMarker,
|
|
1429
|
+
normalizeForVerify,
|
|
1370
1430
|
validateSchemaInput,
|
|
1371
1431
|
validateSchemaOutput,
|
|
1432
|
+
KEY_BITS,
|
|
1433
|
+
IV_BYTES,
|
|
1434
|
+
encodeEchoParts,
|
|
1435
|
+
sha256Hex,
|
|
1436
|
+
sha256Bytes,
|
|
1437
|
+
deriveBlobAddressKey,
|
|
1438
|
+
hmacSha256Hex,
|
|
1439
|
+
derivePresenceKey,
|
|
1440
|
+
derivePresenceTagKey,
|
|
1441
|
+
hmacSignHex,
|
|
1442
|
+
hkdfAesGcmKey,
|
|
1443
|
+
generateIV,
|
|
1444
|
+
generateSalt,
|
|
1445
|
+
generateRecoverySecret,
|
|
1446
|
+
bufferToBase64,
|
|
1447
|
+
base64ToBuffer,
|
|
1448
|
+
evaluateKofN,
|
|
1372
1449
|
makeCapsule,
|
|
1373
|
-
|
|
1450
|
+
generateSigningKeyPair,
|
|
1451
|
+
signBytes,
|
|
1452
|
+
verifyBytes,
|
|
1453
|
+
ctEqualTags,
|
|
1454
|
+
PRIMITIVE_GROUPS,
|
|
1455
|
+
GROUPS_WITHOUT_PRIMITIVES,
|
|
1456
|
+
PRIMITIVES_NOT_ON_THE_DOOR,
|
|
1457
|
+
assertCapsuleSupports,
|
|
1458
|
+
CapsuleNotSupportedError,
|
|
1459
|
+
VDIG_ITERATIONS
|
|
1374
1460
|
};
|
|
1375
|
-
//# sourceMappingURL=chunk-
|
|
1461
|
+
//# sourceMappingURL=chunk-I4S7IZSS.js.map
|