@fedify/fedify 2.0.36-dev.2760 → 2.0.36-dev.2828
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-D43igPLB.mjs +111 -0
- package/dist/{builder-CyuiJaas.mjs → builder-NquOFkEx.mjs} +3 -3
- package/dist/compat/attachment-arrays.test.d.mts +2 -0
- package/dist/compat/attachment-arrays.test.mjs +254 -0
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{deno-Bbso5CSl.mjs → deno-uX5OxSMQ.mjs} +1 -1
- package/dist/{docloader-CP5VuWA0.mjs → docloader-BVio_R-w.mjs} +2 -2
- 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 +280 -0
- package/dist/federation/handler.test.mjs +6 -6
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/keycache.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +7 -7
- package/dist/federation/mod.cjs +1 -1
- 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 +3 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-DBBUPm9V.cjs → http-Bp6bXNxO.cjs} +1 -1
- package/dist/{http-Cp7sQLeG.mjs → http-Cx49vN9O.mjs} +2 -2
- package/dist/{http-D03Qcwc-.js → http-DaxiTQXs.js} +1 -1
- package/dist/{inbox-DTuh59nR.mjs → inbox-Rw21yNrv.mjs} +1 -1
- package/dist/{key-CsY0Ifod.mjs → key-CxZXo3sZ.mjs} +1 -1
- package/dist/{kv-cache-CVxDhqGp.js → kv-cache-BEYK4z_E.js} +1 -1
- package/dist/{kv-cache-BpjVni_0.cjs → kv-cache-BjsvCInD.cjs} +1 -1
- package/dist/{ld-dYjiHKj1.mjs → ld-DTaV6DUm.mjs} +2 -2
- package/dist/{middleware-DFR4tBL2.js → middleware-Bnn9AKMf.js} +259 -32
- package/dist/{middleware-3x7W0auZ.mjs → middleware-BuQURchh.mjs} +170 -45
- package/dist/{middleware-5EN1mHvx.cjs → middleware-By3uBhIJ.cjs} +260 -32
- package/dist/{middleware-2zkNwQvz.cjs → middleware-ByAekFky.cjs} +1 -1
- package/dist/{middleware-DvCyN-xk.mjs → middleware-Cz87lzGU.mjs} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/{owner-A1Xol6Zh.mjs → owner-CEFC5tVI.mjs} +2 -2
- package/dist/{proof-CCZCT2xF.cjs → proof-Bl3zk5c6.cjs} +3 -3
- package/dist/{proof-DGOXBmlo.js → proof-Ct8tSLww.js} +2 -2
- package/dist/{proof-DCqYLXDl.mjs → proof-DFrHHTit.mjs} +2 -2
- package/dist/{send-yQno-6bP.mjs → send-Dn11B6x2.mjs} +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key-types.test.d.mts +1 -1
- package/dist/sig/key.test.mjs +2 -2
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +2 -2
- package/dist/{temporal-C26UV3h7.mjs → temporal-DEWMgahT.mjs} +1 -1
- package/dist/testing/mod.d.mts +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +5 -5
- /package/dist/{callback-BFMEE_9V.d.mts → callback-ySj5p3Ml.d.mts} +0 -0
- /package/dist/{collection-ChgDTHLz.mjs → collection-BD6-SZ6O.mjs} +0 -0
- /package/dist/{keycache-crDMn2HK.mjs → keycache-BhLorx33.mjs} +0 -0
- /package/dist/{negotiation-BehA2uul.mjs → negotiation-DnsfFF8I.mjs} +0 -0
- /package/dist/{retry-B_E3V_Dx.mjs → retry-CJL0poaU.mjs} +0 -0
- /package/dist/{types-C37hquWI.mjs → types-DCP0WLdt.mjs} +0 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
+
import "../std__assert-DflMZha5.mjs";
|
|
7
|
+
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
8
|
+
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-CCxRJhWa.mjs";
|
|
9
|
+
import { _ as verifySignature, c as detachSignature } from "../ld-DTaV6DUm.mjs";
|
|
10
|
+
import { n as signObject } from "../proof-DFrHHTit.mjs";
|
|
11
|
+
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
12
|
+
import { n as FederationImpl, t as ContextImpl, v as prepareActivityJsonLd } from "../middleware-BuQURchh.mjs";
|
|
13
|
+
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
14
|
+
import { Create, Image, Note, Person, PropertyValue, Update } from "@fedify/vocab";
|
|
15
|
+
import { decodeMultibase } from "@fedify/vocab-runtime";
|
|
16
|
+
import serialize from "json-canon";
|
|
17
|
+
//#region src/federation/delivery-attachments.test.ts
|
|
18
|
+
async function assertRawProof(document, proof, publicKey) {
|
|
19
|
+
const unsigned = { ...document };
|
|
20
|
+
delete unsigned.proof;
|
|
21
|
+
delete unsigned.signature;
|
|
22
|
+
const encoder = new TextEncoder();
|
|
23
|
+
const config = {
|
|
24
|
+
"@context": document["@context"],
|
|
25
|
+
type: "DataIntegrityProof",
|
|
26
|
+
cryptosuite: proof.cryptosuite,
|
|
27
|
+
verificationMethod: proof.verificationMethod,
|
|
28
|
+
proofPurpose: proof.proofPurpose,
|
|
29
|
+
created: proof.created
|
|
30
|
+
};
|
|
31
|
+
const configDigest = await crypto.subtle.digest("SHA-256", encoder.encode(serialize(config)));
|
|
32
|
+
const messageDigest = await crypto.subtle.digest("SHA-256", encoder.encode(serialize(unsigned)));
|
|
33
|
+
const bytes = new Uint8Array(configDigest.byteLength + messageDigest.byteLength);
|
|
34
|
+
bytes.set(new Uint8Array(configDigest));
|
|
35
|
+
bytes.set(new Uint8Array(messageDigest), configDigest.byteLength);
|
|
36
|
+
assert(await crypto.subtle.verify("Ed25519", publicKey, decodeMultibase(proof.proofValue).slice(), bytes), "The proof must cover the exact received JSON representation.");
|
|
37
|
+
}
|
|
38
|
+
test("attachment delivery keeps fetched profiles, proofs, and queued bytes consistent", async (t) => {
|
|
39
|
+
const secondEdKey = await crypto.subtle.generateKey("Ed25519", true, ["sign", "verify"]);
|
|
40
|
+
const inbox = "https://example.com/attachment-inbox";
|
|
41
|
+
const received = [];
|
|
42
|
+
let responseStatus = 202;
|
|
43
|
+
esm_default.spyGlobal();
|
|
44
|
+
esm_default.post(inbox, async ({ request }) => {
|
|
45
|
+
received.push(await request.json());
|
|
46
|
+
return new Response(null, { status: responseStatus });
|
|
47
|
+
});
|
|
48
|
+
try {
|
|
49
|
+
for (const scenario of [
|
|
50
|
+
"rsa",
|
|
51
|
+
"immediate",
|
|
52
|
+
"outbox",
|
|
53
|
+
"fanout",
|
|
54
|
+
"raw-fanout",
|
|
55
|
+
"raw-immediate",
|
|
56
|
+
"raw-outbox",
|
|
57
|
+
"rsa-fanout",
|
|
58
|
+
"retry"
|
|
59
|
+
]) await t.step(scenario, async () => {
|
|
60
|
+
const messages = [];
|
|
61
|
+
const federation = new FederationImpl({
|
|
62
|
+
kv: new MemoryKvStore(),
|
|
63
|
+
queue: {
|
|
64
|
+
enqueue(message) {
|
|
65
|
+
messages.push(message);
|
|
66
|
+
return Promise.resolve();
|
|
67
|
+
},
|
|
68
|
+
async listen() {}
|
|
69
|
+
},
|
|
70
|
+
manuallyStartQueue: true,
|
|
71
|
+
allowPrivateAddress: true
|
|
72
|
+
});
|
|
73
|
+
federation.setActorDispatcher("/users/{identifier}", (ctx, identifier) => new Person({
|
|
74
|
+
id: ctx.getActorUri(identifier),
|
|
75
|
+
preferredUsername: identifier,
|
|
76
|
+
attachments: [new PropertyValue({
|
|
77
|
+
name: "Website",
|
|
78
|
+
value: "https://example.com/"
|
|
79
|
+
})]
|
|
80
|
+
})).setKeyPairsDispatcher(() => [{
|
|
81
|
+
privateKey: rsaPrivateKey2,
|
|
82
|
+
publicKey: rsaPublicKey2.publicKey
|
|
83
|
+
}, ...scenario.startsWith("rsa") ? [] : [{
|
|
84
|
+
privateKey: ed25519PrivateKey,
|
|
85
|
+
publicKey: ed25519PublicKey.publicKey
|
|
86
|
+
}, {
|
|
87
|
+
privateKey: secondEdKey.privateKey,
|
|
88
|
+
publicKey: secondEdKey.publicKey
|
|
89
|
+
}]]);
|
|
90
|
+
const ctx = new ContextImpl({
|
|
91
|
+
data: void 0,
|
|
92
|
+
federation,
|
|
93
|
+
url: new URL("https://example.com/"),
|
|
94
|
+
documentLoader: mockDocumentLoader,
|
|
95
|
+
contextLoader: mockDocumentLoader
|
|
96
|
+
});
|
|
97
|
+
const actor = new Person({
|
|
98
|
+
id: ctx.getActorUri("alice"),
|
|
99
|
+
preferredUsername: "alice",
|
|
100
|
+
attachments: [new PropertyValue({
|
|
101
|
+
name: "Website",
|
|
102
|
+
value: "https://example.com/"
|
|
103
|
+
})]
|
|
104
|
+
});
|
|
105
|
+
const fetched = await (await federation.fetch(new Request(ctx.getActorUri("alice"), { headers: { Accept: "application/activity+json" } }), { contextData: void 0 })).json();
|
|
106
|
+
assert(Array.isArray(fetched.attachment));
|
|
107
|
+
const keyPairs = await ctx.getActorKeyPairs("alice");
|
|
108
|
+
const start = received.length;
|
|
109
|
+
await ctx.sendActivity(scenario.startsWith("raw-") ? keyPairs.map((kp) => ({
|
|
110
|
+
privateKey: kp.privateKey,
|
|
111
|
+
keyId: kp.keyId
|
|
112
|
+
})) : { identifier: "alice" }, {
|
|
113
|
+
id: new URL("https://example.com/recipient"),
|
|
114
|
+
inboxId: new URL(inbox)
|
|
115
|
+
}, new Update({
|
|
116
|
+
id: new URL(`https://example.com/updates/${scenario}`),
|
|
117
|
+
actor: actor.id,
|
|
118
|
+
object: actor
|
|
119
|
+
}), scenario === "immediate" || scenario === "raw-immediate" || scenario === "rsa" ? { immediate: true } : scenario === "fanout" || scenario === "raw-fanout" || scenario === "rsa-fanout" ? { fanout: "force" } : {});
|
|
120
|
+
if (scenario === "retry") {
|
|
121
|
+
const first = messages.shift();
|
|
122
|
+
assert(first?.type === "outbox");
|
|
123
|
+
const original = structuredClone(first.activity);
|
|
124
|
+
responseStatus = 503;
|
|
125
|
+
await federation.processQueuedTask(void 0, first);
|
|
126
|
+
responseStatus = 202;
|
|
127
|
+
const retried = messages[0];
|
|
128
|
+
assert(retried?.type === "outbox");
|
|
129
|
+
assertEquals(retried.attempt, 1);
|
|
130
|
+
assertEquals(retried.activity, original);
|
|
131
|
+
}
|
|
132
|
+
for (let count = 0; messages.length > 0; count++) {
|
|
133
|
+
assert(count < 10, "The delivery queue must drain.");
|
|
134
|
+
await federation.processQueuedTask(void 0, messages.shift());
|
|
135
|
+
}
|
|
136
|
+
assert(received.length > start);
|
|
137
|
+
const delivered = received.at(-1);
|
|
138
|
+
assertEquals(delivered.object.attachment, fetched.attachment);
|
|
139
|
+
assert(await verifySignature(delivered, {
|
|
140
|
+
contextLoader: mockDocumentLoader,
|
|
141
|
+
keyCache: {
|
|
142
|
+
get(id) {
|
|
143
|
+
return Promise.resolve(keyPairs.find((kp) => kp.cryptographicKey.id?.href === id.href)?.cryptographicKey ?? null);
|
|
144
|
+
},
|
|
145
|
+
async set() {}
|
|
146
|
+
}
|
|
147
|
+
}));
|
|
148
|
+
const wire = detachSignature(delivered);
|
|
149
|
+
const proofs = wire.proof == null ? [] : Array.isArray(wire.proof) ? wire.proof : [wire.proof];
|
|
150
|
+
assertEquals(proofs.length, scenario.startsWith("rsa") ? 0 : 2);
|
|
151
|
+
for (const proof of proofs) {
|
|
152
|
+
const key = keyPairs.find((kp) => kp.multikey.id?.href === proof.verificationMethod || kp.keyId.href === proof.verificationMethod);
|
|
153
|
+
assert(key != null);
|
|
154
|
+
await assertRawProof(wire, proof, key.publicKey);
|
|
155
|
+
}
|
|
156
|
+
if (scenario === "retry") assertEquals(received.at(-2), received.at(-1));
|
|
157
|
+
});
|
|
158
|
+
} finally {
|
|
159
|
+
esm_default.unmockGlobal();
|
|
160
|
+
esm_default.removeRoutes();
|
|
161
|
+
esm_default.clearHistory();
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
test("public attachment proof serialization remains unchanged", async () => {
|
|
165
|
+
const signed = await signObject(new Create({
|
|
166
|
+
actor: new URL("https://example.com/actor"),
|
|
167
|
+
object: new Note({ attachments: [new Image({ url: new URL("https://example.com/image.png") })] })
|
|
168
|
+
}), ed25519PrivateKey, ed25519PublicKey.id, { contextLoader: mockDocumentLoader });
|
|
169
|
+
const raw = await signed.toJsonLd({
|
|
170
|
+
format: "compact",
|
|
171
|
+
contextLoader: mockDocumentLoader
|
|
172
|
+
});
|
|
173
|
+
assert(!Array.isArray(raw.object.attachment));
|
|
174
|
+
await assertRawProof(raw, raw.proof, ed25519PublicKey.publicKey);
|
|
175
|
+
const resignedJson = await (await signObject(signed, ed25519PrivateKey, ed25519PublicKey.id, { contextLoader: mockDocumentLoader })).toJsonLd({
|
|
176
|
+
format: "compact",
|
|
177
|
+
contextLoader: mockDocumentLoader
|
|
178
|
+
});
|
|
179
|
+
assert(!Array.isArray(resignedJson.object.attachment));
|
|
180
|
+
assert(Array.isArray(resignedJson.proof));
|
|
181
|
+
assertEquals(resignedJson.proof.length, 2);
|
|
182
|
+
for (const proof of resignedJson.proof) await assertRawProof(resignedJson, proof, ed25519PublicKey.publicKey);
|
|
183
|
+
});
|
|
184
|
+
test("delivery preparation only selects changed proof-free attachment JSON", async () => {
|
|
185
|
+
assertEquals(await prepareActivityJsonLd(new Create({
|
|
186
|
+
actor: new URL("https://example.com/actor"),
|
|
187
|
+
object: new Note({ content: "No attachments" })
|
|
188
|
+
}), mockDocumentLoader), void 0);
|
|
189
|
+
const child = new Note({ attachments: [new Image({ url: new URL("https://example.com/image.png") })] });
|
|
190
|
+
const activity = new Create({
|
|
191
|
+
actor: new URL("https://example.com/actor"),
|
|
192
|
+
object: child
|
|
193
|
+
});
|
|
194
|
+
const before = structuredClone(await activity.toJsonLd());
|
|
195
|
+
const childBefore = structuredClone(await child.toJsonLd());
|
|
196
|
+
const prepared = await prepareActivityJsonLd(activity, mockDocumentLoader);
|
|
197
|
+
assert(prepared != null);
|
|
198
|
+
assert(Array.isArray(prepared.object.attachment));
|
|
199
|
+
assertEquals(await activity.toJsonLd(), before);
|
|
200
|
+
assertEquals(await child.toJsonLd(), childBefore);
|
|
201
|
+
const signedChild = await signObject(child, ed25519PrivateKey, ed25519PublicKey.id, { contextLoader: mockDocumentLoader });
|
|
202
|
+
assertEquals(await prepareActivityJsonLd(new Create({
|
|
203
|
+
actor: activity.actorId,
|
|
204
|
+
object: signedChild
|
|
205
|
+
}), mockDocumentLoader), void 0);
|
|
206
|
+
});
|
|
207
|
+
test("existing root proofs retain baseline delivery signing and scalar attachments", async (t) => {
|
|
208
|
+
const inbox = "https://example.com/existing-proof-inbox";
|
|
209
|
+
let delivered;
|
|
210
|
+
esm_default.spyGlobal();
|
|
211
|
+
esm_default.post(inbox, async ({ request }) => {
|
|
212
|
+
delivered = await request.json();
|
|
213
|
+
return new Response(null, { status: 202 });
|
|
214
|
+
});
|
|
215
|
+
try {
|
|
216
|
+
for (const sender of ["actor", "raw"]) await t.step(sender, async () => {
|
|
217
|
+
const federation = new FederationImpl({
|
|
218
|
+
kv: new MemoryKvStore(),
|
|
219
|
+
allowPrivateAddress: true
|
|
220
|
+
});
|
|
221
|
+
federation.setActorDispatcher("/users/{identifier}", (ctx, identifier) => new Person({ id: ctx.getActorUri(identifier) })).setKeyPairsDispatcher(() => [{
|
|
222
|
+
privateKey: rsaPrivateKey2,
|
|
223
|
+
publicKey: rsaPublicKey2.publicKey
|
|
224
|
+
}, {
|
|
225
|
+
privateKey: ed25519PrivateKey,
|
|
226
|
+
publicKey: ed25519PublicKey.publicKey
|
|
227
|
+
}]);
|
|
228
|
+
const ctx = new ContextImpl({
|
|
229
|
+
data: void 0,
|
|
230
|
+
federation,
|
|
231
|
+
url: new URL("https://example.com/"),
|
|
232
|
+
documentLoader: mockDocumentLoader,
|
|
233
|
+
contextLoader: mockDocumentLoader
|
|
234
|
+
});
|
|
235
|
+
const activity = await signObject(new Update({
|
|
236
|
+
id: new URL(`https://example.com/existing-proof/${sender}`),
|
|
237
|
+
actor: ctx.getActorUri("alice"),
|
|
238
|
+
object: new Person({
|
|
239
|
+
id: ctx.getActorUri("alice"),
|
|
240
|
+
attachments: [new PropertyValue({
|
|
241
|
+
name: "Site",
|
|
242
|
+
value: "example"
|
|
243
|
+
})]
|
|
244
|
+
})
|
|
245
|
+
}), ed25519PrivateKey, ed25519PublicKey.id, { contextLoader: mockDocumentLoader });
|
|
246
|
+
const before = structuredClone(await activity.toJsonLd());
|
|
247
|
+
assertEquals(await prepareActivityJsonLd(activity, mockDocumentLoader), void 0);
|
|
248
|
+
await ctx.sendActivity(sender === "actor" ? { identifier: "alice" } : [{
|
|
249
|
+
privateKey: rsaPrivateKey2,
|
|
250
|
+
keyId: rsaPublicKey2.id
|
|
251
|
+
}, {
|
|
252
|
+
privateKey: ed25519PrivateKey,
|
|
253
|
+
keyId: ed25519PublicKey.id
|
|
254
|
+
}], {
|
|
255
|
+
id: new URL("https://example.com/recipient"),
|
|
256
|
+
inboxId: new URL(inbox)
|
|
257
|
+
}, activity, { immediate: true });
|
|
258
|
+
assert(delivered != null);
|
|
259
|
+
assert(!Array.isArray(delivered.object.attachment));
|
|
260
|
+
assert(await verifySignature(delivered, {
|
|
261
|
+
contextLoader: mockDocumentLoader,
|
|
262
|
+
keyCache: {
|
|
263
|
+
get: () => Promise.resolve(rsaPublicKey2),
|
|
264
|
+
async set() {}
|
|
265
|
+
}
|
|
266
|
+
}));
|
|
267
|
+
const wire = detachSignature(delivered);
|
|
268
|
+
const proofs = Array.isArray(wire.proof) ? wire.proof : [wire.proof];
|
|
269
|
+
assertEquals(proofs.length, sender === "actor" ? 2 : 1);
|
|
270
|
+
for (const proof of proofs) await assertRawProof(wire, proof, ed25519PublicKey.publicKey);
|
|
271
|
+
assertEquals(await activity.toJsonLd(), before);
|
|
272
|
+
});
|
|
273
|
+
} finally {
|
|
274
|
+
esm_default.unmockGlobal();
|
|
275
|
+
esm_default.removeRoutes();
|
|
276
|
+
esm_default.clearHistory();
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
//#endregion
|
|
280
|
+
export {};
|
|
@@ -7,15 +7,15 @@ import "../std__assert-DflMZha5.mjs";
|
|
|
7
7
|
import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
|
|
8
8
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
9
9
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
10
|
-
import { i as generateCryptoKeyPair } from "../key-
|
|
11
|
-
import { c as signRequest } from "../http-
|
|
10
|
+
import { i as generateCryptoKeyPair } from "../key-CxZXo3sZ.mjs";
|
|
11
|
+
import { c as signRequest } from "../http-Cx49vN9O.mjs";
|
|
12
12
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
13
|
-
import { a as compactJsonLd, m as signJsonLd } from "../ld-
|
|
13
|
+
import { a as compactJsonLd, m as signJsonLd } from "../ld-DTaV6DUm.mjs";
|
|
14
14
|
import { t as ldSignatureWithoutCreated } from "../ld-signature-_KYhPsqt.mjs";
|
|
15
|
-
import { n as signObject } from "../proof-
|
|
15
|
+
import { n as signObject } from "../proof-DFrHHTit.mjs";
|
|
16
16
|
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
17
|
-
import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-
|
|
18
|
-
import { t as InboxListenerSet } from "../inbox-
|
|
17
|
+
import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-BuQURchh.mjs";
|
|
18
|
+
import { t as InboxListenerSet } from "../inbox-Rw21yNrv.mjs";
|
|
19
19
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
20
20
|
import { Create, CryptographicKey, Multikey, Note, Person } from "@fedify/vocab";
|
|
21
21
|
import { configure, reset } from "@logtape/logtape";
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import "../std__assert-DflMZha5.mjs";
|
|
6
6
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
7
|
-
import { n as signObject } from "../proof-
|
|
7
|
+
import { n as signObject } from "../proof-DFrHHTit.mjs";
|
|
8
8
|
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
9
|
-
import { a as createFederation } from "../middleware-
|
|
9
|
+
import { a as createFederation } from "../middleware-BuQURchh.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,7 +3,7 @@ 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 { n as actorsHaveSameOrigin, t as InboxListenerSet } from "../inbox-
|
|
6
|
+
import { n as actorsHaveSameOrigin, t as InboxListenerSet } from "../inbox-Rw21yNrv.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
|
|
9
9
|
//#region src/federation/inbox.test.ts
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
|
|
6
6
|
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
7
|
-
import { t as KvKeyCache } from "../keycache-
|
|
7
|
+
import { t as KvKeyCache } from "../keycache-BhLorx33.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
10
10
|
//#region src/federation/keycache.test.ts
|
|
@@ -9,16 +9,16 @@ import { r as assertFalse, t as assertThrows } from "../assert_throws-D4DNWrux.m
|
|
|
9
9
|
import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
|
|
10
10
|
import { t as assertNotEquals } from "../assert_not_equals-BkxW5QJI.mjs";
|
|
11
11
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
12
|
-
import { c as signRequest, u as verifyRequest } from "../http-
|
|
12
|
+
import { c as signRequest, u as verifyRequest } from "../http-Cx49vN9O.mjs";
|
|
13
13
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
14
|
-
import { n as getAuthenticatedDocumentLoader } from "../docloader-
|
|
15
|
-
import { a as compactJsonLd, c as detachSignature, g as verifyJsonLd, i as attachSignature, m as signJsonLd } from "../ld-
|
|
14
|
+
import { n as getAuthenticatedDocumentLoader } from "../docloader-BVio_R-w.mjs";
|
|
15
|
+
import { a as compactJsonLd, c as detachSignature, g as verifyJsonLd, i as attachSignature, m as signJsonLd } from "../ld-DTaV6DUm.mjs";
|
|
16
16
|
import { t as ldSignatureWithoutCreated } from "../ld-signature-_KYhPsqt.mjs";
|
|
17
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
18
|
-
import { n as signObject, r as verifyObject } from "../proof-
|
|
17
|
+
import { t as doesActorOwnKey } from "../owner-CEFC5tVI.mjs";
|
|
18
|
+
import { n as signObject, r as verifyObject } from "../proof-DFrHHTit.mjs";
|
|
19
19
|
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
20
|
-
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-
|
|
21
|
-
import { t as SendActivityError } from "../send-
|
|
20
|
+
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-BuQURchh.mjs";
|
|
21
|
+
import { t as SendActivityError } from "../send-Dn11B6x2.mjs";
|
|
22
22
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
23
23
|
import * as vocab from "@fedify/vocab";
|
|
24
24
|
import { Create, Offer, Person, getTypeId, lookupObject } from "@fedify/vocab";
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -2,7 +2,7 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
require("../chunk-DDcVe30Y.cjs");
|
|
5
|
-
const require_middleware = require("../middleware-
|
|
5
|
+
const require_middleware = require("../middleware-By3uBhIJ.cjs");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
//#region src/federation/kv.ts
|
|
8
8
|
/**
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-
|
|
3
|
+
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "../middleware-Bnn9AKMf.js";
|
|
4
4
|
import { isEqual } from "es-toolkit";
|
|
5
5
|
//#region src/federation/kv.ts
|
|
6
6
|
/**
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import "../std__assert-DflMZha5.mjs";
|
|
5
5
|
import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
|
|
6
6
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
7
|
-
import { t as acceptsJsonLd } from "../negotiation-
|
|
7
|
+
import { t as acceptsJsonLd } from "../negotiation-DnsfFF8I.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/federation/negotiation.test.ts
|
|
10
10
|
test("acceptsJsonLd()", () => {
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { l as AssertionError, t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import { t as assertNotEquals } from "../assert_not_equals-BkxW5QJI.mjs";
|
|
6
|
-
import { t as createExponentialBackoffPolicy } from "../retry-
|
|
6
|
+
import { t as createExponentialBackoffPolicy } from "../retry-CJL0poaU.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
//#region src/federation/retry.test.ts
|
|
9
9
|
test("createExponentialBackoffPolicy()", () => {
|
|
@@ -8,10 +8,10 @@ import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
|
|
|
8
8
|
import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
|
|
9
9
|
import { t as assertNotEquals } from "../assert_not_equals-BkxW5QJI.mjs";
|
|
10
10
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
11
|
-
import { u as verifyRequest } from "../http-
|
|
11
|
+
import { u as verifyRequest } from "../http-Cx49vN9O.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
13
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
14
|
-
import { i as sendActivity, n as extractInboxes, r as fetchWithValidatedRedirects, t as SendActivityError } from "../send-
|
|
13
|
+
import { t as doesActorOwnKey } from "../owner-CEFC5tVI.mjs";
|
|
14
|
+
import { i as sendActivity, n as extractInboxes, r as fetchWithValidatedRedirects, t as SendActivityError } from "../send-Dn11B6x2.mjs";
|
|
15
15
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
17
17
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import "../std__assert-DflMZha5.mjs";
|
|
5
5
|
import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
|
|
6
6
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-DEWMgahT.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 () => {
|
|
@@ -5,7 +5,7 @@ import { n as createRequestContext } from "../context-Juj6bdHC.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-DflMZha5.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
8
|
-
import { a as createFederation, o as handleWebFinger } from "../middleware-
|
|
8
|
+
import { a as createFederation, o as handleWebFinger } from "../middleware-BuQURchh.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Image, Link, Person } from "@fedify/vocab";
|
|
11
11
|
//#region src/federation/webfinger.test.ts
|
|
@@ -12,7 +12,7 @@ let byte_encodings_base64 = require("byte-encodings/base64");
|
|
|
12
12
|
let structured_field_values = require("structured-field-values");
|
|
13
13
|
//#region deno.json
|
|
14
14
|
var name = "@fedify/fedify";
|
|
15
|
-
var version = "2.0.36-dev.
|
|
15
|
+
var version = "2.0.36-dev.2828+4d2d041b";
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/sig/key.ts
|
|
18
18
|
/** Classifies decoding failures without hiding unexpected loader errors. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { o as validateCryptoKey, r as fetchKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-uX5OxSMQ.mjs";
|
|
5
|
+
import { o as validateCryptoKey, r as fetchKey } from "./key-CxZXo3sZ.mjs";
|
|
6
6
|
import { CryptographicKey } from "@fedify/vocab";
|
|
7
7
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -11,7 +11,7 @@ import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
|
11
11
|
import { Item, decodeDict, encodeItem } from "structured-field-values";
|
|
12
12
|
//#region deno.json
|
|
13
13
|
var name = "@fedify/fedify";
|
|
14
|
-
var version = "2.0.36-dev.
|
|
14
|
+
var version = "2.0.36-dev.2828+4d2d041b";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/sig/key.ts
|
|
17
17
|
/** Classifies decoding failures without hiding unexpected loader errors. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-uX5OxSMQ.mjs";
|
|
5
5
|
import { Activity, getTypeId } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-uX5OxSMQ.mjs";
|
|
5
5
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
7
7
|
import { FetchError, UrlError, getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { l as validateCryptoKey, t as doubleKnockScoped } from "./http-
|
|
3
|
+
import { l as validateCryptoKey, t as doubleKnockScoped } from "./http-DaxiTQXs.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { curry } from "es-toolkit";
|
|
6
6
|
import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts } from "@fedify/vocab-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
require("./chunk-DDcVe30Y.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-Bp6bXNxO.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { o as validateCryptoKey, r as fetchKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-uX5OxSMQ.mjs";
|
|
5
|
+
import { o as validateCryptoKey, r as fetchKey } from "./key-CxZXo3sZ.mjs";
|
|
6
6
|
import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
|
|
7
7
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { getDocumentLoader, preloadedContexts } from "@fedify/vocab-runtime";
|