@fedify/fedify 1.10.5 → 1.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{actor-CjkHF7Cj.cjs → actor-BGIAXtRd.cjs} +3112 -4674
- package/dist/{actor-Ch9BTg3N.js → actor-C-_2S5Mn.mjs} +8 -15
- package/dist/{actor-CQdxP8N-.js → actor-Cujbx4Zv.js} +1205 -2768
- package/dist/{actor-eeONG_sv.d.ts → actor-DXwwgFeR.d.ts} +3 -3
- package/dist/{actor-D190nbTD.d.cts → actor-DxvGbmjm.d.cts} +3 -3
- package/dist/{assert-MZs1qjMx.js → assert-DikXweDx.mjs} +5 -9
- package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Ew3jOFa3.mjs} +55 -69
- package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-C4Ri6VuN.mjs} +5 -9
- package/dist/{assert_is_error-BPGph1Jx.js → assert_is_error-C50x8tnw.mjs} +5 -9
- package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals--wG9hV7u.mjs} +6 -13
- package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-CJC9ThS-.mjs} +6 -11
- package/dist/{assert_throws-BOO88avQ.js → assert_throws-BIL7gChy.mjs} +6 -10
- package/dist/{authdocloader-fR-Fqcpa.js → authdocloader-1Sk2bqFx.mjs} +9 -14
- package/dist/{authdocloader-COFZT9Wh.js → authdocloader-D4Y6iyTF.js} +8 -15
- package/dist/{authdocloader-zc5ibOmU.cjs → authdocloader-DQfruCir.cjs} +14 -22
- package/dist/{builder-YD0q32nG.js → builder-CZbrDRl7.mjs} +31 -40
- package/dist/{client-B3mQJNO7.d.ts → client-D7t26_op.d.ts} +2 -2
- package/dist/{client-BgCucCG7.js → client-Dyb8MI3u.mjs} +11 -15
- package/dist/{client-n6L4GtQL.d.cts → client-yc0Z0P6Y.d.cts} +2 -2
- package/dist/{collection-CSzG2j1P.js → collection-BD6-SZ6O.mjs} +7 -12
- package/dist/compat/mod.cjs +5 -8
- package/dist/compat/mod.d.cts +78 -12
- package/dist/compat/mod.d.ts +78 -12
- package/dist/compat/mod.js +4 -8
- package/dist/compat/transformers.test.mjs +62 -0
- package/dist/{context-Cr5DIxq_.d.ts → context-C6n2yrj0.d.ts} +33 -26
- package/dist/{context-WJoO0SQs.d.cts → context-PfghnHYj.d.cts} +33 -26
- package/dist/{denokv-D0nfNQ1x.js → denokv-NJPMXyK0.mjs} +22 -11
- package/dist/{docloader-BucCRHZI.d.ts → docloader-D7k5A9JP.d.ts} +2 -7
- package/dist/{docloader-ChxNLZAA.d.cts → docloader-DbM94pGY.d.cts} +2 -7
- package/dist/{docloader-BETPdM09.js → docloader-Dtaju6oI.js} +18 -156
- package/dist/{docloader-irBWMSOZ.cjs → docloader-Q3DfzuUi.cjs} +116 -220
- package/dist/{esm-iGH0sRsE.js → esm-DOJg552-.mjs} +49 -85
- package/dist/federation/{builder.test.js → builder.test.mjs} +22 -41
- package/dist/federation/collection.test.d.mts +2 -0
- package/dist/federation/collection.test.mjs +21 -0
- package/dist/federation/handler.test.d.mts +2 -0
- package/dist/federation/{handler.test.js → handler.test.mjs} +29 -58
- package/dist/federation/idempotency.test.d.mts +2 -0
- package/dist/federation/{idempotency.test.js → idempotency.test.mjs} +29 -59
- package/dist/federation/inbox.test.d.mts +2 -0
- package/dist/federation/{inbox.test.js → inbox.test.mjs} +10 -15
- package/dist/federation/keycache.test.d.mts +2 -0
- package/dist/federation/{keycache.test.js → keycache.test.mjs} +13 -18
- package/dist/federation/kv.test.d.mts +2 -0
- package/dist/federation/{kv.test.js → kv.test.mjs} +12 -26
- package/dist/federation/middleware.test.d.mts +2 -0
- package/dist/federation/{middleware.test.js → middleware.test.mjs} +182 -197
- package/dist/federation/mod.cjs +245 -21
- package/dist/federation/mod.d.cts +4 -13
- package/dist/federation/mod.d.ts +4 -13
- package/dist/federation/mod.js +240 -18
- package/dist/federation/mq.test.d.mts +2 -0
- package/dist/federation/{mq.test.js → mq.test.mjs} +23 -38
- package/dist/federation/retry.test.d.mts +2 -0
- package/dist/federation/{retry.test.js → retry.test.mjs} +9 -14
- package/dist/federation/router.test.d.mts +2 -0
- package/dist/federation/{router.test.js → router.test.mjs} +12 -19
- package/dist/federation/send.test.d.mts +2 -0
- package/dist/federation/{send.test.js → send.test.mjs} +24 -34
- package/dist/{http-PgdBoDIj.js → http-BRwSVBn1.mjs} +16 -32
- package/dist/{http-DS9z_HzB.d.ts → http-BYXQvoZQ.d.ts} +5 -9
- package/dist/{http-C_1RU1U_.d.cts → http-CMzg-A9P.d.cts} +5 -9
- package/dist/{http-CQAqR_vx.cjs → http-DCrun8ql.cjs} +51 -68
- package/dist/{http-CxiIW4rD.js → http-DRnRwr3i.js} +17 -33
- package/dist/{inbox-DcDIqTbR.js → inbox-pD1nbb_5.mjs} +17 -25
- package/dist/key-Cmbps6xt.cjs +4 -0
- package/dist/{key-dNFkodH5.cjs → key-DEYIxAFs.cjs} +42 -50
- package/dist/key-DMO0TgTa.mjs +5 -0
- package/dist/{key-I-ibyaZH.js → key-DdL5Oc59.mjs} +12 -18
- package/dist/{key-Cg0kO4dA.js → key-vIzWPiil.js} +19 -19
- package/dist/{keycache-hSs_XFSb.js → keycache-BVR9f06Y.mjs} +6 -10
- package/dist/{keys-CElJez9H.js → keys-Co-0pK8a.mjs} +6 -10
- package/dist/{kv-DipCBaw2.d.ts → kv-C6UC8M9S.d.ts} +1 -1
- package/dist/{kv-BqEOXcZv.d.cts → kv-ClC9WJh5.d.cts} +1 -1
- package/dist/{kv-QzKcOQgP.js → kv-OuT2IU64.mjs} +6 -10
- package/dist/{ld-b16r91YS.js → ld-BFaDk5gX.mjs} +17 -31
- package/dist/{lookup-CySNcNcC.js → lookup-CMYXdjVH.mjs} +8 -17
- package/dist/{lookup-Bfq9Jpm0.cjs → lookup-CZGJqSjm.cjs} +16 -23
- package/dist/{lookup-CiSAeWJl.js → lookup-jlmCTRsO.js} +5 -11
- package/dist/middleware-BWlZ-wms.cjs +4 -0
- package/dist/{middleware-C5emnCh-.js → middleware-BXD5WJbj.mjs} +276 -321
- package/dist/{middleware-Dxo56yae.cjs → middleware-BhMQrJXH.cjs} +494 -547
- package/dist/{middleware-Bs4xDuXR.js → middleware-CmA2E9Bu.js} +349 -393
- package/dist/middleware-H3Ce7yn3.mjs +5 -0
- package/dist/{mod-D5rfgGFE.d.cts → mod-BQ3lrlXU.d.cts} +3 -3
- package/dist/{mod-Dz5Y15Uy.d.cts → mod-C72agZIN.d.cts} +4 -4
- package/dist/{mod-CxMBb_dd.d.cts → mod-CDbqB60V.d.cts} +2 -2
- package/dist/{mod-DS4kJskR.d.ts → mod-Lj0W1nnG.d.ts} +3 -3
- package/dist/{mod-BZfdiPBo.d.ts → mod-_HNKaczF.d.ts} +4 -4
- package/dist/{mod-ChbckRnC.d.ts → mod-lHd-Zdd_.d.ts} +2 -2
- package/dist/mod.cjs +31 -33
- package/dist/mod.d.cts +15 -17
- package/dist/mod.d.ts +15 -17
- package/dist/mod.js +20 -23
- package/dist/{mq-B7R1Q-M5.d.cts → mq-CrItclRD.d.cts} +1 -1
- package/dist/{mq-CRGm1e_F.d.ts → mq-D_ZZRdby.d.ts} +1 -1
- package/dist/nodeinfo/client.test.d.mts +2 -0
- package/dist/nodeinfo/{client.test.js → client.test.mjs} +23 -45
- package/dist/nodeinfo/handler.test.d.mts +2 -0
- package/dist/nodeinfo/{handler.test.js → handler.test.mjs} +14 -43
- package/dist/nodeinfo/mod.cjs +5 -9
- package/dist/nodeinfo/mod.d.cts +2 -5
- package/dist/nodeinfo/mod.d.ts +2 -5
- package/dist/nodeinfo/mod.js +4 -9
- package/dist/nodeinfo/semver.test.d.mts +2 -0
- package/dist/nodeinfo/{semver.test.js → semver.test.mjs} +28 -51
- package/dist/nodeinfo/types.test.d.mts +2 -0
- package/dist/nodeinfo/{types.test.js → types.test.mjs} +10 -21
- package/dist/otel/exporter.test.d.mts +2 -0
- package/dist/otel/{exporter.test.js → exporter.test.mjs} +122 -180
- package/dist/otel/mod.cjs +16 -22
- package/dist/otel/mod.d.cts +2 -2
- package/dist/otel/mod.d.ts +2 -2
- package/dist/otel/mod.js +9 -16
- package/dist/{otel-Chy5T2Xh.js → otel-0v4Zy01l.mjs} +5 -10
- package/dist/{owner-AcrG3Xz1.d.cts → owner-0yNTyGMb.d.cts} +4 -4
- package/dist/{owner-Bs-sPbHX.js → owner-CNdS8zxf.mjs} +11 -16
- package/dist/{owner-8NMhXwJd.d.ts → owner-CPEbNpnZ.d.ts} +4 -4
- package/dist/{proof-SgRikE_Y.js → proof-Co7YmDpv.mjs} +20 -32
- package/dist/{proof-flD2DeA-.js → proof-DHPbi_Mx.js} +34 -60
- package/dist/{proof-BvQS195q.cjs → proof-DcPdtve2.cjs} +115 -140
- package/dist/{retry-D4GJ670a.js → retry-Ddbq3AcK.mjs} +4 -7
- package/dist/rolldown-runtime-C7fyD9f2.js +15 -0
- package/dist/runtime/authdocloader.test.d.mts +2 -0
- package/dist/runtime/{authdocloader.test.js → authdocloader.test.mjs} +16 -28
- package/dist/runtime/docloader.test.d.mts +2 -0
- package/dist/runtime/{docloader.test.js → docloader.test.mjs} +55 -77
- package/dist/runtime/key.test.d.mts +2 -0
- package/dist/runtime/{key.test.js → key.test.mjs} +27 -57
- package/dist/runtime/langstr.test.d.mts +2 -0
- package/dist/runtime/{langstr.test.js → langstr.test.mjs} +9 -19
- package/dist/runtime/link.test.d.mts +2 -0
- package/dist/runtime/{link.test.js → link.test.mjs} +7 -11
- package/dist/runtime/mod.cjs +7 -13
- package/dist/runtime/mod.d.cts +103 -6
- package/dist/runtime/mod.d.ts +103 -6
- package/dist/runtime/mod.js +6 -13
- package/dist/runtime/multibase/multibase.test.d.mts +2 -0
- package/dist/runtime/multibase/{multibase.test.js → multibase.test.mjs} +16 -33
- package/dist/runtime/url.test.d.mts +2 -0
- package/dist/runtime/{url.test.js → url.test.mjs} +10 -15
- package/dist/{semver-dArNLkR9.js → semver-CgD82xxg.mjs} +13 -28
- package/dist/{send-C0gFHa2i.js → send-BRCWNcMa.mjs} +7 -12
- package/dist/sig/http.test.d.mts +2 -0
- package/dist/sig/{http.test.js → http.test.mjs} +119 -203
- package/dist/sig/key.test.d.mts +2 -0
- package/dist/sig/{key.test.js → key.test.mjs} +13 -22
- package/dist/sig/ld.test.d.mts +2 -0
- package/dist/sig/{ld.test.js → ld.test.mjs} +24 -39
- package/dist/sig/mod.cjs +7 -13
- package/dist/sig/mod.d.cts +3 -7
- package/dist/sig/mod.d.ts +3 -7
- package/dist/sig/mod.js +6 -13
- package/dist/sig/owner.test.d.mts +2 -0
- package/dist/sig/{owner.test.js → owner.test.mjs} +23 -39
- package/dist/sig/proof.test.d.mts +2 -0
- package/dist/sig/{proof.test.js → proof.test.mjs} +18 -31
- package/dist/{std__assert-X-_kMxKM.js → std__assert-2v7gYiZp.mjs} +13 -24
- package/dist/testing/docloader.test.d.mts +2 -0
- package/dist/testing/docloader.test.mjs +12 -0
- package/dist/testing/{mod.d.ts → mod.d.mts} +371 -541
- package/dist/testing/mod.mjs +5 -0
- package/dist/{testing-C1GIraJh.js → testing-BLIh1cXz.mjs} +27 -35
- package/dist/{transformers-BFT6d7J5.js → transformers-BV4OeK9o.js} +3 -7
- package/dist/{transformers-CoBS-oFG.cjs → transformers-CLtJ5H8o.cjs} +20 -25
- package/dist/{types-BgUCCngg.cjs → types-B34v-m2N.cjs} +45 -64
- package/dist/{types-BIgY6c-l.js → types-CAnkAQGM.mjs} +5 -9
- package/dist/{types-Bu-epI-z.js → types-CXZk86AG.js} +18 -36
- package/dist/vocab/actor.test.d.mts +2 -0
- package/dist/vocab/{actor.test.js → actor.test.mjs} +308 -550
- package/dist/vocab/cjs.test.d.mts +2 -0
- package/dist/vocab/cjs.test.mjs +14 -0
- package/dist/vocab/lookup.test.d.mts +2 -0
- package/dist/vocab/{lookup.test.js → lookup.test.mjs} +34 -51
- package/dist/vocab/mod.cjs +256 -16
- package/dist/vocab/mod.d.cts +3 -5
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +249 -10
- package/dist/vocab/type.test.d.mts +2 -0
- package/dist/vocab/type.test.mjs +16 -0
- package/dist/vocab/vocab.test.d.mts +2 -0
- package/dist/vocab/{vocab.test.js → vocab.test.mjs} +178 -311
- package/dist/{vocab-BASuuzcJ.d.ts → vocab-DaT4UsJF.d.ts} +2 -2
- package/dist/{vocab-DPMmFPJ1.d.cts → vocab-DnlmNyXi.d.cts} +2 -2
- package/dist/{type-DUhon7qK.js → vocab-rT_94Pke.mjs} +1178 -2876
- package/dist/webfinger/handler.test.d.mts +2 -0
- package/dist/webfinger/{handler.test.js → handler.test.mjs} +23 -56
- package/dist/webfinger/lookup.test.d.mts +2 -0
- package/dist/webfinger/{lookup.test.js → lookup.test.mjs} +13 -27
- package/dist/webfinger/mod.cjs +5 -9
- package/dist/webfinger/mod.d.cts +1 -3
- package/dist/webfinger/mod.d.ts +1 -3
- package/dist/webfinger/mod.js +4 -9
- package/dist/x/cfworkers.cjs +25 -14
- package/dist/x/cfworkers.d.cts +33 -6
- package/dist/x/cfworkers.d.ts +33 -6
- package/dist/x/cfworkers.js +22 -12
- package/dist/x/cfworkers.test.d.mts +2 -0
- package/dist/x/{cfworkers.test.js → cfworkers.test.mjs} +28 -26
- package/dist/x/hono.cjs +25 -14
- package/dist/x/hono.d.cts +1 -11
- package/dist/x/hono.d.ts +1 -11
- package/dist/x/hono.js +22 -12
- package/dist/x/sveltekit.cjs +23 -12
- package/dist/x/sveltekit.d.cts +1 -11
- package/dist/x/sveltekit.d.ts +1 -11
- package/dist/x/sveltekit.js +20 -10
- package/package.json +2 -2
- package/dist/chunk-DqRYRqnO.cjs +0 -34
- package/dist/compat/transformers.test.d.ts +0 -3
- package/dist/compat/transformers.test.js +0 -86
- package/dist/compat-DmDDELst.cjs +0 -4
- package/dist/compat-nxUqe4Z-.js +0 -4
- package/dist/federation/builder.test.d.ts +0 -3
- package/dist/federation/collection.test.d.ts +0 -3
- package/dist/federation/collection.test.js +0 -35
- package/dist/federation/handler.test.d.ts +0 -3
- package/dist/federation/idempotency.test.d.ts +0 -3
- package/dist/federation/inbox.test.d.ts +0 -3
- package/dist/federation/keycache.test.d.ts +0 -3
- package/dist/federation/kv.test.d.ts +0 -3
- package/dist/federation/middleware.test.d.ts +0 -3
- package/dist/federation/mq.test.d.ts +0 -3
- package/dist/federation/retry.test.d.ts +0 -3
- package/dist/federation/router.test.d.ts +0 -3
- package/dist/federation/send.test.d.ts +0 -3
- package/dist/federation-C15gGOh1.cjs +0 -266
- package/dist/federation-K-xsO03l.js +0 -248
- package/dist/key-Bnod5wJl.js +0 -10
- package/dist/key-C6swTX71.js +0 -10
- package/dist/key-_Uq8gkmM.cjs +0 -10
- package/dist/middleware-BWsOtDIF.cjs +0 -17
- package/dist/middleware-Bm4bJzjg.js +0 -26
- package/dist/middleware-BvODpE_U.js +0 -17
- package/dist/mod-C2tOeRkN.d.cts +0 -1
- package/dist/mod-CD7gfdq3.d.ts +0 -104
- package/dist/mod-CnULG6Aa.d.ts +0 -82
- package/dist/mod-FZd39qVq.d.cts +0 -1
- package/dist/mod-JUhOKMHj.d.cts +0 -102
- package/dist/mod-OQfb33eH.d.cts +0 -80
- package/dist/nodeinfo/client.test.d.ts +0 -3
- package/dist/nodeinfo/handler.test.d.ts +0 -3
- package/dist/nodeinfo/semver.test.d.ts +0 -3
- package/dist/nodeinfo/types.test.d.ts +0 -3
- package/dist/nodeinfo-Co9lJrWl.cjs +0 -4
- package/dist/nodeinfo-DfycQ8Wf.js +0 -4
- package/dist/otel/exporter.test.d.ts +0 -3
- package/dist/runtime/authdocloader.test.d.ts +0 -3
- package/dist/runtime/docloader.test.d.ts +0 -3
- package/dist/runtime/key.test.d.ts +0 -3
- package/dist/runtime/langstr.test.d.ts +0 -3
- package/dist/runtime/link.test.d.ts +0 -3
- package/dist/runtime/multibase/multibase.test.d.ts +0 -3
- package/dist/runtime/url.test.d.ts +0 -3
- package/dist/runtime-C58AJWSv.cjs +0 -4
- package/dist/runtime-DPYEDf-o.js +0 -4
- package/dist/sig/http.test.d.ts +0 -3
- package/dist/sig/key.test.d.ts +0 -3
- package/dist/sig/ld.test.d.ts +0 -3
- package/dist/sig/owner.test.d.ts +0 -3
- package/dist/sig/proof.test.d.ts +0 -3
- package/dist/sig-ByHXzqUi.cjs +0 -4
- package/dist/sig-Cj3tk-ig.js +0 -4
- package/dist/testing/docloader.test.d.ts +0 -3
- package/dist/testing/docloader.test.js +0 -24
- package/dist/testing/mod.js +0 -10
- package/dist/vocab/actor.test.d.ts +0 -3
- package/dist/vocab/lookup.test.d.ts +0 -3
- package/dist/vocab/type.test.d.ts +0 -3
- package/dist/vocab/type.test.js +0 -25
- package/dist/vocab/vocab.test.d.ts +0 -3
- package/dist/vocab-5i6DEIi6.cjs +0 -294
- package/dist/vocab-CBavAdew.js +0 -258
- package/dist/webfinger/handler.test.d.ts +0 -3
- package/dist/webfinger/lookup.test.d.ts +0 -3
- package/dist/webfinger-BjOEdFPs.cjs +0 -4
- package/dist/webfinger-De_bU0iE.js +0 -4
- package/dist/x/cfworkers.test.d.ts +0 -3
- /package/dist/{mod-1pDWKvUL.d.ts → compat/transformers.test.d.mts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → federation/builder.test.d.mts} +0 -0
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, validateCryptoKey } from "../key-Cg0kO4dA.js";
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-C1GIraJh.js";
|
|
14
|
-
import "../std__assert-X-_kMxKM.js";
|
|
15
|
-
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
16
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
17
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
18
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
19
|
-
import { ed25519Multikey, rsaPrivateKey2, rsaPublicKey1, rsaPublicKey2, rsaPublicKey3 } from "../keys-CElJez9H.js";
|
|
20
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { g as Multikey, s as CryptographicKey } from "../vocab-rT_94Pke.mjs";
|
|
5
|
+
import { a as mockDocumentLoader, t as test } from "../testing-BLIh1cXz.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
8
|
+
import { t as assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
|
|
9
|
+
import { t as assertThrows } from "../assert_throws-BIL7gChy.mjs";
|
|
10
|
+
import { a as validateCryptoKey, i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "../key-DdL5Oc59.mjs";
|
|
11
|
+
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-Co-0pK8a.mjs";
|
|
21
12
|
//#region src/sig/key.test.ts
|
|
22
13
|
test("validateCryptoKey()", async () => {
|
|
23
14
|
const pkcs1v15 = await crypto.subtle.generateKey({
|
|
@@ -245,5 +236,5 @@ test("fetchKey()", async () => {
|
|
|
245
236
|
cached: false
|
|
246
237
|
});
|
|
247
238
|
});
|
|
248
|
-
|
|
249
|
-
|
|
239
|
+
//#endregion
|
|
240
|
+
export {};
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { mockDocumentLoader, test } from "../testing-C1GIraJh.js";
|
|
14
|
-
import { assertFalse, assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
15
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
16
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
|
17
|
-
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-CElJez9H.js";
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { s as CryptographicKey } from "../vocab-rT_94Pke.mjs";
|
|
5
|
+
import { a as mockDocumentLoader, t as test } from "../testing-BLIh1cXz.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
+
import { n as assertFalse, t as assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
|
|
8
|
+
import { t as assertThrows } from "../assert_throws-BIL7gChy.mjs";
|
|
9
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
10
|
+
import { r as generateCryptoKeyPair } from "../key-DdL5Oc59.mjs";
|
|
11
|
+
import { a as signJsonLd, n as createSignature, o as verifyJsonLd, r as detachSignature, s as verifySignature, t as attachSignature } from "../ld-BFaDk5gX.mjs";
|
|
12
|
+
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-Co-0pK8a.mjs";
|
|
18
13
|
import { encodeBase64 } from "byte-encodings/base64";
|
|
19
|
-
|
|
20
14
|
//#region src/sig/ld.test.ts
|
|
21
15
|
test("attachSignature()", () => {
|
|
22
16
|
const sig = {
|
|
@@ -43,28 +37,23 @@ test("createSignature()", async () => {
|
|
|
43
37
|
id: "https://example.com/1",
|
|
44
38
|
type: "Create"
|
|
45
39
|
};
|
|
46
|
-
|
|
47
|
-
const key = await verifySignature(attachSignature(doc, sig), {
|
|
40
|
+
assertEquals(await verifySignature(attachSignature(doc, await createSignature(doc, rsaPrivateKey2, rsaPublicKey2.id, { contextLoader: mockDocumentLoader })), {
|
|
48
41
|
documentLoader: mockDocumentLoader,
|
|
49
42
|
contextLoader: mockDocumentLoader
|
|
50
|
-
});
|
|
51
|
-
assertEquals(key, rsaPublicKey2);
|
|
43
|
+
}), rsaPublicKey2);
|
|
52
44
|
assertRejects(() => createSignature(doc, rsaPublicKey2.publicKey, rsaPublicKey2.id, { contextLoader: mockDocumentLoader }), TypeError);
|
|
53
45
|
assertRejects(() => createSignature(doc, ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader }), TypeError);
|
|
54
46
|
});
|
|
55
47
|
test("signJsonLd()", async () => {
|
|
56
|
-
|
|
48
|
+
assert(await verifyJsonLd(await signJsonLd({
|
|
57
49
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
58
50
|
id: "https://example.com/1",
|
|
59
51
|
type: "Create",
|
|
60
52
|
actor: "https://example.com/person2"
|
|
61
|
-
}
|
|
62
|
-
const signed = await signJsonLd(doc, rsaPrivateKey3, rsaPublicKey3.id, { contextLoader: mockDocumentLoader });
|
|
63
|
-
const verified = await verifyJsonLd(signed, {
|
|
53
|
+
}, rsaPrivateKey3, rsaPublicKey3.id, { contextLoader: mockDocumentLoader }), {
|
|
64
54
|
documentLoader: mockDocumentLoader,
|
|
65
55
|
contextLoader: mockDocumentLoader
|
|
66
|
-
});
|
|
67
|
-
assert(verified);
|
|
56
|
+
}));
|
|
68
57
|
});
|
|
69
58
|
const document = {
|
|
70
59
|
"@context": ["https://www.w3.org/ns/activitystreams", {
|
|
@@ -204,23 +193,19 @@ test("verifySignature()", async () => {
|
|
|
204
193
|
assertEquals(key4, key);
|
|
205
194
|
});
|
|
206
195
|
test("verifyJsonLd()", async () => {
|
|
207
|
-
|
|
196
|
+
assert(await verifyJsonLd(testVector, {
|
|
208
197
|
documentLoader: mockDocumentLoader,
|
|
209
198
|
contextLoader: mockDocumentLoader
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
const doc = {
|
|
199
|
+
}));
|
|
200
|
+
assertFalse(await verifyJsonLd(await signJsonLd({
|
|
213
201
|
"@context": "https://www.w3.org/ns/activitystreams",
|
|
214
202
|
id: "https://example.com/1",
|
|
215
203
|
type: "Create",
|
|
216
204
|
actor: "https://example.com/person2"
|
|
217
|
-
}
|
|
218
|
-
const signed = await signJsonLd(doc, rsaPrivateKey2, rsaPublicKey2.id, { contextLoader: mockDocumentLoader });
|
|
219
|
-
const verified2 = await verifyJsonLd(signed, {
|
|
205
|
+
}, rsaPrivateKey2, rsaPublicKey2.id, { contextLoader: mockDocumentLoader }), {
|
|
220
206
|
documentLoader: mockDocumentLoader,
|
|
221
207
|
contextLoader: mockDocumentLoader
|
|
222
|
-
});
|
|
223
|
-
assertFalse(verified2);
|
|
208
|
+
}));
|
|
224
209
|
});
|
|
225
|
-
|
|
226
|
-
|
|
210
|
+
//#endregion
|
|
211
|
+
export {};
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require(
|
|
6
|
-
require(
|
|
7
|
-
require('../lookup-Bfq9Jpm0.cjs');
|
|
8
|
-
const require_key = require('../key-dNFkodH5.cjs');
|
|
9
|
-
const require_http = require('../http-CQAqR_vx.cjs');
|
|
10
|
-
const require_proof = require('../proof-BvQS195q.cjs');
|
|
11
|
-
require('../sig-ByHXzqUi.cjs');
|
|
12
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_key = require("../key-DEYIxAFs.cjs");
|
|
5
|
+
const require_http = require("../http-DCrun8ql.cjs");
|
|
6
|
+
const require_proof = require("../proof-DcPdtve2.cjs");
|
|
13
7
|
exports.attachSignature = require_proof.attachSignature;
|
|
14
8
|
exports.createProof = require_proof.createProof;
|
|
15
9
|
exports.createSignature = require_proof.createSignature;
|
|
@@ -27,4 +21,4 @@ exports.verifyJsonLd = require_proof.verifyJsonLd;
|
|
|
27
21
|
exports.verifyObject = require_proof.verifyObject;
|
|
28
22
|
exports.verifyProof = require_proof.verifyProof;
|
|
29
23
|
exports.verifyRequest = require_http.verifyRequest;
|
|
30
|
-
exports.verifySignature = require_proof.verifySignature;
|
|
24
|
+
exports.verifySignature = require_proof.verifySignature;
|
package/dist/sig/mod.d.cts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../
|
|
3
|
-
import "../
|
|
4
|
-
import "../actor-D190nbTD.cjs";
|
|
5
|
-
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-C_1RU1U_.cjs";
|
|
6
|
-
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-AcrG3Xz1.cjs";
|
|
7
|
-
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-Dz5Y15Uy.cjs";
|
|
1
|
+
import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "../http-CMzg-A9P.cjs";
|
|
2
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-0yNTyGMb.cjs";
|
|
3
|
+
import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "../mod-C72agZIN.cjs";
|
|
8
4
|
export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/mod.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
import "../actor-eeONG_sv.js";
|
|
7
|
-
import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "../http-DS9z_HzB.js";
|
|
8
|
-
import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "../owner-8NMhXwJd.js";
|
|
9
|
-
import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../mod-BZfdiPBo.js";
|
|
3
|
+
import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "../http-BYXQvoZQ.js";
|
|
4
|
+
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-CPEbNpnZ.js";
|
|
5
|
+
import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "../mod-_HNKaczF.js";
|
|
10
6
|
export { CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyOptions, FetchKeyResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/mod.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "../
|
|
6
|
-
|
|
7
|
-
import "../lookup-CiSAeWJl.js";
|
|
8
|
-
import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk } from "../key-I-ibyaZH.js";
|
|
9
|
-
import { signRequest, verifyRequest } from "../http-PgdBoDIj.js";
|
|
10
|
-
import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "../proof-flD2DeA-.js";
|
|
11
|
-
import "../sig-Cj3tk-ig.js";
|
|
12
|
-
|
|
13
|
-
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
import { i as importJwk, n as fetchKey, r as generateCryptoKeyPair, t as exportJwk } from "../key-vIzWPiil.js";
|
|
4
|
+
import { n as signRequest, r as verifyRequest } from "../http-DRnRwr3i.js";
|
|
5
|
+
import { a as doesActorOwnKey, c as createSignature, d as signJsonLd, f as verifyJsonLd, i as verifyProof, l as detachSignature, n as signObject, o as getKeyOwner, p as verifySignature, r as verifyObject, s as attachSignature, t as createProof } from "../proof-DHPbi_Mx.js";
|
|
6
|
+
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import { assertEquals } from "../assert_equals-
|
|
8
|
-
import
|
|
9
|
-
import "../
|
|
10
|
-
import {
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import {
|
|
14
|
-
import { mockDocumentLoader, test } from "../testing-C1GIraJh.js";
|
|
15
|
-
import "../std__assert-X-_kMxKM.js";
|
|
16
|
-
import { assertFalse } from "../assert_rejects-DiIiJbZn.js";
|
|
17
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
18
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
19
|
-
import "../assert_throws-BOO88avQ.js";
|
|
20
|
-
import { rsaPublicKey1, rsaPublicKey2 } from "../keys-CElJez9H.js";
|
|
21
|
-
import { createTestTracerProvider } from "../otel-Chy5T2Xh.js";
|
|
22
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { o as Create, s as CryptographicKey } from "../vocab-rT_94Pke.mjs";
|
|
5
|
+
import { t as lookupObject } from "../lookup-CMYXdjVH.mjs";
|
|
6
|
+
import { a as mockDocumentLoader, t as test } from "../testing-BLIh1cXz.mjs";
|
|
7
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
8
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
9
|
+
import { n as assertFalse } from "../assert_rejects-CJC9ThS-.mjs";
|
|
10
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
11
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CNdS8zxf.mjs";
|
|
12
|
+
import { t as createTestTracerProvider } from "../otel-0v4Zy01l.mjs";
|
|
13
|
+
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-Co-0pK8a.mjs";
|
|
23
14
|
//#region src/sig/owner.test.ts
|
|
24
15
|
test("doesActorOwnKey()", async () => {
|
|
25
16
|
const options = {
|
|
@@ -38,32 +29,25 @@ test("getKeyOwner()", async () => {
|
|
|
38
29
|
documentLoader: mockDocumentLoader,
|
|
39
30
|
contextLoader: mockDocumentLoader
|
|
40
31
|
};
|
|
41
|
-
|
|
42
|
-
assertEquals(owner, await lookupObject("https://example.com/users/handle", options));
|
|
32
|
+
assertEquals(await getKeyOwner(new URL("https://example.com/users/handle#main-key"), options), await lookupObject("https://example.com/users/handle", options));
|
|
43
33
|
const owner2 = await getKeyOwner(new URL("https://example.com/key"), options);
|
|
44
34
|
assertEquals(owner2, await lookupObject("https://example.com/person", options));
|
|
45
|
-
|
|
46
|
-
assertEquals(
|
|
47
|
-
|
|
48
|
-
assertEquals(noOwner, null);
|
|
49
|
-
const noOwner2 = await getKeyOwner(new URL("https://example.com/object"), options);
|
|
50
|
-
assertEquals(noOwner2, null);
|
|
35
|
+
assertEquals(await getKeyOwner(rsaPublicKey1, options), owner2);
|
|
36
|
+
assertEquals(await getKeyOwner(new URL("https://example.com/key2"), options), null);
|
|
37
|
+
assertEquals(await getKeyOwner(new URL("https://example.com/object"), options), null);
|
|
51
38
|
});
|
|
52
39
|
test("doesActorOwnKey() records OpenTelemetry span", async () => {
|
|
53
40
|
const [tracerProvider, exporter] = createTestTracerProvider();
|
|
54
|
-
|
|
41
|
+
assert(await doesActorOwnKey(new Create({
|
|
55
42
|
id: new URL("https://example.com/activity"),
|
|
56
43
|
actor: new URL("https://example.com/person")
|
|
57
|
-
})
|
|
58
|
-
const key = new CryptographicKey({
|
|
44
|
+
}), new CryptographicKey({
|
|
59
45
|
id: new URL("https://example.com/person#key"),
|
|
60
46
|
owner: new URL("https://example.com/person")
|
|
61
|
-
})
|
|
62
|
-
const result = await doesActorOwnKey(activity, key, {
|
|
47
|
+
}), {
|
|
63
48
|
documentLoader: mockDocumentLoader,
|
|
64
49
|
tracerProvider
|
|
65
|
-
});
|
|
66
|
-
assert(result);
|
|
50
|
+
}));
|
|
67
51
|
const spans = exporter.getSpans("activitypub.verify_key_ownership");
|
|
68
52
|
assertEquals(spans.length, 1);
|
|
69
53
|
const span = spans[0];
|
|
@@ -72,5 +56,5 @@ test("doesActorOwnKey() records OpenTelemetry span", async () => {
|
|
|
72
56
|
assertEquals(span.attributes["activitypub.key_ownership.verified"], true);
|
|
73
57
|
assertEquals(span.attributes["activitypub.key_ownership.method"], "owner_id");
|
|
74
58
|
});
|
|
75
|
-
|
|
76
|
-
|
|
59
|
+
//#endregion
|
|
60
|
+
export {};
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "../
|
|
9
|
-
import { assertInstanceOf } from "../assert_instance_of-
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import "../key-Cg0kO4dA.js";
|
|
13
|
-
import { createProof, signObject, verifyObject, verifyProof } from "../proof-SgRikE_Y.js";
|
|
14
|
-
import { mockDocumentLoader, test } from "../testing-C1GIraJh.js";
|
|
15
|
-
import "../std__assert-X-_kMxKM.js";
|
|
16
|
-
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
17
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
18
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
19
|
-
import "../assert_throws-BOO88avQ.js";
|
|
20
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-CElJez9H.js";
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { L as decode, N as importMultibaseKey, _ as Note, c as DataIntegrityProof, g as Multikey, o as Create, w as Place } from "../vocab-rT_94Pke.mjs";
|
|
5
|
+
import { a as mockDocumentLoader, t as test } from "../testing-BLIh1cXz.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
8
|
+
import { t as assertRejects } from "../assert_rejects-CJC9ThS-.mjs";
|
|
9
|
+
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
10
|
+
import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-Co7YmDpv.mjs";
|
|
11
|
+
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-Co-0pK8a.mjs";
|
|
21
12
|
import { decodeHex, encodeHex } from "byte-encodings/hex";
|
|
22
|
-
|
|
23
13
|
//#region src/sig/proof.test.ts
|
|
24
14
|
const fep8b32TestVectorPrivateKey = await crypto.subtle.importKey("jwk", {
|
|
25
15
|
"kty": "OKP",
|
|
@@ -119,11 +109,10 @@ test("signObject()", async () => {
|
|
|
119
109
|
created: "2023-02-24T23:36:38Z"
|
|
120
110
|
}
|
|
121
111
|
});
|
|
122
|
-
|
|
112
|
+
assertEquals(await (await signObject(signedObject, ed25519PrivateKey, ed25519Multikey.id, {
|
|
123
113
|
...options,
|
|
124
114
|
created
|
|
125
|
-
})
|
|
126
|
-
assertEquals(await signedObject2.toJsonLd(options), {
|
|
115
|
+
})).toJsonLd(options), {
|
|
127
116
|
"@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
|
|
128
117
|
id: "https://server.example/activities/1",
|
|
129
118
|
type: "Create",
|
|
@@ -211,16 +200,14 @@ test("verifyProof()", async () => {
|
|
|
211
200
|
cache["https://server.example/users/alice#ed25519-key"] = ed25519Multikey;
|
|
212
201
|
assertEquals(await verifyProof(jsonLd, proof, options), expectedKey);
|
|
213
202
|
assertEquals(cache["https://server.example/users/alice#ed25519-key"], expectedKey);
|
|
214
|
-
|
|
203
|
+
assertEquals(await verifyProof({
|
|
215
204
|
...jsonLd,
|
|
216
205
|
object: {
|
|
217
206
|
...jsonLd.object,
|
|
218
207
|
content: "bye"
|
|
219
208
|
}
|
|
220
|
-
};
|
|
221
|
-
assertEquals(await verifyProof(
|
|
222
|
-
const wrongProof = proof.clone({ created: Temporal.Now.instant() });
|
|
223
|
-
assertEquals(await verifyProof(jsonLd, wrongProof, options), null);
|
|
209
|
+
}, proof, options), null);
|
|
210
|
+
assertEquals(await verifyProof(jsonLd, proof.clone({ created: Temporal.Now.instant() }), options), null);
|
|
224
211
|
});
|
|
225
212
|
test("verifyObject()", async () => {
|
|
226
213
|
const options = {
|
|
@@ -265,5 +252,5 @@ test("verifyObject()", async () => {
|
|
|
265
252
|
assertInstanceOf(note, Note);
|
|
266
253
|
assertEquals(note.content, "Hello world");
|
|
267
254
|
});
|
|
268
|
-
|
|
269
|
-
|
|
255
|
+
//#endregion
|
|
256
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { a as red, i as buildMessage, l as AssertionError, n as diffStr, r as diff, s as format } from "./assert_equals-Ew3jOFa3.mjs";
|
|
5
|
+
import "./assert_rejects-CJC9ThS-.mjs";
|
|
6
|
+
import "./assert_is_error-C50x8tnw.mjs";
|
|
7
|
+
import "./assert_throws-BIL7gChy.mjs";
|
|
8
8
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js
|
|
9
9
|
/**
|
|
10
10
|
* Make an assertion that actual is not null or undefined.
|
|
@@ -23,12 +23,10 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
23
23
|
* @param msg The optional message to include in the error if the assertion fails.
|
|
24
24
|
*/ function assertExists(actual, msg) {
|
|
25
25
|
if (actual === void 0 || actual === null) {
|
|
26
|
-
|
|
27
|
-
msg = `Expected actual: "${actual}" to not be null or undefined${msgSuffix}`;
|
|
26
|
+
msg = `Expected actual: "${actual}" to not be null or undefined${msg ? `: ${msg}` : "."}`;
|
|
28
27
|
throw new AssertionError(msg);
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
|
|
32
30
|
//#endregion
|
|
33
31
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater_or_equal.js
|
|
34
32
|
/**
|
|
@@ -54,7 +52,6 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
54
52
|
const expectedString = format(expected);
|
|
55
53
|
throw new AssertionError(msg ?? `Expect ${actualString} >= ${expectedString}`);
|
|
56
54
|
}
|
|
57
|
-
|
|
58
55
|
//#endregion
|
|
59
56
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater.js
|
|
60
57
|
/**
|
|
@@ -80,7 +77,6 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
80
77
|
const expectedString = format(expected);
|
|
81
78
|
throw new AssertionError(msg ?? `Expect ${actualString} > ${expectedString}`);
|
|
82
79
|
}
|
|
83
|
-
|
|
84
80
|
//#endregion
|
|
85
81
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_strict_equals.js
|
|
86
82
|
/**
|
|
@@ -110,18 +106,13 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
110
106
|
let message;
|
|
111
107
|
const actualString = format(actual);
|
|
112
108
|
const expectedString = format(expected);
|
|
113
|
-
if (actualString === expectedString) {
|
|
114
|
-
|
|
115
|
-
message = `Values have the same structure but are not reference-equal${msgSuffix}\n\n${red(withOffset)}\n`;
|
|
116
|
-
} else {
|
|
109
|
+
if (actualString === expectedString) message = `Values have the same structure but are not reference-equal${msgSuffix}\n\n${red(actualString.split("\n").map((l) => ` ${l}`).join("\n"))}\n`;
|
|
110
|
+
else {
|
|
117
111
|
const stringDiff = typeof actual === "string" && typeof expected === "string";
|
|
118
|
-
|
|
119
|
-
const diffMsg = buildMessage(diffResult, { stringDiff }).join("\n");
|
|
120
|
-
message = `Values are not strictly equal${msgSuffix}\n${diffMsg}`;
|
|
112
|
+
message = `Values are not strictly equal${msgSuffix}\n${buildMessage(stringDiff ? diffStr(actual, expected) : diff(actualString.split("\n"), expectedString.split("\n")), { stringDiff }).join("\n")}`;
|
|
121
113
|
}
|
|
122
114
|
throw new AssertionError(message);
|
|
123
115
|
}
|
|
124
|
-
|
|
125
116
|
//#endregion
|
|
126
117
|
//#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_string_includes.js
|
|
127
118
|
/**
|
|
@@ -141,11 +132,9 @@ import { AssertionError, buildMessage, diff, diffStr, format, red } from "./asse
|
|
|
141
132
|
* @param msg The optional message to display if the assertion fails.
|
|
142
133
|
*/ function assertStringIncludes(actual, expected, msg) {
|
|
143
134
|
if (!actual.includes(expected)) {
|
|
144
|
-
|
|
145
|
-
msg = `Expected actual: "${actual}" to contain: "${expected}"${msgSuffix}`;
|
|
135
|
+
msg = `Expected actual: "${actual}" to contain: "${expected}"${msg ? `: ${msg}` : "."}`;
|
|
146
136
|
throw new AssertionError(msg);
|
|
147
137
|
}
|
|
148
138
|
}
|
|
149
|
-
|
|
150
139
|
//#endregion
|
|
151
|
-
export { assertExists
|
|
140
|
+
export { assertExists as a, assertGreaterOrEqual as i, assertStrictEquals as n, assertGreater as r, assertStringIncludes as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { a as mockDocumentLoader, t as test } from "../testing-BLIh1cXz.mjs";
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
+
import "../std__assert-2v7gYiZp.mjs";
|
|
7
|
+
//#region src/testing/docloader.test.ts
|
|
8
|
+
test("mockDocumentLoader()", async () => {
|
|
9
|
+
assertEquals(await (await mockDocumentLoader("https://example.com/test")).document, { "https://example.com/prop/test": { "@value": "foo" } });
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export {};
|