@fedify/fedify 2.4.0-dev.1959 → 2.4.0-pr.1006.44
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/README.md +2 -0
- package/dist/{builder-sMkz-MdT.mjs → builder-BdcA_1Rt.mjs} +2 -2
- 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-COLwHogJ.d.cts → context-BOnn653X.d.cts} +0 -27
- package/dist/{context-DiiCt4S7.d.ts → context-CmjP-cgJ.d.ts} +0 -27
- package/dist/{deno-Xg7DR4LS.mjs → deno-tSRHKXbU.mjs} +1 -1
- package/dist/{docloader-4YqMWBpt.mjs → docloader-BAO-cgto.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/keycache.test.mjs +4 -30
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +8 -195
- 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/tasks/enqueue.test.mjs +2 -3
- package/dist/federation/tasks/tasks.test.mjs +3 -4
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{federation-BNJgxgH6.cjs → federation-BzLBT04I.cjs} +13 -32
- package/dist/{http-Bh37_81O.js → http-CcFURGbR.js} +1 -1
- package/dist/{http-DyXZdUng.mjs → http-Cp_Byhf8.mjs} +3 -3
- package/dist/{http-BuOvqNbW.cjs → http-DBbZNv2i.cjs} +1 -1
- package/dist/{key-CXsAkAt6.mjs → key-CEDlSMK7.mjs} +2 -2
- package/dist/{keycache-ZLqIfrkL.mjs → keycache-0Jk78XmB.mjs} +1 -3
- package/dist/{kv-cache-Btl0s7i7.cjs → kv-cache-B-JFZafn.cjs} +1 -1
- package/dist/{kv-cache-BubmP7z9.mjs → kv-cache-C7qYJ4To.mjs} +1 -1
- package/dist/{kv-cache-DjFxdXjk.js → kv-cache-CocB_ME8.js} +1 -1
- package/dist/{ld-C5Qv0_xn.mjs → ld-B8k-089e.mjs} +3 -3
- package/dist/{metrics-B7-JxJSv.mjs → metrics-CIK7ZY_B.mjs} +1 -1
- package/dist/{middleware-DB_evWhA.mjs → middleware--nGmJXXx.mjs} +22 -39
- package/dist/{middleware-CF539vn2.js → middleware-CBO16r56.js} +13 -32
- package/dist/{middleware-BfRUvR8e.mjs → middleware-Dx9byvw-.mjs} +1 -1
- package/dist/{mod-CSH1Ee-I.d.ts → mod-BYuZ0WXt.d.ts} +1 -1
- package/dist/{mod-BZldCEU0.d.cts → mod-kUSY5n3f.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-DFzwGoyv.mjs → owner-Cf55GD32.mjs} +2 -2
- package/dist/{proof-DJGBYtRT.mjs → proof-BAVwiUPt.mjs} +4 -4
- package/dist/{proof-3rlJfM0Z.js → proof-CqV_aPhu.js} +1 -1
- package/dist/{proof-BVpjHUMS.cjs → proof-DSohcbCt.cjs} +1 -1
- package/dist/{send-BOXP7DyW.mjs → send-DL5nBv54.mjs} +3 -3
- 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/{temporal-D6yzxQ23.mjs → temporal-C_3AI99D.mjs} +1 -1
- package/dist/testing/mod.d.mts +1 -70
- package/dist/testing/mod.mjs +2 -4
- package/dist/{tasks-dbCShlCb.mjs → testing-D13ymFKy.mjs} +1 -0
- package/dist/utils/docloader.test.mjs +2 -2
- 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 +7 -7
- package/dist/kv-DBRWVx3Q.mjs +0 -104
- package/dist/testing/kv.test.d.mts +0 -2
- package/dist/testing/kv.test.mjs +0 -101
- package/dist/testing-hbky2gMN.mjs +0 -8
package/README.md
CHANGED
|
@@ -100,6 +100,7 @@ Here is the list of packages:
|
|
|
100
100
|
| [@fedify/fedify](/packages/fedify/) | [JSR] | [npm] | The core framework of Fedify |
|
|
101
101
|
| [@fedify/cli](/packages/cli/) | [JSR][jsr:@fedify/cli] | [npm][npm:@fedify/cli] | CLI toolchain for testing and debugging |
|
|
102
102
|
| [@fedify/create](/packages/create/) | | [npm][npm:@fedify/create] | Create a new Fedify project |
|
|
103
|
+
| [@fedify/adonisjs](/packages/adonisjs/) | | [npm][npm:@fedify/adonisjs] | AdonisJS integration |
|
|
103
104
|
| [@fedify/amqp](/packages/amqp/) | [JSR][jsr:@fedify/amqp] | [npm][npm:@fedify/amqp] | AMQP/RabbitMQ driver |
|
|
104
105
|
| [@fedify/astro](/packages/astro/) | [JSR][jsr:@fedify/astro] | [npm][npm:@fedify/astro] | Astro integration |
|
|
105
106
|
| [@fedify/backfill](/packages/backfill/) | [JSR][jsr:@fedify/backfill] | [npm][npm:@fedify/backfill] | ActivityPub backfill support |
|
|
@@ -138,6 +139,7 @@ Here is the list of packages:
|
|
|
138
139
|
[jsr:@fedify/cli]: https://jsr.io/@fedify/cli
|
|
139
140
|
[npm:@fedify/cli]: https://www.npmjs.com/package/@fedify/cli
|
|
140
141
|
[npm:@fedify/create]: https://www.npmjs.com/package/@fedify/create
|
|
142
|
+
[npm:@fedify/adonisjs]: https://www.npmjs.com/package/@fedify/adonisjs
|
|
141
143
|
[jsr:@fedify/amqp]: https://jsr.io/@fedify/amqp
|
|
142
144
|
[npm:@fedify/amqp]: https://www.npmjs.com/package/@fedify/amqp
|
|
143
145
|
[jsr:@fedify/astro]: https://jsr.io/@fedify/astro
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "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-tSRHKXbU.mjs";
|
|
5
5
|
import { t as ActivityListenerSet } from "./activity-listener-C-BSbKI7.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { Router, RouterError, assertPath } from "@fedify/uri-template";
|
|
@@ -85,7 +85,7 @@ var FederationBuilderImpl = class {
|
|
|
85
85
|
* specified.
|
|
86
86
|
*/
|
|
87
87
|
async build(options) {
|
|
88
|
-
const { FederationImpl } = await import("./middleware-
|
|
88
|
+
const { FederationImpl } = await import("./middleware-Dx9byvw-.mjs");
|
|
89
89
|
const f = new FederationImpl(options);
|
|
90
90
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
91
91
|
f.router = this.router.clone();
|
package/dist/compat/mod.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { Gt as ActivityTransformer, n as Context } from "../context-
|
|
2
|
+
import { Gt as ActivityTransformer, n as Context } from "../context-BOnn653X.cjs";
|
|
3
3
|
import { Activity } from "@fedify/vocab";
|
|
4
4
|
|
|
5
5
|
//#region src/compat/transformers.d.ts
|
package/dist/compat/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { Gt as ActivityTransformer, n as Context } from "../context-
|
|
2
|
+
import { Gt as ActivityTransformer, n as Context } from "../context-CmjP-cgJ.js";
|
|
3
3
|
import { Activity } from "@fedify/vocab";
|
|
4
4
|
|
|
5
5
|
//#region src/compat/transformers.d.ts
|
|
@@ -5,7 +5,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
6
6
|
import { t as assertInstanceOf } from "../assert_instance_of-g3WcyYNR.mjs";
|
|
7
7
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
8
|
-
import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware
|
|
8
|
+
import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware--nGmJXXx.mjs";
|
|
9
9
|
import { Follow, Person } from "@fedify/vocab";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
//#region src/compat/transformers.test.ts
|
|
@@ -1975,33 +1975,6 @@ interface FederationOptions<TContextData> {
|
|
|
1975
1975
|
*/
|
|
1976
1976
|
kvPrefixes?: Partial<FederationKvPrefixes>;
|
|
1977
1977
|
/**
|
|
1978
|
-
* The time-to-live for a remote actor's public key cached under
|
|
1979
|
-
* {@link FederationKvPrefixes.publicKey}. Once it expires, the next
|
|
1980
|
-
* signature verification that needs the key refetches it from the remote
|
|
1981
|
-
* server and caches it again.
|
|
1982
|
-
*
|
|
1983
|
-
* Shortening it bounds how long a revoked or rotated key stays in the cache,
|
|
1984
|
-
* at the cost of more requests to remote servers; refetching an expired key
|
|
1985
|
-
* fails while the peer is unavailable, so a very short value makes
|
|
1986
|
-
* verification depend on the peer being reachable.
|
|
1987
|
-
* @default `{ days: 30 }`
|
|
1988
|
-
* @since 2.4.0
|
|
1989
|
-
*/
|
|
1990
|
-
publicKeyTtl?: Temporal.DurationLike;
|
|
1991
|
-
/**
|
|
1992
|
-
* The time-to-live for a remote origin's remembered HTTP Message Signatures
|
|
1993
|
-
* spec cached under {@link FederationKvPrefixes.httpMessageSignaturesSpec}.
|
|
1994
|
-
* Once it expires, the next delivery to that origin relearns the spec by
|
|
1995
|
-
* double-knocking and remembers it again.
|
|
1996
|
-
*
|
|
1997
|
-
* Shortening it makes Fedify notice a peer's spec upgrade sooner, at the
|
|
1998
|
-
* cost of an extra signed request per delivery whenever the first spec tried
|
|
1999
|
-
* is rejected.
|
|
2000
|
-
* @default `{ days: 90 }`
|
|
2001
|
-
* @since 2.4.0
|
|
2002
|
-
*/
|
|
2003
|
-
httpMessageSignaturesSpecTtl?: Temporal.DurationLike;
|
|
2004
|
-
/**
|
|
2005
1978
|
* The message queue for sending and receiving activities. If not provided,
|
|
2006
1979
|
* activities will not be queued and will be processed immediately.
|
|
2007
1980
|
*
|
|
@@ -1977,33 +1977,6 @@ interface FederationOptions<TContextData> {
|
|
|
1977
1977
|
*/
|
|
1978
1978
|
kvPrefixes?: Partial<FederationKvPrefixes>;
|
|
1979
1979
|
/**
|
|
1980
|
-
* The time-to-live for a remote actor's public key cached under
|
|
1981
|
-
* {@link FederationKvPrefixes.publicKey}. Once it expires, the next
|
|
1982
|
-
* signature verification that needs the key refetches it from the remote
|
|
1983
|
-
* server and caches it again.
|
|
1984
|
-
*
|
|
1985
|
-
* Shortening it bounds how long a revoked or rotated key stays in the cache,
|
|
1986
|
-
* at the cost of more requests to remote servers; refetching an expired key
|
|
1987
|
-
* fails while the peer is unavailable, so a very short value makes
|
|
1988
|
-
* verification depend on the peer being reachable.
|
|
1989
|
-
* @default `{ days: 30 }`
|
|
1990
|
-
* @since 2.4.0
|
|
1991
|
-
*/
|
|
1992
|
-
publicKeyTtl?: Temporal.DurationLike;
|
|
1993
|
-
/**
|
|
1994
|
-
* The time-to-live for a remote origin's remembered HTTP Message Signatures
|
|
1995
|
-
* spec cached under {@link FederationKvPrefixes.httpMessageSignaturesSpec}.
|
|
1996
|
-
* Once it expires, the next delivery to that origin relearns the spec by
|
|
1997
|
-
* double-knocking and remembers it again.
|
|
1998
|
-
*
|
|
1999
|
-
* Shortening it makes Fedify notice a peer's spec upgrade sooner, at the
|
|
2000
|
-
* cost of an extra signed request per delivery whenever the first spec tried
|
|
2001
|
-
* is rejected.
|
|
2002
|
-
* @default `{ days: 90 }`
|
|
2003
|
-
* @since 2.4.0
|
|
2004
|
-
*/
|
|
2005
|
-
httpMessageSignaturesSpecTtl?: Temporal.DurationLike;
|
|
2006
|
-
/**
|
|
2007
1980
|
* The message queue for sending and receiving activities. If not provided,
|
|
2008
1981
|
* activities will not be queued and will be processed immediately.
|
|
2009
1982
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { o as validateCryptoKey } from "./key-
|
|
5
|
-
import { n as doubleKnock } from "./http-
|
|
4
|
+
import { o as validateCryptoKey } from "./key-CEDlSMK7.mjs";
|
|
5
|
+
import { n as doubleKnock } from "./http-Cp_Byhf8.mjs";
|
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
|
7
7
|
import { curry } from "es-toolkit";
|
|
8
8
|
import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
|
|
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
|
6
6
|
import { t as assertExists } from "../assert_exists-DtzkXC47.mjs";
|
|
7
7
|
import { t as assertThrows } from "../assert_throws-BJ5wuvR2.mjs";
|
|
8
8
|
import "../std__assert-CxFT0MNt.mjs";
|
|
9
|
-
import { r as createFederationBuilder } from "../builder-
|
|
9
|
+
import { r as createFederationBuilder } from "../builder-BdcA_1Rt.mjs";
|
|
10
10
|
import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
|
|
11
11
|
import { Activity, Note, Person } from "@fedify/vocab";
|
|
12
12
|
import { test } from "@fedify/fixture";
|
|
@@ -10,10 +10,10 @@ import "../std__assert-CxFT0MNt.mjs";
|
|
|
10
10
|
import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
|
|
11
11
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
12
12
|
import { r as parseAcceptSignature } from "../accept-CPVqki78.mjs";
|
|
13
|
-
import { s as signRequest } from "../http-
|
|
13
|
+
import { s as signRequest } from "../http-Cp_Byhf8.mjs";
|
|
14
14
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { a as compactJsonLd, p as signJsonLd } from "../ld-B8k-089e.mjs";
|
|
16
|
+
import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware--nGmJXXx.mjs";
|
|
17
17
|
import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
|
|
18
18
|
import { Activity, Create, Note, Person, Tombstone } from "@fedify/vocab";
|
|
19
19
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
@@ -5,8 +5,8 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
6
6
|
import "../std__assert-CxFT0MNt.mjs";
|
|
7
7
|
import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { r as signObject } from "../proof-BAVwiUPt.mjs";
|
|
9
|
+
import { o as createFederation } from "../middleware--nGmJXXx.mjs";
|
|
10
10
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/idempotency.test.ts
|
|
@@ -2,11 +2,10 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
5
|
-
import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
|
|
6
5
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
7
6
|
import { t as assertInstanceOf } from "../assert_instance_of-g3WcyYNR.mjs";
|
|
8
7
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
9
|
-
import { t as KvKeyCache } from "../keycache-
|
|
8
|
+
import { t as KvKeyCache } from "../keycache-0Jk78XmB.mjs";
|
|
10
9
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
11
10
|
import { test } from "@fedify/fixture";
|
|
12
11
|
//#region src/federation/keycache.test.ts
|
|
@@ -80,41 +79,16 @@ test("KvKeyCache fetch error metadata", async () => {
|
|
|
80
79
|
assertEquals(await cache.getFetchError(keyId), void 0);
|
|
81
80
|
});
|
|
82
81
|
test("KvKeyCache unavailable entries expire", async () => {
|
|
83
|
-
const
|
|
84
|
-
const unavailableKeyTtl = Temporal.Duration.from({ minutes: 10 });
|
|
85
|
-
const cache = new KvKeyCache(kv, ["pk"], { unavailableKeyTtl });
|
|
82
|
+
const cache = new KvKeyCache(new MemoryKvStore(), ["pk"], { unavailableKeyTtl: Temporal.Duration.from({ milliseconds: 1 }) });
|
|
86
83
|
const keyId = new URL("https://example.com/expired");
|
|
87
84
|
await cache.set(keyId, null);
|
|
88
85
|
await cache.setFetchError(keyId, {
|
|
89
86
|
status: 410,
|
|
90
87
|
response: new Response(null, { status: 410 })
|
|
91
88
|
});
|
|
92
|
-
|
|
93
|
-
const later = new KvKeyCache(kv, ["pk"], { unavailableKeyTtl });
|
|
94
|
-
assertEquals(await later.get(keyId), void 0);
|
|
95
|
-
assertEquals(await later.getFetchError(keyId), void 0);
|
|
96
|
-
});
|
|
97
|
-
test("KvKeyCache.keyTtl defaults to 30 days", () => {
|
|
98
|
-
assertEquals(new KvKeyCache(new MemoryKvStore(), ["pk"]).keyTtl.total("day"), 30);
|
|
99
|
-
});
|
|
100
|
-
test("KvKeyCache.keyTtl is configurable", () => {
|
|
101
|
-
assertEquals(new KvKeyCache(new MemoryKvStore(), ["pk"], { keyTtl: Temporal.Duration.from({ days: 7 }) }).keyTtl.total("day"), 7);
|
|
102
|
-
});
|
|
103
|
-
test("KvKeyCache cached keys expire after keyTtl", async () => {
|
|
104
|
-
const kv = new ManualClockKvStore();
|
|
105
|
-
const cache = new KvKeyCache(kv, ["pk"], { keyTtl: Temporal.Duration.from({ days: 30 }) });
|
|
106
|
-
const keyId = new URL("https://example.com/key");
|
|
107
|
-
await cache.set(keyId, new CryptographicKey({ id: keyId }));
|
|
108
|
-
assert(await kv.get(["pk", keyId.href]) != null);
|
|
109
|
-
assertInstanceOf(await cache.get(keyId), CryptographicKey);
|
|
110
|
-
kv.advance({ days: 31 });
|
|
111
|
-
assertEquals(await kv.get(["pk", keyId.href]), void 0);
|
|
89
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
112
90
|
assertEquals(await cache.get(keyId), void 0);
|
|
113
|
-
assertEquals(cache.
|
|
114
|
-
await cache.set(keyId, new CryptographicKey({ id: keyId }));
|
|
115
|
-
const refetched = await cache.get(keyId);
|
|
116
|
-
assertInstanceOf(refetched, CryptographicKey);
|
|
117
|
-
assertEquals(refetched.id?.href, keyId.href);
|
|
91
|
+
assertEquals(await cache.getFetchError(keyId), void 0);
|
|
118
92
|
});
|
|
119
93
|
//#endregion
|
|
120
94
|
export {};
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
5
5
|
import "../std__assert-CxFT0MNt.mjs";
|
|
6
6
|
import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
|
|
7
|
-
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-
|
|
7
|
+
import { _ as recordKeyLookup, a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-CIK7ZY_B.mjs";
|
|
8
8
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
9
9
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
10
10
|
import { DataPointType, MeterProvider, MetricReader } from "@opentelemetry/sdk-metrics";
|
|
@@ -3,9 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
|
-
import { t as
|
|
7
|
-
import { a as numberSchema, r as envelopeSchema, t as MockQueue } from "../tasks-dbCShlCb.mjs";
|
|
8
|
-
import "../testing-hbky2gMN.mjs";
|
|
6
|
+
import { a as numberSchema, r as envelopeSchema, t as MockQueue } from "../testing-D13ymFKy.mjs";
|
|
9
7
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
10
8
|
import { t as assertExists } from "../assert_exists-DtzkXC47.mjs";
|
|
11
9
|
import { t as assertFalse } from "../assert_false-3pLLLsO4.mjs";
|
|
@@ -16,14 +14,14 @@ import "../std__assert-CxFT0MNt.mjs";
|
|
|
16
14
|
import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
|
|
17
15
|
import { t as assertStrictEquals } from "../assert_strict_equals-Bpjl4Psw.mjs";
|
|
18
16
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
19
|
-
import { g as recordInboxActivity } from "../metrics-
|
|
20
|
-
import { l as verifyRequest, s as signRequest } from "../http-
|
|
17
|
+
import { g as recordInboxActivity } from "../metrics-CIK7ZY_B.mjs";
|
|
18
|
+
import { l as verifyRequest, s as signRequest } from "../http-Cp_Byhf8.mjs";
|
|
21
19
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
22
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { i as
|
|
20
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-BAO-cgto.mjs";
|
|
21
|
+
import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-B8k-089e.mjs";
|
|
22
|
+
import { t as doesActorOwnKey } from "../owner-Cf55GD32.mjs";
|
|
23
|
+
import { i as verifyObject, r as signObject } from "../proof-BAVwiUPt.mjs";
|
|
24
|
+
import { g as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware--nGmJXXx.mjs";
|
|
27
25
|
import { t as CircuitBreaker } from "../circuit-breaker-C5NqoLBJ.mjs";
|
|
28
26
|
import { t as TaskCodec } from "../codec-C6rTrpIp.mjs";
|
|
29
27
|
import { t as markCircuitBreakerLegacySweepDone } from "../circuit-breaker-test-utils-DW6YC_Pe.mjs";
|
|
@@ -7360,191 +7358,6 @@ test("KvSpecDeterminer", async (t) => {
|
|
|
7360
7358
|
spec = await determiner.determineSpec("example.com");
|
|
7361
7359
|
assertEquals(spec, "rfc9421");
|
|
7362
7360
|
});
|
|
7363
|
-
await t.step("should default specTtl to 90 days", () => {
|
|
7364
|
-
assertEquals(new KvSpecDeterminer(new MemoryKvStore(), ["test", "spec"]).specTtl.total("day"), 90);
|
|
7365
|
-
});
|
|
7366
|
-
await t.step("should accept a configurable specTtl as a 4th positional argument", () => {
|
|
7367
|
-
assertEquals(new KvSpecDeterminer(new MemoryKvStore(), ["test", "spec"], "rfc9421", { specTtl: Temporal.Duration.from({ days: 7 }) }).specTtl.total("day"), 7);
|
|
7368
|
-
});
|
|
7369
|
-
await t.step("should expire, relearn, and remember the spec again", async () => {
|
|
7370
|
-
const kv = new ManualClockKvStore();
|
|
7371
|
-
const determiner = new KvSpecDeterminer(kv, ["test", "spec"], "rfc9421", { specTtl: Temporal.Duration.from({ days: 90 }) });
|
|
7372
|
-
await determiner.rememberSpec("example.com", "draft-cavage-http-signatures-12");
|
|
7373
|
-
assertEquals(await determiner.determineSpec("example.com"), "draft-cavage-http-signatures-12");
|
|
7374
|
-
kv.advance({ days: 91 });
|
|
7375
|
-
assertEquals(await determiner.determineSpec("example.com"), "rfc9421");
|
|
7376
|
-
await determiner.rememberSpec("example.com", "draft-cavage-http-signatures-12");
|
|
7377
|
-
assertEquals(await determiner.determineSpec("example.com"), "draft-cavage-http-signatures-12");
|
|
7378
|
-
});
|
|
7379
|
-
});
|
|
7380
|
-
/**
|
|
7381
|
-
* A `KvStore` that records the TTL every write was made with, so tests can
|
|
7382
|
-
* assert on TTLs even after the entries themselves have expired.
|
|
7383
|
-
*/
|
|
7384
|
-
var TtlRecordingKvStore = class {
|
|
7385
|
-
inner = new ManualClockKvStore();
|
|
7386
|
-
writes = [];
|
|
7387
|
-
/** Moves the wrapped store's virtual clock forward. */
|
|
7388
|
-
advance(duration) {
|
|
7389
|
-
this.inner.advance(duration);
|
|
7390
|
-
}
|
|
7391
|
-
get(key) {
|
|
7392
|
-
return this.inner.get(key);
|
|
7393
|
-
}
|
|
7394
|
-
set(key, value, options) {
|
|
7395
|
-
this.writes.push({
|
|
7396
|
-
key,
|
|
7397
|
-
ttl: options?.ttl
|
|
7398
|
-
});
|
|
7399
|
-
return this.inner.set(key, value, options);
|
|
7400
|
-
}
|
|
7401
|
-
delete(key) {
|
|
7402
|
-
return this.inner.delete(key);
|
|
7403
|
-
}
|
|
7404
|
-
list(prefix) {
|
|
7405
|
-
return this.inner.list(prefix);
|
|
7406
|
-
}
|
|
7407
|
-
/** The TTL of the most recent write to `key`, or `undefined` if never set. */
|
|
7408
|
-
lastTtl(key) {
|
|
7409
|
-
const matches = this.writes.filter((w) => w.key.length === key.length && w.key.every((p, i) => p === key[i]));
|
|
7410
|
-
return matches.length < 1 ? void 0 : matches[matches.length - 1].ttl;
|
|
7411
|
-
}
|
|
7412
|
-
};
|
|
7413
|
-
test("createFederation() defaults the cache TTLs and lets them be overridden", () => {
|
|
7414
|
-
const defaults = new FederationImpl({ kv: new MemoryKvStore() });
|
|
7415
|
-
assertEquals(defaults.publicKeyTtl.total("day"), 30);
|
|
7416
|
-
assertEquals(defaults.httpMessageSignaturesSpecTtl.total("day"), 90);
|
|
7417
|
-
const overridden = new FederationImpl({
|
|
7418
|
-
kv: new MemoryKvStore(),
|
|
7419
|
-
publicKeyTtl: { days: 1 },
|
|
7420
|
-
httpMessageSignaturesSpecTtl: { hours: 12 }
|
|
7421
|
-
});
|
|
7422
|
-
assertEquals(overridden.publicKeyTtl.total("day"), 1);
|
|
7423
|
-
assertEquals(overridden.httpMessageSignaturesSpecTtl.total("hour"), 12);
|
|
7424
|
-
});
|
|
7425
|
-
test("createFederation() applies httpMessageSignaturesSpecTtl to remembered specs", async () => {
|
|
7426
|
-
esm_default.spyGlobal();
|
|
7427
|
-
try {
|
|
7428
|
-
const attempts = [];
|
|
7429
|
-
esm_default.post("https://example.com/inbox", async (cl) => {
|
|
7430
|
-
const request = cl.request.clone();
|
|
7431
|
-
const spec = request.headers.has("Signature-Input") ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
7432
|
-
attempts.push(spec);
|
|
7433
|
-
if (spec === "rfc9421") return new Response(null, { status: 401 });
|
|
7434
|
-
const key = await verifyRequest(request, {
|
|
7435
|
-
documentLoader: mockDocumentLoader,
|
|
7436
|
-
contextLoader: mockDocumentLoader
|
|
7437
|
-
});
|
|
7438
|
-
return new Response(null, { status: key == null ? 401 : 202 });
|
|
7439
|
-
});
|
|
7440
|
-
const kv = new TtlRecordingKvStore();
|
|
7441
|
-
const ctx = createFederation({
|
|
7442
|
-
kv,
|
|
7443
|
-
documentLoaderFactory: () => mockDocumentLoader,
|
|
7444
|
-
contextLoaderFactory: () => mockDocumentLoader,
|
|
7445
|
-
httpMessageSignaturesSpecTtl: { days: 14 }
|
|
7446
|
-
}).createContext(new URL("https://example.com/"), void 0);
|
|
7447
|
-
const specKey = [
|
|
7448
|
-
"_fedify",
|
|
7449
|
-
"httpMessageSignaturesSpec",
|
|
7450
|
-
"https://example.com"
|
|
7451
|
-
];
|
|
7452
|
-
const send = () => ctx.sendActivity([{
|
|
7453
|
-
privateKey: rsaPrivateKey2,
|
|
7454
|
-
keyId: rsaPublicKey2.id
|
|
7455
|
-
}], {
|
|
7456
|
-
id: new URL("https://example.com/recipient"),
|
|
7457
|
-
inboxId: new URL("https://example.com/inbox")
|
|
7458
|
-
}, new vocab.Create({
|
|
7459
|
-
id: new URL(`https://example.com/activities/${crypto.randomUUID()}`),
|
|
7460
|
-
actor: new URL("https://example.com/person")
|
|
7461
|
-
}));
|
|
7462
|
-
await send();
|
|
7463
|
-
assertEquals(attempts, ["rfc9421", "draft-cavage-http-signatures-12"]);
|
|
7464
|
-
assertEquals(await kv.get(specKey), "draft-cavage-http-signatures-12");
|
|
7465
|
-
assertEquals(kv.lastTtl(specKey)?.total("day"), 14);
|
|
7466
|
-
attempts.length = 0;
|
|
7467
|
-
await send();
|
|
7468
|
-
assertEquals(attempts, ["draft-cavage-http-signatures-12"]);
|
|
7469
|
-
kv.advance({ days: 15 });
|
|
7470
|
-
assertEquals(await kv.get(specKey), void 0);
|
|
7471
|
-
attempts.length = 0;
|
|
7472
|
-
await send();
|
|
7473
|
-
assertEquals(attempts, ["rfc9421", "draft-cavage-http-signatures-12"]);
|
|
7474
|
-
assertEquals(await kv.get(specKey), "draft-cavage-http-signatures-12");
|
|
7475
|
-
assertEquals(kv.lastTtl(specKey)?.total("day"), 14);
|
|
7476
|
-
} finally {
|
|
7477
|
-
esm_default.hardReset();
|
|
7478
|
-
}
|
|
7479
|
-
});
|
|
7480
|
-
test("createFederation() applies publicKeyTtl to cached public keys", async () => {
|
|
7481
|
-
esm_default.spyGlobal();
|
|
7482
|
-
try {
|
|
7483
|
-
let keyFetches = 0;
|
|
7484
|
-
esm_default.get("begin:https://example.com/person2", () => {
|
|
7485
|
-
keyFetches++;
|
|
7486
|
-
return {
|
|
7487
|
-
headers: { "Content-Type": "application/activity+json" },
|
|
7488
|
-
body: person2_default
|
|
7489
|
-
};
|
|
7490
|
-
});
|
|
7491
|
-
const keyId = "https://example.com/person2#key3";
|
|
7492
|
-
const kv = new TtlRecordingKvStore();
|
|
7493
|
-
const federation = createFederation({
|
|
7494
|
-
kv,
|
|
7495
|
-
documentLoaderFactory: () => mockDocumentLoader,
|
|
7496
|
-
contextLoaderFactory: () => mockDocumentLoader,
|
|
7497
|
-
publicKeyTtl: { days: 7 }
|
|
7498
|
-
});
|
|
7499
|
-
const inbox = [];
|
|
7500
|
-
federation.setActorDispatcher("/users/{identifier}", (_, identifier) => identifier === "john" ? new vocab.Person({}) : null).setKeyPairsDispatcher(() => [{
|
|
7501
|
-
privateKey: rsaPrivateKey2,
|
|
7502
|
-
publicKey: rsaPublicKey2.publicKey
|
|
7503
|
-
}]);
|
|
7504
|
-
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").on(vocab.Create, (_ctx, create) => {
|
|
7505
|
-
inbox.push(create);
|
|
7506
|
-
});
|
|
7507
|
-
const deliver = async () => {
|
|
7508
|
-
const activity = new vocab.Create({
|
|
7509
|
-
id: new URL(`https://example.com/activities/${crypto.randomUUID()}`),
|
|
7510
|
-
actor: new URL("https://example.com/person2")
|
|
7511
|
-
});
|
|
7512
|
-
let request = new Request("https://example.com/users/john/inbox", {
|
|
7513
|
-
method: "POST",
|
|
7514
|
-
headers: {
|
|
7515
|
-
"Content-Type": "application/activity+json",
|
|
7516
|
-
accept: "application/ld+json"
|
|
7517
|
-
},
|
|
7518
|
-
body: JSON.stringify(await activity.toJsonLd({ contextLoader: mockDocumentLoader }))
|
|
7519
|
-
});
|
|
7520
|
-
request = await signRequest(request, rsaPrivateKey3, new URL(keyId));
|
|
7521
|
-
return await federation.fetch(request, { contextData: void 0 });
|
|
7522
|
-
};
|
|
7523
|
-
const publicKeyKey = [
|
|
7524
|
-
"_fedify",
|
|
7525
|
-
"publicKey",
|
|
7526
|
-
keyId
|
|
7527
|
-
];
|
|
7528
|
-
assertEquals((await deliver()).status, 202);
|
|
7529
|
-
assertEquals(inbox.length, 1);
|
|
7530
|
-
assert(keyFetches > 0);
|
|
7531
|
-
assert(await kv.get(publicKeyKey) != null);
|
|
7532
|
-
assertEquals(kv.lastTtl(publicKeyKey)?.total("day"), 7);
|
|
7533
|
-
keyFetches = 0;
|
|
7534
|
-
assertEquals((await deliver()).status, 202);
|
|
7535
|
-
assertEquals(inbox.length, 2);
|
|
7536
|
-
assertEquals(keyFetches, 0);
|
|
7537
|
-
kv.advance({ days: 8 });
|
|
7538
|
-
assertEquals(await kv.get(publicKeyKey), void 0);
|
|
7539
|
-
keyFetches = 0;
|
|
7540
|
-
assertEquals((await deliver()).status, 202);
|
|
7541
|
-
assertEquals(inbox.length, 3);
|
|
7542
|
-
assert(keyFetches > 0);
|
|
7543
|
-
assert(await kv.get(publicKeyKey) != null);
|
|
7544
|
-
assertEquals(kv.lastTtl(publicKeyKey)?.total("day"), 7);
|
|
7545
|
-
} finally {
|
|
7546
|
-
esm_default.hardReset();
|
|
7547
|
-
}
|
|
7548
7361
|
});
|
|
7549
7362
|
test("createFederation() instruments documentLoader with activitypub.document.fetch", async () => {
|
|
7550
7363
|
const [meterProvider, recorder] = createTestMeterProvider();
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_federation = require("../federation-
|
|
3
|
+
const require_federation = require("../federation-BzLBT04I.cjs");
|
|
4
4
|
exports.CircuitBreaker = require_federation.CircuitBreaker;
|
|
5
5
|
exports.InProcessMessageQueue = require_federation.InProcessMessageQueue;
|
|
6
6
|
exports.MemoryKvStore = require_federation.MemoryKvStore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { $ as MessageQueueDepth, A as OutboxListenerSetters, At as ObjectAuthorizePredicate, B as TaskEnqueueOptions, Bt as SendActivityError, C as FederationStartQueueOptions, Ct as CustomCollectionCounter, D as InboxListenerSetters, Dt as InboxListener, E as InboxChallengePolicy, Et as InboxErrorHandler, F as createFederation, Ft as OutboxPermanentFailureHandler, G as RetryPolicy, H as TaskRegistry, Ht as PageItems, I as Message, It as SharedInboxKeyDispatcher, J as respondWithObject, K as createExponentialBackoffPolicy, L as createFederationBuilder, Lt as UnverifiedActivityHandler, M as FederationKvPrefixes, Mt as OutboxErrorHandler, N as FederationOrigin, Nt as OutboxListener, O as MediaUploaderSetters, Ot as MediaUploaderCallback, P as FederationQueueOptions, Pt as OutboxListenerErrorHandler, Q as MessageQueue, R as TaskDefinition, Rt as UnverifiedActivityReason, S as FederationOptions, St as CollectionDispatcher, T as IdempotencyStrategy, Tt as CustomCollectionDispatcher, U as CreateExponentialBackoffPolicyOptions, Ut as buildCollectionSynchronizationHeader, V as TaskHandler, Vt as SenderKeyPair, W as RetryContext, Wt as digest, X as InProcessMessageQueue, Y as respondWithObjectIfAcceptable, Z as InProcessMessageQueueOptions, _ as Federatable, _t as ActorHandleMapper, a as GetSignedKeyOptions, at as CircuitBreakerBeforeSendDecision, b as FederationBuilder, bt as CollectionCounter, c as ParseUriResult, ct as CircuitBreakerKvState, d as SendActivityOptions, dt as CircuitBreakerStateChange, et as MessageQueueEnqueueOptions, f as SendActivityOptionsForCollection, ft as NormalizedCircuitBreakerOptions, g as CustomCollectionCallbackSetters, gt as ActorDispatcher, h as ConstructorWithTypeId, ht as ActorAliasMapper, i as GetActorOptions, it as CircuitBreakerActivityDrop, j as Rfc6570Expression, jt as ObjectDispatcher, k as ObjectCallbackSetters, kt as NodeInfoDispatcher, l as RequestContext, lt as CircuitBreakerOptions, m as CollectionCallbackSetters, mt as parseCircuitBreakerKvState, n as Context, nt as ParallelMessageQueue, o as InboxContext, ot as CircuitBreakerCreateOptions, p as ActorCallbackSetters, pt as normalizeCircuitBreakerOptions, q as RespondWithObjectOptions, r as ForwardActivityOptions, rt as CircuitBreaker, s as OutboxContext, st as CircuitBreakerFailurePolicy, t as ActorKeyPair, tt as MessageQueueListenOptions, u as RouteActivityOptions, ut as CircuitBreakerState, v as Federation, vt as ActorKeyPairsDispatcher, w as IdempotencyKeyCallback, wt as CustomCollectionCursor, x as FederationFetchOptions, xt as CollectionCursor, y as FederationBenchmarkOptions, yt as AuthorizePredicate, z as TaskDefinitionOptions, zt as WebFingerLinksDispatcher } from "../context-
|
|
2
|
+
import { $ as MessageQueueDepth, A as OutboxListenerSetters, At as ObjectAuthorizePredicate, B as TaskEnqueueOptions, Bt as SendActivityError, C as FederationStartQueueOptions, Ct as CustomCollectionCounter, D as InboxListenerSetters, Dt as InboxListener, E as InboxChallengePolicy, Et as InboxErrorHandler, F as createFederation, Ft as OutboxPermanentFailureHandler, G as RetryPolicy, H as TaskRegistry, Ht as PageItems, I as Message, It as SharedInboxKeyDispatcher, J as respondWithObject, K as createExponentialBackoffPolicy, L as createFederationBuilder, Lt as UnverifiedActivityHandler, M as FederationKvPrefixes, Mt as OutboxErrorHandler, N as FederationOrigin, Nt as OutboxListener, O as MediaUploaderSetters, Ot as MediaUploaderCallback, P as FederationQueueOptions, Pt as OutboxListenerErrorHandler, Q as MessageQueue, R as TaskDefinition, Rt as UnverifiedActivityReason, S as FederationOptions, St as CollectionDispatcher, T as IdempotencyStrategy, Tt as CustomCollectionDispatcher, U as CreateExponentialBackoffPolicyOptions, Ut as buildCollectionSynchronizationHeader, V as TaskHandler, Vt as SenderKeyPair, W as RetryContext, Wt as digest, X as InProcessMessageQueue, Y as respondWithObjectIfAcceptable, Z as InProcessMessageQueueOptions, _ as Federatable, _t as ActorHandleMapper, a as GetSignedKeyOptions, at as CircuitBreakerBeforeSendDecision, b as FederationBuilder, bt as CollectionCounter, c as ParseUriResult, ct as CircuitBreakerKvState, d as SendActivityOptions, dt as CircuitBreakerStateChange, et as MessageQueueEnqueueOptions, f as SendActivityOptionsForCollection, ft as NormalizedCircuitBreakerOptions, g as CustomCollectionCallbackSetters, gt as ActorDispatcher, h as ConstructorWithTypeId, ht as ActorAliasMapper, i as GetActorOptions, it as CircuitBreakerActivityDrop, j as Rfc6570Expression, jt as ObjectDispatcher, k as ObjectCallbackSetters, kt as NodeInfoDispatcher, l as RequestContext, lt as CircuitBreakerOptions, m as CollectionCallbackSetters, mt as parseCircuitBreakerKvState, n as Context, nt as ParallelMessageQueue, o as InboxContext, ot as CircuitBreakerCreateOptions, p as ActorCallbackSetters, pt as normalizeCircuitBreakerOptions, q as RespondWithObjectOptions, r as ForwardActivityOptions, rt as CircuitBreaker, s as OutboxContext, st as CircuitBreakerFailurePolicy, t as ActorKeyPair, tt as MessageQueueListenOptions, u as RouteActivityOptions, ut as CircuitBreakerState, v as Federation, vt as ActorKeyPairsDispatcher, w as IdempotencyKeyCallback, wt as CustomCollectionCursor, x as FederationFetchOptions, xt as CollectionCursor, y as FederationBenchmarkOptions, yt as AuthorizePredicate, z as TaskDefinitionOptions, zt as WebFingerLinksDispatcher } from "../context-BOnn653X.cjs";
|
|
3
3
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-BhNbN8Ed.cjs";
|
|
4
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-
|
|
4
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-kUSY5n3f.cjs";
|
|
5
5
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBenchmarkOptions, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, 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, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, normalizeCircuitBreakerOptions, parseCircuitBreakerKvState, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
|
-
import { $ as MessageQueueDepth, A as OutboxListenerSetters, At as ObjectAuthorizePredicate, B as TaskEnqueueOptions, Bt as SendActivityError, C as FederationStartQueueOptions, Ct as CustomCollectionCounter, D as InboxListenerSetters, Dt as InboxListener, E as InboxChallengePolicy, Et as InboxErrorHandler, F as createFederation, Ft as OutboxPermanentFailureHandler, G as RetryPolicy, H as TaskRegistry, Ht as PageItems, I as Message, It as SharedInboxKeyDispatcher, J as respondWithObject, K as createExponentialBackoffPolicy, L as createFederationBuilder, Lt as UnverifiedActivityHandler, M as FederationKvPrefixes, Mt as OutboxErrorHandler, N as FederationOrigin, Nt as OutboxListener, O as MediaUploaderSetters, Ot as MediaUploaderCallback, P as FederationQueueOptions, Pt as OutboxListenerErrorHandler, Q as MessageQueue, R as TaskDefinition, Rt as UnverifiedActivityReason, S as FederationOptions, St as CollectionDispatcher, T as IdempotencyStrategy, Tt as CustomCollectionDispatcher, U as CreateExponentialBackoffPolicyOptions, Ut as buildCollectionSynchronizationHeader, V as TaskHandler, Vt as SenderKeyPair, W as RetryContext, Wt as digest, X as InProcessMessageQueue, Y as respondWithObjectIfAcceptable, Z as InProcessMessageQueueOptions, _ as Federatable, _t as ActorHandleMapper, a as GetSignedKeyOptions, at as CircuitBreakerBeforeSendDecision, b as FederationBuilder, bt as CollectionCounter, c as ParseUriResult, ct as CircuitBreakerKvState, d as SendActivityOptions, dt as CircuitBreakerStateChange, et as MessageQueueEnqueueOptions, f as SendActivityOptionsForCollection, ft as NormalizedCircuitBreakerOptions, g as CustomCollectionCallbackSetters, gt as ActorDispatcher, h as ConstructorWithTypeId, ht as ActorAliasMapper, i as GetActorOptions, it as CircuitBreakerActivityDrop, j as Rfc6570Expression, jt as ObjectDispatcher, k as ObjectCallbackSetters, kt as NodeInfoDispatcher, l as RequestContext, lt as CircuitBreakerOptions, m as CollectionCallbackSetters, mt as parseCircuitBreakerKvState, n as Context, nt as ParallelMessageQueue, o as InboxContext, ot as CircuitBreakerCreateOptions, p as ActorCallbackSetters, pt as normalizeCircuitBreakerOptions, q as RespondWithObjectOptions, r as ForwardActivityOptions, rt as CircuitBreaker, s as OutboxContext, st as CircuitBreakerFailurePolicy, t as ActorKeyPair, tt as MessageQueueListenOptions, u as RouteActivityOptions, ut as CircuitBreakerState, v as Federation, vt as ActorKeyPairsDispatcher, w as IdempotencyKeyCallback, wt as CustomCollectionCursor, x as FederationFetchOptions, xt as CollectionCursor, y as FederationBenchmarkOptions, yt as AuthorizePredicate, z as TaskDefinitionOptions, zt as WebFingerLinksDispatcher } from "../context-
|
|
2
|
+
import { $ as MessageQueueDepth, A as OutboxListenerSetters, At as ObjectAuthorizePredicate, B as TaskEnqueueOptions, Bt as SendActivityError, C as FederationStartQueueOptions, Ct as CustomCollectionCounter, D as InboxListenerSetters, Dt as InboxListener, E as InboxChallengePolicy, Et as InboxErrorHandler, F as createFederation, Ft as OutboxPermanentFailureHandler, G as RetryPolicy, H as TaskRegistry, Ht as PageItems, I as Message, It as SharedInboxKeyDispatcher, J as respondWithObject, K as createExponentialBackoffPolicy, L as createFederationBuilder, Lt as UnverifiedActivityHandler, M as FederationKvPrefixes, Mt as OutboxErrorHandler, N as FederationOrigin, Nt as OutboxListener, O as MediaUploaderSetters, Ot as MediaUploaderCallback, P as FederationQueueOptions, Pt as OutboxListenerErrorHandler, Q as MessageQueue, R as TaskDefinition, Rt as UnverifiedActivityReason, S as FederationOptions, St as CollectionDispatcher, T as IdempotencyStrategy, Tt as CustomCollectionDispatcher, U as CreateExponentialBackoffPolicyOptions, Ut as buildCollectionSynchronizationHeader, V as TaskHandler, Vt as SenderKeyPair, W as RetryContext, Wt as digest, X as InProcessMessageQueue, Y as respondWithObjectIfAcceptable, Z as InProcessMessageQueueOptions, _ as Federatable, _t as ActorHandleMapper, a as GetSignedKeyOptions, at as CircuitBreakerBeforeSendDecision, b as FederationBuilder, bt as CollectionCounter, c as ParseUriResult, ct as CircuitBreakerKvState, d as SendActivityOptions, dt as CircuitBreakerStateChange, et as MessageQueueEnqueueOptions, f as SendActivityOptionsForCollection, ft as NormalizedCircuitBreakerOptions, g as CustomCollectionCallbackSetters, gt as ActorDispatcher, h as ConstructorWithTypeId, ht as ActorAliasMapper, i as GetActorOptions, it as CircuitBreakerActivityDrop, j as Rfc6570Expression, jt as ObjectDispatcher, k as ObjectCallbackSetters, kt as NodeInfoDispatcher, l as RequestContext, lt as CircuitBreakerOptions, m as CollectionCallbackSetters, mt as parseCircuitBreakerKvState, n as Context, nt as ParallelMessageQueue, o as InboxContext, ot as CircuitBreakerCreateOptions, p as ActorCallbackSetters, pt as normalizeCircuitBreakerOptions, q as RespondWithObjectOptions, r as ForwardActivityOptions, rt as CircuitBreaker, s as OutboxContext, st as CircuitBreakerFailurePolicy, t as ActorKeyPair, tt as MessageQueueListenOptions, u as RouteActivityOptions, ut as CircuitBreakerState, v as Federation, vt as ActorKeyPairsDispatcher, w as IdempotencyKeyCallback, wt as CustomCollectionCursor, x as FederationFetchOptions, xt as CollectionCursor, y as FederationBenchmarkOptions, yt as AuthorizePredicate, z as TaskDefinitionOptions, zt as WebFingerLinksDispatcher } from "../context-CmjP-cgJ.js";
|
|
3
3
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-BhNbN8Ed.js";
|
|
4
|
-
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-
|
|
4
|
+
import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "../mod-BYuZ0WXt.js";
|
|
5
5
|
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CircuitBreaker, CircuitBreakerActivityDrop, CircuitBreakerBeforeSendDecision, CircuitBreakerCreateOptions, CircuitBreakerFailurePolicy, CircuitBreakerKvState, CircuitBreakerOptions, CircuitBreakerState, CircuitBreakerStateChange, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBenchmarkOptions, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MediaUploaderCallback, MediaUploaderSetters, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, NormalizedCircuitBreakerOptions, 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, TaskDefinition, TaskDefinitionOptions, TaskEnqueueOptions, TaskHandler, TaskRegistry, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, normalizeCircuitBreakerOptions, parseCircuitBreakerKvState, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as respondWithObject, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as SendActivityError, l as CircuitBreaker, n as handleWebFinger, o as respondWithObjectIfAcceptable, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-
|
|
3
|
+
import { a as respondWithObject, c as digest, d as parseCircuitBreakerKvState, f as createFederationBuilder, i as SendActivityError, l as CircuitBreaker, n as handleWebFinger, o as respondWithObjectIfAcceptable, r as createExponentialBackoffPolicy, s as buildCollectionSynchronizationHeader, t as createFederation, u as normalizeCircuitBreakerOptions } from "../middleware-CBO16r56.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { Router as Router$1, RouterError as RouterError$1, assertPath, isPath } from "@fedify/uri-template";
|
|
6
6
|
import { isEqual } from "es-toolkit";
|
|
@@ -10,10 +10,10 @@ import { t as assertNotEquals } from "../assert_not_equals-BN7yDMWe.mjs";
|
|
|
10
10
|
import "../std__assert-CxFT0MNt.mjs";
|
|
11
11
|
import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
|
|
12
12
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
13
|
-
import { l as verifyRequest } from "../http-
|
|
13
|
+
import { l as verifyRequest } from "../http-Cp_Byhf8.mjs";
|
|
14
14
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
|
|
15
|
-
import { t as doesActorOwnKey } from "../owner-
|
|
16
|
-
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-
|
|
15
|
+
import { t as doesActorOwnKey } from "../owner-Cf55GD32.mjs";
|
|
16
|
+
import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-DL5nBv54.mjs";
|
|
17
17
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
18
18
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
19
19
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
@@ -2,9 +2,8 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
|
-
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../
|
|
6
|
-
import "../../
|
|
7
|
-
import { o as createFederation } from "../../middleware-DB_evWhA.mjs";
|
|
5
|
+
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-D13ymFKy.mjs";
|
|
6
|
+
import { o as createFederation } from "../../middleware--nGmJXXx.mjs";
|
|
8
7
|
import { n as ParallelMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
9
8
|
import { configure, reset } from "@logtape/logtape";
|
|
10
9
|
import { delay } from "es-toolkit";
|
|
@@ -2,10 +2,9 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as MemoryKvStore } from "../../kv-DCHkaJ9-.mjs";
|
|
5
|
-
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../
|
|
6
|
-
import "../../
|
|
7
|
-
import {
|
|
8
|
-
import { r as createFederationBuilder } from "../../builder-sMkz-MdT.mjs";
|
|
5
|
+
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, t as MockQueue } from "../../testing-D13ymFKy.mjs";
|
|
6
|
+
import { o as createFederation } from "../../middleware--nGmJXXx.mjs";
|
|
7
|
+
import { r as createFederationBuilder } from "../../builder-BdcA_1Rt.mjs";
|
|
9
8
|
import { t as TaskCodec } from "../../codec-C6rTrpIp.mjs";
|
|
10
9
|
import { t as InProcessMessageQueue } from "../../mq-Dm1Wmtm-.mjs";
|
|
11
10
|
import { W3CTraceContextPropagator } from "@opentelemetry/core";
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertFalse } from "../assert_false-3pLLLsO4.mjs";
|
|
5
5
|
import "../std__assert-CxFT0MNt.mjs";
|
|
6
6
|
import { t as assert } from "../assert-CebeUf0C.mjs";
|
|
7
|
-
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-
|
|
7
|
+
import { t as hasMalformedKnownTemporalLiteral } from "../temporal-C_3AI99D.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 () => {
|
|
@@ -6,7 +6,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
7
7
|
import { t as assertNotEquals } from "../assert_not_equals-BN7yDMWe.mjs";
|
|
8
8
|
import "../std__assert-CxFT0MNt.mjs";
|
|
9
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware
|
|
9
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware--nGmJXXx.mjs";
|
|
10
10
|
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
12
12
|
//#region src/federation/webfinger.test.ts
|