@fedify/fedify 1.8.0-pr.298.1018 → 1.8.0-pr.299.1020
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-BDH3Svb2.js → actor-BBYHS7Zc.js} +3 -3
- package/dist/{actor-CY-7-CJk.js → actor-CX0Gdycg.js} +179 -179
- package/dist/{authdocloader-DLB9gzJA.js → authdocloader-CsoRGXWD.js} +3 -3
- package/dist/{authdocloader-Cl8WQ8xD.js → authdocloader-DtMpkZJn.js} +3 -3
- package/dist/{builder-omyqegGI.js → builder-Dv3HwtjN.js} +3 -3
- package/dist/{client-C4hO09wa.js → client-BkSxmZ6i.js} +1 -1
- package/dist/compat/mod.d.ts +3 -3
- package/dist/compat/transformers.test.js +17 -17
- package/dist/{context-B6mUZhs_.d.ts → context-CrSyJrIa.d.ts} +1 -1
- package/dist/{context-BFaoh-dm.js → context-Ctx-I1t_.js} +2 -2
- package/dist/{docloader-BMbotly1.js → docloader-BOrtj2l_.js} +1 -1
- package/dist/{docloader-CnUIj5rg.js → docloader-HJTyC3AL.js} +1 -1
- package/dist/federation/builder.test.js +4 -4
- package/dist/federation/handler.test.js +19 -19
- package/dist/federation/inbox.test.js +3 -3
- package/dist/federation/keycache.test.js +3 -3
- package/dist/federation/middleware.test.js +18 -18
- package/dist/federation/mod.d.ts +2 -2
- package/dist/federation/mod.js +10 -10
- package/dist/federation/send.test.js +9 -9
- package/dist/{http-BFqf0Gl_.js → http-BAzbPaIH.js} +29 -44
- package/dist/{http-D1uoUH4N.d.ts → http-CP2ZUALI.d.ts} +0 -5
- package/dist/{http-m3ktXS1a.js → http-Ct87hDzx.js} +29 -44
- package/dist/{inbox-0q8f2xfA.js → inbox-BNehUJP3.js} +2 -2
- package/dist/{key-DB9ua3fC.js → key-C-gwymCd.js} +3 -3
- package/dist/{key-CqX6FoSC.js → key-CYyad7d4.js} +5 -5
- package/dist/{key-BFEzG58w.js → key-CxXe6xQ0.js} +2 -2
- package/dist/{key-CDmhf9AI.js → key-DhHpybOz.js} +4 -4
- package/dist/{keycache-D-RkFb0L.js → keycache-CXuGdV-G.js} +1 -1
- package/dist/{keys-CoFlxHx6.js → keys-CD3a5bd5.js} +1 -1
- package/dist/{ld-CNKioLXc.js → ld-B72eFGM9.js} +3 -3
- package/dist/{lookup-C6u2x3tY.js → lookup-DJwSVJZY.js} +1 -1
- package/dist/{lookup-BetW6aID.js → lookup-d957Iv56.js} +3 -3
- package/dist/{lookup-DCFH2aSP.js → lookup-owlfW5CG.js} +1 -1
- package/dist/middleware-BSEPzIPa.js +33 -0
- package/dist/{middleware-C4XOndXA.js → middleware-CVwSsoEb.js} +10 -10
- package/dist/middleware-CfAz8AsB.js +17 -0
- package/dist/{middleware-CYvi_0Nb.js → middleware-HCB2lM2L.js} +15 -15
- package/dist/{mod-0L5jhGYM.d.ts → mod-CytXBx8A.d.ts} +1 -1
- package/dist/{mod-BCl7t-Ka.d.ts → mod-D2uPZuP-.d.ts} +1 -1
- package/dist/{mod-D9qE4iHP.d.ts → mod-DpE8T10I.d.ts} +1 -1
- package/dist/mod.d.ts +5 -5
- package/dist/mod.js +10 -10
- package/dist/nodeinfo/client.test.js +2 -2
- package/dist/nodeinfo/handler.test.js +18 -18
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/{owner-DMgMpkDp.js → owner-DlQ5tZcw.js} +3 -3
- package/dist/{proof-B9Cqx9iV.js → proof-BOsUiEhe.js} +3 -3
- package/dist/{proof-CiUt2qnM.js → proof-C54qhsPT.js} +3 -3
- package/dist/runtime/authdocloader.test.js +8 -8
- package/dist/runtime/docloader.test.js +1 -1
- package/dist/runtime/key.test.js +5 -5
- package/dist/runtime/mod.d.ts +2 -2
- package/dist/runtime/mod.js +6 -6
- package/dist/{send-BN8dsI3B.js → send-XPEqnmi8.js} +2 -2
- package/dist/sig/http.test.js +7 -32
- package/dist/sig/key.test.js +6 -6
- package/dist/sig/ld.test.js +7 -7
- package/dist/sig/mod.d.ts +2 -2
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +8 -8
- package/dist/sig/proof.test.js +7 -7
- package/dist/{types-C1fphH82.js → types-CXmk4Ap7.js} +1 -1
- package/dist/vocab/actor.test.js +4 -4
- package/dist/vocab/lookup.test.js +4 -4
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +2 -2
- package/dist/vocab/vocab.test.js +3 -3
- package/dist/{vocab-Bfo0_lqh.js → vocab-CVR-yfiV.js} +3 -3
- package/dist/{vocab-DDh4jJx9.js → vocab-p_5Ny1-3.js} +178 -178
- package/dist/webfinger/handler.test.js +18 -18
- package/dist/webfinger/lookup.test.js +2 -2
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/hono.d.ts +2 -2
- package/dist/x/sveltekit.d.ts +2 -2
- package/package.json +1 -1
- package/dist/middleware-B3CBz5LJ.js +0 -17
- package/dist/middleware-Q4vTL94L.js +0 -33
@@ -2,9 +2,9 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-
|
6
|
-
import { validateCryptoKey } from "./key-
|
7
|
-
import { doubleKnock } from "./http-
|
5
|
+
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-BOrtj2l_.js";
|
6
|
+
import { validateCryptoKey } from "./key-CxXe6xQ0.js";
|
7
|
+
import { doubleKnock } from "./http-Ct87hDzx.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
|
10
10
|
//#region runtime/authdocloader.ts
|
@@ -3,10 +3,10 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { createRequest, getRemoteDocument, logRequest } from "./docloader-
|
6
|
+
import { createRequest, getRemoteDocument, logRequest } from "./docloader-HJTyC3AL.js";
|
7
7
|
import { UrlError, validatePublicUrl } from "./url-kTAI6_KP.js";
|
8
|
-
import { validateCryptoKey } from "./key-
|
9
|
-
import { doubleKnock } from "./http-
|
8
|
+
import { validateCryptoKey } from "./key-C-gwymCd.js";
|
9
|
+
import { doubleKnock } from "./http-BAzbPaIH.js";
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
11
11
|
|
12
12
|
//#region runtime/authdocloader.ts
|
@@ -3,10 +3,10 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default } from "./docloader-
|
6
|
+
import { deno_default } from "./docloader-HJTyC3AL.js";
|
7
7
|
import { Router, RouterError } from "./router-D3UybECj.js";
|
8
8
|
import { getTypeId } from "./type-D2s5lmbZ.js";
|
9
|
-
import { InboxListenerSet } from "./inbox-
|
9
|
+
import { InboxListenerSet } from "./inbox-BNehUJP3.js";
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
11
11
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
12
12
|
|
@@ -34,7 +34,7 @@ var FederationBuilderImpl = class {
|
|
34
34
|
this.objectTypeIds = {};
|
35
35
|
}
|
36
36
|
async build(options) {
|
37
|
-
const { FederationImpl } = await import("./middleware-
|
37
|
+
const { FederationImpl } = await import("./middleware-BSEPzIPa.js");
|
38
38
|
const f = new FederationImpl(options);
|
39
39
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
40
40
|
f.router = this.router.clone();
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { getUserAgent } from "./docloader-
|
6
|
+
import { getUserAgent } from "./docloader-HJTyC3AL.js";
|
7
7
|
import { parseSemVer } from "./semver-DWClQt_5.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
|
package/dist/compat/mod.d.ts
CHANGED
@@ -5,11 +5,11 @@ import "../docloader-BeCtcTOJ.js";
|
|
5
5
|
import "../client-BQ4AQGKo.js";
|
6
6
|
import "../vocab-By6mpzr-.js";
|
7
7
|
import "../actor-B4TBtqRP.js";
|
8
|
-
import "../http-
|
8
|
+
import "../http-CP2ZUALI.js";
|
9
9
|
import "../owner-CEv_PfyK.js";
|
10
10
|
import "../mod-BFwgZ7_K.js";
|
11
11
|
import "../lookup-J_m4YZg0.js";
|
12
|
-
import { ActivityTransformer } from "../context-
|
12
|
+
import { ActivityTransformer } from "../context-CrSyJrIa.js";
|
13
13
|
import "../mq-DYKDDJmp.js";
|
14
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-
|
14
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-DpE8T10I.js";
|
15
15
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
@@ -7,32 +7,32 @@ import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
|
7
7
|
import { assert } from "../assert-DwEa6glZ.js";
|
8
8
|
import { assertInstanceOf } from "../assert_instance_of-C9QtN-X9.js";
|
9
9
|
import { MemoryKvStore } from "../kv-D7Yt6pnB.js";
|
10
|
-
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-
|
11
|
-
import "../docloader-
|
10
|
+
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-HCB2lM2L.js";
|
11
|
+
import "../docloader-HJTyC3AL.js";
|
12
12
|
import "../url-kTAI6_KP.js";
|
13
13
|
import "../semver-DWClQt_5.js";
|
14
|
-
import "../client-
|
14
|
+
import "../client-BkSxmZ6i.js";
|
15
15
|
import "../router-D3UybECj.js";
|
16
16
|
import "../types-C7C_l-jz.js";
|
17
17
|
import "../multibase-DeCHcK8L.js";
|
18
|
-
import { Follow, Person } from "../vocab-
|
18
|
+
import { Follow, Person } from "../vocab-p_5Ny1-3.js";
|
19
19
|
import "../langstr-DbWheeIS.js";
|
20
|
-
import "../lookup-
|
20
|
+
import "../lookup-DJwSVJZY.js";
|
21
21
|
import "../type-D2s5lmbZ.js";
|
22
|
-
import "../actor-
|
23
|
-
import "../key-
|
24
|
-
import "../http-
|
25
|
-
import "../authdocloader-
|
26
|
-
import "../ld-
|
27
|
-
import "../owner-
|
28
|
-
import "../proof-
|
29
|
-
import "../lookup-
|
30
|
-
import "../inbox-
|
31
|
-
import "../builder-
|
22
|
+
import "../actor-BBYHS7Zc.js";
|
23
|
+
import "../key-C-gwymCd.js";
|
24
|
+
import "../http-BAzbPaIH.js";
|
25
|
+
import "../authdocloader-DtMpkZJn.js";
|
26
|
+
import "../ld-B72eFGM9.js";
|
27
|
+
import "../owner-DlQ5tZcw.js";
|
28
|
+
import "../proof-BOsUiEhe.js";
|
29
|
+
import "../lookup-d957Iv56.js";
|
30
|
+
import "../inbox-BNehUJP3.js";
|
31
|
+
import "../builder-Dv3HwtjN.js";
|
32
32
|
import "../collection-Dfb0TPno.js";
|
33
|
-
import "../keycache-
|
33
|
+
import "../keycache-CXuGdV-G.js";
|
34
34
|
import "../retry-BiIhZWgD.js";
|
35
|
-
import "../send-
|
35
|
+
import "../send-XPEqnmi8.js";
|
36
36
|
import { test } from "../testing-BZ0dJ4qn.js";
|
37
37
|
|
38
38
|
//#region compat/transformers.test.ts
|
@@ -5,7 +5,7 @@ import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFacto
|
|
5
5
|
import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-BQ4AQGKo.js";
|
6
6
|
import { Activity, Collection, CryptographicKey, Hashtag, Link, Multikey, Object as Object$1 } from "./vocab-By6mpzr-.js";
|
7
7
|
import { Actor, Recipient } from "./actor-B4TBtqRP.js";
|
8
|
-
import { HttpMessageSignaturesSpec } from "./http-
|
8
|
+
import { HttpMessageSignaturesSpec } from "./http-CP2ZUALI.js";
|
9
9
|
import { GetKeyOwnerOptions } from "./owner-CEv_PfyK.js";
|
10
10
|
import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-BFwgZ7_K.js";
|
11
11
|
import { LookupWebFingerOptions, ResourceDescriptor } from "./lookup-J_m4YZg0.js";
|
@@ -4,8 +4,8 @@
|
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
6
|
import { RouterError } from "./router-D3UybECj.js";
|
7
|
-
import { lookupWebFinger } from "./lookup-
|
8
|
-
import { lookupObject, traverseCollection } from "./lookup-
|
7
|
+
import { lookupWebFinger } from "./lookup-DJwSVJZY.js";
|
8
|
+
import { lookupObject, traverseCollection } from "./lookup-d957Iv56.js";
|
9
9
|
import { mockDocumentLoader } from "./docloader-09nVWLAZ.js";
|
10
10
|
import { trace } from "@opentelemetry/api";
|
11
11
|
|
@@ -7,16 +7,16 @@ import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
|
7
7
|
import "../assert-DwEa6glZ.js";
|
8
8
|
import "../assert_instance_of-C9QtN-X9.js";
|
9
9
|
import { MemoryKvStore } from "../kv-D7Yt6pnB.js";
|
10
|
-
import "../docloader-
|
10
|
+
import "../docloader-HJTyC3AL.js";
|
11
11
|
import "../url-kTAI6_KP.js";
|
12
12
|
import { parseSemVer } from "../semver-DWClQt_5.js";
|
13
13
|
import "../router-D3UybECj.js";
|
14
14
|
import "../multibase-DeCHcK8L.js";
|
15
|
-
import { Activity, Note, Person } from "../vocab-
|
15
|
+
import { Activity, Note, Person } from "../vocab-p_5Ny1-3.js";
|
16
16
|
import "../langstr-DbWheeIS.js";
|
17
17
|
import "../type-D2s5lmbZ.js";
|
18
|
-
import "../inbox-
|
19
|
-
import { createFederationBuilder } from "../builder-
|
18
|
+
import "../inbox-BNehUJP3.js";
|
19
|
+
import { createFederationBuilder } from "../builder-Dv3HwtjN.js";
|
20
20
|
import { test } from "../testing-BZ0dJ4qn.js";
|
21
21
|
import { assertExists } from "../std__assert-B3iAixc-.js";
|
22
22
|
import "../assert_rejects-DceVjUlD.js";
|
@@ -7,32 +7,32 @@ import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
|
7
7
|
import { assert } from "../assert-DwEa6glZ.js";
|
8
8
|
import "../assert_instance_of-C9QtN-X9.js";
|
9
9
|
import { MemoryKvStore } from "../kv-D7Yt6pnB.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-HCB2lM2L.js";
|
11
|
+
import "../docloader-HJTyC3AL.js";
|
12
12
|
import "../url-kTAI6_KP.js";
|
13
13
|
import "../semver-DWClQt_5.js";
|
14
|
-
import "../client-
|
14
|
+
import "../client-BkSxmZ6i.js";
|
15
15
|
import "../router-D3UybECj.js";
|
16
16
|
import "../types-C7C_l-jz.js";
|
17
17
|
import "../multibase-DeCHcK8L.js";
|
18
|
-
import { Create, Note, Person } from "../vocab-
|
18
|
+
import { Create, Note, Person } from "../vocab-p_5Ny1-3.js";
|
19
19
|
import "../langstr-DbWheeIS.js";
|
20
|
-
import "../lookup-
|
20
|
+
import "../lookup-DJwSVJZY.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-
|
22
|
+
import "../actor-BBYHS7Zc.js";
|
23
|
+
import "../key-C-gwymCd.js";
|
24
|
+
import { signRequest } from "../http-BAzbPaIH.js";
|
25
|
+
import "../authdocloader-DtMpkZJn.js";
|
26
|
+
import "../ld-B72eFGM9.js";
|
27
|
+
import "../owner-DlQ5tZcw.js";
|
28
|
+
import "../proof-BOsUiEhe.js";
|
29
|
+
import "../lookup-d957Iv56.js";
|
30
|
+
import "../inbox-BNehUJP3.js";
|
31
|
+
import "../builder-Dv3HwtjN.js";
|
32
32
|
import "../collection-Dfb0TPno.js";
|
33
|
-
import "../keycache-
|
33
|
+
import "../keycache-CXuGdV-G.js";
|
34
34
|
import "../retry-BiIhZWgD.js";
|
35
|
-
import "../send-
|
35
|
+
import "../send-XPEqnmi8.js";
|
36
36
|
import { test } from "../testing-BZ0dJ4qn.js";
|
37
37
|
import "../std__assert-B3iAixc-.js";
|
38
38
|
import { assertFalse } from "../assert_rejects-DceVjUlD.js";
|
@@ -40,8 +40,8 @@ import "../assert_is_error-DQdKoRgb.js";
|
|
40
40
|
import "../assert_not_equals-7pyUM3Ib.js";
|
41
41
|
import "../assert_throws-DTDC_gwN.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-Ctx-I1t_.js";
|
44
|
+
import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-CD3a5bd5.js";
|
45
45
|
|
46
46
|
//#region federation/handler.test.ts
|
47
47
|
test("acceptsJsonLd()", () => {
|
@@ -4,13 +4,13 @@
|
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
6
|
import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
7
|
-
import "../docloader-
|
7
|
+
import "../docloader-HJTyC3AL.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-p_5Ny1-3.js";
|
11
11
|
import "../langstr-DbWheeIS.js";
|
12
12
|
import "../type-D2s5lmbZ.js";
|
13
|
-
import { InboxListenerSet } from "../inbox-
|
13
|
+
import { InboxListenerSet } from "../inbox-BNehUJP3.js";
|
14
14
|
import { test } from "../testing-BZ0dJ4qn.js";
|
15
15
|
import "../assert_is_error-DQdKoRgb.js";
|
16
16
|
import { assertThrows } from "../assert_throws-DTDC_gwN.js";
|
@@ -7,12 +7,12 @@ import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
|
7
7
|
import { assert } from "../assert-DwEa6glZ.js";
|
8
8
|
import { assertInstanceOf } from "../assert_instance_of-C9QtN-X9.js";
|
9
9
|
import { MemoryKvStore } from "../kv-D7Yt6pnB.js";
|
10
|
-
import "../docloader-
|
10
|
+
import "../docloader-HJTyC3AL.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-p_5Ny1-3.js";
|
14
14
|
import "../langstr-DbWheeIS.js";
|
15
|
-
import { KvKeyCache } from "../keycache-
|
15
|
+
import { KvKeyCache } from "../keycache-CXuGdV-G.js";
|
16
16
|
import { test } from "../testing-BZ0dJ4qn.js";
|
17
17
|
|
18
18
|
//#region federation/keycache.test.ts
|
@@ -7,32 +7,32 @@ import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
|
7
7
|
import { assert } from "../assert-DwEa6glZ.js";
|
8
8
|
import { assertInstanceOf } from "../assert_instance_of-C9QtN-X9.js";
|
9
9
|
import { MemoryKvStore } from "../kv-D7Yt6pnB.js";
|
10
|
-
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "../middleware-
|
11
|
-
import { FetchError, fetchDocumentLoader } from "../docloader-
|
10
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "../middleware-HCB2lM2L.js";
|
11
|
+
import { FetchError, fetchDocumentLoader } from "../docloader-HJTyC3AL.js";
|
12
12
|
import "../url-kTAI6_KP.js";
|
13
13
|
import "../semver-DWClQt_5.js";
|
14
|
-
import "../client-
|
14
|
+
import "../client-BkSxmZ6i.js";
|
15
15
|
import { RouterError } from "../router-D3UybECj.js";
|
16
16
|
import "../types-C7C_l-jz.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-p_5Ny1-3.js";
|
19
19
|
import "../langstr-DbWheeIS.js";
|
20
|
-
import "../lookup-
|
20
|
+
import "../lookup-DJwSVJZY.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-
|
22
|
+
import "../actor-BBYHS7Zc.js";
|
23
|
+
import "../key-C-gwymCd.js";
|
24
|
+
import { signRequest, verifyRequest } from "../http-BAzbPaIH.js";
|
25
|
+
import { getAuthenticatedDocumentLoader } from "../authdocloader-DtMpkZJn.js";
|
26
|
+
import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-B72eFGM9.js";
|
27
|
+
import { doesActorOwnKey } from "../owner-DlQ5tZcw.js";
|
28
|
+
import { signObject, verifyObject } from "../proof-BOsUiEhe.js";
|
29
|
+
import { lookupObject } from "../lookup-d957Iv56.js";
|
30
|
+
import "../inbox-BNehUJP3.js";
|
31
|
+
import "../builder-Dv3HwtjN.js";
|
32
32
|
import "../collection-Dfb0TPno.js";
|
33
|
-
import "../keycache-
|
33
|
+
import "../keycache-CXuGdV-G.js";
|
34
34
|
import "../retry-BiIhZWgD.js";
|
35
|
-
import "../send-
|
35
|
+
import "../send-XPEqnmi8.js";
|
36
36
|
import { test } from "../testing-BZ0dJ4qn.js";
|
37
37
|
import { assertStrictEquals } from "../std__assert-B3iAixc-.js";
|
38
38
|
import { assertFalse, assertRejects } from "../assert_rejects-DceVjUlD.js";
|
@@ -40,7 +40,7 @@ import "../assert_is_error-DQdKoRgb.js";
|
|
40
40
|
import { assertNotEquals } from "../assert_not_equals-7pyUM3Ib.js";
|
41
41
|
import { assertThrows } from "../assert_throws-DTDC_gwN.js";
|
42
42
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
43
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-
|
43
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-CD3a5bd5.js";
|
44
44
|
import { esm_default } from "../esm-d-9EVGaP.js";
|
45
45
|
|
46
46
|
//#region testing/fixtures/example.com/person.json
|
package/dist/federation/mod.d.ts
CHANGED
@@ -5,11 +5,11 @@ import "../docloader-BeCtcTOJ.js";
|
|
5
5
|
import "../client-BQ4AQGKo.js";
|
6
6
|
import "../vocab-By6mpzr-.js";
|
7
7
|
import "../actor-B4TBtqRP.js";
|
8
|
-
import "../http-
|
8
|
+
import "../http-CP2ZUALI.js";
|
9
9
|
import "../owner-CEv_PfyK.js";
|
10
10
|
import "../mod-BFwgZ7_K.js";
|
11
11
|
import "../lookup-J_m4YZg0.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-
|
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-CrSyJrIa.js";
|
13
13
|
import { InProcessMessageQueue, InProcessMessageQueueOptions, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, ParallelMessageQueue } from "../mq-DYKDDJmp.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
@@ -3,16 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
5
|
import "../transformers-ghwJuzGY.js";
|
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-
|
6
|
+
import "../docloader-BOrtj2l_.js";
|
7
|
+
import "../actor-CX0Gdycg.js";
|
8
|
+
import { Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-CVwSsoEb.js";
|
9
|
+
import "../lookup-owlfW5CG.js";
|
10
|
+
import "../key-CxXe6xQ0.js";
|
11
|
+
import "../http-Ct87hDzx.js";
|
12
|
+
import "../proof-C54qhsPT.js";
|
13
13
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "../federation-C44ekWNP.js";
|
14
|
-
import "../types-
|
15
|
-
import "../authdocloader-
|
16
|
-
import "../vocab-
|
14
|
+
import "../types-CXmk4Ap7.js";
|
15
|
+
import "../authdocloader-CsoRGXWD.js";
|
16
|
+
import "../vocab-CVR-yfiV.js";
|
17
17
|
|
18
18
|
export { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable };
|
@@ -6,18 +6,18 @@
|
|
6
6
|
import { assertEquals } from "../assert_equals-C5gKCm6A.js";
|
7
7
|
import { assert } from "../assert-DwEa6glZ.js";
|
8
8
|
import "../assert_instance_of-C9QtN-X9.js";
|
9
|
-
import "../docloader-
|
9
|
+
import "../docloader-HJTyC3AL.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-p_5Ny1-3.js";
|
13
13
|
import "../langstr-DbWheeIS.js";
|
14
|
-
import "../lookup-
|
14
|
+
import "../lookup-DJwSVJZY.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-BBYHS7Zc.js";
|
17
|
+
import "../key-C-gwymCd.js";
|
18
|
+
import { verifyRequest } from "../http-BAzbPaIH.js";
|
19
|
+
import { doesActorOwnKey } from "../owner-DlQ5tZcw.js";
|
20
|
+
import { extractInboxes, sendActivity } from "../send-XPEqnmi8.js";
|
21
21
|
import { test } from "../testing-BZ0dJ4qn.js";
|
22
22
|
import "../std__assert-B3iAixc-.js";
|
23
23
|
import { assertFalse, assertRejects } from "../assert_rejects-DceVjUlD.js";
|
@@ -25,7 +25,7 @@ import "../assert_is_error-DQdKoRgb.js";
|
|
25
25
|
import { assertNotEquals } from "../assert_not_equals-7pyUM3Ib.js";
|
26
26
|
import "../assert_throws-DTDC_gwN.js";
|
27
27
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
28
|
-
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-
|
28
|
+
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-CD3a5bd5.js";
|
29
29
|
import { esm_default } from "../esm-d-9EVGaP.js";
|
30
30
|
|
31
31
|
//#region federation/send.test.ts
|
@@ -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-HJTyC3AL.js";
|
7
|
+
import { CryptographicKey } from "./vocab-p_5Ny1-3.js";
|
8
|
+
import { fetchKey, validateCryptoKey } from "./key-C-gwymCd.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";
|
@@ -31,8 +31,8 @@ async function signRequest(request, privateKey, keyId, options = {}) {
|
|
31
31
|
try {
|
32
32
|
const spec = options.spec ?? "draft-cavage-http-signatures-12";
|
33
33
|
let signed;
|
34
|
-
if (spec === "rfc9421") signed = await signRequestRfc9421(request, privateKey, keyId, span, options.currentTime
|
35
|
-
else signed = await signRequestDraft(request, privateKey, keyId, span, options.currentTime
|
34
|
+
if (spec === "rfc9421") signed = await signRequestRfc9421(request, privateKey, keyId, span, options.currentTime);
|
35
|
+
else signed = await signRequestDraft(request, privateKey, keyId, span, options.currentTime);
|
36
36
|
if (span.isRecording()) {
|
37
37
|
span.setAttribute(ATTR_HTTP_REQUEST_METHOD, signed.method);
|
38
38
|
span.setAttribute(ATTR_URL_FULL, signed.url);
|
@@ -51,10 +51,10 @@ async function signRequest(request, privateKey, keyId, options = {}) {
|
|
51
51
|
}
|
52
52
|
});
|
53
53
|
}
|
54
|
-
async function signRequestDraft(request, privateKey, keyId, span, currentTime
|
54
|
+
async function signRequestDraft(request, privateKey, keyId, span, currentTime) {
|
55
55
|
if (privateKey.algorithm.name !== "RSASSA-PKCS1-v1_5") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
|
56
56
|
const url = new URL(request.url);
|
57
|
-
const body =
|
57
|
+
const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
58
58
|
const headers = new Headers(request.headers);
|
59
59
|
if (!headers.has("Host")) headers.set("Host", url.host);
|
60
60
|
if (!headers.has("Digest") && body != null) {
|
@@ -185,10 +185,10 @@ function parseRfc9421Signature(signature) {
|
|
185
185
|
for (const [key, value] of Object.entries(dict)) if (value.value instanceof Uint8Array) result[key] = value.value;
|
186
186
|
return result;
|
187
187
|
}
|
188
|
-
async function signRequestRfc9421(request, privateKey, keyId, span, currentTime
|
188
|
+
async function signRequestRfc9421(request, privateKey, keyId, span, currentTime) {
|
189
189
|
if (privateKey.algorithm.name !== "RSASSA-PKCS1-v1_5") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
|
190
190
|
const url = new URL(request.url);
|
191
|
-
const body =
|
191
|
+
const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
192
192
|
const headers = new Headers(request.headers);
|
193
193
|
if (!headers.has("Host")) headers.set("Host", url.host);
|
194
194
|
if (!headers.has("Content-Digest") && body != null) {
|
@@ -645,29 +645,6 @@ async function verifyRequestRfc9421(request, span, { documentLoader, contextLoad
|
|
645
645
|
return validKey;
|
646
646
|
}
|
647
647
|
/**
|
648
|
-
* Helper function to create a new Request for redirect handling.
|
649
|
-
* @param request The original request.
|
650
|
-
* @param location The redirect location.
|
651
|
-
* @param body The request body as ArrayBuffer or null.
|
652
|
-
* @returns A new Request object for the redirect.
|
653
|
-
*/
|
654
|
-
function createRedirectRequest(request, location, body) {
|
655
|
-
return new Request(location, {
|
656
|
-
method: request.method,
|
657
|
-
headers: request.headers,
|
658
|
-
body,
|
659
|
-
redirect: "manual",
|
660
|
-
signal: request.signal,
|
661
|
-
mode: request.mode,
|
662
|
-
credentials: request.credentials,
|
663
|
-
referrer: request.referrer,
|
664
|
-
referrerPolicy: request.referrerPolicy,
|
665
|
-
integrity: request.integrity,
|
666
|
-
keepalive: request.keepalive,
|
667
|
-
cache: request.cache
|
668
|
-
});
|
669
|
-
}
|
670
|
-
/**
|
671
648
|
* Performs a double-knock request to the given URL. For the details of
|
672
649
|
* double-knocking, see
|
673
650
|
* <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>.
|
@@ -681,20 +658,28 @@ async function doubleKnock(request, identity, options = {}) {
|
|
681
658
|
const { specDeterminer, log, tracerProvider } = options;
|
682
659
|
const origin = new URL(request.url).origin;
|
683
660
|
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
684
|
-
const body = options.body !== void 0 ? options.body : request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
685
661
|
let signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
|
686
662
|
spec: firstTrySpec,
|
687
|
-
tracerProvider
|
688
|
-
body
|
663
|
+
tracerProvider
|
689
664
|
});
|
690
665
|
log?.(signedRequest);
|
691
666
|
let response = await fetch(signedRequest, { redirect: "manual" });
|
692
667
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
693
668
|
const location = response.headers.get("Location");
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
669
|
+
const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : void 0;
|
670
|
+
return doubleKnock(new Request(location, {
|
671
|
+
method: request.method,
|
672
|
+
headers: request.headers,
|
673
|
+
body,
|
674
|
+
redirect: "manual",
|
675
|
+
signal: request.signal,
|
676
|
+
mode: request.mode,
|
677
|
+
credentials: request.credentials,
|
678
|
+
referrer: request.referrer,
|
679
|
+
referrerPolicy: request.referrerPolicy,
|
680
|
+
integrity: request.integrity,
|
681
|
+
keepalive: request.keepalive
|
682
|
+
}), identity, options);
|
698
683
|
} else if (response.status === 400 || response.status === 401 || response.status > 401) {
|
699
684
|
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
700
685
|
getLogger([
|
@@ -709,17 +694,17 @@ async function doubleKnock(request, identity, options = {}) {
|
|
709
694
|
});
|
710
695
|
signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
|
711
696
|
spec,
|
712
|
-
tracerProvider
|
713
|
-
body
|
697
|
+
tracerProvider
|
714
698
|
});
|
715
699
|
log?.(signedRequest);
|
716
700
|
response = await fetch(signedRequest, { redirect: "manual" });
|
717
701
|
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
718
702
|
const location = response.headers.get("Location");
|
719
|
-
|
720
|
-
|
703
|
+
const body = request.method !== "GET" && request.method !== "HEAD" ? request.clone().body : null;
|
704
|
+
return doubleKnock(new Request(location, {
|
705
|
+
...request,
|
721
706
|
body
|
722
|
-
});
|
707
|
+
}), identity, options);
|
723
708
|
} else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
724
709
|
} else await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
725
710
|
return response;
|
@@ -148,11 +148,6 @@ interface SignRequestOptions {
|
|
148
148
|
* @since 1.6.0
|
149
149
|
*/
|
150
150
|
currentTime?: Temporal.Instant;
|
151
|
-
/**
|
152
|
-
* The request body as ArrayBuffer. If provided, avoids cloning the request body.
|
153
|
-
* @since 1.8.0
|
154
|
-
*/
|
155
|
-
body?: ArrayBuffer | null;
|
156
151
|
/**
|
157
152
|
* The OpenTelemetry tracer provider. If omitted, the global tracer provider
|
158
153
|
* is used.
|