@fedify/fedify 2.4.0-dev.2010 → 2.4.0-dev.2027
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/{assert-CebeUf0C.mjs → assert-D1Eafmd_.mjs} +1 -1
- package/dist/{assert_equals-CBlRfA-_.mjs → assert_equals-Z6IcEbWU.mjs} +2 -28
- package/dist/{assert_exists-DtzkXC47.mjs → assert_exists-cffSpJ7X.mjs} +1 -1
- package/dist/{assert_false-3pLLLsO4.mjs → assert_false-CPdRnc3E.mjs} +1 -1
- package/dist/{assert_greater_or_equal-BApOTh1h.mjs → assert_greater_or_equal-BlafOF4-.mjs} +2 -1
- package/dist/{assert_instance_of-g3WcyYNR.mjs → assert_instance_of-mrXWWNY-.mjs} +1 -1
- package/dist/{assert_not_equals-BN7yDMWe.mjs → assert_not_equals-CpPK2t89.mjs} +2 -1
- package/dist/{assert_rejects-wFbSPn1O.mjs → assert_rejects-CTptdYck.mjs} +2 -2
- package/dist/{assert_strict_equals-Bpjl4Psw.mjs → assert_strict_equals-CYvBmkpC.mjs} +2 -1
- package/dist/{assert_throws-BJ5wuvR2.mjs → assert_throws-BYITOvPO.mjs} +2 -1
- package/dist/assertion_error-B-cx0fFA.mjs +31 -0
- package/dist/{builder-asm96yV1.mjs → builder-BM255b90.mjs} +2 -2
- package/dist/compat/outgoing-jsonld.test.mjs +71 -3
- package/dist/compat/public-audience.test.mjs +3 -3
- package/dist/compat/secured-document.test.d.mts +2 -0
- package/dist/compat/secured-document.test.mjs +58 -0
- package/dist/compat/transformers.test.mjs +4 -4
- package/dist/{compound-proof-7UIAueLV.mjs → compound-proof-CPvNisT2.mjs} +1 -1
- package/dist/{deno-Ckq9TwCv.mjs → deno-BcZNXlJn.mjs} +1 -1
- package/dist/{docloader-DUKEPG-O.mjs → docloader-iHi0-9mK.mjs} +2 -2
- package/dist/federation/builder.test.mjs +5 -5
- package/dist/federation/circuit-breaker.test.mjs +3 -3
- package/dist/federation/collection.test.mjs +2 -2
- package/dist/federation/compound-fanout.test.d.mts +2 -0
- package/dist/federation/compound-fanout.test.mjs +228 -0
- package/dist/federation/handler-compound-proof.test.mjs +5 -5
- package/dist/federation/handler.test.mjs +11 -11
- package/dist/federation/idempotency.test.mjs +4 -4
- package/dist/federation/inbox.test.mjs +2 -2
- package/dist/federation/keycache.test.mjs +3 -3
- package/dist/federation/kv.test.mjs +2 -2
- package/dist/federation/metrics.test.mjs +4 -4
- package/dist/federation/middleware.test.mjs +17 -17
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +7 -6
- package/dist/federation/negotiation.test.mjs +3 -3
- package/dist/federation/retry.test.mjs +3 -2
- package/dist/federation/router.test.mjs +5 -5
- package/dist/federation/send.test.mjs +11 -11
- package/dist/federation/tasks/enqueue.test.mjs +1 -1
- package/dist/federation/tasks/tasks.test.mjs +2 -2
- package/dist/federation/temporal.test.mjs +4 -4
- package/dist/federation/webfinger.test.mjs +4 -4
- package/dist/{federation-CgbvMauV.cjs → federation-C0ijTwhx.cjs} +21 -5
- package/dist/{http-DQBfmkrS.cjs → http-CWXKwHPv.cjs} +1 -1
- package/dist/{http-DQA2JOEJ.js → http-KZWtR1H8.js} +1 -1
- package/dist/{http-DZaAutqg.mjs → http-fIK5D83n.mjs} +3 -3
- package/dist/{key-zxzx01Ec.mjs → key-Xb1hVVZO.mjs} +2 -2
- package/dist/{kv-cache-CbrUX90H.mjs → kv-cache-CU1rmQFB.mjs} +1 -1
- package/dist/{kv-cache-sy8OMNT8.cjs → kv-cache-Dos4tOWb.cjs} +1 -1
- package/dist/{kv-cache-BBoePTOJ.js → kv-cache-HOO6BsuW.js} +1 -1
- package/dist/{ld-CD_TN0e8.mjs → ld-DFHvxLtx.mjs} +3 -3
- package/dist/{metrics-B47Cm5gK.mjs → metrics-D7RydU_p.mjs} +1 -1
- package/dist/{middleware-pHwDTAnq.mjs → middleware-BsYD_ufs.mjs} +32 -16
- package/dist/{middleware-U_Gannqi.mjs → middleware-DgU5bJnn.mjs} +1 -1
- package/dist/{middleware-U0OIuqwD.js → middleware-iffqYoTV.js} +21 -5
- package/dist/{mod-UDwMjuHM.d.ts → mod-CNRAxXEb.d.ts} +1 -5
- package/dist/{mod-CbKDOnCt.d.cts → mod-CVQFWefn.d.cts} +1 -5
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +1 -1
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/client.test.mjs +2 -2
- package/dist/nodeinfo/handler.test.mjs +3 -3
- package/dist/nodeinfo/types.test.mjs +3 -3
- package/dist/otel/exporter.test.mjs +2 -2
- package/dist/{outgoing-jsonld-B5Ne7JoL.mjs → outgoing-jsonld-4IJqPYos.mjs} +11 -9
- package/dist/{owner-BNKC3s6G.js → owner-B7lgRMdU.js} +127 -35
- package/dist/{owner-u3IJRhVx.mjs → owner-D53bUI-n.mjs} +2 -2
- package/dist/{owner--mNatWct.cjs → owner-DffLVeYC.cjs} +126 -34
- package/dist/{proof-D3te0SP-.mjs → proof-4ADU3qy0.mjs} +80 -23
- package/dist/{public-audience-Cc2YJ3ip.mjs → public-audience--klBIOk1.mjs} +13 -9
- package/dist/secured-document-CxzZZ9nL.mjs +35 -0
- package/dist/{send-CDr0Zivk.mjs → send-n-W6bG7y.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +3 -3
- package/dist/sig/compound-proof-verification.test.mjs +5 -5
- package/dist/sig/compound-proof.test.mjs +145 -58
- package/dist/sig/http.test.mjs +11 -10
- package/dist/sig/key.test.mjs +6 -6
- package/dist/sig/ld.test.mjs +9 -9
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +1 -1
- package/dist/sig/mod.d.ts +1 -1
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +5 -5
- package/dist/sig/proof.test.mjs +9 -9
- package/dist/std__assert-DvMDRPes.mjs +8 -0
- package/dist/{temporal-DKhVF_Uk.mjs → temporal-BFUyXrYg.mjs} +1 -1
- package/dist/testing/kv.test.mjs +2 -2
- package/dist/utils/docloader.test.mjs +5 -5
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
- package/dist/std__assert-CxFT0MNt.mjs +0 -8
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { Temporal } from "temporal-polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
5
|
+
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
8
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
|
+
import { t as exportJwk } from "../key-Xb1hVVZO.mjs";
|
|
10
|
+
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
11
|
+
import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
|
|
12
|
+
import { n as FederationImpl } from "../middleware-BsYD_ufs.mjs";
|
|
13
|
+
import { c as verifyProof, r as signObject } from "../proof-4ADU3qy0.mjs";
|
|
14
|
+
import { Create, DataIntegrityProof, Note } from "@fedify/vocab";
|
|
15
|
+
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
|
+
import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
|
|
17
|
+
import serialize from "json-canon";
|
|
18
|
+
//#region src/federation/compound-fanout.test.ts
|
|
19
|
+
const options = {
|
|
20
|
+
contextLoader: mockDocumentLoader,
|
|
21
|
+
documentLoader: mockDocumentLoader
|
|
22
|
+
};
|
|
23
|
+
const context = ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"];
|
|
24
|
+
const childContext = [...context, { ex: "https://example.com/ns#" }];
|
|
25
|
+
async function parseProof(document) {
|
|
26
|
+
const proof = document.proof;
|
|
27
|
+
return await DataIntegrityProof.fromJsonLd({
|
|
28
|
+
"@context": document["@context"],
|
|
29
|
+
...proof
|
|
30
|
+
}, options);
|
|
31
|
+
}
|
|
32
|
+
test("fanout delivery keeps an embedded signed child intact", async () => {
|
|
33
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
34
|
+
const childDid = await exportDidKey(ed25519PublicKey.publicKey);
|
|
35
|
+
const childKeyId = new URL(`${childDid}#${childDid.substring(8)}`);
|
|
36
|
+
const child = await signObject(new Note({
|
|
37
|
+
id: parseIri(`ap+ef61://${childDid}/objects/fanned-out`),
|
|
38
|
+
attribution: parseIri(`ap+ef61://${childDid}/actor`),
|
|
39
|
+
content: "A portable note carried through the fanout queue"
|
|
40
|
+
}), ed25519PrivateKey, childKeyId, {
|
|
41
|
+
...options,
|
|
42
|
+
context: childContext,
|
|
43
|
+
created
|
|
44
|
+
});
|
|
45
|
+
const compound = await normalizeOutgoingActivityJsonLd(await (await signObject(new Create({
|
|
46
|
+
id: new URL("https://example.com/activities/fanned-out"),
|
|
47
|
+
actor: new URL("https://example.com/person"),
|
|
48
|
+
object: child
|
|
49
|
+
}), ed25519PrivateKey, childKeyId, {
|
|
50
|
+
...options,
|
|
51
|
+
context,
|
|
52
|
+
created
|
|
53
|
+
})).toJsonLd({
|
|
54
|
+
format: "compact",
|
|
55
|
+
...options,
|
|
56
|
+
context
|
|
57
|
+
}), mockDocumentLoader, { preserveNestedSecuredDocuments: true });
|
|
58
|
+
const securedChild = compound.object;
|
|
59
|
+
assertEquals(securedChild["@context"], childContext);
|
|
60
|
+
esm_default.spyGlobal();
|
|
61
|
+
try {
|
|
62
|
+
let delivered = null;
|
|
63
|
+
esm_default.post("https://example.com/inbox", async (cl) => {
|
|
64
|
+
delivered = await cl.request.json();
|
|
65
|
+
return new Response(null, { status: 202 });
|
|
66
|
+
});
|
|
67
|
+
const federation = new FederationImpl({
|
|
68
|
+
kv: new MemoryKvStore(),
|
|
69
|
+
contextLoaderFactory: () => mockDocumentLoader
|
|
70
|
+
});
|
|
71
|
+
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox");
|
|
72
|
+
const message = {
|
|
73
|
+
type: "fanout",
|
|
74
|
+
id: crypto.randomUUID(),
|
|
75
|
+
baseUrl: "https://example.com",
|
|
76
|
+
keys: [{
|
|
77
|
+
keyId: rsaPublicKey2.id.href,
|
|
78
|
+
privateKey: await exportJwk(rsaPrivateKey2)
|
|
79
|
+
}],
|
|
80
|
+
inboxes: { "https://example.com/inbox": {
|
|
81
|
+
actorIds: ["https://example.com/recipient"],
|
|
82
|
+
sharedInbox: false
|
|
83
|
+
} },
|
|
84
|
+
activity: compound,
|
|
85
|
+
activityId: "https://example.com/activities/fanned-out",
|
|
86
|
+
activityType: "https://www.w3.org/ns/activitystreams#Create",
|
|
87
|
+
normalizeExistingProofs: true,
|
|
88
|
+
traceContext: {}
|
|
89
|
+
};
|
|
90
|
+
await federation.processQueuedTask(void 0, message);
|
|
91
|
+
assert(delivered != null);
|
|
92
|
+
const body = delivered;
|
|
93
|
+
delete body.signature;
|
|
94
|
+
assertEquals(serialize(body), serialize(compound));
|
|
95
|
+
const embedded = body.object;
|
|
96
|
+
assertEquals((await verifyProof(embedded, await parseProof(embedded), options))?.id, childKeyId);
|
|
97
|
+
assertEquals((await verifyProof(body, await parseProof(body), options))?.id, childKeyId);
|
|
98
|
+
} finally {
|
|
99
|
+
esm_default.hardReset();
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
test("forced fanout signs before serializing so the child survives", async () => {
|
|
103
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
104
|
+
const childDid = await exportDidKey(ed25519PublicKey.publicKey);
|
|
105
|
+
const childKeyId = new URL(`${childDid}#${childDid.substring(8)}`);
|
|
106
|
+
const child = await signObject(new Note({
|
|
107
|
+
id: parseIri(`ap+ef61://${childDid}/objects/forced-fanout`),
|
|
108
|
+
attribution: parseIri(`ap+ef61://${childDid}/actor`),
|
|
109
|
+
content: "A portable note sent through a forced fanout"
|
|
110
|
+
}), ed25519PrivateKey, childKeyId, {
|
|
111
|
+
...options,
|
|
112
|
+
context: childContext,
|
|
113
|
+
created
|
|
114
|
+
});
|
|
115
|
+
const activity = new Create({
|
|
116
|
+
id: new URL("https://example.com/activities/forced-fanout"),
|
|
117
|
+
actor: new URL("https://example.com/person"),
|
|
118
|
+
object: child
|
|
119
|
+
});
|
|
120
|
+
esm_default.spyGlobal();
|
|
121
|
+
try {
|
|
122
|
+
let delivered = null;
|
|
123
|
+
esm_default.post("https://example.com/inbox", async (cl) => {
|
|
124
|
+
delivered = await cl.request.json();
|
|
125
|
+
return new Response(null, { status: 202 });
|
|
126
|
+
});
|
|
127
|
+
const queued = [];
|
|
128
|
+
const federation = new FederationImpl({
|
|
129
|
+
kv: new MemoryKvStore(),
|
|
130
|
+
queue: {
|
|
131
|
+
enqueue(message) {
|
|
132
|
+
queued.push(message);
|
|
133
|
+
return Promise.resolve();
|
|
134
|
+
},
|
|
135
|
+
listen() {
|
|
136
|
+
return Promise.resolve();
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
manuallyStartQueue: true,
|
|
140
|
+
contextLoaderFactory: () => mockDocumentLoader
|
|
141
|
+
});
|
|
142
|
+
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox");
|
|
143
|
+
await federation.createContext(new URL("https://example.com/")).sendActivity({
|
|
144
|
+
keyId: childKeyId,
|
|
145
|
+
privateKey: ed25519PrivateKey
|
|
146
|
+
}, {
|
|
147
|
+
id: new URL("https://example.com/users/bob"),
|
|
148
|
+
inboxId: new URL("https://example.com/inbox")
|
|
149
|
+
}, activity, { fanout: "force" });
|
|
150
|
+
assertEquals(queued.length, 1);
|
|
151
|
+
for (let i = 0; i < queued.length; i++) await federation.processQueuedTask(void 0, queued[i]);
|
|
152
|
+
assert(delivered != null);
|
|
153
|
+
const body = delivered;
|
|
154
|
+
delete body.signature;
|
|
155
|
+
const embedded = body.object;
|
|
156
|
+
assertEquals(embedded["@context"], childContext);
|
|
157
|
+
assertEquals((await verifyProof(embedded, await parseProof(embedded), options))?.id, childKeyId);
|
|
158
|
+
assertEquals((await verifyProof(body, await parseProof(body), options))?.id, childKeyId);
|
|
159
|
+
} finally {
|
|
160
|
+
esm_default.hardReset();
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
test("an already signed activity keeps its single proof through fanout", async () => {
|
|
164
|
+
const created = Temporal.Instant.from("2023-02-24T23:36:38Z");
|
|
165
|
+
const childDid = await exportDidKey(ed25519PublicKey.publicKey);
|
|
166
|
+
const childKeyId = new URL(`${childDid}#${childDid.substring(8)}`);
|
|
167
|
+
const child = await signObject(new Note({
|
|
168
|
+
id: parseIri(`ap+ef61://${childDid}/objects/pre-signed`),
|
|
169
|
+
attribution: parseIri(`ap+ef61://${childDid}/actor`),
|
|
170
|
+
content: "A portable note in a pre-signed activity"
|
|
171
|
+
}), ed25519PrivateKey, childKeyId, {
|
|
172
|
+
...options,
|
|
173
|
+
context: childContext,
|
|
174
|
+
created
|
|
175
|
+
});
|
|
176
|
+
const activity = await signObject(new Create({
|
|
177
|
+
id: new URL("https://example.com/activities/pre-signed"),
|
|
178
|
+
actor: new URL("https://example.com/person"),
|
|
179
|
+
object: child
|
|
180
|
+
}), ed25519PrivateKey, childKeyId, {
|
|
181
|
+
...options,
|
|
182
|
+
created
|
|
183
|
+
});
|
|
184
|
+
esm_default.spyGlobal();
|
|
185
|
+
try {
|
|
186
|
+
let delivered = null;
|
|
187
|
+
esm_default.post("https://example.com/inbox", async (cl) => {
|
|
188
|
+
delivered = await cl.request.json();
|
|
189
|
+
return new Response(null, { status: 202 });
|
|
190
|
+
});
|
|
191
|
+
const queued = [];
|
|
192
|
+
const federation = new FederationImpl({
|
|
193
|
+
kv: new MemoryKvStore(),
|
|
194
|
+
queue: {
|
|
195
|
+
enqueue(message) {
|
|
196
|
+
queued.push(message);
|
|
197
|
+
return Promise.resolve();
|
|
198
|
+
},
|
|
199
|
+
listen() {
|
|
200
|
+
return Promise.resolve();
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
manuallyStartQueue: true,
|
|
204
|
+
contextLoaderFactory: () => mockDocumentLoader
|
|
205
|
+
});
|
|
206
|
+
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox");
|
|
207
|
+
await federation.createContext(new URL("https://example.com/")).sendActivity({
|
|
208
|
+
keyId: childKeyId,
|
|
209
|
+
privateKey: ed25519PrivateKey
|
|
210
|
+
}, {
|
|
211
|
+
id: new URL("https://example.com/users/bob"),
|
|
212
|
+
inboxId: new URL("https://example.com/inbox")
|
|
213
|
+
}, activity, { fanout: "force" });
|
|
214
|
+
for (let i = 0; i < queued.length; i++) await federation.processQueuedTask(void 0, queued[i]);
|
|
215
|
+
assert(delivered != null);
|
|
216
|
+
const body = delivered;
|
|
217
|
+
delete body.signature;
|
|
218
|
+
assert(!Array.isArray(body.proof));
|
|
219
|
+
assertEquals((await verifyProof(body, await parseProof(body), options))?.id, childKeyId);
|
|
220
|
+
const embedded = body.object;
|
|
221
|
+
assertEquals(embedded["@context"], childContext);
|
|
222
|
+
assertEquals((await verifyProof(embedded, await parseProof(embedded), options))?.id, childKeyId);
|
|
223
|
+
} finally {
|
|
224
|
+
esm_default.hardReset();
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
//#endregion
|
|
228
|
+
export {};
|
|
@@ -3,12 +3,12 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { r as createRequestContext, t as createInboxContext } from "../context-CbS35fLr.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
|
-
import { t as assertEquals } from "../assert_equals-
|
|
7
|
-
import "../std__assert-
|
|
8
|
-
import { s as signRequest } from "../http-
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
8
|
+
import { s as signRequest } from "../http-fIK5D83n.mjs";
|
|
9
9
|
import { a as rsaPrivateKey3, c as rsaPublicKey3 } from "../keys-DIJNHW-Y.mjs";
|
|
10
|
-
import { d as handleInbox, o as createFederation } from "../middleware-
|
|
11
|
-
import { p as signJsonLd } from "../ld-
|
|
10
|
+
import { d as handleInbox, o as createFederation } from "../middleware-BsYD_ufs.mjs";
|
|
11
|
+
import { p as signJsonLd } from "../ld-DFHvxLtx.mjs";
|
|
12
12
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
13
13
|
import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
|
|
14
14
|
import { Create } from "@fedify/vocab";
|
|
@@ -3,19 +3,19 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-CbS35fLr.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
|
-
import { t as assertEquals } from "../assert_equals-
|
|
7
|
-
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-
|
|
8
|
-
import { t as assertInstanceOf } from "../assert_instance_of-
|
|
9
|
-
import "../std__assert-
|
|
10
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
11
|
-
import { t as assert } from "../assert-
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
|
+
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
|
|
8
|
+
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
9
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
10
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
11
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
12
12
|
import { r as parseAcceptSignature } from "../accept-CPVqki78.mjs";
|
|
13
|
-
import { a as generateCryptoKeyPair } from "../key-
|
|
14
|
-
import { s as signRequest } from "../http-
|
|
13
|
+
import { a as generateCryptoKeyPair } from "../key-Xb1hVVZO.mjs";
|
|
14
|
+
import { s as signRequest } from "../http-fIK5D83n.mjs";
|
|
15
15
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
16
|
-
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-
|
|
17
|
-
import { a as compactJsonLd, p as signJsonLd } from "../ld-
|
|
18
|
-
import { r as signObject } from "../proof-
|
|
16
|
+
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-BsYD_ufs.mjs";
|
|
17
|
+
import { a as compactJsonLd, p as signJsonLd } from "../ld-DFHvxLtx.mjs";
|
|
18
|
+
import { r as signObject } from "../proof-4ADU3qy0.mjs";
|
|
19
19
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
20
20
|
import { Activity, Create, CryptographicKey, Multikey, Note, Person, Tombstone } from "@fedify/vocab";
|
|
21
21
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -2,11 +2,11 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
5
|
-
import { t as assertEquals } from "../assert_equals-
|
|
6
|
-
import "../std__assert-
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
8
|
-
import { o as createFederation } from "../middleware-
|
|
9
|
-
import { r as signObject } from "../proof-
|
|
8
|
+
import { o as createFederation } from "../middleware-BsYD_ufs.mjs";
|
|
9
|
+
import { r as signObject } from "../proof-4ADU3qy0.mjs";
|
|
10
10
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/idempotency.test.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { t as assertThrows } from "../assert_throws-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
6
6
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
7
7
|
import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
@@ -3,9 +3,9 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
5
5
|
import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
|
|
6
|
-
import { t as assertEquals } from "../assert_equals-
|
|
7
|
-
import { t as assertInstanceOf } from "../assert_instance_of-
|
|
8
|
-
import { t as assert } from "../assert-
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
|
+
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
8
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
9
|
import { t as KvKeyCache } from "../keycache-BUDHB5rY.mjs";
|
|
10
10
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
11
11
|
import { test } from "@fedify/fixture";
|
|
@@ -2,8 +2,8 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
5
|
-
import { t as assertEquals } from "../assert_equals-
|
|
6
|
-
import "../std__assert-
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
//#region src/federation/kv.test.ts
|
|
9
9
|
test("MemoryKvStore", async (t) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
7
|
-
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
7
|
+
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-D7RydU_p.mjs";
|
|
8
8
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
9
9
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
10
10
|
import { DataPointType, MeterProvider, MetricReader } from "@opentelemetry/sdk-metrics";
|
|
@@ -6,24 +6,24 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
6
6
|
import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
|
|
7
7
|
import { a as numberSchema, r as envelopeSchema, t as MockQueue } from "../tasks-dbCShlCb.mjs";
|
|
8
8
|
import "../testing-hbky2gMN.mjs";
|
|
9
|
-
import { t as assertEquals } from "../assert_equals-
|
|
10
|
-
import { t as assertExists } from "../assert_exists-
|
|
11
|
-
import { t as assertFalse } from "../assert_false-
|
|
12
|
-
import { t as assertInstanceOf } from "../assert_instance_of-
|
|
13
|
-
import { t as assertThrows } from "../assert_throws-
|
|
14
|
-
import { t as assertNotEquals } from "../assert_not_equals-
|
|
15
|
-
import "../std__assert-
|
|
16
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
17
|
-
import { t as assertStrictEquals } from "../assert_strict_equals-
|
|
18
|
-
import { t as assert } from "../assert-
|
|
19
|
-
import { g as recordInboxActivity } from "../metrics-
|
|
20
|
-
import { l as verifyRequest, s as signRequest } from "../http-
|
|
9
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
10
|
+
import { t as assertExists } from "../assert_exists-cffSpJ7X.mjs";
|
|
11
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
12
|
+
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
13
|
+
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
14
|
+
import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
|
|
15
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
16
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
17
|
+
import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
|
|
18
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
19
|
+
import { g as recordInboxActivity } from "../metrics-D7RydU_p.mjs";
|
|
20
|
+
import { l as verifyRequest, s as signRequest } from "../http-fIK5D83n.mjs";
|
|
21
21
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
22
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
23
|
-
import { g as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-
|
|
24
|
-
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-
|
|
25
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
26
|
-
import { a as verifyObject, r as signObject } from "../proof-
|
|
22
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-iHi0-9mK.mjs";
|
|
23
|
+
import { g as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-BsYD_ufs.mjs";
|
|
24
|
+
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-DFHvxLtx.mjs";
|
|
25
|
+
import { t as doesActorOwnKey } from "../owner-D53bUI-n.mjs";
|
|
26
|
+
import { a as verifyObject, r as signObject } from "../proof-4ADU3qy0.mjs";
|
|
27
27
|
import { t as CircuitBreaker } from "../circuit-breaker-C5NqoLBJ.mjs";
|
|
28
28
|
import { t as TaskCodec } from "../codec-C6rTrpIp.mjs";
|
|
29
29
|
import { t as markCircuitBreakerLegacySweepDone } from "../circuit-breaker-test-utils-DW6YC_Pe.mjs";
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_federation = require("../federation-
|
|
3
|
+
const require_federation = require("../federation-C0ijTwhx.cjs");
|
|
4
4
|
exports.CircuitBreaker = require_federation.CircuitBreaker;
|
|
5
5
|
exports.InProcessMessageQueue = require_federation.InProcessMessageQueue;
|
|
6
6
|
exports.MemoryKvStore = require_federation.MemoryKvStore;
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as respondWithObject, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as SendActivityError, l as CircuitBreaker, n as handleWebFinger, o as respondWithObjectIfAcceptable, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-
|
|
3
|
+
import { a as respondWithObject, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as SendActivityError, l as CircuitBreaker, n as handleWebFinger, o as respondWithObjectIfAcceptable, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-iffqYoTV.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { Router as Router$1, RouterError as RouterError$1, assertPath, isPath } from "@fedify/uri-template";
|
|
6
6
|
import { isEqual } from "es-toolkit";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import "../
|
|
8
|
-
import
|
|
9
|
-
import { t as
|
|
4
|
+
import { t as AssertionError } from "../assertion_error-B-cx0fFA.mjs";
|
|
5
|
+
import { s as format, t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
7
|
+
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
|
|
8
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
9
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
10
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
10
11
|
import { n as ParallelMessageQueue, t as InProcessMessageQueue } from "../mq-Dm1Wmtm-.mjs";
|
|
11
12
|
import { delay } from "es-toolkit";
|
|
12
13
|
import { test } from "@fedify/fixture";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertFalse } from "../assert_false-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assert } from "../assert-
|
|
4
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
5
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
7
|
import { t as acceptsJsonLd } from "../negotiation-CCocWT_N.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/federation/negotiation.test.ts
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
4
|
+
import { t as AssertionError } from "../assertion_error-B-cx0fFA.mjs";
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
|
+
import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
|
|
6
7
|
import { t as createExponentialBackoffPolicy } from "../retry-zX5xw5e0.mjs";
|
|
7
8
|
import { test } from "@fedify/fixture";
|
|
8
9
|
//#region src/federation/retry.test.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertEquals } from "../assert_equals-
|
|
5
|
-
import { t as assertFalse } from "../assert_false-
|
|
6
|
-
import { t as assertThrows } from "../assert_throws-
|
|
7
|
-
import "../std__assert-
|
|
8
|
-
import { t as assert } from "../assert-
|
|
4
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
5
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
6
|
+
import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
|
|
7
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
8
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
import { Router, RouterError, assertPath, isPath } from "@fedify/uri-template";
|
|
11
11
|
import { test } from "@fedify/fixture";
|
|
@@ -2,18 +2,18 @@ import "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
5
|
-
import { t as assertEquals } from "../assert_equals-
|
|
6
|
-
import { t as assertFalse } from "../assert_false-
|
|
7
|
-
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-
|
|
8
|
-
import { t as assertInstanceOf } from "../assert_instance_of-
|
|
9
|
-
import { t as assertNotEquals } from "../assert_not_equals-
|
|
10
|
-
import "../std__assert-
|
|
11
|
-
import { t as assertRejects } from "../assert_rejects-
|
|
12
|
-
import { t as assert } from "../assert-
|
|
13
|
-
import { l as verifyRequest } from "../http-
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
6
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
7
|
+
import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
|
|
8
|
+
import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
|
|
9
|
+
import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
|
|
10
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
11
|
+
import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
|
|
12
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
13
|
+
import { l as verifyRequest } from "../http-fIK5D83n.mjs";
|
|
14
14
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
15
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
16
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
15
|
+
import { t as doesActorOwnKey } from "../owner-D53bUI-n.mjs";
|
|
16
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-n-W6bG7y.mjs";
|
|
17
17
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
18
18
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
19
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
5
|
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../tasks-dbCShlCb.mjs";
|
|
6
6
|
import "../../testing-hbky2gMN.mjs";
|
|
7
|
-
import { o as createFederation } from "../../middleware-
|
|
7
|
+
import { o as createFederation } from "../../middleware-BsYD_ufs.mjs";
|
|
8
8
|
import { n as ParallelMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
9
9
|
import { configure, reset } from "@logtape/logtape";
|
|
10
10
|
import { delay } from "es-toolkit";
|
|
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
5
|
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../tasks-dbCShlCb.mjs";
|
|
6
6
|
import "../../testing-hbky2gMN.mjs";
|
|
7
|
-
import { o as createFederation } from "../../middleware-
|
|
8
|
-
import { r as createFederationBuilder } from "../../builder-
|
|
7
|
+
import { o as createFederation } from "../../middleware-BsYD_ufs.mjs";
|
|
8
|
+
import { r as createFederationBuilder } from "../../builder-BM255b90.mjs";
|
|
9
9
|
import { t as TaskCodec } from "../../codec-C6rTrpIp.mjs";
|
|
10
10
|
import { t as InProcessMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
11
11
|
import { W3CTraceContextPropagator } from "@opentelemetry/core";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as assertFalse } from "../assert_false-
|
|
5
|
-
import "../std__assert-
|
|
6
|
-
import { t as assert } from "../assert-
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
4
|
+
import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
|
|
5
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
6
|
+
import { t as assert } from "../assert-D1Eafmd_.mjs";
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-BFUyXrYg.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/federation/temporal.test.ts
|
|
10
10
|
test("hasMalformedKnownTemporalLiteral() detects expanded proof timestamps", async () => {
|
|
@@ -3,10 +3,10 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { r as createRequestContext } from "../context-CbS35fLr.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
|
-
import { t as assertEquals } from "../assert_equals-
|
|
7
|
-
import { t as assertNotEquals } from "../assert_not_equals-
|
|
8
|
-
import "../std__assert-
|
|
9
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware-
|
|
6
|
+
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
|
+
import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
|
|
8
|
+
import "../std__assert-DvMDRPes.mjs";
|
|
9
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware-BsYD_ufs.mjs";
|
|
10
10
|
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/webfinger.test.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-Dmm3t92W.cjs");
|
|
3
3
|
const require_transformers = require("./transformers-BalCrSsr.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-CWXKwHPv.cjs");
|
|
5
5
|
const require_types = require("./types-Be2zbyeG.cjs");
|
|
6
|
-
const require_owner = require("./owner
|
|
7
|
-
const require_kv_cache = require("./kv-cache-
|
|
6
|
+
const require_owner = require("./owner-DffLVeYC.cjs");
|
|
7
|
+
const require_kv_cache = require("./kv-cache-Dos4tOWb.cjs");
|
|
8
8
|
let _logtape_logtape = require("@logtape/logtape");
|
|
9
9
|
let _fedify_uri_template = require("@fedify/uri-template");
|
|
10
10
|
let _fedify_vocab = require("@fedify/vocab");
|
|
@@ -5756,6 +5756,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
5756
5756
|
collectionSync: message.collectionSync,
|
|
5757
5757
|
orderingKey: message.orderingKey,
|
|
5758
5758
|
normalizeExistingProofs: message.normalizeExistingProofs,
|
|
5759
|
+
activityJsonLd: message.activity,
|
|
5759
5760
|
context
|
|
5760
5761
|
});
|
|
5761
5762
|
}
|
|
@@ -6461,11 +6462,11 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
6461
6462
|
proofCreated = true;
|
|
6462
6463
|
}
|
|
6463
6464
|
}
|
|
6464
|
-
let jsonLd = await activity.toJsonLd({
|
|
6465
|
+
let jsonLd = !proofCreated && options.activityJsonLd != null ? options.activityJsonLd : await activity.toJsonLd({
|
|
6465
6466
|
format: "compact",
|
|
6466
6467
|
contextLoader
|
|
6467
6468
|
});
|
|
6468
|
-
if (proofCreated || !hasProof || options.normalizeExistingProofs) jsonLd = await require_owner.normalizeOutgoingActivityJsonLd(jsonLd, contextLoader);
|
|
6469
|
+
if (proofCreated || !hasProof || options.normalizeExistingProofs) jsonLd = await require_owner.normalizeOutgoingActivityJsonLd(jsonLd, contextLoader, { preserveNestedSecuredDocuments: true });
|
|
6469
6470
|
if (rsaKey == null) logger.warn("No supported key found to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature. In order to create a Linked Data signature, at least one RSASSA-PKCS1-v1_5 key must be provided.", {
|
|
6470
6471
|
activityId,
|
|
6471
6472
|
keys: keys.map((pair) => ({
|
|
@@ -7448,6 +7449,21 @@ var ContextImpl = class ContextImpl {
|
|
|
7448
7449
|
});
|
|
7449
7450
|
proofCreated = true;
|
|
7450
7451
|
}
|
|
7452
|
+
} else {
|
|
7453
|
+
const contextLoader = this.contextLoader;
|
|
7454
|
+
let hasProof = false;
|
|
7455
|
+
for await (const _ of activity.getProofs({ contextLoader })) {
|
|
7456
|
+
hasProof = true;
|
|
7457
|
+
break;
|
|
7458
|
+
}
|
|
7459
|
+
if (!hasProof) for (const { keyId, privateKey } of keys) {
|
|
7460
|
+
if (privateKey.algorithm.name !== "Ed25519") continue;
|
|
7461
|
+
activity = await require_owner.signObject(activity, privateKey, keyId, {
|
|
7462
|
+
contextLoader,
|
|
7463
|
+
tracerProvider: this.tracerProvider
|
|
7464
|
+
});
|
|
7465
|
+
proofCreated = true;
|
|
7466
|
+
}
|
|
7451
7467
|
}
|
|
7452
7468
|
const inboxes = extractInboxes({
|
|
7453
7469
|
recipients: expandedRecipients,
|