@fedify/fedify 1.6.1-dev.877 → 1.6.1-dev.881
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-DuRbv_Bj.js → actor-BRIxlOTx.js} +3 -3
- package/dist/{actor-BHqS2e3c.js → actor-BidJp8n0.js} +180 -180
- package/dist/{actor-f67C7yQD.d.ts → actor-tT_B0pDn.d.ts} +5 -8
- package/dist/{assert-Dv75vaGI.js → assert-YJk-1DlZ.js} +1 -1
- package/dist/{assert_equals-ClvzlhZu.js → assert_equals-Dnj7ejjL.js} +16 -9
- package/dist/{assert_instance_of--9UCVKsi.js → assert_instance_of-DBIoG5k7.js} +1 -1
- package/dist/{assert_is_error-D162gXcM.js → assert_is_error-jyzqjHud.js} +1 -1
- package/dist/{assert_not_equals-Cyf5m9Ke.js → assert_not_equals-wx-SRs4i.js} +1 -1
- package/dist/{assert_rejects-FOHCtlD2.js → assert_rejects-BZjUwo62.js} +2 -2
- package/dist/{assert_throws-CRfQJvVx.js → assert_throws-gBPv3v2V.js} +2 -2
- package/dist/{authdocloader-BeFl0PFE.js → authdocloader-BRs7flug.js} +4 -4
- package/dist/{authdocloader-Bl6g1FVm.js → authdocloader-CG3GTtW2.js} +3 -3
- package/dist/{builder-DY8xBedN.js → builder-DtoRVfyu.js} +3 -3
- package/dist/{client-DcBIDSv0.js → client-CQ24CTCb.js} +1 -1
- package/dist/{client-Dw1pCSIt.d.ts → client-Cd552pKL.d.ts} +6 -9
- package/dist/{collection-QaGK9TVn.js → collection-Dfb0TPno.js} +1 -1
- package/dist/compat/mod.d.ts +12 -12
- package/dist/compat/mod.js +1 -1
- package/dist/compat/transformers.test.js +21 -21
- package/dist/{context-DBM4y1xF.d.ts → context-DRhhOsMk.d.ts} +12 -28
- package/dist/{context-BDE1HkwS.js → context-Dub61h2m.js} +2 -2
- package/dist/{docloader-YfB_ekLA.js → docloader-BzbamfL0.js} +1 -1
- package/dist/{docloader-D8aaMXMS.js → docloader-CjMOaZ0w.js} +1 -1
- package/dist/{docloader-DTRsVZPo.d.ts → docloader-DlUDOVSe.d.ts} +4 -7
- package/dist/{esm-BxIKwi-M.js → esm-Btx3E8og.js} +1 -1
- package/dist/federation/builder.test.js +12 -12
- package/dist/federation/collection.test.js +9 -9
- package/dist/federation/handler.test.js +28 -28
- package/dist/federation/inbox.test.js +6 -6
- package/dist/federation/keycache.test.js +6 -6
- package/dist/federation/kv.test.js +8 -8
- package/dist/federation/middleware.test.js +28 -28
- package/dist/federation/mod.d.ts +11 -11
- package/dist/federation/mod.js +12 -12
- package/dist/federation/mq.test.js +9 -9
- package/dist/federation/retry.test.js +2 -2
- package/dist/federation/router.test.js +9 -9
- package/dist/federation/send.test.js +18 -18
- package/dist/{federation-Bmj7soSg.js → federation-3B6BDKCK.js} +1 -1
- package/dist/{hongminhee__deno-mock-fetch-DJKLj_H-.js → hongminhee__deno-mock-fetch-Az7fJGtg.js} +1 -1
- package/dist/{http-B0cOjwNh.js → http-B3Xedrzu.js} +12 -6
- package/dist/{http-CZyKN-rt.d.ts → http-BkUCISGt.d.ts} +6 -14
- package/dist/{http-Df-q_v_l.js → http-CV67UidJ.js} +12 -6
- package/dist/{inbox-CTtTAWQW.js → inbox-BoldQCGa.js} +4 -4
- package/dist/{key-yakqWjMR.js → key-D3Mc3n0F.js} +3 -3
- package/dist/{key-lg7Bamqg.js → key-DD4k9Ph4.js} +4 -4
- package/dist/{key-D66XeFWU.js → key-Dt894e0l.js} +2 -2
- package/dist/{key-CcDIn1xI.js → key-zqk3iQJM.js} +5 -5
- package/dist/{keycache-BNazIgsa.js → keycache-DXp-3NZn.js} +2 -2
- package/dist/{keys-sBaDMsit.js → keys-j3LZyq_M.js} +1 -1
- package/dist/{kv-BmsWxOQ2.d.ts → kv-p8sC8PTT.d.ts} +3 -7
- package/dist/{ld-DFhDZpVO.js → ld-BJz01zAZ.js} +4 -4
- package/dist/{lookup-1_LyYkq2.js → lookup-CNv4GGs7.js} +1 -1
- package/dist/{lookup-Zz0ToYnF.js → lookup-DTOPcLsZ.js} +1 -1
- package/dist/{lookup-B3yeXDFK.js → lookup-dfyiwjbB.js} +3 -3
- package/dist/{lookup-nlxO7x0u.d.ts → lookup-vJccIKCS.d.ts} +4 -8
- package/dist/{middleware-DfZ8KIdq.js → middleware-BXqSM2dw.js} +18 -18
- package/dist/{middleware-DORBFmeo.js → middleware-DB7wiPiW.js} +18 -18
- package/dist/middleware-HBJtiy_q.js +17 -0
- package/dist/middleware-ORyJDzKn.js +33 -0
- package/dist/{mod-iE_61Xjt.d.ts → mod-BTHfUeLo.d.ts} +2 -9
- package/dist/{mod-BUAWJ2pK.d.ts → mod-BUTm-sog.d.ts} +5 -9
- package/dist/{mod-CsYfI7YL.d.ts → mod-CgmTOt4z.d.ts} +3 -21
- package/dist/{mod-Bx6Du4Ct.d.ts → mod-DSPyncxx.d.ts} +5 -11
- package/dist/mod.d.ts +14 -14
- package/dist/mod.js +12 -12
- package/dist/{mq-Bue016Tz.d.ts → mq-nceTGCuc.d.ts} +3 -7
- package/dist/nodeinfo/client.test.js +11 -11
- package/dist/nodeinfo/handler.test.js +27 -27
- package/dist/nodeinfo/mod.d.ts +3 -3
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +8 -8
- package/dist/nodeinfo/types.test.js +8 -8
- package/dist/{owner-C_Gw25Id.d.ts → owner-CbRc94FP.d.ts} +6 -9
- package/dist/{owner-B-x5wVW7.js → owner-DPR9iegf.js} +3 -3
- package/dist/{proof-Bt6oaSF6.js → proof-CIdBQp8W.js} +3 -3
- package/dist/{proof-DlVhAg_t.js → proof-DozAJu8u.js} +5 -5
- package/dist/runtime/authdocloader.test.js +17 -17
- package/dist/runtime/docloader.test.js +10 -10
- package/dist/runtime/key.test.js +13 -13
- package/dist/runtime/langstr.test.js +8 -8
- package/dist/runtime/mod.d.ts +5 -5
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +8 -8
- package/dist/runtime/url.test.js +4 -4
- package/dist/{send-CqqlfPUc.js → send-ZuWTBaWD.js} +3 -3
- package/dist/sig/http.test.js +16 -16
- package/dist/sig/key.test.js +14 -14
- package/dist/sig/ld.test.js +12 -12
- package/dist/sig/mod.d.ts +7 -7
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +16 -16
- package/dist/sig/proof.test.js +15 -15
- package/dist/{std__assert-CaBUULmX.js → std__assert-CHXwj7zk.js} +1 -1
- package/dist/testing/docloader.test.js +8 -8
- package/dist/testing/mod.d.ts +0 -1
- package/dist/{transformers-jxj-4o2K.js → transformers-ghwJuzGY.js} +1 -1
- package/dist/{types-COsvFBcH.js → types-BkYhmwmv.js} +1 -1
- package/dist/vocab/actor.test.js +37 -37
- package/dist/vocab/lookup.test.js +13 -13
- package/dist/vocab/mod.d.ts +5 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +129 -132
- package/dist/{vocab-BlP2AeMB.js → vocab-CKuJcawO.js} +3 -3
- package/dist/{vocab-BXZLOG9E.js → vocab-D0LMe9FE.js} +178 -178
- package/dist/{vocab-C4bpdeio.d.ts → vocab-DSFLLLe6.d.ts} +2 -7
- package/dist/webfinger/handler.test.js +27 -27
- package/dist/webfinger/lookup.test.js +11 -11
- package/dist/webfinger/mod.d.ts +3 -3
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.d.ts +2 -9
- package/dist/x/cfworkers.test.js +8 -8
- package/dist/x/hono.d.ts +11 -12
- package/dist/x/sveltekit.d.ts +11 -12
- package/package.json +2 -2
- package/dist/middleware-DnbfTDpa.js +0 -17
- package/dist/middleware-DoD5Iw7X.js +0 -33
@@ -3,16 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import "../assert-
|
8
|
-
import "../assert_instance_of
|
9
|
-
import { buildCollectionSynchronizationHeader, digest } from "../collection-
|
6
|
+
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
+
import "../assert-YJk-1DlZ.js";
|
8
|
+
import "../assert_instance_of-DBIoG5k7.js";
|
9
|
+
import { buildCollectionSynchronizationHeader, digest } from "../collection-Dfb0TPno.js";
|
10
10
|
import { test } from "../testing-jcGLO9Lp.js";
|
11
|
-
import "../std__assert-
|
12
|
-
import "../assert_rejects-
|
13
|
-
import "../assert_is_error-
|
14
|
-
import "../assert_not_equals-
|
15
|
-
import "../assert_throws-
|
11
|
+
import "../std__assert-CHXwj7zk.js";
|
12
|
+
import "../assert_rejects-BZjUwo62.js";
|
13
|
+
import "../assert_is_error-jyzqjHud.js";
|
14
|
+
import "../assert_not_equals-wx-SRs4i.js";
|
15
|
+
import "../assert_throws-gBPv3v2V.js";
|
16
16
|
import { decodeHex } from "byte-encodings/hex";
|
17
17
|
|
18
18
|
//#region federation/collection.test.ts
|
@@ -3,45 +3,45 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import { assert } from "../assert-
|
8
|
-
import "../assert_instance_of
|
6
|
+
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
+
import { assert } from "../assert-YJk-1DlZ.js";
|
8
|
+
import "../assert_instance_of-DBIoG5k7.js";
|
9
9
|
import { MemoryKvStore } from "../kv-DohFOP2C.js";
|
10
|
-
import { acceptsJsonLd, createFederation, handleActor, handleCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-
|
11
|
-
import "../docloader-
|
10
|
+
import { acceptsJsonLd, createFederation, handleActor, handleCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-BXqSM2dw.js";
|
11
|
+
import "../docloader-BzbamfL0.js";
|
12
12
|
import "../url-kTAI6_KP.js";
|
13
13
|
import "../semver-CbbIgUsa.js";
|
14
|
-
import "../client-
|
14
|
+
import "../client-CQ24CTCb.js";
|
15
15
|
import "../router-D_aVZZUc.js";
|
16
16
|
import "../types-CqoqWDkp.js";
|
17
17
|
import "../multibase-DeCHcK8L.js";
|
18
|
-
import { Create, Note, Person } from "../vocab-
|
18
|
+
import { Create, Note, Person } from "../vocab-D0LMe9FE.js";
|
19
19
|
import "../langstr-DbWheeIS.js";
|
20
|
-
import "../lookup-
|
20
|
+
import "../lookup-CNv4GGs7.js";
|
21
21
|
import "../type-D2s5lmbZ.js";
|
22
|
-
import "../actor-
|
23
|
-
import "../key-
|
24
|
-
import { signRequest } from "../http-
|
25
|
-
import "../authdocloader-
|
26
|
-
import "../ld-
|
27
|
-
import "../owner-
|
28
|
-
import "../proof-
|
29
|
-
import "../lookup-
|
30
|
-
import "../inbox-
|
31
|
-
import "../builder-
|
32
|
-
import "../collection-
|
33
|
-
import "../keycache-
|
22
|
+
import "../actor-BRIxlOTx.js";
|
23
|
+
import "../key-D3Mc3n0F.js";
|
24
|
+
import { signRequest } from "../http-B3Xedrzu.js";
|
25
|
+
import "../authdocloader-CG3GTtW2.js";
|
26
|
+
import "../ld-BJz01zAZ.js";
|
27
|
+
import "../owner-DPR9iegf.js";
|
28
|
+
import "../proof-CIdBQp8W.js";
|
29
|
+
import "../lookup-dfyiwjbB.js";
|
30
|
+
import "../inbox-BoldQCGa.js";
|
31
|
+
import "../builder-DtoRVfyu.js";
|
32
|
+
import "../collection-Dfb0TPno.js";
|
33
|
+
import "../keycache-DXp-3NZn.js";
|
34
34
|
import "../retry-BiIhZWgD.js";
|
35
|
-
import "../send-
|
35
|
+
import "../send-ZuWTBaWD.js";
|
36
36
|
import { test } from "../testing-jcGLO9Lp.js";
|
37
|
-
import "../std__assert-
|
38
|
-
import { assertFalse } from "../assert_rejects-
|
39
|
-
import "../assert_is_error-
|
40
|
-
import "../assert_not_equals-
|
41
|
-
import "../assert_throws-
|
37
|
+
import "../std__assert-CHXwj7zk.js";
|
38
|
+
import { assertFalse } from "../assert_rejects-BZjUwo62.js";
|
39
|
+
import "../assert_is_error-jyzqjHud.js";
|
40
|
+
import "../assert_not_equals-wx-SRs4i.js";
|
41
|
+
import "../assert_throws-gBPv3v2V.js";
|
42
42
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
43
|
-
import { createInboxContext, createRequestContext } from "../context-
|
44
|
-
import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-
|
43
|
+
import { createInboxContext, createRequestContext } from "../context-Dub61h2m.js";
|
44
|
+
import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-j3LZyq_M.js";
|
45
45
|
|
46
46
|
//#region federation/handler.test.ts
|
47
47
|
test("acceptsJsonLd()", () => {
|
@@ -3,17 +3,17 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import "../docloader-
|
6
|
+
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
+
import "../docloader-BzbamfL0.js";
|
8
8
|
import "../url-kTAI6_KP.js";
|
9
9
|
import "../multibase-DeCHcK8L.js";
|
10
|
-
import { Activity, Create, Invite, Offer, Update } from "../vocab-
|
10
|
+
import { Activity, Create, Invite, Offer, Update } from "../vocab-D0LMe9FE.js";
|
11
11
|
import "../langstr-DbWheeIS.js";
|
12
12
|
import "../type-D2s5lmbZ.js";
|
13
|
-
import { InboxListenerSet } from "../inbox-
|
13
|
+
import { InboxListenerSet } from "../inbox-BoldQCGa.js";
|
14
14
|
import { test } from "../testing-jcGLO9Lp.js";
|
15
|
-
import "../assert_is_error-
|
16
|
-
import { assertThrows } from "../assert_throws-
|
15
|
+
import "../assert_is_error-jyzqjHud.js";
|
16
|
+
import { assertThrows } from "../assert_throws-gBPv3v2V.js";
|
17
17
|
|
18
18
|
//#region federation/inbox.test.ts
|
19
19
|
test("InboxListenerSet", () => {
|
@@ -3,16 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import { assert } from "../assert-
|
8
|
-
import { assertInstanceOf } from "../assert_instance_of
|
6
|
+
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
+
import { assert } from "../assert-YJk-1DlZ.js";
|
8
|
+
import { assertInstanceOf } from "../assert_instance_of-DBIoG5k7.js";
|
9
9
|
import { MemoryKvStore } from "../kv-DohFOP2C.js";
|
10
|
-
import "../docloader-
|
10
|
+
import "../docloader-BzbamfL0.js";
|
11
11
|
import "../url-kTAI6_KP.js";
|
12
12
|
import "../multibase-DeCHcK8L.js";
|
13
|
-
import { CryptographicKey, Multikey } from "../vocab-
|
13
|
+
import { CryptographicKey, Multikey } from "../vocab-D0LMe9FE.js";
|
14
14
|
import "../langstr-DbWheeIS.js";
|
15
|
-
import { KvKeyCache } from "../keycache-
|
15
|
+
import { KvKeyCache } from "../keycache-DXp-3NZn.js";
|
16
16
|
import { test } from "../testing-jcGLO9Lp.js";
|
17
17
|
|
18
18
|
//#region federation/keycache.test.ts
|
@@ -3,16 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import "../assert-
|
8
|
-
import "../assert_instance_of
|
6
|
+
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
+
import "../assert-YJk-1DlZ.js";
|
8
|
+
import "../assert_instance_of-DBIoG5k7.js";
|
9
9
|
import { MemoryKvStore } from "../kv-DohFOP2C.js";
|
10
10
|
import { test } from "../testing-jcGLO9Lp.js";
|
11
|
-
import "../std__assert-
|
12
|
-
import "../assert_rejects-
|
13
|
-
import "../assert_is_error-
|
14
|
-
import "../assert_not_equals-
|
15
|
-
import "../assert_throws-
|
11
|
+
import "../std__assert-CHXwj7zk.js";
|
12
|
+
import "../assert_rejects-BZjUwo62.js";
|
13
|
+
import "../assert_is_error-jyzqjHud.js";
|
14
|
+
import "../assert_not_equals-wx-SRs4i.js";
|
15
|
+
import "../assert_throws-gBPv3v2V.js";
|
16
16
|
|
17
17
|
//#region federation/kv.test.ts
|
18
18
|
test("MemoryKvStore", async (t) => {
|
@@ -3,45 +3,45 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import { assert } from "../assert-
|
8
|
-
import { assertInstanceOf } from "../assert_instance_of
|
6
|
+
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
+
import { assert } from "../assert-YJk-1DlZ.js";
|
8
|
+
import { assertInstanceOf } from "../assert_instance_of-DBIoG5k7.js";
|
9
9
|
import { MemoryKvStore } from "../kv-DohFOP2C.js";
|
10
|
-
import { ContextImpl, FederationImpl, InboxContextImpl, createFederation } from "../middleware-
|
11
|
-
import { FetchError, fetchDocumentLoader } from "../docloader-
|
10
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, createFederation } from "../middleware-BXqSM2dw.js";
|
11
|
+
import { FetchError, fetchDocumentLoader } from "../docloader-BzbamfL0.js";
|
12
12
|
import "../url-kTAI6_KP.js";
|
13
13
|
import "../semver-CbbIgUsa.js";
|
14
|
-
import "../client-
|
14
|
+
import "../client-CQ24CTCb.js";
|
15
15
|
import { RouterError } from "../router-D_aVZZUc.js";
|
16
16
|
import "../types-CqoqWDkp.js";
|
17
17
|
import "../multibase-DeCHcK8L.js";
|
18
|
-
import { Activity, Announce, Create, Invite, Multikey, Note, Object as Object$1, Offer, Person } from "../vocab-
|
18
|
+
import { Activity, Announce, Create, Invite, Multikey, Note, Object as Object$1, Offer, Person } from "../vocab-D0LMe9FE.js";
|
19
19
|
import "../langstr-DbWheeIS.js";
|
20
|
-
import "../lookup-
|
20
|
+
import "../lookup-CNv4GGs7.js";
|
21
21
|
import { getTypeId } from "../type-D2s5lmbZ.js";
|
22
|
-
import "../actor-
|
23
|
-
import "../key-
|
24
|
-
import { signRequest, verifyRequest } from "../http-
|
25
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-
|
26
|
-
import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-
|
27
|
-
import { doesActorOwnKey } from "../owner-
|
28
|
-
import { signObject, verifyObject } from "../proof-
|
29
|
-
import { lookupObject } from "../lookup-
|
30
|
-
import "../inbox-
|
31
|
-
import "../builder-
|
32
|
-
import "../collection-
|
33
|
-
import "../keycache-
|
22
|
+
import "../actor-BRIxlOTx.js";
|
23
|
+
import "../key-D3Mc3n0F.js";
|
24
|
+
import { signRequest, verifyRequest } from "../http-B3Xedrzu.js";
|
25
|
+
import { getAuthenticatedDocumentLoader } from "../authdocloader-CG3GTtW2.js";
|
26
|
+
import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-BJz01zAZ.js";
|
27
|
+
import { doesActorOwnKey } from "../owner-DPR9iegf.js";
|
28
|
+
import { signObject, verifyObject } from "../proof-CIdBQp8W.js";
|
29
|
+
import { lookupObject } from "../lookup-dfyiwjbB.js";
|
30
|
+
import "../inbox-BoldQCGa.js";
|
31
|
+
import "../builder-DtoRVfyu.js";
|
32
|
+
import "../collection-Dfb0TPno.js";
|
33
|
+
import "../keycache-DXp-3NZn.js";
|
34
34
|
import "../retry-BiIhZWgD.js";
|
35
|
-
import "../send-
|
35
|
+
import "../send-ZuWTBaWD.js";
|
36
36
|
import { test } from "../testing-jcGLO9Lp.js";
|
37
|
-
import { assertStrictEquals } from "../std__assert-
|
38
|
-
import { assertFalse, assertRejects } from "../assert_rejects-
|
39
|
-
import "../assert_is_error-
|
40
|
-
import { assertNotEquals } from "../assert_not_equals-
|
41
|
-
import { assertThrows } from "../assert_throws-
|
37
|
+
import { assertStrictEquals } from "../std__assert-CHXwj7zk.js";
|
38
|
+
import { assertFalse, assertRejects } from "../assert_rejects-BZjUwo62.js";
|
39
|
+
import "../assert_is_error-jyzqjHud.js";
|
40
|
+
import { assertNotEquals } from "../assert_not_equals-wx-SRs4i.js";
|
41
|
+
import { assertThrows } from "../assert_throws-gBPv3v2V.js";
|
42
42
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
43
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-
|
44
|
-
import { esm_default } from "../esm-
|
43
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-j3LZyq_M.js";
|
44
|
+
import { esm_default } from "../esm-Btx3E8og.js";
|
45
45
|
|
46
46
|
//#region testing/fixtures/example.com/person.json
|
47
47
|
var __context$1 = ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"];
|
package/dist/federation/mod.d.ts
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { KvKey, KvStore, KvStoreSetOptions, MemoryKvStore
|
4
|
-
import "../docloader-
|
5
|
-
import "../client-
|
6
|
-
import "../vocab-
|
7
|
-
import "../actor-
|
8
|
-
import "../http-
|
9
|
-
import "../owner-
|
10
|
-
import "../mod-
|
11
|
-
import "../lookup-
|
12
|
-
import { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router
|
13
|
-
import { InProcessMessageQueue
|
3
|
+
import { KvKey, KvStore, KvStoreSetOptions, MemoryKvStore } from "../kv-p8sC8PTT.js";
|
4
|
+
import "../docloader-DlUDOVSe.js";
|
5
|
+
import "../client-Cd552pKL.js";
|
6
|
+
import "../vocab-DSFLLLe6.js";
|
7
|
+
import "../actor-tT_B0pDn.js";
|
8
|
+
import "../http-BkUCISGt.js";
|
9
|
+
import "../owner-CbRc94FP.js";
|
10
|
+
import "../mod-DSPyncxx.js";
|
11
|
+
import "../lookup-vJccIKCS.js";
|
12
|
+
import { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../context-DRhhOsMk.js";
|
13
|
+
import { InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue } from "../mq-nceTGCuc.js";
|
14
14
|
import "../mod-g0xFzAP9.js";
|
15
15
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, Context, CreateExponentialBackoffPolicyOptions, CreateFederationOptions, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.js
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import "../transformers-
|
6
|
-
import "../docloader-
|
7
|
-
import "../actor-
|
8
|
-
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-
|
9
|
-
import "../lookup-
|
10
|
-
import "../key-
|
11
|
-
import "../http-
|
12
|
-
import "../proof-
|
13
|
-
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "../federation-
|
14
|
-
import "../types-
|
15
|
-
import "../authdocloader-
|
16
|
-
import "../vocab-
|
5
|
+
import "../transformers-ghwJuzGY.js";
|
6
|
+
import "../docloader-CjMOaZ0w.js";
|
7
|
+
import "../actor-BidJp8n0.js";
|
8
|
+
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-DB7wiPiW.js";
|
9
|
+
import "../lookup-DTOPcLsZ.js";
|
10
|
+
import "../key-Dt894e0l.js";
|
11
|
+
import "../http-CV67UidJ.js";
|
12
|
+
import "../proof-DozAJu8u.js";
|
13
|
+
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "../federation-3B6BDKCK.js";
|
14
|
+
import "../types-BkYhmwmv.js";
|
15
|
+
import "../authdocloader-BRs7flug.js";
|
16
|
+
import "../vocab-CKuJcawO.js";
|
17
17
|
|
18
18
|
export { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
@@ -3,15 +3,15 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import "../assert-
|
8
|
-
import "../assert_instance_of
|
6
|
+
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
+
import "../assert-YJk-1DlZ.js";
|
8
|
+
import "../assert_instance_of-DBIoG5k7.js";
|
9
9
|
import { test } from "../testing-jcGLO9Lp.js";
|
10
|
-
import { assertGreater, assertGreaterOrEqual } from "../std__assert-
|
11
|
-
import "../assert_rejects-
|
12
|
-
import "../assert_is_error-
|
13
|
-
import "../assert_not_equals-
|
14
|
-
import "../assert_throws-
|
10
|
+
import { assertGreater, assertGreaterOrEqual } from "../std__assert-CHXwj7zk.js";
|
11
|
+
import "../assert_rejects-BZjUwo62.js";
|
12
|
+
import "../assert_is_error-jyzqjHud.js";
|
13
|
+
import "../assert_not_equals-wx-SRs4i.js";
|
14
|
+
import "../assert_throws-gBPv3v2V.js";
|
15
15
|
import { delay } from "@es-toolkit/es-toolkit";
|
16
16
|
|
17
17
|
//#region federation/mq.ts
|
@@ -134,7 +134,7 @@ var ParallelMessageQueue = class ParallelMessageQueue {
|
|
134
134
|
await this.queue.enqueueMany(messages, options);
|
135
135
|
}
|
136
136
|
listen(handler, options = {}) {
|
137
|
-
const workers = new Map();
|
137
|
+
const workers = /* @__PURE__ */ new Map();
|
138
138
|
return this.queue.listen(async (message) => {
|
139
139
|
while (workers.size >= this.workers) {
|
140
140
|
const consumedId = await Promise.any(workers.values());
|
@@ -3,10 +3,10 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { AssertionError, assertEquals } from "../assert_equals-
|
6
|
+
import { AssertionError, assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
7
|
import { createExponentialBackoffPolicy } from "../retry-BiIhZWgD.js";
|
8
8
|
import { test } from "../testing-jcGLO9Lp.js";
|
9
|
-
import { assertNotEquals } from "../assert_not_equals-
|
9
|
+
import { assertNotEquals } from "../assert_not_equals-wx-SRs4i.js";
|
10
10
|
|
11
11
|
//#region federation/retry.test.ts
|
12
12
|
test("createExponentialBackoffPolicy()", () => {
|
@@ -3,16 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import { assert } from "../assert-
|
8
|
-
import "../assert_instance_of
|
6
|
+
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
+
import { assert } from "../assert-YJk-1DlZ.js";
|
8
|
+
import "../assert_instance_of-DBIoG5k7.js";
|
9
9
|
import { Router, RouterError } from "../router-D_aVZZUc.js";
|
10
10
|
import { test } from "../testing-jcGLO9Lp.js";
|
11
|
-
import "../std__assert-
|
12
|
-
import { assertFalse } from "../assert_rejects-
|
13
|
-
import "../assert_is_error-
|
14
|
-
import "../assert_not_equals-
|
15
|
-
import { assertThrows } from "../assert_throws-
|
11
|
+
import "../std__assert-CHXwj7zk.js";
|
12
|
+
import { assertFalse } from "../assert_rejects-BZjUwo62.js";
|
13
|
+
import "../assert_is_error-jyzqjHud.js";
|
14
|
+
import "../assert_not_equals-wx-SRs4i.js";
|
15
|
+
import { assertThrows } from "../assert_throws-gBPv3v2V.js";
|
16
16
|
|
17
17
|
//#region federation/router.test.ts
|
18
18
|
function setUp(options = {}) {
|
@@ -36,7 +36,7 @@ test("Router.clone()", () => {
|
|
36
36
|
});
|
37
37
|
test("Router.add()", () => {
|
38
38
|
const router = new Router();
|
39
|
-
assertEquals(router.add("/users", "users"), new Set());
|
39
|
+
assertEquals(router.add("/users", "users"), /* @__PURE__ */ new Set());
|
40
40
|
assertEquals(router.add("/users/{name}", "user"), new Set(["name"]));
|
41
41
|
assertEquals(router.add("/users/{name}/posts/{postId}", "post"), new Set(["name", "postId"]));
|
42
42
|
assertThrows(() => router.add("foo", "name"), RouterError);
|
@@ -3,30 +3,30 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { assertEquals } from "../assert_equals-
|
7
|
-
import { assert } from "../assert-
|
8
|
-
import "../assert_instance_of
|
9
|
-
import "../docloader-
|
6
|
+
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
+
import { assert } from "../assert-YJk-1DlZ.js";
|
8
|
+
import "../assert_instance_of-DBIoG5k7.js";
|
9
|
+
import "../docloader-BzbamfL0.js";
|
10
10
|
import "../url-kTAI6_KP.js";
|
11
11
|
import "../multibase-DeCHcK8L.js";
|
12
|
-
import { Activity, Application, Endpoints, Group, Person, Service } from "../vocab-
|
12
|
+
import { Activity, Application, Endpoints, Group, Person, Service } from "../vocab-D0LMe9FE.js";
|
13
13
|
import "../langstr-DbWheeIS.js";
|
14
|
-
import "../lookup-
|
14
|
+
import "../lookup-CNv4GGs7.js";
|
15
15
|
import "../type-D2s5lmbZ.js";
|
16
|
-
import "../actor-
|
17
|
-
import "../key-
|
18
|
-
import { verifyRequest } from "../http-
|
19
|
-
import { doesActorOwnKey } from "../owner-
|
20
|
-
import { extractInboxes, sendActivity } from "../send-
|
16
|
+
import "../actor-BRIxlOTx.js";
|
17
|
+
import "../key-D3Mc3n0F.js";
|
18
|
+
import { verifyRequest } from "../http-B3Xedrzu.js";
|
19
|
+
import { doesActorOwnKey } from "../owner-DPR9iegf.js";
|
20
|
+
import { extractInboxes, sendActivity } from "../send-ZuWTBaWD.js";
|
21
21
|
import { test } from "../testing-jcGLO9Lp.js";
|
22
|
-
import "../std__assert-
|
23
|
-
import { assertFalse, assertRejects } from "../assert_rejects-
|
24
|
-
import "../assert_is_error-
|
25
|
-
import { assertNotEquals } from "../assert_not_equals-
|
26
|
-
import "../assert_throws-
|
22
|
+
import "../std__assert-CHXwj7zk.js";
|
23
|
+
import { assertFalse, assertRejects } from "../assert_rejects-BZjUwo62.js";
|
24
|
+
import "../assert_is_error-jyzqjHud.js";
|
25
|
+
import { assertNotEquals } from "../assert_not_equals-wx-SRs4i.js";
|
26
|
+
import "../assert_throws-gBPv3v2V.js";
|
27
27
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
28
|
-
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-
|
29
|
-
import { esm_default } from "../esm-
|
28
|
+
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-j3LZyq_M.js";
|
29
|
+
import { esm_default } from "../esm-Btx3E8og.js";
|
30
30
|
|
31
31
|
//#region federation/send.test.ts
|
32
32
|
test("extractInboxes()", () => {
|
@@ -168,7 +168,7 @@ var ParallelMessageQueue = class ParallelMessageQueue {
|
|
168
168
|
await this.queue.enqueueMany(messages, options);
|
169
169
|
}
|
170
170
|
listen(handler, options = {}) {
|
171
|
-
const workers = new Map();
|
171
|
+
const workers = /* @__PURE__ */ new Map();
|
172
172
|
return this.queue.listen(async (message) => {
|
173
173
|
while (workers.size >= this.workers) {
|
174
174
|
const consumedId = await Promise.any(workers.values());
|
package/dist/{hongminhee__deno-mock-fetch-DJKLj_H-.js → hongminhee__deno-mock-fetch-Az7fJGtg.js}
RENAMED
@@ -117,7 +117,7 @@ var UnhandledRouteError = class extends Error {
|
|
117
117
|
* const { fetch, mock, remove, reset } = sandbox()
|
118
118
|
* ```
|
119
119
|
*/ function sandbox() {
|
120
|
-
const routeStore = new Map();
|
120
|
+
const routeStore = /* @__PURE__ */ new Map();
|
121
121
|
async function fetch(input, init) {
|
122
122
|
if (input instanceof URL) input = input.toString();
|
123
123
|
const req = new Request(input, init);
|
@@ -3,9 +3,9 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default } from "./docloader-
|
7
|
-
import { CryptographicKey } from "./vocab-
|
8
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
6
|
+
import { deno_default } from "./docloader-BzbamfL0.js";
|
7
|
+
import { CryptographicKey } from "./vocab-D0LMe9FE.js";
|
8
|
+
import { fetchKey, validateCryptoKey } from "./key-D3Mc3n0F.js";
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
10
10
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
11
11
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
@@ -62,7 +62,7 @@ async function signRequestDraft(request, privateKey, keyId, span, currentTime) {
|
|
62
62
|
headers.set("Digest", `SHA-256=${encodeBase64(digest)}`);
|
63
63
|
if (span.isRecording()) span.setAttribute("http_signatures.digest.sha-256", encodeHex(digest));
|
64
64
|
}
|
65
|
-
if (!headers.has("Date")) headers.set("Date", currentTime == null ? new Date().toUTCString() : new Date(currentTime.toString()).toUTCString());
|
65
|
+
if (!headers.has("Date")) headers.set("Date", currentTime == null ? (/* @__PURE__ */ new Date()).toUTCString() : new Date(currentTime.toString()).toUTCString());
|
66
66
|
const serialized = [["(request-target)", `${request.method.toLowerCase()} ${url.pathname}`], ...headers];
|
67
67
|
const headerNames = serialized.map(([name]) => name);
|
68
68
|
const message = serialized.map(([name, value]) => `${name}: ${value.trim()}`).join("\n");
|
@@ -103,7 +103,11 @@ function createRfc9421SignatureBase(request, components, parameters) {
|
|
103
103
|
else if (component === "@query-param") throw new Error("@query-param requires a parameter name");
|
104
104
|
else if (component === "@status") throw new Error("@status is only valid for responses");
|
105
105
|
else if (component.startsWith("@")) throw new Error(`Unsupported derived component: ${component}`);
|
106
|
-
else
|
106
|
+
else {
|
107
|
+
const header = request.headers.get(component);
|
108
|
+
if (header == null) throw new Error(`Missing header: ${component}`);
|
109
|
+
value = header;
|
110
|
+
}
|
107
111
|
baseComponents.push(`"${component}": ${value}`);
|
108
112
|
}
|
109
113
|
const sigComponents = components.map((c) => `"${c}"`).join(" ");
|
@@ -192,7 +196,9 @@ async function signRequestRfc9421(request, privateKey, keyId, span, currentTime)
|
|
192
196
|
headers.set("Content-Digest", `sha-256=:${encodeBase64(digest)}:`);
|
193
197
|
if (span.isRecording()) span.setAttribute("http_signatures.digest.sha-256", encodeHex(digest));
|
194
198
|
}
|
195
|
-
|
199
|
+
currentTime ??= Temporal.Now.instant();
|
200
|
+
const created = currentTime.epochMilliseconds / 1e3 | 0;
|
201
|
+
if (!headers.has("Date")) headers.set("Date", new Date(currentTime.toString()).toUTCString());
|
196
202
|
const components = [
|
197
203
|
"@method",
|
198
204
|
"@target-uri",
|
@@ -1,17 +1,10 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { DocumentLoader } from "./docloader-
|
4
|
-
import { CryptographicKey
|
3
|
+
import { DocumentLoader } from "./docloader-DlUDOVSe.js";
|
4
|
+
import { CryptographicKey, Multikey } from "./vocab-DSFLLLe6.js";
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
6
6
|
|
7
7
|
//#region sig/key.d.ts
|
8
|
-
/**
|
9
|
-
* Generates a key pair which is appropriate for Fedify.
|
10
|
-
* @param algorithm The algorithm to use. Currently only RSASSA-PKCS1-v1_5 and
|
11
|
-
* Ed25519 are supported.
|
12
|
-
* @returns The generated key pair.
|
13
|
-
* @throws {TypeError} If the algorithm is unsupported.
|
14
|
-
*/
|
15
8
|
|
16
9
|
/**
|
17
10
|
* Generates a key pair which is appropriate for Fedify.
|
@@ -121,7 +114,8 @@ interface KeyCache {
|
|
121
114
|
* (e.g., fetching the key was tried but failed).
|
122
115
|
*/
|
123
116
|
set(keyId: URL, key: CryptographicKey | Multikey | null): Promise<void>;
|
124
|
-
}
|
117
|
+
}
|
118
|
+
//#endregion
|
125
119
|
//#region sig/http.d.ts
|
126
120
|
/**
|
127
121
|
* The standard to use for signing and verifying HTTP signatures.
|
@@ -248,11 +242,9 @@ interface HttpMessageSignaturesSpecDeterminer {
|
|
248
242
|
*/
|
249
243
|
rememberSpec(origin: string, spec: HttpMessageSignaturesSpec): void | Promise<void>;
|
250
244
|
}
|
251
|
-
|
252
|
-
//#endregion
|
253
245
|
/**
|
254
246
|
* The options for double-knock requests.
|
255
247
|
* @since 1.6.0
|
256
248
|
*/
|
257
|
-
|
258
|
-
export { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk
|
249
|
+
//#endregion
|
250
|
+
export { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest };
|
@@ -2,9 +2,9 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { deno_default } from "./docloader-
|
6
|
-
import { CryptographicKey } from "./actor-
|
7
|
-
import { fetchKey, validateCryptoKey } from "./key-
|
5
|
+
import { deno_default } from "./docloader-CjMOaZ0w.js";
|
6
|
+
import { CryptographicKey } from "./actor-BidJp8n0.js";
|
7
|
+
import { fetchKey, validateCryptoKey } from "./key-Dt894e0l.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
10
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
@@ -61,7 +61,7 @@ async function signRequestDraft(request, privateKey, keyId, span, currentTime) {
|
|
61
61
|
headers.set("Digest", `SHA-256=${encodeBase64(digest)}`);
|
62
62
|
if (span.isRecording()) span.setAttribute("http_signatures.digest.sha-256", encodeHex(digest));
|
63
63
|
}
|
64
|
-
if (!headers.has("Date")) headers.set("Date", currentTime == null ? new Date().toUTCString() : new Date(currentTime.toString()).toUTCString());
|
64
|
+
if (!headers.has("Date")) headers.set("Date", currentTime == null ? (/* @__PURE__ */ new Date()).toUTCString() : new Date(currentTime.toString()).toUTCString());
|
65
65
|
const serialized = [["(request-target)", `${request.method.toLowerCase()} ${url.pathname}`], ...headers];
|
66
66
|
const headerNames = serialized.map(([name]) => name);
|
67
67
|
const message = serialized.map(([name, value]) => `${name}: ${value.trim()}`).join("\n");
|
@@ -102,7 +102,11 @@ function createRfc9421SignatureBase(request, components, parameters) {
|
|
102
102
|
else if (component === "@query-param") throw new Error("@query-param requires a parameter name");
|
103
103
|
else if (component === "@status") throw new Error("@status is only valid for responses");
|
104
104
|
else if (component.startsWith("@")) throw new Error(`Unsupported derived component: ${component}`);
|
105
|
-
else
|
105
|
+
else {
|
106
|
+
const header = request.headers.get(component);
|
107
|
+
if (header == null) throw new Error(`Missing header: ${component}`);
|
108
|
+
value = header;
|
109
|
+
}
|
106
110
|
baseComponents.push(`"${component}": ${value}`);
|
107
111
|
}
|
108
112
|
const sigComponents = components.map((c) => `"${c}"`).join(" ");
|
@@ -191,7 +195,9 @@ async function signRequestRfc9421(request, privateKey, keyId, span, currentTime)
|
|
191
195
|
headers.set("Content-Digest", `sha-256=:${encodeBase64(digest)}:`);
|
192
196
|
if (span.isRecording()) span.setAttribute("http_signatures.digest.sha-256", encodeHex(digest));
|
193
197
|
}
|
194
|
-
|
198
|
+
currentTime ??= Temporal.Now.instant();
|
199
|
+
const created = currentTime.epochMilliseconds / 1e3 | 0;
|
200
|
+
if (!headers.has("Date")) headers.set("Date", new Date(currentTime.toString()).toUTCString());
|
195
201
|
const components = [
|
196
202
|
"@method",
|
197
203
|
"@target-uri",
|