@fedify/fedify 2.2.19 → 2.2.21
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/attachment-arrays-CalAATqD.mjs +16 -0
- package/dist/{builder-UmydCxtK.mjs → builder-4ImvtjG4.mjs} +3 -3
- package/dist/callback-0KrwzutD.d.mts +2607 -0
- package/dist/{client-CSddvgWN.d.ts → client-9DPcy_Yx.d.ts} +16 -1
- package/dist/{client-CAM_bQXx.d.cts → client-B3ruDgWg.d.cts} +16 -1
- package/dist/{client-9F_u23dc.mjs → client-XYMC0Mmk.mjs} +189 -65
- package/dist/compat/attachment-arrays.test.d.mts +2 -0
- package/dist/compat/attachment-arrays.test.mjs +255 -0
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/outgoing-jsonld.test.mjs +1 -1
- package/dist/compat/public-audience.test.mjs +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{context-tJbL_Hkw.d.cts → context-CjWuov0g.d.cts} +57 -14
- package/dist/{context-OkwEpc3-.d.ts → context-DZqI2LJD.d.ts} +57 -14
- package/dist/{deno-CD-8UlUi.mjs → deno-AWk3S2Ug.mjs} +1 -1
- package/dist/docloader-Bogpjg4d.mjs +125 -0
- package/dist/federation/attachment-responses.test.d.mts +2 -0
- package/dist/federation/attachment-responses.test.mjs +182 -0
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/delivery-attachments.test.d.mts +2 -0
- package/dist/federation/delivery-attachments.test.mjs +288 -0
- package/dist/federation/handler.test.mjs +208 -16
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox.test.mjs +2 -2
- package/dist/federation/middleware.test.mjs +1567 -30
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +2 -2
- package/dist/federation/mod.d.ts +2 -2
- package/dist/federation/mod.js +1 -1
- package/dist/federation/negotiation.test.mjs +1 -1
- package/dist/federation/retry.test.mjs +1 -1
- package/dist/federation/send.test.mjs +723 -68
- package/dist/federation/temporal.test.mjs +25 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-BBBUbwKh.mjs → http-B3wCvgu8.mjs} +199 -99
- package/dist/{http-DrUG4fPS.cjs → http-BNaPJVnF.cjs} +178 -107
- package/dist/{http-DJK2udgX.js → http-BpdLaGy8.js} +177 -106
- package/dist/{http-Dl00HXr4.d.ts → http-C8qLHs_Z.d.cts} +3 -4
- package/dist/{http-DqZhyEso.d.cts → http-D8WmcRAF.d.ts} +3 -4
- package/dist/{inbox-Dca_0fwc.mjs → inbox-DLy6WBXU.mjs} +1 -1
- package/dist/{key-DolXUaLH.mjs → key-Bhc8cQC7.mjs} +3 -2
- package/dist/{kv-cache-Bk3V1Tiu.cjs → kv-cache-Bj3CY9Jo.cjs} +59 -17
- package/dist/{kv-cache-DDm80t1K.js → kv-cache-CvjLUQTf.js} +60 -18
- package/dist/{ld-rTdIfZ63.mjs → ld-DTeykI0e.mjs} +153 -21
- package/dist/ld-signature-Dgz_b89j.mjs +23 -0
- package/dist/{middleware-BWOwEGpy.cjs → middleware-BSQP4d9p.cjs} +642 -149
- package/dist/{middleware-B4-Rzdi3.cjs → middleware-CWOzxb3o.cjs} +1 -1
- package/dist/{middleware-DYK_res8.mjs → middleware-DkMsC5mQ.mjs} +1 -1
- package/dist/{middleware-BimXKBcP.js → middleware-Dx1iwFk8.js} +641 -149
- package/dist/{middleware-CpXoRHs3.mjs → middleware-dlGvSrXl.mjs} +452 -122
- package/dist/{mod-D2JyWtW3.d.cts → mod-BmxqcEnU.d.ts} +30 -13
- package/dist/{mod-a6kmB8xD.d.cts → mod-DWEx2D4q.d.cts} +1 -1
- package/dist/{mod-DQGjRJUG.d.ts → mod-DnPmz3-S.d.ts} +1 -1
- package/dist/{mod-ej_rLx8h.d.ts → mod-INjDw-m0.d.cts} +30 -13
- package/dist/{mod-B6LmugJ4.d.ts → mod-REfljt0T.d.ts} +4 -10
- package/dist/{mod-V2vDnYNu.d.cts → mod-UvIGUHqW.d.cts} +4 -10
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +8 -8
- package/dist/mod.d.ts +8 -8
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/client.test.mjs +764 -18
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/nodeinfo/mod.cjs +1 -1
- package/dist/nodeinfo/mod.d.cts +1 -1
- package/dist/nodeinfo/mod.d.ts +1 -1
- package/dist/nodeinfo/mod.js +1 -1
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/otel/exporter.test.mjs +292 -30
- package/dist/otel/mod.cjs +36 -30
- package/dist/otel/mod.d.cts +13 -0
- package/dist/otel/mod.d.ts +13 -0
- package/dist/otel/mod.js +36 -30
- package/dist/{outgoing-jsonld-amccRMrV.mjs → outgoing-jsonld-DHf_DYXp.mjs} +38 -8
- package/dist/{owner-CVfzyM5V.mjs → owner-BsA7qMHB.mjs} +2 -2
- package/dist/{proof-gOGM-sJS.mjs → proof-C63Hqt9N.mjs} +40 -15
- package/dist/{proof-DhaTTn-P.cjs → proof-Dbz6ApNP.cjs} +1190 -1007
- package/dist/{proof-CaQ4KG6y.js → proof-QV_o5ZqS.js} +1174 -1003
- package/dist/send-CAdpwbFX.mjs +416 -0
- package/dist/sig/http.test.mjs +528 -2
- package/dist/sig/key-types.test.d.mts +218 -0
- package/dist/sig/key-types.test.mjs +8 -0
- package/dist/sig/key.test.mjs +2 -2
- package/dist/sig/ld.test.mjs +573 -8
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +96 -4
- package/dist/{temporal-CA4Y9hBJ.mjs → temporal-B3JGkVgk.mjs} +3 -5
- package/dist/testing/mod.d.mts +1 -2396
- package/dist/{types-DRPjmHVV.cjs → types-BWx7zw3Y.cjs} +187 -63
- package/dist/{types-miAYfiGO.js → types-Dx_w2JSM.js} +188 -64
- package/dist/utils/docloader.test.mjs +318 -34
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
- package/dist/docloader-D1ghurDJ.mjs +0 -83
- package/dist/send-D35Va72B.mjs +0 -260
- /package/dist/{activity-listener-ell7W1s9.mjs → activity-listener-tztVvlNb.mjs} +0 -0
- /package/dist/{collection-D-HqUuA2.mjs → collection-CA3V5zyK.mjs} +0 -0
- /package/dist/{negotiation-SQvQgUqe.mjs → negotiation-VnHNB0Q5.mjs} +0 -0
- /package/dist/{public-audience-DpJqzPuh.mjs → public-audience-4g3_Ze4y.mjs} +0 -0
- /package/dist/{retry-v_sGLH1d.mjs → retry-CXg_MBI-.mjs} +0 -0
- /package/dist/{types-J53Kw7so.mjs → types-BFowWFTT.mjs} +0 -0
|
@@ -4,20 +4,23 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-Dk_tacqz.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-DNZ4Liil.mjs";
|
|
7
|
+
import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
|
|
7
8
|
import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
|
|
8
9
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
9
10
|
import { r as parseAcceptSignature } from "../accept-Dd__NiUL.mjs";
|
|
10
|
-
import { a as generateCryptoKeyPair } from "../key-
|
|
11
|
-
import {
|
|
11
|
+
import { a as generateCryptoKeyPair } from "../key-Bhc8cQC7.mjs";
|
|
12
|
+
import { c as signRequest } from "../http-B3wCvgu8.mjs";
|
|
12
13
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
|
|
13
14
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
14
|
-
import { a as compactJsonLd,
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { a as compactJsonLd, h as signJsonLd } from "../ld-DTeykI0e.mjs";
|
|
16
|
+
import { t as ldSignatureWithoutCreated } from "../ld-signature-Dgz_b89j.mjs";
|
|
17
|
+
import { r as signObject } from "../proof-C63Hqt9N.mjs";
|
|
18
|
+
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-dlGvSrXl.mjs";
|
|
19
|
+
import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
|
|
18
20
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
21
|
import { Activity, Create, CryptographicKey, Multikey, Note, Person, Tombstone } from "@fedify/vocab";
|
|
20
22
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
23
|
+
import { configure, reset } from "@logtape/logtape";
|
|
21
24
|
//#region src/federation/handler.test.ts
|
|
22
25
|
const QUOTE_CONTEXT_TERMS = {
|
|
23
26
|
QuoteAuthorization: "https://w3id.org/fep/044f#QuoteAuthorization",
|
|
@@ -601,8 +604,8 @@ test("handleCollection()", async () => {
|
|
|
601
604
|
assertEquals(response.status, 200);
|
|
602
605
|
assertEquals(response.headers.get("Content-Type"), "application/activity+json");
|
|
603
606
|
const createCtx = [
|
|
604
|
-
"https://w3id.org/identity/v1",
|
|
605
607
|
"https://www.w3.org/ns/activitystreams",
|
|
608
|
+
"https://w3id.org/security/v1",
|
|
606
609
|
"https://w3id.org/security/data-integrity/v1",
|
|
607
610
|
"https://gotosocial.org/ns",
|
|
608
611
|
{
|
|
@@ -649,7 +652,13 @@ test("handleCollection()", async () => {
|
|
|
649
652
|
"@id": "fedibird:emojiReactions",
|
|
650
653
|
"@type": "@id"
|
|
651
654
|
}
|
|
652
|
-
}
|
|
655
|
+
},
|
|
656
|
+
{ orderedItems: {
|
|
657
|
+
"@id": "https://www.w3.org/ns/activitystreams#items",
|
|
658
|
+
"@type": "@id",
|
|
659
|
+
"@container": "@list",
|
|
660
|
+
"@context": null
|
|
661
|
+
} }
|
|
653
662
|
],
|
|
654
663
|
id: "https://example.com/users/someone",
|
|
655
664
|
type: "OrderedCollection",
|
|
@@ -734,7 +743,13 @@ test("handleCollection()", async () => {
|
|
|
734
743
|
"@id": "fedibird:emojiReactions",
|
|
735
744
|
"@type": "@id"
|
|
736
745
|
}
|
|
737
|
-
}
|
|
746
|
+
},
|
|
747
|
+
{ orderedItems: {
|
|
748
|
+
"@id": "https://www.w3.org/ns/activitystreams#items",
|
|
749
|
+
"@type": "@id",
|
|
750
|
+
"@container": "@list",
|
|
751
|
+
"@context": null
|
|
752
|
+
} }
|
|
738
753
|
],
|
|
739
754
|
id: "https://example.com/users/someone",
|
|
740
755
|
type: "OrderedCollection",
|
|
@@ -854,7 +869,13 @@ test("handleCollection()", async () => {
|
|
|
854
869
|
"@id": "fedibird:emojiReactions",
|
|
855
870
|
"@type": "@id"
|
|
856
871
|
}
|
|
857
|
-
}
|
|
872
|
+
},
|
|
873
|
+
{ orderedItems: {
|
|
874
|
+
"@id": "https://www.w3.org/ns/activitystreams#items",
|
|
875
|
+
"@type": "@id",
|
|
876
|
+
"@container": "@list",
|
|
877
|
+
"@context": null
|
|
878
|
+
} }
|
|
858
879
|
],
|
|
859
880
|
id: "https://example.com/users/someone?cursor=0",
|
|
860
881
|
type: "OrderedCollectionPage",
|
|
@@ -914,7 +935,13 @@ test("handleCollection()", async () => {
|
|
|
914
935
|
"@id": "fedibird:emojiReactions",
|
|
915
936
|
"@type": "@id"
|
|
916
937
|
}
|
|
917
|
-
}
|
|
938
|
+
},
|
|
939
|
+
{ orderedItems: {
|
|
940
|
+
"@id": "https://www.w3.org/ns/activitystreams#items",
|
|
941
|
+
"@type": "@id",
|
|
942
|
+
"@container": "@list",
|
|
943
|
+
"@context": null
|
|
944
|
+
} }
|
|
918
945
|
],
|
|
919
946
|
id: "https://example.com/users/someone?cursor=2",
|
|
920
947
|
type: "OrderedCollectionPage",
|
|
@@ -2551,6 +2578,166 @@ test("handleOutbox()", async () => {
|
|
|
2551
2578
|
assertEquals(response.status, 500);
|
|
2552
2579
|
assertEquals(onErrorCalled, true);
|
|
2553
2580
|
});
|
|
2581
|
+
test("handleInbox() verifies Linked Data signatures without created", async (t) => {
|
|
2582
|
+
const inserted = structuredClone(ldSignatureWithoutCreated);
|
|
2583
|
+
const withTimestamp = {
|
|
2584
|
+
...inserted,
|
|
2585
|
+
signature: {
|
|
2586
|
+
...inserted.signature,
|
|
2587
|
+
created: "2024-09-12T16:50:46Z"
|
|
2588
|
+
}
|
|
2589
|
+
};
|
|
2590
|
+
const tampered = structuredClone(ldSignatureWithoutCreated);
|
|
2591
|
+
tampered.object.content = "tampered";
|
|
2592
|
+
const invalid = structuredClone(ldSignatureWithoutCreated);
|
|
2593
|
+
invalid.signature.signatureValue = "AAAA";
|
|
2594
|
+
const { signature: _, ...unsigned } = ldSignatureWithoutCreated;
|
|
2595
|
+
for (const [name, body, expected] of [
|
|
2596
|
+
[
|
|
2597
|
+
"valid LD-only",
|
|
2598
|
+
ldSignatureWithoutCreated,
|
|
2599
|
+
202
|
|
2600
|
+
],
|
|
2601
|
+
[
|
|
2602
|
+
"inserted created",
|
|
2603
|
+
withTimestamp,
|
|
2604
|
+
401
|
|
2605
|
+
],
|
|
2606
|
+
[
|
|
2607
|
+
"tampered content",
|
|
2608
|
+
tampered,
|
|
2609
|
+
401
|
|
2610
|
+
],
|
|
2611
|
+
[
|
|
2612
|
+
"invalid signature",
|
|
2613
|
+
invalid,
|
|
2614
|
+
401
|
|
2615
|
+
],
|
|
2616
|
+
[
|
|
2617
|
+
"unsigned",
|
|
2618
|
+
unsigned,
|
|
2619
|
+
401
|
|
2620
|
+
],
|
|
2621
|
+
[
|
|
2622
|
+
"malformed created",
|
|
2623
|
+
{
|
|
2624
|
+
...ldSignatureWithoutCreated,
|
|
2625
|
+
signature: {
|
|
2626
|
+
...ldSignatureWithoutCreated.signature,
|
|
2627
|
+
created: 123
|
|
2628
|
+
}
|
|
2629
|
+
},
|
|
2630
|
+
401
|
|
2631
|
+
],
|
|
2632
|
+
[
|
|
2633
|
+
"malformed creator",
|
|
2634
|
+
{
|
|
2635
|
+
...ldSignatureWithoutCreated,
|
|
2636
|
+
signature: {
|
|
2637
|
+
...ldSignatureWithoutCreated.signature,
|
|
2638
|
+
creator: {}
|
|
2639
|
+
}
|
|
2640
|
+
},
|
|
2641
|
+
401
|
|
2642
|
+
],
|
|
2643
|
+
[
|
|
2644
|
+
"malformed null",
|
|
2645
|
+
{
|
|
2646
|
+
...ldSignatureWithoutCreated,
|
|
2647
|
+
signature: null
|
|
2648
|
+
},
|
|
2649
|
+
401
|
|
2650
|
+
],
|
|
2651
|
+
[
|
|
2652
|
+
"malformed array",
|
|
2653
|
+
{
|
|
2654
|
+
...ldSignatureWithoutCreated,
|
|
2655
|
+
signature: []
|
|
2656
|
+
},
|
|
2657
|
+
401
|
|
2658
|
+
],
|
|
2659
|
+
[
|
|
2660
|
+
"malformed primitive",
|
|
2661
|
+
{
|
|
2662
|
+
...ldSignatureWithoutCreated,
|
|
2663
|
+
signature: "secret"
|
|
2664
|
+
},
|
|
2665
|
+
401
|
|
2666
|
+
]
|
|
2667
|
+
]) await t.step(name, async () => {
|
|
2668
|
+
const kv = new MemoryKvStore();
|
|
2669
|
+
const federation = createFederation({ kv });
|
|
2670
|
+
const request = new Request("https://example.com/inbox", {
|
|
2671
|
+
method: "POST",
|
|
2672
|
+
body: JSON.stringify(body)
|
|
2673
|
+
});
|
|
2674
|
+
const context = createRequestContext({
|
|
2675
|
+
federation,
|
|
2676
|
+
request,
|
|
2677
|
+
url: new URL(request.url),
|
|
2678
|
+
data: void 0,
|
|
2679
|
+
documentLoader: mockDocumentLoader,
|
|
2680
|
+
contextLoader: mockDocumentLoader
|
|
2681
|
+
});
|
|
2682
|
+
let deliveries = 0;
|
|
2683
|
+
const inboxListeners = new ActivityListenerSet();
|
|
2684
|
+
inboxListeners.add(Create, () => {
|
|
2685
|
+
deliveries++;
|
|
2686
|
+
});
|
|
2687
|
+
const records = [];
|
|
2688
|
+
await configure({
|
|
2689
|
+
sinks: { buffer: (record) => records.push(record) },
|
|
2690
|
+
loggers: [{
|
|
2691
|
+
category: ["fedify"],
|
|
2692
|
+
sinks: ["buffer"],
|
|
2693
|
+
lowestLevel: "debug"
|
|
2694
|
+
}, {
|
|
2695
|
+
category: ["logtape", "meta"],
|
|
2696
|
+
sinks: []
|
|
2697
|
+
}],
|
|
2698
|
+
reset: true
|
|
2699
|
+
});
|
|
2700
|
+
try {
|
|
2701
|
+
assertEquals((await handleInbox(request, {
|
|
2702
|
+
recipient: null,
|
|
2703
|
+
context,
|
|
2704
|
+
inboxContextFactory() {
|
|
2705
|
+
return createInboxContext({
|
|
2706
|
+
...context,
|
|
2707
|
+
clone: void 0
|
|
2708
|
+
});
|
|
2709
|
+
},
|
|
2710
|
+
kv,
|
|
2711
|
+
kvPrefixes: {
|
|
2712
|
+
activityIdempotence: ["_fedify", "activityIdempotence"],
|
|
2713
|
+
publicKey: ["_fedify", "publicKey"],
|
|
2714
|
+
acceptSignatureNonce: ["_fedify", "acceptSignatureNonce"]
|
|
2715
|
+
},
|
|
2716
|
+
actorDispatcher: () => null,
|
|
2717
|
+
inboxListeners,
|
|
2718
|
+
onNotFound: () => new Response("Not found", { status: 404 }),
|
|
2719
|
+
signatureTimeWindow: { minutes: 5 },
|
|
2720
|
+
skipSignatureVerification: false
|
|
2721
|
+
})).status, expected);
|
|
2722
|
+
assertEquals(deliveries, expected === 202 ? 1 : 0);
|
|
2723
|
+
const malformedRecords = records.filter((r) => r.rawMessage === "Linked Data Signature has an unsupported shape: {signatureKind}; properties: {signatureProperties}.");
|
|
2724
|
+
assertEquals(malformedRecords.length, name.startsWith("malformed") ? 1 : 0);
|
|
2725
|
+
for (const record of malformedRecords) {
|
|
2726
|
+
assertEquals(record.category, [
|
|
2727
|
+
"fedify",
|
|
2728
|
+
"federation",
|
|
2729
|
+
"inbox"
|
|
2730
|
+
]);
|
|
2731
|
+
assertEquals(record.level, "debug");
|
|
2732
|
+
assertFalse(JSON.stringify(record).includes(ldSignatureWithoutCreated.signature.creator));
|
|
2733
|
+
assertFalse(JSON.stringify(record).includes(ldSignatureWithoutCreated.signature.signatureValue));
|
|
2734
|
+
assertFalse(JSON.stringify(record).includes("secret"));
|
|
2735
|
+
}
|
|
2736
|
+
} finally {
|
|
2737
|
+
await reset();
|
|
2738
|
+
}
|
|
2739
|
+
});
|
|
2740
|
+
});
|
|
2554
2741
|
test("handleInbox() preserves the raw signed payload for inboxContextFactory", async () => {
|
|
2555
2742
|
const federation = createFederation({ kv: new MemoryKvStore() });
|
|
2556
2743
|
const remoteContextUrl = "https://remote.example/contexts/ext";
|
|
@@ -3276,8 +3463,8 @@ test("handleCustomCollection()", async () => {
|
|
|
3276
3463
|
assertEquals(response.status, 200);
|
|
3277
3464
|
assertEquals(response.headers.get("Content-Type"), "application/activity+json");
|
|
3278
3465
|
const createCtx = [
|
|
3279
|
-
"https://w3id.org/identity/v1",
|
|
3280
3466
|
"https://www.w3.org/ns/activitystreams",
|
|
3467
|
+
"https://w3id.org/security/v1",
|
|
3281
3468
|
"https://w3id.org/security/data-integrity/v1",
|
|
3282
3469
|
"https://gotosocial.org/ns",
|
|
3283
3470
|
{
|
|
@@ -3325,8 +3512,13 @@ test("handleCustomCollection()", async () => {
|
|
|
3325
3512
|
}
|
|
3326
3513
|
}
|
|
3327
3514
|
];
|
|
3515
|
+
const ITEM_CONTEXT = [...CONTEXT, { items: {
|
|
3516
|
+
"@id": "https://www.w3.org/ns/activitystreams#items",
|
|
3517
|
+
"@type": "@id",
|
|
3518
|
+
"@context": null
|
|
3519
|
+
} }];
|
|
3328
3520
|
assertEquals(await response.json(), {
|
|
3329
|
-
"@context":
|
|
3521
|
+
"@context": ITEM_CONTEXT,
|
|
3330
3522
|
id: "https://example.com/",
|
|
3331
3523
|
type: "Collection",
|
|
3332
3524
|
items: [
|
|
@@ -3381,7 +3573,7 @@ test("handleCustomCollection()", async () => {
|
|
|
3381
3573
|
assertEquals(response.status, 200);
|
|
3382
3574
|
assertEquals(response.headers.get("Content-Type"), "application/activity+json");
|
|
3383
3575
|
assertEquals(await response.json(), {
|
|
3384
|
-
"@context":
|
|
3576
|
+
"@context": ITEM_CONTEXT,
|
|
3385
3577
|
id: "https://example.com/",
|
|
3386
3578
|
type: "Collection",
|
|
3387
3579
|
items: [
|
|
@@ -3439,7 +3631,7 @@ test("handleCustomCollection()", async () => {
|
|
|
3439
3631
|
assertEquals(response.status, 200);
|
|
3440
3632
|
assertEquals(response.headers.get("Content-Type"), "application/activity+json");
|
|
3441
3633
|
assertEquals(await response.json(), {
|
|
3442
|
-
"@context":
|
|
3634
|
+
"@context": ITEM_CONTEXT,
|
|
3443
3635
|
id: "https://example.com/?cursor=0",
|
|
3444
3636
|
type: "CollectionPage",
|
|
3445
3637
|
partOf: "https://example.com/",
|
|
@@ -3468,7 +3660,7 @@ test("handleCustomCollection()", async () => {
|
|
|
3468
3660
|
assertEquals(response.status, 200);
|
|
3469
3661
|
assertEquals(response.headers.get("Content-Type"), "application/activity+json");
|
|
3470
3662
|
assertEquals(await response.json(), {
|
|
3471
|
-
"@context":
|
|
3663
|
+
"@context": ITEM_CONTEXT,
|
|
3472
3664
|
id: "https://example.com/?cursor=2",
|
|
3473
3665
|
type: "CollectionPage",
|
|
3474
3666
|
partOf: "https://example.com/",
|
|
@@ -5,8 +5,8 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import "../std__assert-DNZ4Liil.mjs";
|
|
6
6
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
|
|
8
|
-
import { r as signObject } from "../proof-
|
|
9
|
-
import { o as createFederation } from "../middleware-
|
|
8
|
+
import { r as signObject } from "../proof-C63Hqt9N.mjs";
|
|
9
|
+
import { o as createFederation } from "../middleware-dlGvSrXl.mjs";
|
|
10
10
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
11
11
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
12
12
|
//#region src/federation/idempotency.test.ts
|
|
@@ -3,8 +3,8 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import { r as assertFalse, t as assertThrows } from "../assert_throws-D4DNWrux.mjs";
|
|
6
|
-
import { t as ActivityListenerSet } from "../activity-listener-
|
|
7
|
-
import { t as actorsHaveSameOrigin } from "../inbox-
|
|
6
|
+
import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
|
|
7
|
+
import { t as actorsHaveSameOrigin } from "../inbox-DLy6WBXU.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
|
|
10
10
|
//#region src/federation/inbox.test.ts
|