@fedify/fedify 1.7.0-dev.893 → 1.7.0-dev.896
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/{actor-C3adWLHo.js → actor-CJya_eDy.js} +179 -179
- package/dist/{actor-tT_B0pDn.d.ts → actor-CPpvuBKU.d.ts} +2 -2
- package/dist/{actor-Dv8qr9rc.js → actor-Coq5gJ_S.js} +3 -3
- package/dist/{authdocloader-CLRgxbyp.js → authdocloader-CfmylMQ6.js} +3 -3
- package/dist/{authdocloader-CkOdo5gV.js → authdocloader-DQULPMEs.js} +3 -3
- package/dist/{builder-ZpfHloFH.js → builder-BhHMyqfi.js} +3 -3
- package/dist/{client-Bkyh-Y77.js → client-BWUnWOMm.js} +2 -2
- package/dist/{client-Cd552pKL.d.ts → client-DvtwXO7t.d.ts} +1 -1
- package/dist/compat/mod.d.ts +11 -11
- package/dist/compat/transformers.test.js +21 -21
- package/dist/{context-CLT6-1Sz.js → context-D5oyLaE-.js} +2 -2
- package/dist/{context-DdICJaUT.d.ts → context-DPggmpB4.d.ts} +28 -9
- package/dist/{docloader-DSiCgrLm.js → docloader-BN8NlZMg.js} +1 -1
- package/dist/{docloader-B0bm7EOo.js → docloader-DllReFU8.js} +1 -1
- package/dist/{docloader-DlUDOVSe.d.ts → docloader-Q42SMRIB.d.ts} +2 -2
- package/dist/{esm-e_d5TL5c.js → esm-CASHO3OR.js} +2 -2
- package/dist/federation/builder.test.js +29 -7
- package/dist/federation/collection.test.js +1 -1
- package/dist/federation/handler.test.js +23 -23
- package/dist/federation/inbox.test.js +4 -4
- package/dist/federation/keycache.test.js +5 -5
- package/dist/federation/kv.test.js +2 -2
- package/dist/federation/middleware.test.js +61 -24
- package/dist/federation/mod.d.ts +10 -10
- package/dist/federation/mod.js +11 -11
- package/dist/federation/mq.test.js +1 -1
- package/dist/federation/retry.test.js +1 -1
- package/dist/federation/router.test.js +1 -1
- package/dist/federation/send.test.js +11 -11
- package/dist/{federation-lZOZyLAo.js → federation-BRIQn-GV.js} +1 -1
- package/dist/{http-BkUCISGt.d.ts → http-B8EiSgi2.d.ts} +2 -2
- package/dist/{http-MseFekx9.js → http-Ccv35XGv.js} +3 -3
- package/dist/{http-De-b9bjC.js → http-L-alQmLv.js} +3 -3
- package/dist/{inbox-BY6vPZcf.js → inbox-BvI2lUGG.js} +2 -2
- package/dist/{key-Dofz8jJa.js → key-CwD3Zzul.js} +3 -3
- package/dist/{key-BZz0KSmk.js → key-DbkEUPZw.js} +5 -5
- package/dist/{key-CmRKpLwe.js → key-VY-BrF4v.js} +4 -4
- package/dist/{key-BcPkzzIH.js → key-_b8O70K_.js} +2 -2
- package/dist/{keycache-D9t9UCrM.js → keycache-DTvMl0Yz.js} +1 -1
- package/dist/{keys-CbDsdbvx.js → keys-DJpi5dqk.js} +1 -1
- package/dist/{kv-DohFOP2C.js → kv-BMY6Qf_A.js} +1 -1
- package/dist/{kv-p8sC8PTT.d.ts → kv-DRaeSXco.d.ts} +4 -4
- package/dist/{ld-Dq9PjkKR.js → ld-B-S8s7zw.js} +3 -3
- package/dist/{lookup-Dz8VgsKQ.js → lookup-1cUlskQW.js} +1 -1
- package/dist/{lookup-BCwKLGsa.js → lookup-BC70ikTL.js} +3 -3
- package/dist/{lookup-vJccIKCS.d.ts → lookup-Bf-K85bV.d.ts} +1 -1
- package/dist/{lookup-HiiBJuJM.js → lookup-oJGCqjmn.js} +1 -1
- package/dist/middleware-BkqqXD1Y.js +17 -0
- package/dist/{middleware-BOhI33ac.js → middleware-DZickJRL.js} +16 -14
- package/dist/{middleware-z5RQLn4K.js → middleware-JaZKIa-g.js} +22 -20
- package/dist/middleware-xV5-Gux5.js +33 -0
- package/dist/{mod-BTHfUeLo.d.ts → mod-C2drFqH8.d.ts} +2 -2
- package/dist/{mod-DSPyncxx.d.ts → mod-CDzlVCUF.d.ts} +2 -2
- package/dist/{mod-5orySGMZ.d.ts → mod-CbjCOiVh.d.ts} +2 -2
- package/dist/{mod-BUTm-sog.d.ts → mod-sEI6_uZ2.d.ts} +3 -3
- package/dist/mod.d.ts +13 -13
- package/dist/mod.js +11 -11
- package/dist/nodeinfo/client.test.js +5 -5
- package/dist/nodeinfo/handler.test.js +22 -22
- package/dist/nodeinfo/mod.d.ts +3 -3
- package/dist/nodeinfo/mod.js +2 -2
- package/dist/nodeinfo/semver.test.js +2 -2
- package/dist/nodeinfo/types.test.js +3 -3
- package/dist/{owner-EJ3S1Sal.js → owner-CyKql97g.js} +3 -3
- package/dist/{owner-CbRc94FP.d.ts → owner-D0cOz8R5.d.ts} +3 -3
- package/dist/{proof-BhrRK7yd.js → proof-DBBmxLH9.js} +3 -3
- package/dist/{proof-CRJVyuH1.js → proof-zJ6oVUCk.js} +3 -3
- package/dist/runtime/authdocloader.test.js +10 -10
- package/dist/runtime/docloader.test.js +4 -4
- package/dist/runtime/key.test.js +6 -6
- package/dist/runtime/langstr.test.js +1 -1
- package/dist/runtime/mod.d.ts +5 -5
- package/dist/runtime/mod.js +6 -6
- package/dist/runtime/multibase/multibase.test.js +1 -1
- package/dist/runtime/url.test.js +1 -1
- package/dist/{semver-CbbIgUsa.js → semver-DWClQt_5.js} +2 -2
- package/dist/{send-DD6dtRRG.js → send-Cx7SQVCT.js} +2 -2
- package/dist/sig/http.test.js +15 -15
- package/dist/sig/key.test.js +7 -7
- package/dist/sig/ld.test.js +8 -8
- package/dist/sig/mod.d.ts +7 -7
- package/dist/sig/mod.js +6 -6
- package/dist/sig/owner.test.js +9 -9
- package/dist/sig/proof.test.js +8 -8
- package/dist/testing/docloader.test.js +1 -1
- package/dist/testing/mod.js +1 -1
- package/dist/{testing-jcGLO9Lp.js → testing-BZ0dJ4qn.js} +1 -1
- package/dist/{types-CqoqWDkp.js → types-C7C_l-jz.js} +1 -1
- package/dist/{types-CgjsbFdI.js → types-gd7Gb6VB.js} +3 -3
- package/dist/vocab/actor.test.js +6 -6
- package/dist/vocab/lookup.test.js +6 -6
- package/dist/vocab/mod.d.ts +5 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +8 -8
- package/dist/{vocab-BiYbNl-S.js → vocab-BP5KigRG.js} +3 -3
- package/dist/{vocab-DSFLLLe6.d.ts → vocab-CzEfWQk2.d.ts} +1 -1
- package/dist/{vocab-ByIVrnT5.js → vocab-DjXjRN_-.js} +178 -178
- package/dist/webfinger/handler.test.js +22 -22
- package/dist/webfinger/lookup.test.js +4 -4
- package/dist/webfinger/mod.d.ts +3 -3
- package/dist/webfinger/mod.js +2 -2
- package/dist/x/cfworkers.d.ts +1 -1
- package/dist/x/cfworkers.test.js +1 -1
- package/dist/x/hono.d.ts +10 -10
- package/dist/x/sveltekit.d.ts +10 -10
- package/package.json +1 -1
- package/dist/middleware-BV22URws.js +0 -17
- package/dist/middleware-Bfv68Ymw.js +0 -33
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { GetUserAgentOptions } from "./docloader-
|
4
|
-
import { Application, Group, Organization, Person, Service } from "./vocab-
|
3
|
+
import { GetUserAgentOptions } from "./docloader-Q42SMRIB.js";
|
4
|
+
import { Application, Group, Organization, Person, Service } from "./vocab-CzEfWQk2.js";
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
6
6
|
|
7
7
|
//#region vocab/actor.d.ts
|
@@ -3,9 +3,9 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default } from "./docloader-
|
7
|
-
import { Application, Group, Organization, Person, Service } from "./vocab-
|
8
|
-
import { lookupWebFinger } from "./lookup-
|
6
|
+
import { deno_default } from "./docloader-DllReFU8.js";
|
7
|
+
import { Application, Group, Organization, Person, Service } from "./vocab-DjXjRN_-.js";
|
8
|
+
import { lookupWebFinger } from "./lookup-oJGCqjmn.js";
|
9
9
|
import { getTypeId } from "./type-D2s5lmbZ.js";
|
10
10
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
11
11
|
import { domainToASCII, domainToUnicode } from "node:url";
|
@@ -3,10 +3,10 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { createRequest, getRemoteDocument, logRequest } from "./docloader-
|
6
|
+
import { createRequest, getRemoteDocument, logRequest } from "./docloader-DllReFU8.js";
|
7
7
|
import { UrlError, validatePublicUrl } from "./url-kTAI6_KP.js";
|
8
|
-
import { validateCryptoKey } from "./key-
|
9
|
-
import { doubleKnock } from "./http-
|
8
|
+
import { validateCryptoKey } from "./key-CwD3Zzul.js";
|
9
|
+
import { doubleKnock } from "./http-Ccv35XGv.js";
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
11
11
|
|
12
12
|
//#region runtime/authdocloader.ts
|
@@ -2,9 +2,9 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-
|
6
|
-
import { validateCryptoKey } from "./key-
|
7
|
-
import { doubleKnock } from "./http-
|
5
|
+
import { UrlError, createRequest, getRemoteDocument, logRequest, validatePublicUrl } from "./docloader-BN8NlZMg.js";
|
6
|
+
import { validateCryptoKey } from "./key-_b8O70K_.js";
|
7
|
+
import { doubleKnock } from "./http-L-alQmLv.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
|
10
10
|
//#region runtime/authdocloader.ts
|
@@ -3,10 +3,10 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { deno_default } from "./docloader-
|
6
|
+
import { deno_default } from "./docloader-DllReFU8.js";
|
7
7
|
import { Router, RouterError } from "./router-D_aVZZUc.js";
|
8
8
|
import { getTypeId } from "./type-D2s5lmbZ.js";
|
9
|
-
import { InboxListenerSet } from "./inbox-
|
9
|
+
import { InboxListenerSet } from "./inbox-BvI2lUGG.js";
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
11
11
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
12
12
|
|
@@ -34,7 +34,7 @@ var FederationBuilderImpl = class {
|
|
34
34
|
this.objectTypeIds = {};
|
35
35
|
}
|
36
36
|
async build(options) {
|
37
|
-
const { FederationImpl } = await import("./middleware-
|
37
|
+
const { FederationImpl } = await import("./middleware-xV5-Gux5.js");
|
38
38
|
const f = new FederationImpl(options);
|
39
39
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
40
40
|
f.router = this.router.clone();
|
@@ -3,8 +3,8 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { getUserAgent } from "./docloader-
|
7
|
-
import { parseSemVer } from "./semver-
|
6
|
+
import { getUserAgent } from "./docloader-DllReFU8.js";
|
7
|
+
import { parseSemVer } from "./semver-DWClQt_5.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
|
10
10
|
//#region nodeinfo/client.ts
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { GetUserAgentOptions } from "./docloader-
|
3
|
+
import { GetUserAgentOptions } from "./docloader-Q42SMRIB.js";
|
4
4
|
|
5
5
|
//#region nodeinfo/semver.d.ts
|
6
6
|
/**
|
package/dist/compat/mod.d.ts
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import "../kv-
|
4
|
-
import "../docloader-
|
5
|
-
import "../client-
|
6
|
-
import "../vocab-
|
7
|
-
import "../actor-
|
8
|
-
import "../http-
|
9
|
-
import "../owner-
|
10
|
-
import "../mod-
|
11
|
-
import "../lookup-
|
12
|
-
import { ActivityTransformer } from "../context-
|
3
|
+
import "../kv-DRaeSXco.js";
|
4
|
+
import "../docloader-Q42SMRIB.js";
|
5
|
+
import "../client-DvtwXO7t.js";
|
6
|
+
import "../vocab-CzEfWQk2.js";
|
7
|
+
import "../actor-CPpvuBKU.js";
|
8
|
+
import "../http-B8EiSgi2.js";
|
9
|
+
import "../owner-D0cOz8R5.js";
|
10
|
+
import "../mod-CDzlVCUF.js";
|
11
|
+
import "../lookup-Bf-K85bV.js";
|
12
|
+
import { ActivityTransformer } from "../context-DPggmpB4.js";
|
13
13
|
import "../mq-DYKDDJmp.js";
|
14
|
-
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-
|
14
|
+
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "../mod-CbjCOiVh.js";
|
15
15
|
export { ActivityTransformer, actorDehydrator, autoIdAssigner, getDefaultActivityTransformers };
|
@@ -6,34 +6,34 @@
|
|
6
6
|
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
7
|
import { assert } from "../assert-YJk-1DlZ.js";
|
8
8
|
import { assertInstanceOf } from "../assert_instance_of-DBIoG5k7.js";
|
9
|
-
import { MemoryKvStore } from "../kv-
|
10
|
-
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-
|
11
|
-
import "../docloader-
|
9
|
+
import { MemoryKvStore } from "../kv-BMY6Qf_A.js";
|
10
|
+
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-JaZKIa-g.js";
|
11
|
+
import "../docloader-DllReFU8.js";
|
12
12
|
import "../url-kTAI6_KP.js";
|
13
|
-
import "../semver-
|
14
|
-
import "../client-
|
13
|
+
import "../semver-DWClQt_5.js";
|
14
|
+
import "../client-BWUnWOMm.js";
|
15
15
|
import "../router-D_aVZZUc.js";
|
16
|
-
import "../types-
|
16
|
+
import "../types-C7C_l-jz.js";
|
17
17
|
import "../multibase-DeCHcK8L.js";
|
18
|
-
import { Follow, Person } from "../vocab-
|
18
|
+
import { Follow, Person } from "../vocab-DjXjRN_-.js";
|
19
19
|
import "../langstr-DbWheeIS.js";
|
20
|
-
import "../lookup-
|
20
|
+
import "../lookup-oJGCqjmn.js";
|
21
21
|
import "../type-D2s5lmbZ.js";
|
22
|
-
import "../actor-
|
23
|
-
import "../key-
|
24
|
-
import "../http-
|
25
|
-
import "../authdocloader-
|
26
|
-
import "../ld-
|
27
|
-
import "../owner-
|
28
|
-
import "../proof-
|
29
|
-
import "../lookup-
|
30
|
-
import "../inbox-
|
31
|
-
import "../builder-
|
22
|
+
import "../actor-Coq5gJ_S.js";
|
23
|
+
import "../key-CwD3Zzul.js";
|
24
|
+
import "../http-Ccv35XGv.js";
|
25
|
+
import "../authdocloader-CfmylMQ6.js";
|
26
|
+
import "../ld-B-S8s7zw.js";
|
27
|
+
import "../owner-CyKql97g.js";
|
28
|
+
import "../proof-DBBmxLH9.js";
|
29
|
+
import "../lookup-BC70ikTL.js";
|
30
|
+
import "../inbox-BvI2lUGG.js";
|
31
|
+
import "../builder-BhHMyqfi.js";
|
32
32
|
import "../collection-Dfb0TPno.js";
|
33
|
-
import "../keycache-
|
33
|
+
import "../keycache-DTvMl0Yz.js";
|
34
34
|
import "../retry-BiIhZWgD.js";
|
35
|
-
import "../send-
|
36
|
-
import { test } from "../testing-
|
35
|
+
import "../send-Cx7SQVCT.js";
|
36
|
+
import { test } from "../testing-BZ0dJ4qn.js";
|
37
37
|
|
38
38
|
//#region compat/transformers.test.ts
|
39
39
|
const federation = new FederationImpl({ kv: new MemoryKvStore() });
|
@@ -4,8 +4,8 @@
|
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
6
|
import { RouterError } from "./router-D_aVZZUc.js";
|
7
|
-
import { lookupWebFinger } from "./lookup-
|
8
|
-
import { lookupObject, traverseCollection } from "./lookup-
|
7
|
+
import { lookupWebFinger } from "./lookup-oJGCqjmn.js";
|
8
|
+
import { lookupObject, traverseCollection } from "./lookup-BC70ikTL.js";
|
9
9
|
import { mockDocumentLoader } from "./docloader-09nVWLAZ.js";
|
10
10
|
import { trace } from "@opentelemetry/api";
|
11
11
|
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { KvKey, KvStore } from "./kv-
|
4
|
-
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "./docloader-
|
5
|
-
import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-
|
6
|
-
import { Activity, Collection, CryptographicKey, Hashtag, Link, Multikey, Object as Object$1 } from "./vocab-
|
7
|
-
import { Actor, Recipient } from "./actor-
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
3
|
+
import { KvKey, KvStore } from "./kv-DRaeSXco.js";
|
4
|
+
import { AuthenticatedDocumentLoaderFactory, DocumentLoader, DocumentLoaderFactory, GetUserAgentOptions } from "./docloader-Q42SMRIB.js";
|
5
|
+
import { GetNodeInfoOptions, JsonValue, NodeInfo } from "./client-DvtwXO7t.js";
|
6
|
+
import { Activity, Collection, CryptographicKey, Hashtag, Link, Multikey, Object as Object$1 } from "./vocab-CzEfWQk2.js";
|
7
|
+
import { Actor, Recipient } from "./actor-CPpvuBKU.js";
|
8
|
+
import { HttpMessageSignaturesSpec } from "./http-B8EiSgi2.js";
|
9
|
+
import { GetKeyOwnerOptions } from "./owner-D0cOz8R5.js";
|
10
|
+
import { LookupObjectOptions, TraverseCollectionOptions } from "./mod-CDzlVCUF.js";
|
11
|
+
import { LookupWebFingerOptions, ResourceDescriptor } from "./lookup-Bf-K85bV.js";
|
11
12
|
import { MessageQueue } from "./mq-DYKDDJmp.js";
|
12
13
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
13
14
|
|
@@ -956,7 +957,7 @@ interface FederationBuilder<TContextData> extends Federatable<TContextData> {
|
|
956
957
|
*/
|
957
958
|
interface FederationOptions<TContextData> {
|
958
959
|
/**
|
959
|
-
* The key
|
960
|
+
* The key–value store used for caching, outbox queues, and inbox idempotence.
|
960
961
|
*/
|
961
962
|
kv: KvStore;
|
962
963
|
/**
|
@@ -1073,6 +1074,24 @@ interface FederationOptions<TContextData> {
|
|
1073
1074
|
* @since 0.13.0
|
1074
1075
|
*/
|
1075
1076
|
skipSignatureVerification?: boolean;
|
1077
|
+
/**
|
1078
|
+
* The HTTP Signatures specification to use for the first signature
|
1079
|
+
* attempt when communicating with unknown servers. This option affects
|
1080
|
+
* the "double-knocking" mechanism as described in the ActivityPub HTTP
|
1081
|
+
* Signature documentation.
|
1082
|
+
*
|
1083
|
+
* When making HTTP requests to servers that haven't been encountered before,
|
1084
|
+
* Fedify will first attempt to sign the request using the specified
|
1085
|
+
* signature specification. If the request fails, it will retry with the
|
1086
|
+
* alternative specification.
|
1087
|
+
*
|
1088
|
+
* Defaults to `"rfc9421"` (HTTP Message Signatures).
|
1089
|
+
*
|
1090
|
+
* @see {@link https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions}
|
1091
|
+
* @default `"rfc9421"`
|
1092
|
+
* @since 1.7.0
|
1093
|
+
*/
|
1094
|
+
firstKnock?: HttpMessageSignaturesSpec;
|
1076
1095
|
/**
|
1077
1096
|
* The retry policy for sending activities to recipients' inboxes.
|
1078
1097
|
* By default, this uses an exponential backoff strategy with a maximum of
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { KvKey, KvStore } from "./kv-
|
3
|
+
import { KvKey, KvStore } from "./kv-DRaeSXco.js";
|
4
4
|
|
5
5
|
//#region runtime/docloader.d.ts
|
6
6
|
/**
|
@@ -149,7 +149,7 @@ interface KvCacheParameters {
|
|
149
149
|
*/
|
150
150
|
loader: DocumentLoader;
|
151
151
|
/**
|
152
|
-
* The key
|
152
|
+
* The key–value store to use for backing the cache.
|
153
153
|
*/
|
154
154
|
kv: KvStore;
|
155
155
|
/**
|
@@ -576,7 +576,7 @@ const getUrlMatcher = (route) => {
|
|
576
576
|
}
|
577
577
|
if (typeof matcherUrl === "string") {
|
578
578
|
for (const shorthand in stringMatchers) if (matcherUrl.indexOf(`${shorthand}:`) === 0) {
|
579
|
-
const urlFragment = matcherUrl.replace(new RegExp(`^${shorthand}:`), "");
|
579
|
+
const urlFragment = matcherUrl.replace(/* @__PURE__ */ new RegExp(`^${shorthand}:`), "");
|
580
580
|
return stringMatchers[shorthand](urlFragment);
|
581
581
|
}
|
582
582
|
return getFullUrlMatcher(route, matcherUrl, query);
|
@@ -906,7 +906,7 @@ var Router = class {
|
|
906
906
|
} catch (err) {
|
907
907
|
reject(err);
|
908
908
|
}
|
909
|
-
else reject(new Error(`fetch-mock: No response or fallback rule to cover ${options && options.method || "GET"} to ${url}`));
|
909
|
+
else reject(/* @__PURE__ */ new Error(`fetch-mock: No response or fallback rule to cover ${options && options.method || "GET"} to ${url}`));
|
910
910
|
});
|
911
911
|
}
|
912
912
|
async generateResponse(callLog) {
|
@@ -6,18 +6,18 @@
|
|
6
6
|
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
7
|
import "../assert-YJk-1DlZ.js";
|
8
8
|
import "../assert_instance_of-DBIoG5k7.js";
|
9
|
-
import { MemoryKvStore } from "../kv-
|
10
|
-
import "../docloader-
|
9
|
+
import { MemoryKvStore } from "../kv-BMY6Qf_A.js";
|
10
|
+
import "../docloader-DllReFU8.js";
|
11
11
|
import "../url-kTAI6_KP.js";
|
12
|
-
import { parseSemVer } from "../semver-
|
12
|
+
import { parseSemVer } from "../semver-DWClQt_5.js";
|
13
13
|
import "../router-D_aVZZUc.js";
|
14
14
|
import "../multibase-DeCHcK8L.js";
|
15
|
-
import { Activity, Note, Person } from "../vocab-
|
15
|
+
import { Activity, Note, Person } from "../vocab-DjXjRN_-.js";
|
16
16
|
import "../langstr-DbWheeIS.js";
|
17
17
|
import "../type-D2s5lmbZ.js";
|
18
|
-
import "../inbox-
|
19
|
-
import { createFederationBuilder } from "../builder-
|
20
|
-
import { test } from "../testing-
|
18
|
+
import "../inbox-BvI2lUGG.js";
|
19
|
+
import { createFederationBuilder } from "../builder-BhHMyqfi.js";
|
20
|
+
import { test } from "../testing-BZ0dJ4qn.js";
|
21
21
|
import { assertExists } from "../std__assert-CHXwj7zk.js";
|
22
22
|
import "../assert_rejects-BZjUwo62.js";
|
23
23
|
import "../assert_is_error-jyzqjHud.js";
|
@@ -107,6 +107,28 @@ test("FederationBuilder", async (t) => {
|
|
107
107
|
assertEquals(impl.router.trailingSlashInsensitive, true);
|
108
108
|
assertEquals(impl.origin?.webOrigin, "https://example.com");
|
109
109
|
});
|
110
|
+
await t.step("should handle firstKnock option", async () => {
|
111
|
+
const builder = createFederationBuilder();
|
112
|
+
const kv = new MemoryKvStore();
|
113
|
+
const federationDefault = await builder.build({ kv });
|
114
|
+
assertExists(federationDefault);
|
115
|
+
const implDefault = federationDefault;
|
116
|
+
assertEquals(implDefault.firstKnock, void 0);
|
117
|
+
const federationCustom = await builder.build({
|
118
|
+
kv,
|
119
|
+
firstKnock: "draft-cavage-http-signatures-12"
|
120
|
+
});
|
121
|
+
assertExists(federationCustom);
|
122
|
+
const implCustom = federationCustom;
|
123
|
+
assertEquals(implCustom.firstKnock, "draft-cavage-http-signatures-12");
|
124
|
+
const federationRfc = await builder.build({
|
125
|
+
kv,
|
126
|
+
firstKnock: "rfc9421"
|
127
|
+
});
|
128
|
+
assertExists(federationRfc);
|
129
|
+
const implRfc = federationRfc;
|
130
|
+
assertEquals(implRfc.firstKnock, "rfc9421");
|
131
|
+
});
|
110
132
|
await t.step("should register multiple object dispatchers and verify them", async () => {
|
111
133
|
const builder = createFederationBuilder();
|
112
134
|
const kv = new MemoryKvStore();
|
@@ -7,7 +7,7 @@ import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
|
7
7
|
import "../assert-YJk-1DlZ.js";
|
8
8
|
import "../assert_instance_of-DBIoG5k7.js";
|
9
9
|
import { buildCollectionSynchronizationHeader, digest } from "../collection-Dfb0TPno.js";
|
10
|
-
import { test } from "../testing-
|
10
|
+
import { test } from "../testing-BZ0dJ4qn.js";
|
11
11
|
import "../std__assert-CHXwj7zk.js";
|
12
12
|
import "../assert_rejects-BZjUwo62.js";
|
13
13
|
import "../assert_is_error-jyzqjHud.js";
|
@@ -6,42 +6,42 @@
|
|
6
6
|
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
7
|
import { assert } from "../assert-YJk-1DlZ.js";
|
8
8
|
import "../assert_instance_of-DBIoG5k7.js";
|
9
|
-
import { MemoryKvStore } from "../kv-
|
10
|
-
import { acceptsJsonLd, createFederation, handleActor, handleCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-
|
11
|
-
import "../docloader-
|
9
|
+
import { MemoryKvStore } from "../kv-BMY6Qf_A.js";
|
10
|
+
import { acceptsJsonLd, createFederation, handleActor, handleCollection, handleInbox, handleObject, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-JaZKIa-g.js";
|
11
|
+
import "../docloader-DllReFU8.js";
|
12
12
|
import "../url-kTAI6_KP.js";
|
13
|
-
import "../semver-
|
14
|
-
import "../client-
|
13
|
+
import "../semver-DWClQt_5.js";
|
14
|
+
import "../client-BWUnWOMm.js";
|
15
15
|
import "../router-D_aVZZUc.js";
|
16
|
-
import "../types-
|
16
|
+
import "../types-C7C_l-jz.js";
|
17
17
|
import "../multibase-DeCHcK8L.js";
|
18
|
-
import { Create, Note, Person } from "../vocab-
|
18
|
+
import { Create, Note, Person } from "../vocab-DjXjRN_-.js";
|
19
19
|
import "../langstr-DbWheeIS.js";
|
20
|
-
import "../lookup-
|
20
|
+
import "../lookup-oJGCqjmn.js";
|
21
21
|
import "../type-D2s5lmbZ.js";
|
22
|
-
import "../actor-
|
23
|
-
import "../key-
|
24
|
-
import { signRequest } from "../http-
|
25
|
-
import "../authdocloader-
|
26
|
-
import "../ld-
|
27
|
-
import "../owner-
|
28
|
-
import "../proof-
|
29
|
-
import "../lookup-
|
30
|
-
import "../inbox-
|
31
|
-
import "../builder-
|
22
|
+
import "../actor-Coq5gJ_S.js";
|
23
|
+
import "../key-CwD3Zzul.js";
|
24
|
+
import { signRequest } from "../http-Ccv35XGv.js";
|
25
|
+
import "../authdocloader-CfmylMQ6.js";
|
26
|
+
import "../ld-B-S8s7zw.js";
|
27
|
+
import "../owner-CyKql97g.js";
|
28
|
+
import "../proof-DBBmxLH9.js";
|
29
|
+
import "../lookup-BC70ikTL.js";
|
30
|
+
import "../inbox-BvI2lUGG.js";
|
31
|
+
import "../builder-BhHMyqfi.js";
|
32
32
|
import "../collection-Dfb0TPno.js";
|
33
|
-
import "../keycache-
|
33
|
+
import "../keycache-DTvMl0Yz.js";
|
34
34
|
import "../retry-BiIhZWgD.js";
|
35
|
-
import "../send-
|
36
|
-
import { test } from "../testing-
|
35
|
+
import "../send-Cx7SQVCT.js";
|
36
|
+
import { test } from "../testing-BZ0dJ4qn.js";
|
37
37
|
import "../std__assert-CHXwj7zk.js";
|
38
38
|
import { assertFalse } from "../assert_rejects-BZjUwo62.js";
|
39
39
|
import "../assert_is_error-jyzqjHud.js";
|
40
40
|
import "../assert_not_equals-wx-SRs4i.js";
|
41
41
|
import "../assert_throws-gBPv3v2V.js";
|
42
42
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
43
|
-
import { createInboxContext, createRequestContext } from "../context-
|
44
|
-
import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-
|
43
|
+
import { createInboxContext, createRequestContext } from "../context-D5oyLaE-.js";
|
44
|
+
import { rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-DJpi5dqk.js";
|
45
45
|
|
46
46
|
//#region federation/handler.test.ts
|
47
47
|
test("acceptsJsonLd()", () => {
|
@@ -4,14 +4,14 @@
|
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
6
|
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
|
-
import "../docloader-
|
7
|
+
import "../docloader-DllReFU8.js";
|
8
8
|
import "../url-kTAI6_KP.js";
|
9
9
|
import "../multibase-DeCHcK8L.js";
|
10
|
-
import { Activity, Create, Invite, Offer, Update } from "../vocab-
|
10
|
+
import { Activity, Create, Invite, Offer, Update } from "../vocab-DjXjRN_-.js";
|
11
11
|
import "../langstr-DbWheeIS.js";
|
12
12
|
import "../type-D2s5lmbZ.js";
|
13
|
-
import { InboxListenerSet } from "../inbox-
|
14
|
-
import { test } from "../testing-
|
13
|
+
import { InboxListenerSet } from "../inbox-BvI2lUGG.js";
|
14
|
+
import { test } from "../testing-BZ0dJ4qn.js";
|
15
15
|
import "../assert_is_error-jyzqjHud.js";
|
16
16
|
import { assertThrows } from "../assert_throws-gBPv3v2V.js";
|
17
17
|
|
@@ -6,14 +6,14 @@
|
|
6
6
|
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
7
|
import { assert } from "../assert-YJk-1DlZ.js";
|
8
8
|
import { assertInstanceOf } from "../assert_instance_of-DBIoG5k7.js";
|
9
|
-
import { MemoryKvStore } from "../kv-
|
10
|
-
import "../docloader-
|
9
|
+
import { MemoryKvStore } from "../kv-BMY6Qf_A.js";
|
10
|
+
import "../docloader-DllReFU8.js";
|
11
11
|
import "../url-kTAI6_KP.js";
|
12
12
|
import "../multibase-DeCHcK8L.js";
|
13
|
-
import { CryptographicKey, Multikey } from "../vocab-
|
13
|
+
import { CryptographicKey, Multikey } from "../vocab-DjXjRN_-.js";
|
14
14
|
import "../langstr-DbWheeIS.js";
|
15
|
-
import { KvKeyCache } from "../keycache-
|
16
|
-
import { test } from "../testing-
|
15
|
+
import { KvKeyCache } from "../keycache-DTvMl0Yz.js";
|
16
|
+
import { test } from "../testing-BZ0dJ4qn.js";
|
17
17
|
|
18
18
|
//#region federation/keycache.test.ts
|
19
19
|
test("KvKeyCache.set()", async () => {
|
@@ -6,8 +6,8 @@
|
|
6
6
|
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
7
|
import "../assert-YJk-1DlZ.js";
|
8
8
|
import "../assert_instance_of-DBIoG5k7.js";
|
9
|
-
import { MemoryKvStore } from "../kv-
|
10
|
-
import { test } from "../testing-
|
9
|
+
import { MemoryKvStore } from "../kv-BMY6Qf_A.js";
|
10
|
+
import { test } from "../testing-BZ0dJ4qn.js";
|
11
11
|
import "../std__assert-CHXwj7zk.js";
|
12
12
|
import "../assert_rejects-BZjUwo62.js";
|
13
13
|
import "../assert_is_error-jyzqjHud.js";
|
@@ -6,42 +6,42 @@
|
|
6
6
|
import { assertEquals } from "../assert_equals-Dnj7ejjL.js";
|
7
7
|
import { assert } from "../assert-YJk-1DlZ.js";
|
8
8
|
import { assertInstanceOf } from "../assert_instance_of-DBIoG5k7.js";
|
9
|
-
import { MemoryKvStore } from "../kv-
|
10
|
-
import { ContextImpl, FederationImpl, InboxContextImpl, createFederation } from "../middleware-
|
11
|
-
import { FetchError, fetchDocumentLoader } from "../docloader-
|
9
|
+
import { MemoryKvStore } from "../kv-BMY6Qf_A.js";
|
10
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "../middleware-JaZKIa-g.js";
|
11
|
+
import { FetchError, fetchDocumentLoader } from "../docloader-DllReFU8.js";
|
12
12
|
import "../url-kTAI6_KP.js";
|
13
|
-
import "../semver-
|
14
|
-
import "../client-
|
13
|
+
import "../semver-DWClQt_5.js";
|
14
|
+
import "../client-BWUnWOMm.js";
|
15
15
|
import { RouterError } from "../router-D_aVZZUc.js";
|
16
|
-
import "../types-
|
16
|
+
import "../types-C7C_l-jz.js";
|
17
17
|
import "../multibase-DeCHcK8L.js";
|
18
|
-
import { Activity, Announce, Create, Invite, Multikey, Note, Object as Object$1, Offer, Person } from "../vocab-
|
18
|
+
import { Activity, Announce, Create, Invite, Multikey, Note, Object as Object$1, Offer, Person } from "../vocab-DjXjRN_-.js";
|
19
19
|
import "../langstr-DbWheeIS.js";
|
20
|
-
import "../lookup-
|
20
|
+
import "../lookup-oJGCqjmn.js";
|
21
21
|
import { getTypeId } from "../type-D2s5lmbZ.js";
|
22
|
-
import "../actor-
|
23
|
-
import "../key-
|
24
|
-
import { signRequest, verifyRequest } from "../http-
|
25
|
-
import { getAuthenticatedDocumentLoader } from "../authdocloader-
|
26
|
-
import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-
|
27
|
-
import { doesActorOwnKey } from "../owner-
|
28
|
-
import { signObject, verifyObject } from "../proof-
|
29
|
-
import { lookupObject } from "../lookup-
|
30
|
-
import "../inbox-
|
31
|
-
import "../builder-
|
22
|
+
import "../actor-Coq5gJ_S.js";
|
23
|
+
import "../key-CwD3Zzul.js";
|
24
|
+
import { signRequest, verifyRequest } from "../http-Ccv35XGv.js";
|
25
|
+
import { getAuthenticatedDocumentLoader } from "../authdocloader-CfmylMQ6.js";
|
26
|
+
import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-B-S8s7zw.js";
|
27
|
+
import { doesActorOwnKey } from "../owner-CyKql97g.js";
|
28
|
+
import { signObject, verifyObject } from "../proof-DBBmxLH9.js";
|
29
|
+
import { lookupObject } from "../lookup-BC70ikTL.js";
|
30
|
+
import "../inbox-BvI2lUGG.js";
|
31
|
+
import "../builder-BhHMyqfi.js";
|
32
32
|
import "../collection-Dfb0TPno.js";
|
33
|
-
import "../keycache-
|
33
|
+
import "../keycache-DTvMl0Yz.js";
|
34
34
|
import "../retry-BiIhZWgD.js";
|
35
|
-
import "../send-
|
36
|
-
import { test } from "../testing-
|
35
|
+
import "../send-Cx7SQVCT.js";
|
36
|
+
import { test } from "../testing-BZ0dJ4qn.js";
|
37
37
|
import { assertStrictEquals } from "../std__assert-CHXwj7zk.js";
|
38
38
|
import { assertFalse, assertRejects } from "../assert_rejects-BZjUwo62.js";
|
39
39
|
import "../assert_is_error-jyzqjHud.js";
|
40
40
|
import { assertNotEquals } from "../assert_not_equals-wx-SRs4i.js";
|
41
41
|
import { assertThrows } from "../assert_throws-gBPv3v2V.js";
|
42
42
|
import { mockDocumentLoader } from "../docloader-09nVWLAZ.js";
|
43
|
-
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-
|
44
|
-
import { esm_default } from "../esm-
|
43
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-DJpi5dqk.js";
|
44
|
+
import { esm_default } from "../esm-CASHO3OR.js";
|
45
45
|
|
46
46
|
//#region testing/fixtures/example.com/person.json
|
47
47
|
var __context$1 = ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"];
|
@@ -933,7 +933,7 @@ test("Federation.setInboxListeners()", async (t) => {
|
|
933
933
|
privateKey: rsaPrivateKey2,
|
934
934
|
publicKey: rsaPublicKey2.publicKey
|
935
935
|
}]);
|
936
|
-
const error = new Error("test");
|
936
|
+
const error = /* @__PURE__ */ new Error("test");
|
937
937
|
const errors = [];
|
938
938
|
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").on(Create, () => {
|
939
939
|
throw error;
|
@@ -1742,5 +1742,42 @@ test("InboxContextImpl.forwardActivity()", async (t) => {
|
|
1742
1742
|
});
|
1743
1743
|
esm_default.hardReset();
|
1744
1744
|
});
|
1745
|
+
test("KvSpecDeterminer", async (t) => {
|
1746
|
+
await t.step("should use default spec when not found in KV", async () => {
|
1747
|
+
const kv = new MemoryKvStore();
|
1748
|
+
const prefix = ["test", "spec"];
|
1749
|
+
const determiner = new KvSpecDeterminer(kv, prefix);
|
1750
|
+
const spec = await determiner.determineSpec("example.com");
|
1751
|
+
assertEquals(spec, "rfc9421");
|
1752
|
+
});
|
1753
|
+
await t.step("should use custom default spec", async () => {
|
1754
|
+
const kv = new MemoryKvStore();
|
1755
|
+
const prefix = ["test", "spec"];
|
1756
|
+
const determiner = new KvSpecDeterminer(kv, prefix, "draft-cavage-http-signatures-12");
|
1757
|
+
const spec = await determiner.determineSpec("example.com");
|
1758
|
+
assertEquals(spec, "draft-cavage-http-signatures-12");
|
1759
|
+
});
|
1760
|
+
await t.step("should remember and retrieve spec from KV", async () => {
|
1761
|
+
const kv = new MemoryKvStore();
|
1762
|
+
const prefix = ["test", "spec"];
|
1763
|
+
const determiner = new KvSpecDeterminer(kv, prefix);
|
1764
|
+
await determiner.rememberSpec("example.com", "draft-cavage-http-signatures-12");
|
1765
|
+
const spec = await determiner.determineSpec("example.com");
|
1766
|
+
assertEquals(spec, "draft-cavage-http-signatures-12");
|
1767
|
+
const defaultSpec = await determiner.determineSpec("other.com");
|
1768
|
+
assertEquals(defaultSpec, "rfc9421");
|
1769
|
+
});
|
1770
|
+
await t.step("should override remembered spec", async () => {
|
1771
|
+
const kv = new MemoryKvStore();
|
1772
|
+
const prefix = ["test", "spec"];
|
1773
|
+
const determiner = new KvSpecDeterminer(kv, prefix);
|
1774
|
+
await determiner.rememberSpec("example.com", "draft-cavage-http-signatures-12");
|
1775
|
+
let spec = await determiner.determineSpec("example.com");
|
1776
|
+
assertEquals(spec, "draft-cavage-http-signatures-12");
|
1777
|
+
await determiner.rememberSpec("example.com", "rfc9421");
|
1778
|
+
spec = await determiner.determineSpec("example.com");
|
1779
|
+
assertEquals(spec, "rfc9421");
|
1780
|
+
});
|
1781
|
+
});
|
1745
1782
|
|
1746
1783
|
//#endregion
|