@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,20 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const json_canon = require_chunk.__toESM(require("json-canon"));
|
|
15
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
const require_docloader = require("./docloader-Q3DfzuUi.cjs");
|
|
4
|
+
const require_actor = require("./actor-BGIAXtRd.cjs");
|
|
5
|
+
const require_key = require("./key-DEYIxAFs.cjs");
|
|
6
|
+
let _logtape_logtape = require("@logtape/logtape");
|
|
7
|
+
let _opentelemetry_api = require("@opentelemetry/api");
|
|
8
|
+
let jsonld = require("jsonld");
|
|
9
|
+
jsonld = require_docloader.__toESM(jsonld);
|
|
10
|
+
let byte_encodings_base64 = require("byte-encodings/base64");
|
|
11
|
+
let byte_encodings_hex = require("byte-encodings/hex");
|
|
12
|
+
let json_canon = require("json-canon");
|
|
13
|
+
json_canon = require_docloader.__toESM(json_canon);
|
|
16
14
|
//#region src/sig/ld.ts
|
|
17
|
-
const logger$1 = (0,
|
|
15
|
+
const logger$1 = (0, _logtape_logtape.getLogger)([
|
|
18
16
|
"fedify",
|
|
19
17
|
"sig",
|
|
20
18
|
"ld"
|
|
@@ -54,11 +52,8 @@ async function createSignature(jsonLd, privateKey, keyId, { contextLoader, creat
|
|
|
54
52
|
creator: keyId.href,
|
|
55
53
|
created: created?.toString() ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
56
54
|
};
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const message = optionsHash + docHash;
|
|
60
|
-
const encoder = new TextEncoder();
|
|
61
|
-
const messageBytes = encoder.encode(message);
|
|
55
|
+
const message = await hashJsonLd(options, contextLoader) + await hashJsonLd(jsonLd, contextLoader);
|
|
56
|
+
const messageBytes = new TextEncoder().encode(message);
|
|
62
57
|
const signature = await crypto.subtle.sign("RSASSA-PKCS1-v1_5", privateKey, messageBytes);
|
|
63
58
|
return {
|
|
64
59
|
...options,
|
|
@@ -80,9 +75,7 @@ async function createSignature(jsonLd, privateKey, keyId, { contextLoader, creat
|
|
|
80
75
|
* @since 1.0.0
|
|
81
76
|
*/
|
|
82
77
|
async function signJsonLd(jsonLd, privateKey, keyId, options) {
|
|
83
|
-
|
|
84
|
-
const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
|
|
85
|
-
return await tracer.startActiveSpan("ld_signatures.sign", { attributes: { "ld_signatures.key_id": keyId.href } }, async (span) => {
|
|
78
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_docloader.name, require_docloader.version).startActiveSpan("ld_signatures.sign", { attributes: { "ld_signatures.key_id": keyId.href } }, async (span) => {
|
|
86
79
|
try {
|
|
87
80
|
const signature = await createSignature(jsonLd, privateKey, keyId, options);
|
|
88
81
|
if (span.isRecording()) {
|
|
@@ -92,7 +85,7 @@ async function signJsonLd(jsonLd, privateKey, keyId, options) {
|
|
|
92
85
|
return attachSignature(jsonLd, signature);
|
|
93
86
|
} catch (error) {
|
|
94
87
|
span.setStatus({
|
|
95
|
-
code:
|
|
88
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
96
89
|
message: String(error)
|
|
97
90
|
});
|
|
98
91
|
throw error;
|
|
@@ -184,23 +177,21 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
184
177
|
const encoder = new TextEncoder();
|
|
185
178
|
const message = sigOptsHash + docHash;
|
|
186
179
|
const messageBytes = encoder.encode(message);
|
|
187
|
-
|
|
188
|
-
if (verified) return key;
|
|
180
|
+
if (await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, signature.slice(), messageBytes)) return key;
|
|
189
181
|
if (cached) {
|
|
190
182
|
logger$1.debug("Failed to verify with the cached key {keyId}; signature {signatureValue} is invalid. Retrying with the freshly fetched key...", {
|
|
191
183
|
keyId: sig.creator,
|
|
192
184
|
...sig
|
|
193
185
|
});
|
|
194
|
-
const { key
|
|
186
|
+
const { key } = await require_key.fetchKey(new URL(sig.creator), require_actor.CryptographicKey, {
|
|
195
187
|
...options,
|
|
196
188
|
keyCache: {
|
|
197
189
|
get: () => Promise.resolve(void 0),
|
|
198
|
-
set: async (keyId, key
|
|
190
|
+
set: async (keyId, key) => await options.keyCache?.set(keyId, key)
|
|
199
191
|
}
|
|
200
192
|
});
|
|
201
|
-
if (key
|
|
202
|
-
|
|
203
|
-
return verified$1 ? key$1 : null;
|
|
193
|
+
if (key == null) return null;
|
|
194
|
+
return await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, signature.slice(), messageBytes) ? key : null;
|
|
204
195
|
}
|
|
205
196
|
logger$1.debug("Failed to verify with the fetched key {keyId}; signature {signatureValue} is invalid. Check if the key is correct or if the signed message is correct. The message to sign is:\n{message}", {
|
|
206
197
|
keyId: sig.creator,
|
|
@@ -219,9 +210,7 @@ async function verifySignature(jsonLd, options = {}) {
|
|
|
219
210
|
* @returns `true` if the document is authentic; `false` otherwise.
|
|
220
211
|
*/
|
|
221
212
|
async function verifyJsonLd(jsonLd, options = {}) {
|
|
222
|
-
|
|
223
|
-
const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
|
|
224
|
-
return await tracer.startActiveSpan("ld_signatures.verify", async (span) => {
|
|
213
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_docloader.name, require_docloader.version).startActiveSpan("ld_signatures.verify", async (span) => {
|
|
225
214
|
try {
|
|
226
215
|
const object = await require_actor.Object.fromJsonLd(jsonLd, options);
|
|
227
216
|
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
@@ -247,7 +236,7 @@ async function verifyJsonLd(jsonLd, options = {}) {
|
|
|
247
236
|
return true;
|
|
248
237
|
} catch (error) {
|
|
249
238
|
span.setStatus({
|
|
250
|
-
code:
|
|
239
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
251
240
|
message: String(error)
|
|
252
241
|
});
|
|
253
242
|
throw error;
|
|
@@ -262,10 +251,8 @@ async function hashJsonLd(jsonLd, contextLoader) {
|
|
|
262
251
|
documentLoader: contextLoader ?? require_docloader.getDocumentLoader()
|
|
263
252
|
});
|
|
264
253
|
const encoder = new TextEncoder();
|
|
265
|
-
|
|
266
|
-
return (0, byte_encodings_hex.encodeHex)(hash);
|
|
254
|
+
return (0, byte_encodings_hex.encodeHex)(await crypto.subtle.digest("SHA-256", encoder.encode(canon)));
|
|
267
255
|
}
|
|
268
|
-
|
|
269
256
|
//#endregion
|
|
270
257
|
//#region src/sig/owner.ts
|
|
271
258
|
/**
|
|
@@ -276,10 +263,8 @@ async function hashJsonLd(jsonLd, contextLoader) {
|
|
|
276
263
|
* @returns Whether the actor is the owner of the key.
|
|
277
264
|
*/
|
|
278
265
|
async function doesActorOwnKey(activity, key, options) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return await tracer.startActiveSpan("activitypub.verify_key_ownership", {
|
|
282
|
-
kind: __opentelemetry_api.SpanKind.INTERNAL,
|
|
266
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_docloader.name, require_docloader.version).startActiveSpan("activitypub.verify_key_ownership", {
|
|
267
|
+
kind: _opentelemetry_api.SpanKind.INTERNAL,
|
|
283
268
|
attributes: {
|
|
284
269
|
"activitypub.actor.id": activity.actorId?.href ?? "",
|
|
285
270
|
"activitypub.key.id": key.id?.href ?? ""
|
|
@@ -309,7 +294,7 @@ async function doesActorOwnKey(activity, key, options) {
|
|
|
309
294
|
} catch (error) {
|
|
310
295
|
span.recordException(error);
|
|
311
296
|
span.setStatus({
|
|
312
|
-
code:
|
|
297
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
313
298
|
message: String(error)
|
|
314
299
|
});
|
|
315
300
|
throw error;
|
|
@@ -329,7 +314,7 @@ async function doesActorOwnKey(activity, key, options) {
|
|
|
329
314
|
* @since 0.7.0
|
|
330
315
|
*/
|
|
331
316
|
async function getKeyOwner(keyId, options) {
|
|
332
|
-
const tracerProvider = options.tracerProvider ??
|
|
317
|
+
const tracerProvider = options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider();
|
|
333
318
|
const documentLoader = options.documentLoader ?? require_docloader.getDocumentLoader();
|
|
334
319
|
const contextLoader = options.contextLoader ?? require_docloader.getDocumentLoader();
|
|
335
320
|
let object;
|
|
@@ -359,9 +344,9 @@ async function getKeyOwner(keyId, options) {
|
|
|
359
344
|
contextLoader,
|
|
360
345
|
tracerProvider
|
|
361
346
|
});
|
|
362
|
-
} catch (e
|
|
363
|
-
if (e
|
|
364
|
-
throw e
|
|
347
|
+
} catch (e) {
|
|
348
|
+
if (e instanceof TypeError) return null;
|
|
349
|
+
throw e;
|
|
365
350
|
}
|
|
366
351
|
}
|
|
367
352
|
}
|
|
@@ -379,10 +364,9 @@ async function getKeyOwner(keyId, options) {
|
|
|
379
364
|
for (const kid of owner.publicKeyIds) if (kid.href === keyId.href) return owner;
|
|
380
365
|
return null;
|
|
381
366
|
}
|
|
382
|
-
|
|
383
367
|
//#endregion
|
|
384
368
|
//#region src/sig/proof.ts
|
|
385
|
-
const logger = (0,
|
|
369
|
+
const logger = (0, _logtape_logtape.getLogger)([
|
|
386
370
|
"fedify",
|
|
387
371
|
"sig",
|
|
388
372
|
"proof"
|
|
@@ -400,8 +384,7 @@ const logger = (0, __logtape_logtape.getLogger)([
|
|
|
400
384
|
async function createProof(object, privateKey, keyId, { contextLoader, context, created } = {}) {
|
|
401
385
|
require_key.validateCryptoKey(privateKey, "private");
|
|
402
386
|
if (privateKey.algorithm.name !== "Ed25519") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
|
|
403
|
-
const
|
|
404
|
-
const compactMsg = await objectWithoutProofs.toJsonLd({
|
|
387
|
+
const compactMsg = await object.clone({ proofs: [] }).toJsonLd({
|
|
405
388
|
format: "compact",
|
|
406
389
|
contextLoader,
|
|
407
390
|
context
|
|
@@ -411,15 +394,14 @@ async function createProof(object, privateKey, keyId, { contextLoader, context,
|
|
|
411
394
|
const msgBytes = encoder.encode(msgCanon);
|
|
412
395
|
const msgDigest = await crypto.subtle.digest("SHA-256", msgBytes);
|
|
413
396
|
created ??= Temporal.Now.instant();
|
|
414
|
-
const
|
|
397
|
+
const proofCanon = (0, json_canon.default)({
|
|
415
398
|
"@context": compactMsg["@context"],
|
|
416
399
|
type: "DataIntegrityProof",
|
|
417
400
|
cryptosuite: "eddsa-jcs-2022",
|
|
418
401
|
verificationMethod: keyId.href,
|
|
419
402
|
proofPurpose: "assertionMethod",
|
|
420
403
|
created: created.toString()
|
|
421
|
-
};
|
|
422
|
-
const proofCanon = (0, json_canon.default)(proofConfig);
|
|
404
|
+
});
|
|
423
405
|
const proofBytes = encoder.encode(proofCanon);
|
|
424
406
|
const proofDigest = await crypto.subtle.digest("SHA-256", proofBytes);
|
|
425
407
|
const digest = new Uint8Array(proofDigest.byteLength + msgDigest.byteLength);
|
|
@@ -445,13 +427,11 @@ async function createProof(object, privateKey, keyId, { contextLoader, context,
|
|
|
445
427
|
* @since 0.10.0
|
|
446
428
|
*/
|
|
447
429
|
async function signObject(object, privateKey, keyId, options = {}) {
|
|
448
|
-
|
|
449
|
-
const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
|
|
450
|
-
return await tracer.startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": require_actor.getTypeId(object).href } }, async (span) => {
|
|
430
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_docloader.name, require_docloader.version).startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": require_actor.getTypeId(object).href } }, async (span) => {
|
|
451
431
|
try {
|
|
452
432
|
if (object.id != null) span.setAttribute("activitypub.object.id", object.id.href);
|
|
453
433
|
const existingProofs = [];
|
|
454
|
-
for await (const proof
|
|
434
|
+
for await (const proof of object.getProofs(options)) existingProofs.push(proof);
|
|
455
435
|
const proof = await createProof(object, privateKey, keyId, options);
|
|
456
436
|
if (span.isRecording()) {
|
|
457
437
|
if (proof.cryptosuite != null) span.setAttribute("object_integrity_proofs.cryptosuite", proof.cryptosuite);
|
|
@@ -461,7 +441,7 @@ async function signObject(object, privateKey, keyId, options = {}) {
|
|
|
461
441
|
return object.clone({ proofs: [...existingProofs, proof] });
|
|
462
442
|
} catch (error) {
|
|
463
443
|
span.setStatus({
|
|
464
|
-
code:
|
|
444
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
465
445
|
message: String(error)
|
|
466
446
|
});
|
|
467
447
|
throw error;
|
|
@@ -481,9 +461,7 @@ async function signObject(object, privateKey, keyId, options = {}) {
|
|
|
481
461
|
* @since 0.10.0
|
|
482
462
|
*/
|
|
483
463
|
async function verifyProof(jsonLd, proof, options = {}) {
|
|
484
|
-
|
|
485
|
-
const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
|
|
486
|
-
return await tracer.startActiveSpan("object_integrity_proofs.verify", async (span) => {
|
|
464
|
+
return await (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_docloader.name, require_docloader.version).startActiveSpan("object_integrity_proofs.verify", async (span) => {
|
|
487
465
|
if (span.isRecording()) {
|
|
488
466
|
if (proof.cryptosuite != null) span.setAttribute("object_integrity_proofs.cryptosuite", proof.cryptosuite);
|
|
489
467
|
if (proof.verificationMethodId != null) span.setAttribute("object_integrity_proofs.key_id", proof.verificationMethodId.href);
|
|
@@ -491,11 +469,11 @@ async function verifyProof(jsonLd, proof, options = {}) {
|
|
|
491
469
|
}
|
|
492
470
|
try {
|
|
493
471
|
const key = await verifyProofInternal(jsonLd, proof, options);
|
|
494
|
-
if (key == null) span.setStatus({ code:
|
|
472
|
+
if (key == null) span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
|
|
495
473
|
return key;
|
|
496
474
|
} catch (error) {
|
|
497
475
|
span.setStatus({
|
|
498
|
-
code:
|
|
476
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
499
477
|
message: String(error)
|
|
500
478
|
});
|
|
501
479
|
throw error;
|
|
@@ -507,15 +485,14 @@ async function verifyProof(jsonLd, proof, options = {}) {
|
|
|
507
485
|
async function verifyProofInternal(jsonLd, proof, options) {
|
|
508
486
|
if (typeof jsonLd !== "object" || proof.cryptosuite !== "eddsa-jcs-2022" || proof.verificationMethodId == null || proof.proofPurpose !== "assertionMethod" || proof.proofValue == null || proof.created == null) return null;
|
|
509
487
|
const publicKeyPromise = require_key.fetchKey(proof.verificationMethodId, require_actor.Multikey, options);
|
|
510
|
-
const
|
|
488
|
+
const proofCanon = (0, json_canon.default)({
|
|
511
489
|
"@context": jsonLd["@context"],
|
|
512
490
|
type: "DataIntegrityProof",
|
|
513
491
|
cryptosuite: proof.cryptosuite,
|
|
514
492
|
verificationMethod: proof.verificationMethodId.href,
|
|
515
493
|
proofPurpose: proof.proofPurpose,
|
|
516
494
|
created: proof.created.toString()
|
|
517
|
-
};
|
|
518
|
-
const proofCanon = (0, json_canon.default)(proofConfig);
|
|
495
|
+
});
|
|
519
496
|
const encoder = new TextEncoder();
|
|
520
497
|
const proofBytes = encoder.encode(proofCanon);
|
|
521
498
|
const proofDigest = await crypto.subtle.digest("SHA-256", proofBytes);
|
|
@@ -566,8 +543,7 @@ async function verifyProofInternal(jsonLd, proof, options) {
|
|
|
566
543
|
});
|
|
567
544
|
return null;
|
|
568
545
|
}
|
|
569
|
-
|
|
570
|
-
if (!verified) {
|
|
546
|
+
if (!await crypto.subtle.verify("Ed25519", publicKey.publicKey, proof.proofValue.slice(), digest)) {
|
|
571
547
|
if (fetchedKey.cached) {
|
|
572
548
|
logger.debug("Failed to verify the proof with the cached key {keyId}; retrying with the freshly fetched key...", {
|
|
573
549
|
keyId: proof.verificationMethodId.href,
|
|
@@ -604,7 +580,7 @@ async function verifyProofInternal(jsonLd, proof, options) {
|
|
|
604
580
|
* @since 0.10.0
|
|
605
581
|
*/
|
|
606
582
|
async function verifyObject(cls, jsonLd, options = {}) {
|
|
607
|
-
const logger
|
|
583
|
+
const logger = (0, _logtape_logtape.getLogger)([
|
|
608
584
|
"fedify",
|
|
609
585
|
"sig",
|
|
610
586
|
"proof"
|
|
@@ -616,94 +592,93 @@ async function verifyObject(cls, jsonLd, options = {}) {
|
|
|
616
592
|
const key = await verifyProof(jsonLd, proof, options);
|
|
617
593
|
if (key === null) return null;
|
|
618
594
|
if (key.controllerId == null) {
|
|
619
|
-
logger
|
|
595
|
+
logger.debug("Key {keyId} does not have a controller.", { keyId: key.id?.href });
|
|
620
596
|
continue;
|
|
621
597
|
}
|
|
622
598
|
attributions.delete(key.controllerId.href);
|
|
623
599
|
}
|
|
624
600
|
if (attributions.size > 0) {
|
|
625
|
-
logger
|
|
601
|
+
logger.debug("Some attributions are not authenticated by the proofs: {attributions}.", { attributions: [...attributions] });
|
|
626
602
|
return null;
|
|
627
603
|
}
|
|
628
604
|
return object;
|
|
629
605
|
}
|
|
630
|
-
|
|
631
606
|
//#endregion
|
|
632
|
-
Object.defineProperty(exports,
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
607
|
+
Object.defineProperty(exports, "attachSignature", {
|
|
608
|
+
enumerable: true,
|
|
609
|
+
get: function() {
|
|
610
|
+
return attachSignature;
|
|
611
|
+
}
|
|
637
612
|
});
|
|
638
|
-
Object.defineProperty(exports,
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
613
|
+
Object.defineProperty(exports, "createProof", {
|
|
614
|
+
enumerable: true,
|
|
615
|
+
get: function() {
|
|
616
|
+
return createProof;
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
Object.defineProperty(exports, "createSignature", {
|
|
620
|
+
enumerable: true,
|
|
621
|
+
get: function() {
|
|
622
|
+
return createSignature;
|
|
623
|
+
}
|
|
643
624
|
});
|
|
644
|
-
Object.defineProperty(exports,
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
625
|
+
Object.defineProperty(exports, "detachSignature", {
|
|
626
|
+
enumerable: true,
|
|
627
|
+
get: function() {
|
|
628
|
+
return detachSignature;
|
|
629
|
+
}
|
|
649
630
|
});
|
|
650
|
-
Object.defineProperty(exports,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
631
|
+
Object.defineProperty(exports, "doesActorOwnKey", {
|
|
632
|
+
enumerable: true,
|
|
633
|
+
get: function() {
|
|
634
|
+
return doesActorOwnKey;
|
|
635
|
+
}
|
|
655
636
|
});
|
|
656
|
-
Object.defineProperty(exports,
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
637
|
+
Object.defineProperty(exports, "getKeyOwner", {
|
|
638
|
+
enumerable: true,
|
|
639
|
+
get: function() {
|
|
640
|
+
return getKeyOwner;
|
|
641
|
+
}
|
|
661
642
|
});
|
|
662
|
-
Object.defineProperty(exports,
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
643
|
+
Object.defineProperty(exports, "hasSignature", {
|
|
644
|
+
enumerable: true,
|
|
645
|
+
get: function() {
|
|
646
|
+
return hasSignature;
|
|
647
|
+
}
|
|
667
648
|
});
|
|
668
|
-
Object.defineProperty(exports,
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
649
|
+
Object.defineProperty(exports, "signJsonLd", {
|
|
650
|
+
enumerable: true,
|
|
651
|
+
get: function() {
|
|
652
|
+
return signJsonLd;
|
|
653
|
+
}
|
|
673
654
|
});
|
|
674
|
-
Object.defineProperty(exports,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
655
|
+
Object.defineProperty(exports, "signObject", {
|
|
656
|
+
enumerable: true,
|
|
657
|
+
get: function() {
|
|
658
|
+
return signObject;
|
|
659
|
+
}
|
|
679
660
|
});
|
|
680
|
-
Object.defineProperty(exports,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
661
|
+
Object.defineProperty(exports, "verifyJsonLd", {
|
|
662
|
+
enumerable: true,
|
|
663
|
+
get: function() {
|
|
664
|
+
return verifyJsonLd;
|
|
665
|
+
}
|
|
685
666
|
});
|
|
686
|
-
Object.defineProperty(exports,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
667
|
+
Object.defineProperty(exports, "verifyObject", {
|
|
668
|
+
enumerable: true,
|
|
669
|
+
get: function() {
|
|
670
|
+
return verifyObject;
|
|
671
|
+
}
|
|
691
672
|
});
|
|
692
|
-
Object.defineProperty(exports,
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
673
|
+
Object.defineProperty(exports, "verifyProof", {
|
|
674
|
+
enumerable: true,
|
|
675
|
+
get: function() {
|
|
676
|
+
return verifyProof;
|
|
677
|
+
}
|
|
697
678
|
});
|
|
698
|
-
Object.defineProperty(exports,
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
679
|
+
Object.defineProperty(exports, "verifySignature", {
|
|
680
|
+
enumerable: true,
|
|
681
|
+
get: function() {
|
|
682
|
+
return verifySignature;
|
|
683
|
+
}
|
|
703
684
|
});
|
|
704
|
-
Object.defineProperty(exports, 'verifySignature', {
|
|
705
|
-
enumerable: true,
|
|
706
|
-
get: function () {
|
|
707
|
-
return verifySignature;
|
|
708
|
-
}
|
|
709
|
-
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
6
4
|
//#region src/federation/retry.ts
|
|
7
5
|
/**
|
|
8
6
|
* Creates an exponential backoff retry policy. The delay between retries
|
|
@@ -32,6 +30,5 @@ function createExponentialBackoffPolicy(options = {}) {
|
|
|
32
30
|
return Temporal.Duration.compare(delay, maxDelay) > 0 ? maxDelay : delay;
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
|
-
|
|
36
33
|
//#endregion
|
|
37
|
-
export { createExponentialBackoffPolicy };
|
|
34
|
+
export { createExponentialBackoffPolicy as t };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __exportAll = (all, no_symbols) => {
|
|
6
|
+
let target = {};
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
11
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
12
|
+
return target;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { __exportAll as t };
|
|
@@ -1,26 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import { verifyRequest } from "../http-CxiIW4rD.js";
|
|
14
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-COFZT9Wh.js";
|
|
15
|
-
import { mockDocumentLoader, test } from "../testing-C1GIraJh.js";
|
|
16
|
-
import "../std__assert-X-_kMxKM.js";
|
|
17
|
-
import { assertRejects } from "../assert_rejects-DiIiJbZn.js";
|
|
18
|
-
import "../assert_is_error-BPGph1Jx.js";
|
|
19
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
20
|
-
import "../assert_throws-BOO88avQ.js";
|
|
21
|
-
import { rsaPrivateKey2 } from "../keys-CElJez9H.js";
|
|
22
|
-
import { esm_default } from "../esm-iGH0sRsE.js";
|
|
23
|
-
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { $ as UrlError } 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 { l as verifyRequest } from "../http-BRwSVBn1.mjs";
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../authdocloader-1Sk2bqFx.mjs";
|
|
11
|
+
import { t as esm_default } from "../esm-DOJg552-.mjs";
|
|
12
|
+
import { i as rsaPrivateKey2 } from "../keys-Co-0pK8a.mjs";
|
|
24
13
|
//#region src/runtime/authdocloader.test.ts
|
|
25
14
|
test("getAuthenticatedDocumentLoader()", async (t) => {
|
|
26
15
|
esm_default.spyGlobal();
|
|
@@ -33,11 +22,10 @@ test("getAuthenticatedDocumentLoader()", async (t) => {
|
|
|
33
22
|
return new Response(JSON.stringify(v != null), { headers: { "Content-Type": "application/json" } });
|
|
34
23
|
});
|
|
35
24
|
await t.step("test", async () => {
|
|
36
|
-
|
|
25
|
+
assertEquals(await (await getAuthenticatedDocumentLoader({
|
|
37
26
|
keyId: new URL("https://example.com/key2"),
|
|
38
27
|
privateKey: rsaPrivateKey2
|
|
39
|
-
})
|
|
40
|
-
assertEquals(await loader("https://example.com/object"), {
|
|
28
|
+
}))("https://example.com/object"), {
|
|
41
29
|
contextUrl: null,
|
|
42
30
|
documentUrl: "https://example.com/object",
|
|
43
31
|
document: true
|
|
@@ -99,5 +87,5 @@ test("getAuthenticatedDocumentLoader() cancellation", {
|
|
|
99
87
|
});
|
|
100
88
|
esm_default.hardReset();
|
|
101
89
|
});
|
|
102
|
-
|
|
103
|
-
|
|
90
|
+
//#endregion
|
|
91
|
+
export {};
|