@fedify/fedify 2.4.0-dev.1951 → 2.4.0-dev.1959
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-P44yYQ5Z.mjs → builder-sMkz-MdT.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-BOnn653X.d.cts → context-COLwHogJ.d.cts} +27 -0
- package/dist/{context-CmjP-cgJ.d.ts → context-DiiCt4S7.d.ts} +27 -0
- package/dist/{deno-U6Pe1U6h.mjs → deno-Xg7DR4LS.mjs} +1 -1
- package/dist/{docloader-DantBD_9.mjs → docloader-4YqMWBpt.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 +30 -4
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +195 -8
- 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 +3 -2
- package/dist/federation/tasks/tasks.test.mjs +4 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{federation-BAtfz-C3.cjs → federation-BNJgxgH6.cjs} +32 -13
- package/dist/{http-CnBZmc4J.js → http-Bh37_81O.js} +1 -1
- package/dist/{http-BTD1L4Sv.cjs → http-BuOvqNbW.cjs} +1 -1
- package/dist/{http-Cssq59HU.mjs → http-DyXZdUng.mjs} +3 -3
- package/dist/{key-GeKuVU-k.mjs → key-CXsAkAt6.mjs} +2 -2
- package/dist/{keycache-0Jk78XmB.mjs → keycache-ZLqIfrkL.mjs} +3 -1
- package/dist/kv-DBRWVx3Q.mjs +104 -0
- package/dist/{kv-cache-D3gKJwUK.cjs → kv-cache-Btl0s7i7.cjs} +1 -1
- package/dist/{kv-cache-CoMnysg5.mjs → kv-cache-BubmP7z9.mjs} +1 -1
- package/dist/{kv-cache-CMUnx7rx.js → kv-cache-DjFxdXjk.js} +1 -1
- package/dist/{ld-BLl_mzo2.mjs → ld-C5Qv0_xn.mjs} +3 -3
- package/dist/{metrics-KDlQIBxX.mjs → metrics-B7-JxJSv.mjs} +1 -1
- package/dist/{middleware-CIlcGav-.mjs → middleware-BfRUvR8e.mjs} +1 -1
- package/dist/{middleware-aheUmEPU.js → middleware-CF539vn2.js} +32 -13
- package/dist/{middleware-D-vIOT8Y.mjs → middleware-DB_evWhA.mjs} +39 -22
- package/dist/{mod-kUSY5n3f.d.cts → mod-BZldCEU0.d.cts} +1 -1
- package/dist/{mod-BYuZ0WXt.d.ts → mod-CSH1Ee-I.d.ts} +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-C111mU7b.mjs → owner-DFzwGoyv.mjs} +2 -2
- package/dist/{proof-CLZurGKe.js → proof-3rlJfM0Z.js} +1 -1
- package/dist/{proof-B_yPn2BI.cjs → proof-BVpjHUMS.cjs} +1 -1
- package/dist/{proof-B_5-ezjh.mjs → proof-DJGBYtRT.mjs} +4 -4
- package/dist/{send-r_mRJ1qS.mjs → send-BOXP7DyW.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/{testing-D13ymFKy.mjs → tasks-dbCShlCb.mjs} +0 -1
- package/dist/{temporal-CIBMJUty.mjs → temporal-D6yzxQ23.mjs} +1 -1
- package/dist/testing/kv.test.d.mts +2 -0
- package/dist/testing/kv.test.mjs +101 -0
- package/dist/testing/mod.d.mts +70 -1
- package/dist/testing/mod.mjs +4 -2
- package/dist/testing-hbky2gMN.mjs +8 -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/testing/mod.d.mts
CHANGED
|
@@ -1943,6 +1943,33 @@ interface FederationOptions<TContextData> {
|
|
|
1943
1943
|
* are prefixed with `["_fedify"]`.
|
|
1944
1944
|
*/
|
|
1945
1945
|
kvPrefixes?: Partial<FederationKvPrefixes>;
|
|
1946
|
+
/**
|
|
1947
|
+
* The time-to-live for a remote actor's public key cached under
|
|
1948
|
+
* {@link FederationKvPrefixes.publicKey}. Once it expires, the next
|
|
1949
|
+
* signature verification that needs the key refetches it from the remote
|
|
1950
|
+
* server and caches it again.
|
|
1951
|
+
*
|
|
1952
|
+
* Shortening it bounds how long a revoked or rotated key stays in the cache,
|
|
1953
|
+
* at the cost of more requests to remote servers; refetching an expired key
|
|
1954
|
+
* fails while the peer is unavailable, so a very short value makes
|
|
1955
|
+
* verification depend on the peer being reachable.
|
|
1956
|
+
* @default `{ days: 30 }`
|
|
1957
|
+
* @since 2.4.0
|
|
1958
|
+
*/
|
|
1959
|
+
publicKeyTtl?: Temporal.DurationLike;
|
|
1960
|
+
/**
|
|
1961
|
+
* The time-to-live for a remote origin's remembered HTTP Message Signatures
|
|
1962
|
+
* spec cached under {@link FederationKvPrefixes.httpMessageSignaturesSpec}.
|
|
1963
|
+
* Once it expires, the next delivery to that origin relearns the spec by
|
|
1964
|
+
* double-knocking and remembers it again.
|
|
1965
|
+
*
|
|
1966
|
+
* Shortening it makes Fedify notice a peer's spec upgrade sooner, at the
|
|
1967
|
+
* cost of an extra signed request per delivery whenever the first spec tried
|
|
1968
|
+
* is rejected.
|
|
1969
|
+
* @default `{ days: 90 }`
|
|
1970
|
+
* @since 2.4.0
|
|
1971
|
+
*/
|
|
1972
|
+
httpMessageSignaturesSpecTtl?: Temporal.DurationLike;
|
|
1946
1973
|
/**
|
|
1947
1974
|
* The message queue for sending and receiving activities. If not provided,
|
|
1948
1975
|
* activities will not be queued and will be processed immediately.
|
|
@@ -3564,6 +3591,48 @@ declare function createOutboxContext<TContextData>(args: Partial<OutboxContext<T
|
|
|
3564
3591
|
federation: Federation<TContextData>;
|
|
3565
3592
|
}): OutboxContext<TContextData>;
|
|
3566
3593
|
//#endregion
|
|
3594
|
+
//#region src/testing/kv.d.ts
|
|
3595
|
+
/**
|
|
3596
|
+
* A {@link KvStore} decorator whose entry expiry is driven by a virtual clock
|
|
3597
|
+
* instead of wall-clock time.
|
|
3598
|
+
*
|
|
3599
|
+
* {@link MemoryKvStore} decides expiry by comparing timestamps rather than by
|
|
3600
|
+
* scheduling timers, so a test that wants to observe a TTL elapsing would
|
|
3601
|
+
* otherwise have to sleep for longer than the TTL and hope the runner keeps
|
|
3602
|
+
* up. That makes such tests both slow and load-sensitive.
|
|
3603
|
+
*
|
|
3604
|
+
* This decorator keeps the TTLs itself and never passes them to the store it
|
|
3605
|
+
* wraps, so nothing expires until {@link advance} moves the clock. Cache
|
|
3606
|
+
* hits, expiry, and repopulation therefore all become deterministic, without
|
|
3607
|
+
* patching any global and without a test-only entry point in the library
|
|
3608
|
+
* itself. The clock starts at the Unix epoch and only ever moves forward.
|
|
3609
|
+
*/
|
|
3610
|
+
declare class ManualClockKvStore implements KvStore {
|
|
3611
|
+
#private;
|
|
3612
|
+
/**
|
|
3613
|
+
* Present only when the wrapped store has its own `cas()`. Callers such as
|
|
3614
|
+
* the task deduplication planner test `kv.cas != null` to decide whether a
|
|
3615
|
+
* conditional write is available, so the decorator must not advertise a
|
|
3616
|
+
* capability the wrapped store lacks.
|
|
3617
|
+
*/
|
|
3618
|
+
readonly cas?: (key: KvKey, expectedValue: unknown, newValue: unknown, options?: KvStoreSetOptions) => Promise<boolean>;
|
|
3619
|
+
constructor(inner?: KvStore);
|
|
3620
|
+
/**
|
|
3621
|
+
* The current reading of the virtual clock.
|
|
3622
|
+
*/
|
|
3623
|
+
get now(): Temporal.Instant;
|
|
3624
|
+
/**
|
|
3625
|
+
* Moves the virtual clock forward. Any entry whose TTL has elapsed by the
|
|
3626
|
+
* new time reads as missing from this point on, exactly as it would once a
|
|
3627
|
+
* real `KvStore` had let it expire.
|
|
3628
|
+
*/
|
|
3629
|
+
advance(duration: Temporal.DurationLike): void;
|
|
3630
|
+
get<T = unknown>(key: KvKey): Promise<T | undefined>;
|
|
3631
|
+
set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
|
|
3632
|
+
delete(key: KvKey): Promise<void>;
|
|
3633
|
+
list(prefix?: KvKey): AsyncIterable<KvStoreListEntry>;
|
|
3634
|
+
}
|
|
3635
|
+
//#endregion
|
|
3567
3636
|
//#region src/testing/tasks.d.ts
|
|
3568
3637
|
/** Federation options (sans `queue`) shared by the task suites. */
|
|
3569
3638
|
declare const baseOptions: Omit<FederationOptions<void>, "queue">;
|
|
@@ -3650,4 +3719,4 @@ interface TestDefinition {
|
|
|
3650
3719
|
}
|
|
3651
3720
|
declare const testDefinitions: TestDefinition[];
|
|
3652
3721
|
//#endregion
|
|
3653
|
-
export { type Envelope, MockQueue, type MockQueueOptions, baseOptions, createInboxContext, createOutboxContext, createRequestContext, envelopeSchema, makeSchema, numberSchema, stringSchema, testDefinitions };
|
|
3722
|
+
export { type Envelope, ManualClockKvStore, MockQueue, type MockQueueOptions, baseOptions, createInboxContext, createOutboxContext, createRequestContext, envelopeSchema, makeSchema, numberSchema, stringSchema, testDefinitions };
|
package/dist/testing/mod.mjs
CHANGED
|
@@ -3,5 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { r as testDefinitions } from "../dist-BQvArojP.mjs";
|
|
5
5
|
import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-CbS35fLr.mjs";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
|
|
7
|
+
import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, r as envelopeSchema, t as MockQueue } from "../tasks-dbCShlCb.mjs";
|
|
8
|
+
import "../testing-hbky2gMN.mjs";
|
|
9
|
+
export { ManualClockKvStore, MockQueue, baseOptions, createInboxContext, createOutboxContext, createRequestContext, envelopeSchema, makeSchema, numberSchema, stringSchema, testDefinitions };
|
|
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-CBlRfA-_.mjs";
|
|
6
6
|
import "../std__assert-CxFT0MNt.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-wFbSPn1O.mjs";
|
|
8
|
-
import { l as verifyRequest } from "../http-
|
|
8
|
+
import { l as verifyRequest } from "../http-DyXZdUng.mjs";
|
|
9
9
|
import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
|
|
10
|
-
import { t as getAuthenticatedDocumentLoader } from "../docloader-
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-4YqMWBpt.mjs";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
import { UrlError } from "@fedify/vocab-runtime";
|
|
13
13
|
//#region src/utils/docloader.test.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as kvCache, t as MockKvStore } from "../kv-cache-
|
|
4
|
+
import { n as kvCache, t as MockKvStore } from "../kv-cache-BubmP7z9.mjs";
|
|
5
5
|
import { deepStrictEqual, throws } from "node:assert";
|
|
6
6
|
import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
7
7
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_kv_cache = require("../kv-cache-
|
|
3
|
+
const require_kv_cache = require("../kv-cache-Btl0s7i7.cjs");
|
|
4
4
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
|
5
5
|
exports.kvCache = require_kv_cache.kvCache;
|
package/dist/utils/mod.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-
|
|
3
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-DjFxdXjk.js";
|
|
4
4
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/fedify",
|
|
3
|
-
"version": "2.4.0-dev.
|
|
3
|
+
"version": "2.4.0-dev.1959+0da7be03",
|
|
4
4
|
"description": "An ActivityPub server framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -151,10 +151,10 @@
|
|
|
151
151
|
"structured-field-values": "^2.0.4",
|
|
152
152
|
"temporal-polyfill": "^1.0.1",
|
|
153
153
|
"urlpattern-polyfill": "^10.1.0",
|
|
154
|
-
"@fedify/uri-template": "2.4.0-dev.
|
|
155
|
-
"@fedify/vocab": "2.4.0-dev.
|
|
156
|
-
"@fedify/
|
|
157
|
-
"@fedify/
|
|
154
|
+
"@fedify/uri-template": "2.4.0-dev.1959+0da7be03",
|
|
155
|
+
"@fedify/vocab-runtime": "2.4.0-dev.1959+0da7be03",
|
|
156
|
+
"@fedify/webfinger": "2.4.0-dev.1959+0da7be03",
|
|
157
|
+
"@fedify/vocab": "2.4.0-dev.1959+0da7be03"
|
|
158
158
|
},
|
|
159
159
|
"devDependencies": {
|
|
160
160
|
"@std/assert": "npm:@jsr/std__assert@^0.226.0",
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
"tsx": "^4.21.0",
|
|
167
167
|
"typescript": "^6.0.0",
|
|
168
168
|
"wrangler": "^4.17.0",
|
|
169
|
-
"@fedify/
|
|
170
|
-
"@fedify/
|
|
169
|
+
"@fedify/fixture": "2.0.0",
|
|
170
|
+
"@fedify/vocab-tools": "^2.4.0-dev.1959+0da7be03"
|
|
171
171
|
},
|
|
172
172
|
"scripts": {
|
|
173
173
|
"build:self": "tsdown",
|