@fedify/fedify 2.2.0-dev.933 → 2.2.0-dev.938
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_strict_equals-Dmjbg-bA.mjs +41 -0
- package/dist/{builder-CC8FC1dV.mjs → builder-Dq6ijpsL.mjs} +3 -3
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/outgoing-jsonld.test.d.mts +2 -0
- package/dist/compat/outgoing-jsonld.test.mjs +189 -0
- package/dist/compat/public-audience.test.mjs +1 -1
- package/dist/compat/transformers.test.mjs +3 -3
- package/dist/{context-BGrYMSTk.d.ts → context-BzH2-ajs.d.ts} +22 -0
- package/dist/{context-CMUd4wy0.d.cts → context-DJGagtNd.d.cts} +22 -0
- package/dist/{deno-B8mWkTTn.mjs → deno-sVjM503s.mjs} +1 -1
- package/dist/{docloader-DKJ5e8gU.mjs → docloader-C5hOIM67.mjs} +2 -2
- package/dist/federation/builder.test.mjs +3 -3
- package/dist/federation/collection.test.mjs +2 -2
- package/dist/federation/handler.test.mjs +8 -8
- package/dist/federation/idempotency.test.mjs +5 -5
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/keycache.test.mjs +3 -3
- package/dist/federation/kv.test.mjs +2 -2
- package/dist/federation/middleware.test.mjs +150 -10
- 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/mq.test.mjs +2 -2
- package/dist/federation/negotiation.test.mjs +3 -3
- package/dist/federation/retry.test.mjs +1 -1
- package/dist/federation/router.test.mjs +2 -2
- package/dist/federation/send.test.mjs +6 -6
- package/dist/federation/webfinger.test.mjs +3 -3
- package/dist/{http-DPlMNgUK.js → http-DMkdP3lE.js} +1 -1
- package/dist/{http-p0UsGIlL.cjs → http-De4te5mA.cjs} +1 -1
- package/dist/{http-DAbItDan.mjs → http-pO-cqL07.mjs} +3 -3
- package/dist/{key-DN889XzS.mjs → key-Ch1SiRyF.mjs} +1 -1
- package/dist/{kv-cache-CuhV7I2P.cjs → kv-cache-BM50uOpt.cjs} +1 -1
- package/dist/{kv-cache-BGV0-93s.js → kv-cache-D7IdkIte.js} +1 -1
- package/dist/{ld-DYd5xgGv.mjs → ld-DkpX94b7.mjs} +2 -2
- package/dist/{middleware-R4UP180T.cjs → middleware-0gXHFt3T.cjs} +1 -1
- package/dist/{middleware-D3XX3847.mjs → middleware-BOshhaxP.mjs} +34 -24
- package/dist/{middleware-zZ0oW5en.mjs → middleware-BqT40f_u.mjs} +1 -1
- package/dist/{middleware-BiTRBm8d.cjs → middleware-CSKiL4bq.cjs} +20 -10
- package/dist/{middleware-CSqRr3A7.js → middleware-T1_RW8x2.js} +19 -9
- package/dist/{mod-CJXfyw7v.d.ts → mod-2d12ffz3.d.ts} +1 -1
- package/dist/{mod-BcJHeuv1.d.cts → mod-D35TRn09.d.cts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +2 -2
- package/dist/mod.d.ts +2 -2
- 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 +2 -2
- package/dist/otel/exporter.test.mjs +2 -2
- package/dist/outgoing-jsonld-CNmZLixq.mjs +203 -0
- package/dist/{owner-BQOHi8l9.mjs → owner-uOWCZ4oR.mjs} +2 -2
- package/dist/{proof-Bv96WRg6.mjs → proof-B9ynOKyy.mjs} +12 -10
- package/dist/{proof-xfLfyhFS.cjs → proof-Bku-2gS1.cjs} +249 -42
- package/dist/{proof-CrSFSoGi.js → proof-DONzhIHm.js} +248 -41
- package/dist/{public-audience-eovWqzOF.mjs → public-audience-DYFHzm_c.mjs} +20 -9
- package/dist/{send-BTzs3k9i.mjs → send-D-qKOq3i.mjs} +2 -2
- package/dist/sig/accept.test.mjs +1 -1
- package/dist/sig/http.test.mjs +5 -5
- package/dist/sig/key.test.mjs +3 -3
- package/dist/sig/ld.test.mjs +4 -4
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +4 -4
- package/dist/sig/proof.test.mjs +25 -10
- package/dist/{std__assert-Duiq_YC9.mjs → std__assert-CRDpx_HF.mjs} +3 -38
- package/dist/testing/mod.d.mts +22 -0
- package/dist/utils/docloader.test.mjs +4 -4
- 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 +5 -5
- /package/dist/{accept-Dd__NiUL.mjs → accept-CPkZzmGN.mjs} +0 -0
- /package/dist/{activity-listener-CFzUqoCS.mjs → activity-listener-ell7W1s9.mjs} +0 -0
- /package/dist/{assert-ddO5KLpe.mjs → assert-DikXweDx.mjs} +0 -0
- /package/dist/{client-DVu6Fmom.mjs → client-D_1QpnWt.mjs} +0 -0
- /package/dist/{collection-BQRKGS7L.mjs → collection-D-HqUuA2.mjs} +0 -0
- /package/dist/{keycache-C2t1kvP5.mjs → keycache-EGATflN-.mjs} +0 -0
- /package/dist/{keys-BAK-tUlf.mjs → keys-DGu1NFwu.mjs} +0 -0
- /package/dist/{kv-cache-B01V7s3h.mjs → kv-cache-U__xU4qR.mjs} +0 -0
- /package/dist/{kv-C-TG81Sv.mjs → kv-rV3vodCc.mjs} +0 -0
- /package/dist/{negotiation-xb0QR3u_.mjs → negotiation-SQvQgUqe.mjs} +0 -0
- /package/dist/{retry-CJL0poaU.mjs → retry-bMXBL97A.mjs} +0 -0
- /package/dist/{types-CGUnLkU3.mjs → types-J53Kw7so.mjs} +0 -0
|
@@ -4,25 +4,27 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
5
5
|
import { n as RouterError } from "../router-CrMLXoOr.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
-
import
|
|
7
|
+
import "../std__assert-CRDpx_HF.mjs";
|
|
8
8
|
import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
9
9
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
10
10
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
11
11
|
import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { t as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
12
|
+
import { t as assertStrictEquals } from "../assert_strict_equals-Dmjbg-bA.mjs";
|
|
13
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
14
|
+
import { l as verifyRequest, s as signRequest } from "../http-pO-cqL07.mjs";
|
|
15
|
+
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
16
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-C5hOIM67.mjs";
|
|
17
|
+
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-DkpX94b7.mjs";
|
|
18
|
+
import { t as doesActorOwnKey } from "../owner-uOWCZ4oR.mjs";
|
|
19
|
+
import { i as verifyObject, r as signObject } from "../proof-B9ynOKyy.mjs";
|
|
20
|
+
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
21
|
+
import { i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-BOshhaxP.mjs";
|
|
21
22
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
22
23
|
import * as vocab from "@fedify/vocab";
|
|
23
24
|
import { getTypeId, lookupObject } from "@fedify/vocab";
|
|
24
25
|
import { FetchError, getDocumentLoader } from "@fedify/vocab-runtime";
|
|
25
26
|
import { configure, reset } from "@logtape/logtape";
|
|
27
|
+
import serialize from "json-canon";
|
|
26
28
|
//#region ../fixture/src/fixtures/example.com/create.json
|
|
27
29
|
var id$2 = "https://example.com/create";
|
|
28
30
|
var create_default = {
|
|
@@ -1815,6 +1817,24 @@ test("FederationImpl.sendActivity()", async (t) => {
|
|
|
1815
1817
|
assertEquals(verified, ["ld", "http"]);
|
|
1816
1818
|
assertEquals((await request?.json())?.to, vocab.PUBLIC_COLLECTION.href);
|
|
1817
1819
|
verified = null;
|
|
1820
|
+
await federation.sendActivity([{
|
|
1821
|
+
privateKey: rsaPrivateKey3,
|
|
1822
|
+
keyId: rsaPublicKey3.id
|
|
1823
|
+
}], inboxes, new vocab.Create({
|
|
1824
|
+
id: new URL("https://example.com/activity/attachment"),
|
|
1825
|
+
actor: new URL("https://example.com/person2"),
|
|
1826
|
+
object: new vocab.Note({
|
|
1827
|
+
id: new URL("https://example.com/note/attachment"),
|
|
1828
|
+
attachments: [new vocab.Document({
|
|
1829
|
+
mediaType: "image/png",
|
|
1830
|
+
url: new URL("https://example.com/image.png")
|
|
1831
|
+
})]
|
|
1832
|
+
})
|
|
1833
|
+
}), { context });
|
|
1834
|
+
assertEquals(verified, ["ld", "http"]);
|
|
1835
|
+
const postedObject = (await request?.json()).object;
|
|
1836
|
+
assertEquals(Array.isArray(postedObject.attachment), true);
|
|
1837
|
+
verified = null;
|
|
1818
1838
|
await federation.sendActivity([{
|
|
1819
1839
|
privateKey: rsaPrivateKey3,
|
|
1820
1840
|
keyId: rsaPublicKey3.id
|
|
@@ -1834,6 +1854,53 @@ test("FederationImpl.sendActivity()", async (t) => {
|
|
|
1834
1854
|
assertEquals(request?.method, "POST");
|
|
1835
1855
|
assertEquals(request?.url, "https://example.com/inbox");
|
|
1836
1856
|
assertEquals(request?.headers.get("Content-Type"), "application/activity+json");
|
|
1857
|
+
const preSignedActivity = new vocab.Create({
|
|
1858
|
+
id: new URL("https://example.com/activity/pre-signed-attachment"),
|
|
1859
|
+
actor: new URL("https://example.com/person2"),
|
|
1860
|
+
object: new vocab.Note({
|
|
1861
|
+
id: new URL("https://example.com/note/pre-signed-attachment"),
|
|
1862
|
+
attachments: [new vocab.Document({
|
|
1863
|
+
mediaType: "image/png",
|
|
1864
|
+
url: new URL("https://example.com/pre-signed-image.png")
|
|
1865
|
+
})]
|
|
1866
|
+
})
|
|
1867
|
+
});
|
|
1868
|
+
const preSignedJson = await preSignedActivity.toJsonLd({
|
|
1869
|
+
format: "compact",
|
|
1870
|
+
contextLoader: mockDocumentLoader
|
|
1871
|
+
});
|
|
1872
|
+
const preSignedObject = preSignedJson.object;
|
|
1873
|
+
assertEquals(Array.isArray(preSignedObject.attachment), false);
|
|
1874
|
+
const created = Temporal.Now.instant();
|
|
1875
|
+
const proofConfig = {
|
|
1876
|
+
"@context": preSignedJson["@context"],
|
|
1877
|
+
type: "DataIntegrityProof",
|
|
1878
|
+
cryptosuite: "eddsa-jcs-2022",
|
|
1879
|
+
verificationMethod: ed25519Multikey.id.href,
|
|
1880
|
+
proofPurpose: "assertionMethod",
|
|
1881
|
+
created: created.toString()
|
|
1882
|
+
};
|
|
1883
|
+
const encoder = new TextEncoder();
|
|
1884
|
+
const proofDigest = await crypto.subtle.digest("SHA-256", encoder.encode(serialize(proofConfig)));
|
|
1885
|
+
const msgDigest = await crypto.subtle.digest("SHA-256", encoder.encode(serialize(preSignedJson)));
|
|
1886
|
+
const digest = new Uint8Array(proofDigest.byteLength + msgDigest.byteLength);
|
|
1887
|
+
digest.set(new Uint8Array(proofDigest), 0);
|
|
1888
|
+
digest.set(new Uint8Array(msgDigest), proofDigest.byteLength);
|
|
1889
|
+
const proofValue = new Uint8Array(await crypto.subtle.sign("Ed25519", ed25519PrivateKey, digest));
|
|
1890
|
+
verified = null;
|
|
1891
|
+
await federation.sendActivity([{
|
|
1892
|
+
privateKey: ed25519PrivateKey,
|
|
1893
|
+
keyId: ed25519Multikey.id
|
|
1894
|
+
}], inboxes, preSignedActivity.clone({ proofs: [new vocab.DataIntegrityProof({
|
|
1895
|
+
cryptosuite: "eddsa-jcs-2022",
|
|
1896
|
+
verificationMethod: ed25519Multikey.id,
|
|
1897
|
+
proofPurpose: "assertionMethod",
|
|
1898
|
+
proofValue,
|
|
1899
|
+
created
|
|
1900
|
+
})] }), { context });
|
|
1901
|
+
assertEquals(verified, ["proof"]);
|
|
1902
|
+
const postedPreSignedObject = (await request?.json()).object;
|
|
1903
|
+
assertEquals(Array.isArray(postedPreSignedObject.attachment), false);
|
|
1837
1904
|
verified = null;
|
|
1838
1905
|
await federation.sendActivity([{
|
|
1839
1906
|
privateKey: rsaPrivateKey3,
|
|
@@ -2318,6 +2385,31 @@ test("ContextImpl.sendActivity()", async (t) => {
|
|
|
2318
2385
|
assertEquals(request?.method, "POST");
|
|
2319
2386
|
assertEquals(request?.url, "https://example.com/inbox");
|
|
2320
2387
|
assertEquals(request?.headers.get("Content-Type"), "application/activity+json");
|
|
2388
|
+
const actorEdKey = (await ctx.getActorKeyPairs("1")).find((key) => key.privateKey.algorithm.name === "Ed25519");
|
|
2389
|
+
assert(actorEdKey != null);
|
|
2390
|
+
assert(actorEdKey.multikey.id != null);
|
|
2391
|
+
const signedWithNormalizedProof = await signObject(new vocab.Create({
|
|
2392
|
+
id: new URL("https://example.com/activity/signed-attachment"),
|
|
2393
|
+
actor: ctx.getActorUri("1"),
|
|
2394
|
+
object: new vocab.Note({
|
|
2395
|
+
id: new URL("https://example.com/note/signed-attachment"),
|
|
2396
|
+
attachments: [new vocab.Document({
|
|
2397
|
+
mediaType: "image/png",
|
|
2398
|
+
url: new URL("https://example.com/signed-image.png")
|
|
2399
|
+
})]
|
|
2400
|
+
})
|
|
2401
|
+
}), actorEdKey.privateKey, actorEdKey.multikey.id, { contextLoader: documentLoader });
|
|
2402
|
+
verified = null;
|
|
2403
|
+
await ctx.sendActivity([{
|
|
2404
|
+
privateKey: actorEdKey.privateKey,
|
|
2405
|
+
keyId: actorEdKey.multikey.id
|
|
2406
|
+
}], {
|
|
2407
|
+
id: new URL("https://example.com/recipient"),
|
|
2408
|
+
inboxId: new URL("https://example.com/inbox")
|
|
2409
|
+
}, signedWithNormalizedProof, { normalizeExistingProofs: true });
|
|
2410
|
+
assertEquals(verified, ["proof"]);
|
|
2411
|
+
const postedSignedObject = (await request?.json()).object;
|
|
2412
|
+
assertEquals(Array.isArray(postedSignedObject.attachment), true);
|
|
2321
2413
|
await assertRejects(() => ctx.sendActivity({ identifier: "not-found" }, {
|
|
2322
2414
|
id: new URL("https://example.com/recipient"),
|
|
2323
2415
|
inboxId: new URL("https://example.com/inbox")
|
|
@@ -2430,6 +2522,54 @@ test("ContextImpl.sendActivity()", async (t) => {
|
|
|
2430
2522
|
assertEquals(proofCount, 1);
|
|
2431
2523
|
});
|
|
2432
2524
|
queue.clear();
|
|
2525
|
+
await t.step("fanout: \"force\" preserves pre-signed proof normalization", async () => {
|
|
2526
|
+
const ctxForProof = new ContextImpl({
|
|
2527
|
+
data: void 0,
|
|
2528
|
+
federation,
|
|
2529
|
+
url: new URL("https://example.com/"),
|
|
2530
|
+
documentLoader,
|
|
2531
|
+
contextLoader: documentLoader
|
|
2532
|
+
});
|
|
2533
|
+
const actorEdKey = (await ctxForProof.getActorKeyPairs("1")).find((key) => key.privateKey.algorithm.name === "Ed25519");
|
|
2534
|
+
assert(actorEdKey != null);
|
|
2535
|
+
assert(actorEdKey.multikey.id != null);
|
|
2536
|
+
const signedWithNormalizedProof = await signObject(new vocab.Create({
|
|
2537
|
+
id: new URL("https://example.com/activity/signed-attachment-fanout"),
|
|
2538
|
+
actor: ctxForProof.getActorUri("1"),
|
|
2539
|
+
object: new vocab.Note({
|
|
2540
|
+
id: new URL("https://example.com/note/signed-attachment-fanout"),
|
|
2541
|
+
attachments: [new vocab.Document({
|
|
2542
|
+
mediaType: "image/png",
|
|
2543
|
+
url: new URL("https://example.com/signed-fanout-image.png")
|
|
2544
|
+
})]
|
|
2545
|
+
})
|
|
2546
|
+
}), actorEdKey.privateKey, actorEdKey.multikey.id, { contextLoader: documentLoader });
|
|
2547
|
+
await ctx2.sendActivity([{
|
|
2548
|
+
privateKey: actorEdKey.privateKey,
|
|
2549
|
+
keyId: actorEdKey.multikey.id
|
|
2550
|
+
}], {
|
|
2551
|
+
id: new URL("https://example.com/recipient"),
|
|
2552
|
+
inboxId: new URL("https://example.com/inbox")
|
|
2553
|
+
}, signedWithNormalizedProof, {
|
|
2554
|
+
fanout: "force",
|
|
2555
|
+
normalizeExistingProofs: true
|
|
2556
|
+
});
|
|
2557
|
+
assertEquals(queue.messages.length, 1);
|
|
2558
|
+
assert(queue.messages[0].type === "fanout");
|
|
2559
|
+
const fanoutMsg = queue.messages[0];
|
|
2560
|
+
assertEquals(fanoutMsg.normalizeExistingProofs, true);
|
|
2561
|
+
queue.clear();
|
|
2562
|
+
await federation2.processQueuedTask(void 0, fanoutMsg);
|
|
2563
|
+
assertEquals(queue.messages.length, 1);
|
|
2564
|
+
const outboxMsg = queue.messages[0];
|
|
2565
|
+
assert(outboxMsg.type === "outbox");
|
|
2566
|
+
verified = null;
|
|
2567
|
+
await federation2.processQueuedTask(void 0, outboxMsg);
|
|
2568
|
+
assertEquals(verified, ["proof"]);
|
|
2569
|
+
const postedSignedObject = (await request?.json()).object;
|
|
2570
|
+
assertEquals(Array.isArray(postedSignedObject.attachment), true);
|
|
2571
|
+
});
|
|
2572
|
+
queue.clear();
|
|
2433
2573
|
await t.step("fanout: \"skip\"", async () => {
|
|
2434
2574
|
const activity = new vocab.Create({
|
|
2435
2575
|
id: new URL("https://example.com/activity/1"),
|
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-CSKiL4bq.cjs");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
//#region src/federation/kv.ts
|
|
8
8
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "../context-
|
|
1
|
+
import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "../context-DJGagtNd.cjs";
|
|
2
2
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-CbLNp3zQ.cjs";
|
|
3
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
3
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-D35TRn09.cjs";
|
|
4
4
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "../context-
|
|
3
|
+
import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "../context-BzH2-ajs.js";
|
|
4
4
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-GFYnFoOl.js";
|
|
5
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
5
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-2d12ffz3.js";
|
|
6
6
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "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-T1_RW8x2.js";
|
|
4
4
|
import { isEqual } from "es-toolkit";
|
|
5
5
|
//#region src/federation/kv.ts
|
|
6
6
|
/**
|
|
@@ -2,9 +2,9 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { n as assertGreater, r as assertGreaterOrEqual } from "../std__assert-CRDpx_HF.mjs";
|
|
6
6
|
import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
7
|
-
import { t as assert } from "../assert-
|
|
7
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
import { delay } from "es-toolkit";
|
|
10
10
|
//#region src/federation/mq.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import "../std__assert-
|
|
4
|
+
import "../std__assert-CRDpx_HF.mjs";
|
|
5
5
|
import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
6
|
-
import { t as assert } from "../assert-
|
|
7
|
-
import { t as acceptsJsonLd } from "../negotiation-
|
|
6
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
7
|
+
import { t as acceptsJsonLd } from "../negotiation-SQvQgUqe.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--wG9hV7u.mjs";
|
|
6
|
-
import { t as createExponentialBackoffPolicy } from "../retry-
|
|
6
|
+
import { t as createExponentialBackoffPolicy } from "../retry-bMXBL97A.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
//#region src/federation/retry.test.ts
|
|
9
9
|
test("createExponentialBackoffPolicy()", () => {
|
|
@@ -3,10 +3,10 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as RouterError, t as Router } from "../router-CrMLXoOr.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
-
import "../std__assert-
|
|
6
|
+
import "../std__assert-CRDpx_HF.mjs";
|
|
7
7
|
import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
8
8
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
9
|
-
import { t as assert } from "../assert-
|
|
9
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
//#region src/federation/router.test.ts
|
|
12
12
|
function setUp(options = {}) {
|
|
@@ -3,15 +3,15 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
-
import "../std__assert-
|
|
6
|
+
import "../std__assert-CRDpx_HF.mjs";
|
|
7
7
|
import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
8
8
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
9
9
|
import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
|
|
10
|
-
import { t as assert } from "../assert-
|
|
11
|
-
import { l as verifyRequest } from "../http-
|
|
12
|
-
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-
|
|
13
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
14
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
10
|
+
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
11
|
+
import { l as verifyRequest } from "../http-pO-cqL07.mjs";
|
|
12
|
+
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
|
|
13
|
+
import { t as doesActorOwnKey } from "../owner-uOWCZ4oR.mjs";
|
|
14
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-D-qKOq3i.mjs";
|
|
15
15
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
16
16
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
17
17
|
//#region src/federation/send.test.ts
|
|
@@ -3,9 +3,9 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { r as createRequestContext } from "../context-Dk_tacqz.mjs";
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
-
import "../std__assert-
|
|
7
|
-
import { t as MemoryKvStore } from "../kv-
|
|
8
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware-
|
|
6
|
+
import "../std__assert-CRDpx_HF.mjs";
|
|
7
|
+
import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
|
|
8
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware-BOshhaxP.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
//#region src/federation/webfinger.test.ts
|
|
@@ -10,7 +10,7 @@ import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } fro
|
|
|
10
10
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
11
11
|
//#region deno.json
|
|
12
12
|
var name = "@fedify/fedify";
|
|
13
|
-
var version = "2.2.0-dev.
|
|
13
|
+
var version = "2.2.0-dev.938+94d98c0c";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/sig/accept.ts
|
|
16
16
|
/**
|
|
@@ -11,7 +11,7 @@ let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conve
|
|
|
11
11
|
let byte_encodings_base64 = require("byte-encodings/base64");
|
|
12
12
|
//#region deno.json
|
|
13
13
|
var name = "@fedify/fedify";
|
|
14
|
-
var version = "2.2.0-dev.
|
|
14
|
+
var version = "2.2.0-dev.938+94d98c0c";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/sig/accept.ts
|
|
17
17
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
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 { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-
|
|
6
|
-
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-sVjM503s.mjs";
|
|
5
|
+
import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-CPkZzmGN.mjs";
|
|
6
|
+
import { o as validateCryptoKey, r as fetchKeyDetailed } from "./key-Ch1SiRyF.mjs";
|
|
7
7
|
import { CryptographicKey } from "@fedify/vocab";
|
|
8
8
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
9
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -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-sVjM503s.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, getDocumentLoader } 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-De4te5mA.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,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { d as validateCryptoKey, t as doubleKnock } from "./http-
|
|
3
|
+
import { d as validateCryptoKey, t as doubleKnock } from "./http-DMkdP3lE.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { curry } from "es-toolkit";
|
|
6
6
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@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 { n as fetchKey, o as validateCryptoKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-sVjM503s.mjs";
|
|
5
|
+
import { n as fetchKey, o as validateCryptoKey } from "./key-Ch1SiRyF.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 } from "@fedify/vocab-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
-
const require_middleware = require("./middleware-
|
|
3
|
+
const require_middleware = require("./middleware-CSKiL4bq.cjs");
|
|
4
4
|
exports.FederationImpl = require_middleware.FederationImpl;
|
|
@@ -2,24 +2,24 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as RouterError } from "./router-CrMLXoOr.mjs";
|
|
5
|
-
import { n as version, t as name } from "./deno-
|
|
6
|
-
import { t as formatAcceptSignature } from "./accept-
|
|
7
|
-
import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-
|
|
8
|
-
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-
|
|
9
|
-
import { t as getAuthenticatedDocumentLoader } from "./docloader-
|
|
10
|
-
import { n as kvCache } from "./kv-cache-
|
|
11
|
-
import { a as signJsonLd, i as hasSignatureLike, o as verifyJsonLd, r as detachSignature } from "./ld-
|
|
12
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
13
|
-
import {
|
|
14
|
-
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-
|
|
15
|
-
import { t as getNodeInfo } from "./client-
|
|
16
|
-
import { t as nodeInfoToJson } from "./types-
|
|
17
|
-
import { t as FederationBuilderImpl } from "./builder-
|
|
18
|
-
import { t as buildCollectionSynchronizationHeader } from "./collection-
|
|
19
|
-
import { t as KvKeyCache } from "./keycache-
|
|
20
|
-
import { t as acceptsJsonLd } from "./negotiation-
|
|
21
|
-
import { t as createExponentialBackoffPolicy } from "./retry-
|
|
22
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-
|
|
5
|
+
import { n as version, t as name } from "./deno-sVjM503s.mjs";
|
|
6
|
+
import { t as formatAcceptSignature } from "./accept-CPkZzmGN.mjs";
|
|
7
|
+
import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-Ch1SiRyF.mjs";
|
|
8
|
+
import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-pO-cqL07.mjs";
|
|
9
|
+
import { t as getAuthenticatedDocumentLoader } from "./docloader-C5hOIM67.mjs";
|
|
10
|
+
import { n as kvCache } from "./kv-cache-U__xU4qR.mjs";
|
|
11
|
+
import { a as signJsonLd, i as hasSignatureLike, o as verifyJsonLd, r as detachSignature } from "./ld-DkpX94b7.mjs";
|
|
12
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-uOWCZ4oR.mjs";
|
|
13
|
+
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-CNmZLixq.mjs";
|
|
14
|
+
import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-B9ynOKyy.mjs";
|
|
15
|
+
import { t as getNodeInfo } from "./client-D_1QpnWt.mjs";
|
|
16
|
+
import { t as nodeInfoToJson } from "./types-J53Kw7so.mjs";
|
|
17
|
+
import { t as FederationBuilderImpl } from "./builder-Dq6ijpsL.mjs";
|
|
18
|
+
import { t as buildCollectionSynchronizationHeader } from "./collection-D-HqUuA2.mjs";
|
|
19
|
+
import { t as KvKeyCache } from "./keycache-EGATflN-.mjs";
|
|
20
|
+
import { t as acceptsJsonLd } from "./negotiation-SQvQgUqe.mjs";
|
|
21
|
+
import { t as createExponentialBackoffPolicy } from "./retry-bMXBL97A.mjs";
|
|
22
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-D-qKOq3i.mjs";
|
|
23
23
|
import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
|
|
24
24
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
25
25
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
@@ -1952,6 +1952,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1952
1952
|
await this.sendActivity(keys, message.inboxes, activity, {
|
|
1953
1953
|
collectionSync: message.collectionSync,
|
|
1954
1954
|
orderingKey: message.orderingKey,
|
|
1955
|
+
normalizeExistingProofs: message.normalizeExistingProofs,
|
|
1955
1956
|
context
|
|
1956
1957
|
});
|
|
1957
1958
|
}
|
|
@@ -2236,6 +2237,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2236
2237
|
else if (keys.length < 1) throw new TypeError("The keys must not be empty.");
|
|
2237
2238
|
const contextLoader = this.contextLoaderFactory(this.#getLoaderOptions(ctx.origin));
|
|
2238
2239
|
const activityId = activity.id.href;
|
|
2240
|
+
let hasProof = false;
|
|
2239
2241
|
let proofCreated = false;
|
|
2240
2242
|
let rsaKey = null;
|
|
2241
2243
|
for (const { keyId, privateKey } of keys) {
|
|
@@ -2246,15 +2248,16 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2246
2248
|
};
|
|
2247
2249
|
}
|
|
2248
2250
|
for await (const _ of activity.getProofs({ contextLoader })) {
|
|
2249
|
-
|
|
2251
|
+
hasProof = true;
|
|
2250
2252
|
break;
|
|
2251
2253
|
}
|
|
2252
|
-
if (!
|
|
2254
|
+
if (!hasProof) {
|
|
2253
2255
|
for (const { keyId, privateKey } of keys) if (privateKey.algorithm.name === "Ed25519") {
|
|
2254
2256
|
activity = await signObject(activity, privateKey, keyId, {
|
|
2255
2257
|
contextLoader,
|
|
2256
2258
|
tracerProvider: this.tracerProvider
|
|
2257
2259
|
});
|
|
2260
|
+
hasProof = true;
|
|
2258
2261
|
proofCreated = true;
|
|
2259
2262
|
}
|
|
2260
2263
|
}
|
|
@@ -2262,7 +2265,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2262
2265
|
format: "compact",
|
|
2263
2266
|
contextLoader
|
|
2264
2267
|
});
|
|
2265
|
-
jsonLd = await
|
|
2268
|
+
if (proofCreated || !hasProof || options.normalizeExistingProofs) jsonLd = await normalizeOutgoingActivityJsonLd(jsonLd, contextLoader);
|
|
2266
2269
|
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.", {
|
|
2267
2270
|
activityId,
|
|
2268
2271
|
keys: keys.map((pair) => ({
|
|
@@ -2274,7 +2277,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2274
2277
|
contextLoader,
|
|
2275
2278
|
tracerProvider: this.tracerProvider
|
|
2276
2279
|
});
|
|
2277
|
-
if (!
|
|
2280
|
+
if (!hasProof) logger.warn("No supported key found to create a proof for the activity {activityId}. The activity will be sent without a proof. In order to create a proof, at least one Ed25519 key must be provided.", {
|
|
2278
2281
|
activityId,
|
|
2279
2282
|
keys: keys.map((pair) => ({
|
|
2280
2283
|
keyId: pair.keyId.href,
|
|
@@ -3071,7 +3074,8 @@ var ContextImpl = class ContextImpl {
|
|
|
3071
3074
|
context: this,
|
|
3072
3075
|
orderingKey: options.orderingKey,
|
|
3073
3076
|
collectionSync,
|
|
3074
|
-
immediate: options.immediate
|
|
3077
|
+
immediate: options.immediate,
|
|
3078
|
+
normalizeExistingProofs: options.normalizeExistingProofs
|
|
3075
3079
|
};
|
|
3076
3080
|
span.setAttribute("activitypub.inboxes", expandedRecipients.length);
|
|
3077
3081
|
for (const activityTransformer of this.federation.activityTransformers) activity = activityTransformer(activity, this);
|
|
@@ -3083,6 +3087,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3083
3087
|
});
|
|
3084
3088
|
throw new TypeError("The activity to send must have at least one actor property.");
|
|
3085
3089
|
}
|
|
3090
|
+
let proofCreated = false;
|
|
3086
3091
|
if (actorKeyPairs != null) {
|
|
3087
3092
|
const contextLoader = this.contextLoader;
|
|
3088
3093
|
for (const kp of actorKeyPairs) {
|
|
@@ -3091,6 +3096,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3091
3096
|
contextLoader,
|
|
3092
3097
|
tracerProvider: this.tracerProvider
|
|
3093
3098
|
});
|
|
3099
|
+
proofCreated = true;
|
|
3094
3100
|
}
|
|
3095
3101
|
}
|
|
3096
3102
|
const inboxes = extractInboxes({
|
|
@@ -3111,7 +3117,10 @@ var ContextImpl = class ContextImpl {
|
|
|
3111
3117
|
activity
|
|
3112
3118
|
});
|
|
3113
3119
|
if (this.federation.fanoutQueue == null || options.immediate || options.fanout === "skip" || (options.fanout ?? "auto") === "auto" && globalThis.Object.keys(inboxes).length < FANOUT_THRESHOLD) {
|
|
3114
|
-
await this.federation.sendActivity(keys, inboxes, activity,
|
|
3120
|
+
await this.federation.sendActivity(keys, inboxes, activity, {
|
|
3121
|
+
...opts,
|
|
3122
|
+
normalizeExistingProofs: proofCreated || options.normalizeExistingProofs
|
|
3123
|
+
});
|
|
3115
3124
|
return true;
|
|
3116
3125
|
}
|
|
3117
3126
|
const keyJwkPairs = await Promise.all(keys.map(async ({ keyId, privateKey }) => ({
|
|
@@ -3137,6 +3146,7 @@ var ContextImpl = class ContextImpl {
|
|
|
3137
3146
|
activityType: getTypeId(activity).href,
|
|
3138
3147
|
collectionSync: opts.collectionSync,
|
|
3139
3148
|
orderingKey: options.orderingKey,
|
|
3149
|
+
normalizeExistingProofs: proofCreated || options.normalizeExistingProofs,
|
|
3140
3150
|
traceContext: carrier
|
|
3141
3151
|
};
|
|
3142
3152
|
if (!this.federation.manuallyStartQueue) this.federation._startQueueInternal(this.data);
|