@fedify/fedify 2.0.10 → 2.0.12
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/{builder-opzCVeXZ.mjs → builder-D6J-5hKa.mjs} +3 -3
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{context-Dyg7P1qW.d.ts → context-DKccFiYD.d.ts} +4 -1
- package/dist/{context-CNIt-Qn7.d.cts → context-Kt2s6UWW.d.cts} +4 -1
- package/dist/{deno-CrjRl2cm.mjs → deno-SCNd7qf9.mjs} +1 -1
- package/dist/{docloader-35wi0JO1.mjs → docloader-hJEqcTL7.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +3 -3
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +89 -29
- 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/send.test.mjs +3 -3
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-BGjkvEDc.js → http-8mR6zS99.js} +1 -1
- package/dist/{http-VQAKycaZ.mjs → http-B98y63Kd.mjs} +2 -2
- package/dist/{http-DLnqzOtY.cjs → http-CJBoXT7y.cjs} +1 -1
- package/dist/{inbox-B6DfJ3h9.mjs → inbox-C23H7V44.mjs} +1 -1
- package/dist/{key-C9oV7wk8.mjs → key-DB6mlGEl.mjs} +1 -1
- package/dist/{kv-cache-QxhhotWv.js → kv-cache-CZPQRg2z.js} +1 -1
- package/dist/{kv-cache-BAEaVRvi.cjs → kv-cache-DyDvcvqh.cjs} +1 -1
- package/dist/{ld-BfEccFSP.mjs → ld-BLu-KvLW.mjs} +2 -2
- package/dist/{middleware-DuFvBMT2.cjs → middleware-C2p8Tgjt.cjs} +1 -1
- package/dist/{middleware-CGkdTPmX.mjs → middleware-CNP01MGn.mjs} +1 -1
- package/dist/{middleware-Dj7uT9F8.cjs → middleware-DTZLVRS1.cjs} +43 -18
- package/dist/{middleware-ReZIkikn.mjs → middleware-Do_Wjr4i.mjs} +49 -24
- package/dist/{middleware-Bc4sY_YW.js → middleware-ROrpLy17.js} +42 -17
- package/dist/{mod-BnAKGh2w.d.ts → mod-Cwmyxyoc.d.ts} +1 -1
- package/dist/{mod-DWoQffTD.d.cts → mod-DiGQkv-4.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/handler.test.mjs +1 -1
- package/dist/{owner-CRLqJlP_.mjs → owner-CnWzoI3C.mjs} +2 -2
- package/dist/{proof-DvQ28mUJ.js → proof-3N_8Goy3.js} +1 -1
- package/dist/{proof-B4SaJCmK.cjs → proof-CpP_LUUi.cjs} +1 -1
- package/dist/{proof-9SGtq4tE.mjs → proof-gNE8tyl0.mjs} +2 -2
- package/dist/{send-DN2ywoe8.mjs → send-Bt03lAUy.mjs} +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +1 -1
- 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 +1 -1
- package/dist/testing/mod.d.mts +4 -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 +6 -6
|
@@ -2,8 +2,8 @@ import "@js-temporal/polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { n as RouterError, t as Router } from "./router-CrMLXoOr.mjs";
|
|
5
|
-
import { n as version, t as name } from "./deno-
|
|
6
|
-
import { t as InboxListenerSet } from "./inbox-
|
|
5
|
+
import { n as version, t as name } from "./deno-SCNd7qf9.mjs";
|
|
6
|
+
import { t as InboxListenerSet } from "./inbox-C23H7V44.mjs";
|
|
7
7
|
import { getTypeId } from "@fedify/vocab";
|
|
8
8
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -42,7 +42,7 @@ var FederationBuilderImpl = class {
|
|
|
42
42
|
this.collectionTypeIds = {};
|
|
43
43
|
}
|
|
44
44
|
async build(options) {
|
|
45
|
-
const { FederationImpl } = await import("./middleware-
|
|
45
|
+
const { FederationImpl } = await import("./middleware-CNP01MGn.mjs");
|
|
46
46
|
const f = new FederationImpl(options);
|
|
47
47
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
48
48
|
f.router = this.router.clone();
|
package/dist/compat/mod.d.cts
CHANGED
package/dist/compat/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 { bt as ActivityTransformer, n as Context } from "../context-
|
|
3
|
+
import { bt as ActivityTransformer, n as Context } from "../context-DKccFiYD.js";
|
|
4
4
|
import { Activity } from "@fedify/vocab";
|
|
5
5
|
|
|
6
6
|
//#region src/compat/transformers.d.ts
|
|
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
6
6
|
import { t as assert } from "../assert-ddO5KLpe.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
8
|
-
import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-
|
|
8
|
+
import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-Do_Wjr4i.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Follow, Person } from "@fedify/vocab";
|
|
11
11
|
//#region src/compat/transformers.test.ts
|
|
@@ -2471,7 +2471,10 @@ interface GetSignedKeyOptions {
|
|
|
2471
2471
|
*/
|
|
2472
2472
|
interface ActorKeyPair extends CryptoKeyPair {
|
|
2473
2473
|
/**
|
|
2474
|
-
* The URI of the public key, which is used for
|
|
2474
|
+
* The URI of the public key for {@link CryptographicKey}, which is used for
|
|
2475
|
+
* verifying HTTP Signatures and Linked Data Signatures. Note that this is
|
|
2476
|
+
* the ID of the {@link cryptographicKey}, not of the {@link multikey};
|
|
2477
|
+
* the {@link Multikey} instance has a distinct ID of its own.
|
|
2475
2478
|
*/
|
|
2476
2479
|
readonly keyId: URL;
|
|
2477
2480
|
/**
|
|
@@ -2469,7 +2469,10 @@ interface GetSignedKeyOptions {
|
|
|
2469
2469
|
*/
|
|
2470
2470
|
interface ActorKeyPair extends CryptoKeyPair {
|
|
2471
2471
|
/**
|
|
2472
|
-
* The URI of the public key, which is used for
|
|
2472
|
+
* The URI of the public key for {@link CryptographicKey}, which is used for
|
|
2473
|
+
* verifying HTTP Signatures and Linked Data Signatures. Note that this is
|
|
2474
|
+
* the ID of the {@link cryptographicKey}, not of the {@link multikey};
|
|
2475
|
+
* the {@link Multikey} instance has a distinct ID of its own.
|
|
2473
2476
|
*/
|
|
2474
2477
|
readonly keyId: URL;
|
|
2475
2478
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { a as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { a as validateCryptoKey } from "./key-DB6mlGEl.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-B98y63Kd.mjs";
|
|
6
6
|
import { curry } from "es-toolkit";
|
|
7
7
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import { a as assertExists } from "../std__assert-Duiq_YC9.mjs";
|
|
6
6
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
8
|
-
import { n as createFederationBuilder } from "../builder-
|
|
8
|
+
import { n as createFederationBuilder } from "../builder-D6J-5hKa.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
11
11
|
//#region src/federation/builder.test.ts
|
|
@@ -5,11 +5,11 @@ import { n as createRequestContext, t as createInboxContext } from "../context-J
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-Duiq_YC9.mjs";
|
|
7
7
|
import { t as assert } from "../assert-ddO5KLpe.mjs";
|
|
8
|
-
import { s as signRequest } from "../http-
|
|
8
|
+
import { s as signRequest } from "../http-B98y63Kd.mjs";
|
|
9
9
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-CtZLJq76.mjs";
|
|
10
10
|
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
11
|
-
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-
|
|
12
|
-
import { t as InboxListenerSet } from "../inbox-
|
|
11
|
+
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-Do_Wjr4i.mjs";
|
|
12
|
+
import { t as InboxListenerSet } from "../inbox-C23H7V44.mjs";
|
|
13
13
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
14
14
|
import { Create, Note, Person } from "@fedify/vocab";
|
|
15
15
|
//#region src/federation/handler.test.ts
|
|
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import "../std__assert-Duiq_YC9.mjs";
|
|
6
6
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-CtZLJq76.mjs";
|
|
7
|
-
import { n as signObject } from "../proof-
|
|
7
|
+
import { n as signObject } from "../proof-gNE8tyl0.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-Do_Wjr4i.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 { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
6
|
-
import { t as InboxListenerSet } from "../inbox-
|
|
6
|
+
import { t as InboxListenerSet } from "../inbox-C23H7V44.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
|
|
@@ -10,14 +10,14 @@ 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
12
|
import { t as assert } from "../assert-ddO5KLpe.mjs";
|
|
13
|
-
import { l as verifyRequest, s as signRequest } from "../http-
|
|
13
|
+
import { l as verifyRequest, s as signRequest } from "../http-B98y63Kd.mjs";
|
|
14
14
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CtZLJq76.mjs";
|
|
15
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
16
|
-
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-
|
|
17
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
18
|
-
import { n as signObject, r as verifyObject } from "../proof-
|
|
15
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-hJEqcTL7.mjs";
|
|
16
|
+
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-BLu-KvLW.mjs";
|
|
17
|
+
import { t as doesActorOwnKey } from "../owner-CnWzoI3C.mjs";
|
|
18
|
+
import { n as signObject, r as verifyObject } from "../proof-gNE8tyl0.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-
|
|
20
|
+
import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-Do_Wjr4i.mjs";
|
|
21
21
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
22
22
|
import * as vocab from "@fedify/vocab";
|
|
23
23
|
import { getTypeId, lookupObject } from "@fedify/vocab";
|
|
@@ -285,7 +285,7 @@ test({
|
|
|
285
285
|
owner: new URL("https://example.com/users/handle")
|
|
286
286
|
}),
|
|
287
287
|
multikey: new vocab.Multikey({
|
|
288
|
-
id: new URL("https://example.com/users/handle#
|
|
288
|
+
id: new URL("https://example.com/users/handle#multikey-1"),
|
|
289
289
|
controller: new URL("https://example.com/users/handle"),
|
|
290
290
|
publicKey: rsaPublicKey2.publicKey
|
|
291
291
|
})
|
|
@@ -298,7 +298,7 @@ test({
|
|
|
298
298
|
owner: new URL("https://example.com/users/handle")
|
|
299
299
|
}),
|
|
300
300
|
multikey: new vocab.Multikey({
|
|
301
|
-
id: new URL("https://example.com/users/handle#
|
|
301
|
+
id: new URL("https://example.com/users/handle#multikey-2"),
|
|
302
302
|
controller: new URL("https://example.com/users/handle"),
|
|
303
303
|
publicKey: ed25519PublicKey.publicKey
|
|
304
304
|
})
|
|
@@ -1529,8 +1529,10 @@ test("ContextImpl.sendActivity()", async (t) => {
|
|
|
1529
1529
|
keyCache: {
|
|
1530
1530
|
async get(keyId) {
|
|
1531
1531
|
const keys = await federation.createContext(new URL("https://example.com/"), void 0).getActorKeyPairs("1");
|
|
1532
|
-
for (const key of keys)
|
|
1533
|
-
|
|
1532
|
+
for (const key of keys) {
|
|
1533
|
+
if (key.keyId.href === keyId.href) return key.cryptographicKey;
|
|
1534
|
+
if (key.multikey.id?.href === keyId.href) return key.multikey;
|
|
1535
|
+
}
|
|
1534
1536
|
},
|
|
1535
1537
|
async set(_keyId, _key) {}
|
|
1536
1538
|
}
|
|
@@ -1696,25 +1698,29 @@ test("ContextImpl.sendActivity()", async (t) => {
|
|
|
1696
1698
|
id: new URL("https://example.com/recipient"),
|
|
1697
1699
|
inboxId: new URL("https://example.com/inbox")
|
|
1698
1700
|
}, activity, { fanout: "force" });
|
|
1699
|
-
assertEquals(queue.messages,
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
}
|
|
1701
|
+
assertEquals(queue.messages.length, 1);
|
|
1702
|
+
assert(queue.messages[0].type === "fanout");
|
|
1703
|
+
const fanoutMsg = queue.messages[0];
|
|
1704
|
+
assertEquals(fanoutMsg.activityId, "https://example.com/activity/1");
|
|
1705
|
+
assertEquals(fanoutMsg.activityType, "https://www.w3.org/ns/activitystreams#Create");
|
|
1706
|
+
assertEquals(fanoutMsg.baseUrl, "https://example.com");
|
|
1707
|
+
assertEquals(fanoutMsg.collectionSync, void 0);
|
|
1708
|
+
assertEquals(fanoutMsg.orderingKey, void 0);
|
|
1709
|
+
assertEquals(fanoutMsg.inboxes, { "https://example.com/inbox": {
|
|
1710
|
+
actorIds: ["https://example.com/recipient"],
|
|
1711
|
+
sharedInbox: false
|
|
1712
|
+
} });
|
|
1713
|
+
const signedActivity = await vocab.Create.fromJsonLd(fanoutMsg.activity, {
|
|
1714
|
+
contextLoader: documentLoader,
|
|
1715
|
+
documentLoader
|
|
1716
|
+
});
|
|
1717
|
+
assertEquals(signedActivity.id?.href, "https://example.com/activity/1");
|
|
1718
|
+
let proofCount = 0;
|
|
1719
|
+
for await (const proof of signedActivity.getProofs({ contextLoader: documentLoader })) {
|
|
1720
|
+
assertEquals(proof.verificationMethodId?.href, "https://example.com/john#multikey-2");
|
|
1721
|
+
proofCount++;
|
|
1722
|
+
}
|
|
1723
|
+
assertEquals(proofCount, 1);
|
|
1718
1724
|
});
|
|
1719
1725
|
queue.clear();
|
|
1720
1726
|
await t.step("fanout: \"skip\"", async () => {
|
|
@@ -1773,6 +1779,60 @@ test("ContextImpl.sendActivity()", async (t) => {
|
|
|
1773
1779
|
type: "fanout"
|
|
1774
1780
|
}]);
|
|
1775
1781
|
});
|
|
1782
|
+
await t.step("fanout: fanoutQueue.enqueue() is awaited before sendActivity() returns", async () => {
|
|
1783
|
+
const asyncEnqueued = [];
|
|
1784
|
+
const fed = new FederationImpl({
|
|
1785
|
+
kv,
|
|
1786
|
+
contextLoaderFactory: () => mockDocumentLoader,
|
|
1787
|
+
queue: {
|
|
1788
|
+
enqueue(message) {
|
|
1789
|
+
return new Promise((resolve) => {
|
|
1790
|
+
setTimeout(() => {
|
|
1791
|
+
asyncEnqueued.push(message);
|
|
1792
|
+
resolve();
|
|
1793
|
+
}, 0);
|
|
1794
|
+
});
|
|
1795
|
+
},
|
|
1796
|
+
async listen() {}
|
|
1797
|
+
},
|
|
1798
|
+
manuallyStartQueue: true
|
|
1799
|
+
});
|
|
1800
|
+
fed.setActorDispatcher("/{identifier}", async (ctx, identifier) => {
|
|
1801
|
+
if (identifier !== "john") return null;
|
|
1802
|
+
const keys = await ctx.getActorKeyPairs(identifier);
|
|
1803
|
+
return new vocab.Person({
|
|
1804
|
+
id: ctx.getActorUri(identifier),
|
|
1805
|
+
preferredUsername: "john",
|
|
1806
|
+
publicKey: keys[0].cryptographicKey,
|
|
1807
|
+
assertionMethods: keys.map((k) => k.multikey)
|
|
1808
|
+
});
|
|
1809
|
+
}).setKeyPairsDispatcher((_ctx, identifier) => {
|
|
1810
|
+
if (identifier !== "john") return [];
|
|
1811
|
+
return [{
|
|
1812
|
+
privateKey: rsaPrivateKey2,
|
|
1813
|
+
publicKey: rsaPublicKey2.publicKey
|
|
1814
|
+
}, {
|
|
1815
|
+
privateKey: ed25519PrivateKey,
|
|
1816
|
+
publicKey: ed25519PublicKey.publicKey
|
|
1817
|
+
}];
|
|
1818
|
+
});
|
|
1819
|
+
const ctx3 = new ContextImpl({
|
|
1820
|
+
data: void 0,
|
|
1821
|
+
federation: fed,
|
|
1822
|
+
url: new URL("https://example.com/"),
|
|
1823
|
+
documentLoader: mockDocumentLoader,
|
|
1824
|
+
contextLoader: mockDocumentLoader
|
|
1825
|
+
});
|
|
1826
|
+
const activity = new vocab.Create({
|
|
1827
|
+
id: new URL("https://example.com/activity/1"),
|
|
1828
|
+
actor: new URL("https://example.com/person")
|
|
1829
|
+
});
|
|
1830
|
+
await ctx3.sendActivity({ username: "john" }, {
|
|
1831
|
+
id: new URL("https://example.com/recipient"),
|
|
1832
|
+
inboxId: new URL("https://example.com/inbox")
|
|
1833
|
+
}, activity, { fanout: "force" });
|
|
1834
|
+
assertEquals(asyncEnqueued.length, 1, "fanoutQueue.enqueue() must be awaited before sendActivity() returns");
|
|
1835
|
+
});
|
|
1776
1836
|
collectionSyncHeader = null;
|
|
1777
1837
|
await t.step("followers collection without syncCollection", async () => {
|
|
1778
1838
|
const ctx = new ContextImpl({
|
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-DTZLVRS1.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 AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "../context-
|
|
1
|
+
import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "../context-Kt2s6UWW.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-DiGQkv-4.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, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, 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 AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "../context-
|
|
3
|
+
import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "../context-DKccFiYD.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-Cwmyxyoc.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, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, 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-ROrpLy17.js";
|
|
4
4
|
import { isEqual } from "es-toolkit";
|
|
5
5
|
//#region src/federation/kv.ts
|
|
6
6
|
/**
|
|
@@ -8,10 +8,10 @@ import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z
|
|
|
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
10
|
import { t as assert } from "../assert-ddO5KLpe.mjs";
|
|
11
|
-
import { l as verifyRequest } from "../http-
|
|
11
|
+
import { l as verifyRequest } from "../http-B98y63Kd.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CtZLJq76.mjs";
|
|
13
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
14
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
13
|
+
import { t as doesActorOwnKey } from "../owner-CnWzoI3C.mjs";
|
|
14
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-Bt03lAUy.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
|
|
@@ -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-Duiq_YC9.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-Do_Wjr4i.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
|
|
@@ -10,7 +10,7 @@ import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
|
10
10
|
import { Item, decodeDict, encodeItem } from "structured-field-values";
|
|
11
11
|
//#region deno.json
|
|
12
12
|
var name = "@fedify/fedify";
|
|
13
|
-
var version = "2.0.
|
|
13
|
+
var version = "2.0.12";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/sig/key.ts
|
|
16
16
|
/**
|
|
@@ -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 { a as validateCryptoKey, n as fetchKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-SCNd7qf9.mjs";
|
|
5
|
+
import { a as validateCryptoKey, n as fetchKey } from "./key-DB6mlGEl.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 @@ let byte_encodings_base64 = require("byte-encodings/base64");
|
|
|
11
11
|
let structured_field_values = require("structured-field-values");
|
|
12
12
|
//#region deno.json
|
|
13
13
|
var name = "@fedify/fedify";
|
|
14
|
-
var version = "2.0.
|
|
14
|
+
var version = "2.0.12";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/sig/key.ts
|
|
17
17
|
/**
|
|
@@ -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-SCNd7qf9.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-SCNd7qf9.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 { 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 { c as validateCryptoKey, t as doubleKnock } from "./http-
|
|
3
|
+
import { c as validateCryptoKey, t as doubleKnock } from "./http-8mR6zS99.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,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-CJBoXT7y.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 { a as validateCryptoKey, n as fetchKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-SCNd7qf9.mjs";
|
|
5
|
+
import { a as validateCryptoKey, n as fetchKey } from "./key-DB6mlGEl.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-DTZLVRS1.cjs");
|
|
4
4
|
exports.FederationImpl = require_middleware.FederationImpl;
|