@fedify/fedify 1.9.9 → 1.9.11
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-DILKT_HU.cjs → actor-BaIbAIQ4.cjs} +187 -187
- package/dist/{actor-DVET8NhO.mjs → actor-BgNoo4Eo.mjs} +1 -1
- package/dist/{actor-MDInzRdc.js → actor-I6MTQt65.js} +187 -187
- package/dist/{authdocloader-hwjRHw8X.cjs → authdocloader-BML29LEF.cjs} +3 -3
- package/dist/{authdocloader-DLvikTbR.mjs → authdocloader-CQRL6xBg.mjs} +3 -3
- package/dist/{authdocloader-DRG9qnz7.js → authdocloader-DGVNFUsJ.js} +3 -3
- package/dist/{builder-DfInnU0K.mjs → builder-B8VNNUzm.mjs} +4 -4
- package/dist/{client-DuRbuCIQ.mjs → client-Cjo9kYUV.mjs} +1 -1
- package/dist/compat/mod.cjs +1 -1
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +3 -3
- package/dist/{context-Cf8s07xm.d.ts → context-CNkTuNIm.d.ts} +48 -6
- package/dist/{context-Crmwowsw.d.cts → context-jX79cwCB.d.cts} +48 -6
- package/dist/{docloader-BZfjD0Xt.cjs → docloader-CB5WT9yk.cjs} +12 -3
- package/dist/{docloader-ivt5xNwJ.js → docloader-XzYOPh6W.js} +12 -3
- package/dist/{esm-D0urVWqo.mjs → esm-Br6fmrGY.mjs} +1 -1
- package/dist/federation/builder.test.mjs +3 -3
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +1361 -45
- package/dist/federation/idempotency.test.mjs +5 -5
- package/dist/federation/inbox.test.mjs +3 -3
- package/dist/federation/keycache.test.mjs +3 -3
- package/dist/federation/kv.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +1586 -82
- package/dist/federation/mod.cjs +2 -2
- package/dist/federation/mod.d.cts +1 -1
- package/dist/federation/mod.d.ts +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +3 -3
- package/dist/federation/retry.test.mjs +2 -2
- package/dist/federation/router.test.mjs +2 -2
- package/dist/federation/send.test.mjs +7 -7
- package/dist/federation/temporal.test.d.mts +2 -0
- package/dist/federation/temporal.test.mjs +71 -0
- package/dist/{http-Dbj7ZT3b.js → http-CXpt61mo.js} +3 -3
- package/dist/{http-CsSHezSz.mjs → http-GSUEBn2H.mjs} +2 -2
- package/dist/{http-8jvVkJos.cjs → http-L4148RPe.cjs} +3 -3
- package/dist/{inbox-D7U8Ysvc.mjs → inbox-DRfIo1Ox.mjs} +7 -4
- package/dist/{key-Bbuzt358.mjs → key-73aMUDcO.mjs} +2 -2
- package/dist/{key-Bg3Rr_bi.mjs → key-CqxBq3-S.mjs} +1 -1
- package/dist/{key-CUorXS6k.cjs → key-D3E68McA.cjs} +2 -2
- package/dist/{key-C2e_Yz1s.js → key-DtaAm2V1.js} +2 -2
- package/dist/{key-Bl8yte5W.cjs → key-Yfx6HgfZ.cjs} +1 -1
- package/dist/{keycache-Dpm1JlAw.mjs → keycache-tpX1dxwp.mjs} +1 -1
- package/dist/{keys-CZlvPl27.mjs → keys-B9pkL0lY.mjs} +1 -1
- package/dist/ld-DqEigU4F.mjs +548 -0
- package/dist/{lookup-BnvWOvmD.cjs → lookup-BK6z2RO5.cjs} +1 -1
- package/dist/{lookup-DhIULso8.mjs → lookup-DA92hMtK.mjs} +1 -1
- package/dist/{lookup-BOFQeNi_.js → lookup-DDOc-i0I.js} +1 -1
- package/dist/{middleware-BD8iV5GL.cjs → middleware-CcRfmHUw.cjs} +404 -78
- package/dist/{middleware-D0zludVl.js → middleware-D72Tt9sq.js} +401 -76
- package/dist/{middleware-BBjNkISH.mjs → middleware-DNRnMI46.mjs} +313 -80
- package/dist/{middleware-TO6qMFz0.cjs → middleware-DfCM9WFN.cjs} +1 -1
- package/dist/{middleware-DauQ1R8p.mjs → middleware-ufTj15Ba.mjs} +1 -1
- package/dist/mod.cjs +10 -10
- package/dist/mod.d.cts +1 -1
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +9 -9
- package/dist/nodeinfo/client.test.mjs +3 -3
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/nodeinfo/mod.cjs +1 -1
- package/dist/nodeinfo/mod.js +1 -1
- package/dist/nodeinfo/semver.test.mjs +1 -1
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/{owner-CAvCysNj.mjs → owner-C7rjJog4.mjs} +3 -3
- package/dist/{proof-2V3jxAdE.cjs → proof-BZb-g5fh.cjs} +347 -5
- package/dist/{proof-C99DO0SE.js → proof-CjgdsMq_.js} +300 -6
- package/dist/{proof-DkUAJViu.mjs → proof-GWFCtXCY.mjs} +2 -2
- package/dist/runtime/authdocloader.test.mjs +6 -6
- package/dist/runtime/docloader.test.mjs +3 -3
- package/dist/runtime/key.test.mjs +3 -3
- package/dist/runtime/langstr.test.mjs +2 -2
- package/dist/runtime/link.test.mjs +2 -2
- package/dist/runtime/mod.cjs +3 -3
- package/dist/runtime/mod.js +3 -3
- package/dist/runtime/multibase/multibase.test.mjs +2 -2
- package/dist/runtime/url.test.mjs +5 -2
- package/dist/{send-BxjL4pnG.mjs → send-B1cXA43r.mjs} +2 -2
- package/dist/sig/http.test.mjs +6 -6
- package/dist/sig/key.test.mjs +4 -4
- package/dist/sig/ld.test.mjs +561 -5
- package/dist/sig/mod.cjs +3 -3
- package/dist/sig/mod.js +3 -3
- package/dist/sig/owner.test.mjs +5 -5
- package/dist/sig/proof.test.mjs +4 -4
- package/dist/temporal-DE-KwUkP.mjs +95 -0
- package/dist/testing/docloader.test.mjs +1 -1
- package/dist/testing/mod.d.mts +48 -6
- package/dist/testing/mod.mjs +1 -1
- package/dist/{testing-eYbMkj5P.mjs → testing-Brx3i-JJ.mjs} +2 -2
- package/dist/{transformers-DW7EyHh4.cjs → transformers-v2GoHgHn.cjs} +1 -1
- package/dist/{types-dHLDn_7H.js → types-CRRb96yX.js} +1 -1
- package/dist/{types-B0U2QC2Q.cjs → types-Ck12MwLI.cjs} +1 -1
- package/dist/vocab/actor.test.mjs +4 -4
- package/dist/vocab/cjs.test.mjs +1 -1
- package/dist/vocab/lookup.test.mjs +4 -4
- package/dist/vocab/mod.cjs +3 -3
- package/dist/vocab/mod.js +3 -3
- package/dist/vocab/type.test.mjs +2 -2
- package/dist/vocab/vocab.test.mjs +3 -3
- package/dist/{vocab-CG-IqKPs.mjs → vocab-D9ewcFHJ.mjs} +197 -188
- package/dist/webfinger/handler.test.mjs +3 -3
- package/dist/webfinger/lookup.test.mjs +3 -3
- package/dist/webfinger/mod.cjs +1 -1
- package/dist/webfinger/mod.js +1 -1
- package/dist/x/cfworkers.cjs +1 -1
- package/dist/x/cfworkers.test.mjs +1 -1
- package/dist/x/hono.cjs +1 -1
- package/dist/x/hono.d.cts +1 -1
- package/dist/x/hono.d.ts +1 -1
- package/dist/x/sveltekit.cjs +1 -1
- package/dist/x/sveltekit.d.cts +1 -1
- package/dist/x/sveltekit.d.ts +1 -1
- package/package.json +1 -1
- package/dist/ld-iU-MUtGB.mjs +0 -254
- /package/dist/{denokv-CoSB_Eps.mjs → denokv-NJPMXyK0.mjs} +0 -0
- /package/dist/{retry-Ddbq3AcK.mjs → retry-B_E3V_Dx.mjs} +0 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { J as getDocumentLoader, U as getTypeId, W as lookupWebFinger, Z as kvCache, a as CollectionPage, b as OrderedCollection, g as Multikey, h as Link, i as Collection, ot as name, s as CryptographicKey, st as version, t as Activity, v as Object$1, x as OrderedCollectionPage } from "./vocab-
|
|
5
|
-
import { i as RouterError, n as traverseCollection, t as lookupObject } from "./lookup-
|
|
6
|
-
import { t as getNodeInfo } from "./client-
|
|
4
|
+
import { J as getDocumentLoader, U as getTypeId, W as lookupWebFinger, Z as kvCache, a as CollectionPage, b as OrderedCollection, g as Multikey, h as Link, i as Collection, ot as name, s as CryptographicKey, st as version, t as Activity, v as Object$1, x as OrderedCollectionPage } from "./vocab-D9ewcFHJ.mjs";
|
|
5
|
+
import { i as RouterError, n as traverseCollection, t as lookupObject } from "./lookup-DA92hMtK.mjs";
|
|
6
|
+
import { t as getNodeInfo } from "./client-Cjo9kYUV.mjs";
|
|
7
7
|
import { t as nodeInfoToJson } from "./types-CAnkAQGM.mjs";
|
|
8
|
-
import "./actor-
|
|
9
|
-
import { a as validateCryptoKey, i as importJwk, t as exportJwk } from "./key-
|
|
10
|
-
import { l as verifyRequest } from "./http-
|
|
11
|
-
import { t as getAuthenticatedDocumentLoader } from "./authdocloader-
|
|
12
|
-
import { a as signJsonLd,
|
|
13
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
14
|
-
import { n as signObject, r as verifyObject } from "./proof-
|
|
15
|
-
import { n as routeActivity } from "./inbox-
|
|
16
|
-
import { t as FederationBuilderImpl } from "./builder-
|
|
8
|
+
import "./actor-BgNoo4Eo.mjs";
|
|
9
|
+
import { a as validateCryptoKey, i as importJwk, t as exportJwk } from "./key-73aMUDcO.mjs";
|
|
10
|
+
import { l as verifyRequest } from "./http-GSUEBn2H.mjs";
|
|
11
|
+
import { t as getAuthenticatedDocumentLoader } from "./authdocloader-CQRL6xBg.mjs";
|
|
12
|
+
import { a as compactJsonLd, c as getNormalizationContextLoader, d as isInvalidUrlTypeError, f as signJsonLd, g as wrapContextLoaderForJsonLd, l as hasSignature, p as verifyCompactJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as isClearlyMalformedContextReference } from "./ld-DqEigU4F.mjs";
|
|
13
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-C7rjJog4.mjs";
|
|
14
|
+
import { n as signObject, r as verifyObject } from "./proof-GWFCtXCY.mjs";
|
|
15
|
+
import { n as routeActivity } from "./inbox-DRfIo1Ox.mjs";
|
|
16
|
+
import { t as FederationBuilderImpl } from "./builder-B8VNNUzm.mjs";
|
|
17
17
|
import { t as buildCollectionSynchronizationHeader } from "./collection-BD6-SZ6O.mjs";
|
|
18
|
-
import { t as KvKeyCache } from "./keycache-
|
|
19
|
-
import { t as
|
|
20
|
-
import {
|
|
18
|
+
import { t as KvKeyCache } from "./keycache-tpX1dxwp.mjs";
|
|
19
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-DE-KwUkP.mjs";
|
|
20
|
+
import { t as createExponentialBackoffPolicy } from "./retry-B_E3V_Dx.mjs";
|
|
21
|
+
import { n as sendActivity, t as extractInboxes } from "./send-B1cXA43r.mjs";
|
|
21
22
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
22
23
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
23
24
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
@@ -337,6 +338,33 @@ function preferredMediaTypes(accept) {
|
|
|
337
338
|
}
|
|
338
339
|
//#endregion
|
|
339
340
|
//#region src/federation/handler.ts
|
|
341
|
+
const rawInboxContextFactorySymbol = Symbol("fedify.rawInboxContextFactory");
|
|
342
|
+
function isRemoteContextLoadingFailure$1(error) {
|
|
343
|
+
return error instanceof Error && typeof error.details === "object" && error.details != null && error.details.code === "loading remote context failed";
|
|
344
|
+
}
|
|
345
|
+
function isPermanentRemoteContextError$1(error) {
|
|
346
|
+
if (!(error instanceof Error) || error.name !== "jsonld.InvalidUrl") return false;
|
|
347
|
+
const details = error.details;
|
|
348
|
+
if (details?.code === "invalid remote context") return true;
|
|
349
|
+
return isRemoteContextLoadingFailure$1(error) && typeof details?.url === "string" && !URL.canParse(details.url) && isClearlyMalformedContextReference(details.url);
|
|
350
|
+
}
|
|
351
|
+
function isInvalidJsonLdError(error) {
|
|
352
|
+
if (!(error instanceof Error)) return false;
|
|
353
|
+
const name = error.name;
|
|
354
|
+
return name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError$1(error) || name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure$1(error);
|
|
355
|
+
}
|
|
356
|
+
function isValidationTypeError(error) {
|
|
357
|
+
return error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:)/.test(error.message) || isInvalidUrlTypeError(error));
|
|
358
|
+
}
|
|
359
|
+
function isPermanentActivityParseError(error) {
|
|
360
|
+
return isInvalidJsonLdError(error) || isValidationTypeError(error);
|
|
361
|
+
}
|
|
362
|
+
function hasHttpSignatureHeaders(request) {
|
|
363
|
+
return request.headers.has("Signature") || request.headers.has("Signature-Input");
|
|
364
|
+
}
|
|
365
|
+
function hasObjectIntegrityProof(json) {
|
|
366
|
+
return typeof json === "object" && json != null && "proof" in json;
|
|
367
|
+
}
|
|
340
368
|
function acceptsJsonLd(request) {
|
|
341
369
|
const accept = request.headers.get("Accept");
|
|
342
370
|
const types = accept ? preferredMediaTypes(accept) : ["*/*"];
|
|
@@ -720,35 +748,120 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
720
748
|
});
|
|
721
749
|
}
|
|
722
750
|
const keyCache = new KvKeyCache(kv, kvPrefixes.publicKey, ctx);
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
751
|
+
const jsonWithoutSig = detachSignature(json);
|
|
752
|
+
const hasLdSignature = hasSignature(json);
|
|
753
|
+
const canAttemptAlternateAuthAfterLdSignatureFailure = skipSignatureVerification || hasHttpSignatureHeaders(request) || hasObjectIntegrityProof(jsonWithoutSig);
|
|
754
|
+
let deferredLdSignatureError = void 0;
|
|
755
|
+
const respondInvalidActivity = async (error) => {
|
|
756
|
+
logger.error("Failed to parse activity:\n{error}", {
|
|
757
|
+
recipient,
|
|
758
|
+
activity: json,
|
|
759
|
+
error
|
|
730
760
|
});
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
761
|
+
try {
|
|
762
|
+
await inboxErrorHandler?.(ctx, error);
|
|
763
|
+
} catch (error) {
|
|
764
|
+
logger.error("An unexpected error occurred in inbox error handler:\n{error}", {
|
|
765
|
+
error,
|
|
766
|
+
activity: json,
|
|
767
|
+
recipient
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
span.setStatus({
|
|
771
|
+
code: SpanStatusCode.ERROR,
|
|
772
|
+
message: `Failed to parse activity:\n${error}`
|
|
773
|
+
});
|
|
774
|
+
return new Response("Invalid activity.", {
|
|
775
|
+
status: 400,
|
|
776
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
777
|
+
});
|
|
778
|
+
};
|
|
779
|
+
let compactedJson = json;
|
|
780
|
+
let compactedJsonWithoutSig = jsonWithoutSig;
|
|
781
|
+
let ldSigVerified = false;
|
|
782
|
+
if (hasLdSignature) {
|
|
783
|
+
try {
|
|
784
|
+
compactedJson = await compactJsonLd(json, ctx.contextLoader);
|
|
785
|
+
} catch (error) {
|
|
786
|
+
if (isInvalidJsonLdError(error)) {
|
|
787
|
+
logger.error("Failed to parse JSON-LD:\n{error}", {
|
|
788
|
+
recipient,
|
|
789
|
+
error
|
|
790
|
+
});
|
|
791
|
+
return new Response("Invalid JSON-LD.", {
|
|
792
|
+
status: 400,
|
|
793
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
if (!canAttemptAlternateAuthAfterLdSignatureFailure) throw error;
|
|
797
|
+
if (!skipSignatureVerification) deferredLdSignatureError = error;
|
|
798
|
+
logger.debug("Failed to normalize JSON-LD for Linked Data Signatures; deferring to another authentication path only if it verifies:\n{error}", {
|
|
734
799
|
recipient,
|
|
735
800
|
error
|
|
736
801
|
});
|
|
737
|
-
return new Response("Invalid JSON-LD.", {
|
|
738
|
-
status: 400,
|
|
739
|
-
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
740
|
-
});
|
|
741
802
|
}
|
|
742
|
-
|
|
803
|
+
if (compactedJson !== json) {
|
|
804
|
+
compactedJsonWithoutSig = detachSignature(compactedJson);
|
|
805
|
+
try {
|
|
806
|
+
ldSigVerified = await verifyCompactJsonLd(compactedJson, {
|
|
807
|
+
contextLoader: ctx.contextLoader,
|
|
808
|
+
documentLoader: ctx.documentLoader,
|
|
809
|
+
keyCache,
|
|
810
|
+
tracerProvider
|
|
811
|
+
});
|
|
812
|
+
} catch (error) {
|
|
813
|
+
if (error instanceof RangeError && await hasMalformedKnownTemporalLiteral(compactedJsonWithoutSig, ctx.contextLoader)) return await respondInvalidActivity(error);
|
|
814
|
+
if (isInvalidJsonLdError(error)) {
|
|
815
|
+
logger.error("Failed to parse JSON-LD:\n{error}", {
|
|
816
|
+
recipient,
|
|
817
|
+
error
|
|
818
|
+
});
|
|
819
|
+
return new Response("Invalid JSON-LD.", {
|
|
820
|
+
status: 400,
|
|
821
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
if (!canAttemptAlternateAuthAfterLdSignatureFailure) throw error;
|
|
825
|
+
if (!skipSignatureVerification) try {
|
|
826
|
+
await Object$1.fromJsonLd(compactedJson, {
|
|
827
|
+
contextLoader: getNormalizationContextLoader(ctx.contextLoader),
|
|
828
|
+
documentLoader: ctx.documentLoader,
|
|
829
|
+
tracerProvider
|
|
830
|
+
});
|
|
831
|
+
} catch (parseError) {
|
|
832
|
+
if (parseError instanceof RangeError && await hasMalformedKnownTemporalLiteral(compactedJsonWithoutSig, ctx.contextLoader)) return await respondInvalidActivity(parseError);
|
|
833
|
+
if (isInvalidJsonLdError(parseError)) {
|
|
834
|
+
logger.error("Failed to parse JSON-LD:\n{error}", {
|
|
835
|
+
recipient,
|
|
836
|
+
error: parseError
|
|
837
|
+
});
|
|
838
|
+
return new Response("Invalid JSON-LD.", {
|
|
839
|
+
status: 400,
|
|
840
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
deferredLdSignatureError = parseError;
|
|
844
|
+
}
|
|
845
|
+
ldSigVerified = false;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
743
848
|
}
|
|
744
|
-
const jsonWithoutSig = detachSignature(json);
|
|
745
849
|
let activity = null;
|
|
746
850
|
if (ldSigVerified) {
|
|
747
851
|
logger.debug("Linked Data Signatures are verified.", {
|
|
748
852
|
recipient,
|
|
749
853
|
json
|
|
750
854
|
});
|
|
751
|
-
|
|
855
|
+
try {
|
|
856
|
+
activity = await Activity.fromJsonLd(compactedJsonWithoutSig, {
|
|
857
|
+
...ctx,
|
|
858
|
+
contextLoader: getNormalizationContextLoader(ctx.contextLoader)
|
|
859
|
+
});
|
|
860
|
+
} catch (error) {
|
|
861
|
+
if (error instanceof RangeError && await hasMalformedKnownTemporalLiteral(compactedJsonWithoutSig, ctx.contextLoader)) return await respondInvalidActivity(error);
|
|
862
|
+
if (!isPermanentActivityParseError(error)) throw error;
|
|
863
|
+
return await respondInvalidActivity(error);
|
|
864
|
+
}
|
|
752
865
|
} else {
|
|
753
866
|
logger.debug("Linked Data Signatures are not verified.", {
|
|
754
867
|
recipient,
|
|
@@ -756,12 +869,21 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
756
869
|
});
|
|
757
870
|
try {
|
|
758
871
|
activity = await verifyObject(Activity, jsonWithoutSig, {
|
|
759
|
-
contextLoader: ctx.contextLoader,
|
|
872
|
+
contextLoader: wrapContextLoaderForJsonLd(ctx.contextLoader),
|
|
760
873
|
documentLoader: ctx.documentLoader,
|
|
761
874
|
keyCache,
|
|
762
875
|
tracerProvider
|
|
763
876
|
});
|
|
764
877
|
} catch (error) {
|
|
878
|
+
if (error instanceof RangeError && await hasMalformedKnownTemporalLiteral(jsonWithoutSig, ctx.contextLoader)) return await respondInvalidActivity(error);
|
|
879
|
+
if (deferredLdSignatureError != null) {
|
|
880
|
+
logger.debug("Object Integrity Proof fallback did not supersede a deferred Linked Data Signature failure:\n{error}", {
|
|
881
|
+
recipient,
|
|
882
|
+
error
|
|
883
|
+
});
|
|
884
|
+
activity = null;
|
|
885
|
+
}
|
|
886
|
+
if (!isPermanentActivityParseError(error)) throw error;
|
|
765
887
|
logger.error("Failed to parse activity:\n{error}", {
|
|
766
888
|
recipient,
|
|
767
889
|
activity: json,
|
|
@@ -805,6 +927,7 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
805
927
|
tracerProvider
|
|
806
928
|
});
|
|
807
929
|
if (key == null) {
|
|
930
|
+
if (deferredLdSignatureError != null) throw deferredLdSignatureError;
|
|
808
931
|
logger.error("Failed to verify the request's HTTP Signatures.", { recipient });
|
|
809
932
|
span.setStatus({
|
|
810
933
|
code: SpanStatusCode.ERROR,
|
|
@@ -817,11 +940,20 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
817
940
|
} else logger.debug("HTTP Signatures are verified.", { recipient });
|
|
818
941
|
httpSigKey = key;
|
|
819
942
|
}
|
|
820
|
-
|
|
943
|
+
try {
|
|
944
|
+
activity = await Activity.fromJsonLd(jsonWithoutSig, {
|
|
945
|
+
...ctx,
|
|
946
|
+
contextLoader: wrapContextLoaderForJsonLd(ctx.contextLoader)
|
|
947
|
+
});
|
|
948
|
+
} catch (error) {
|
|
949
|
+
if (!isPermanentActivityParseError(error)) throw error;
|
|
950
|
+
return await respondInvalidActivity(error);
|
|
951
|
+
}
|
|
821
952
|
}
|
|
822
953
|
if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
|
|
823
954
|
span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
|
|
824
955
|
if (httpSigKey != null && !await doesActorOwnKey(activity, httpSigKey, ctx)) {
|
|
956
|
+
if (deferredLdSignatureError != null) throw deferredLdSignatureError;
|
|
825
957
|
logger.error("The signer ({keyId}) and the actor ({actorId}) do not match.", {
|
|
826
958
|
activity: json,
|
|
827
959
|
recipient,
|
|
@@ -840,10 +972,14 @@ async function handleInboxInternal(request, parameters, span) {
|
|
|
840
972
|
const routeResult = await routeActivity({
|
|
841
973
|
context: ctx,
|
|
842
974
|
json,
|
|
975
|
+
originalJson: json,
|
|
976
|
+
normalizedActivity: hasLdSignature && compactedJson !== json ? compactedJson : void 0,
|
|
977
|
+
ldSignatureVerified: hasLdSignature ? ldSigVerified : void 0,
|
|
843
978
|
activity,
|
|
844
979
|
recipient,
|
|
845
980
|
inboxListeners,
|
|
846
981
|
inboxContextFactory,
|
|
982
|
+
listenerInboxContextFactory: ldSigVerified ? inboxContextFactory[rawInboxContextFactorySymbol] : void 0,
|
|
847
983
|
inboxErrorHandler,
|
|
848
984
|
kv,
|
|
849
985
|
kvPrefixes,
|
|
@@ -1343,6 +1479,18 @@ async function respondWithObjectIfAcceptable(object, request, options) {
|
|
|
1343
1479
|
}
|
|
1344
1480
|
//#endregion
|
|
1345
1481
|
//#region src/federation/middleware.ts
|
|
1482
|
+
function isRemoteContextLoadingFailure(error) {
|
|
1483
|
+
return error instanceof Error && typeof error.details === "object" && error.details != null && error.details.code === "loading remote context failed";
|
|
1484
|
+
}
|
|
1485
|
+
function isPermanentRemoteContextError(error) {
|
|
1486
|
+
if (!(error instanceof Error) || error.name !== "jsonld.InvalidUrl") return false;
|
|
1487
|
+
const details = error.details;
|
|
1488
|
+
if (details?.code === "invalid remote context") return true;
|
|
1489
|
+
return isRemoteContextLoadingFailure(error) && typeof details?.url === "string" && !URL.canParse(details.url) && isClearlyMalformedContextReference(details.url);
|
|
1490
|
+
}
|
|
1491
|
+
function isPermanentInboxParseError(error) {
|
|
1492
|
+
return error instanceof Error && (error.name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError(error) || error.name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure(error)) || error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:)/.test(error.message) || isInvalidUrlTypeError(error));
|
|
1493
|
+
}
|
|
1346
1494
|
/**
|
|
1347
1495
|
* Create a new {@link Federation} instance.
|
|
1348
1496
|
* @param parameters Parameters for initializing the instance.
|
|
@@ -1674,7 +1822,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1674
1822
|
}
|
|
1675
1823
|
logger.info("Successfully sent activity {activityId} to {inbox}.", { ...logData });
|
|
1676
1824
|
}
|
|
1677
|
-
async #listenInboxMessage(ctxData, message,
|
|
1825
|
+
async #listenInboxMessage(ctxData, message, _span) {
|
|
1678
1826
|
const logger = getLogger([
|
|
1679
1827
|
"fedify",
|
|
1680
1828
|
"federation",
|
|
@@ -1687,60 +1835,28 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1687
1835
|
const identity = await this.sharedInboxKeyDispatcher(context);
|
|
1688
1836
|
if (identity != null) context = this.#createContext(baseUrl, ctxData, { documentLoader: "identifier" in identity || "username" in identity || "handle" in identity ? await context.getDocumentLoader(identity) : context.getDocumentLoader(identity) });
|
|
1689
1837
|
}
|
|
1690
|
-
const activity = await Activity.fromJsonLd(message.activity, context);
|
|
1691
|
-
span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
|
|
1692
|
-
if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
|
|
1693
|
-
const cacheKey = activity.id == null ? null : [
|
|
1694
|
-
...this.kvPrefixes.activityIdempotence,
|
|
1695
|
-
context.origin,
|
|
1696
|
-
activity.id.href
|
|
1697
|
-
];
|
|
1698
|
-
if (cacheKey != null) {
|
|
1699
|
-
if (await this.kv.get(cacheKey) === true) {
|
|
1700
|
-
logger.debug("Activity {activityId} has already been processed.", {
|
|
1701
|
-
activityId: activity.id?.href,
|
|
1702
|
-
activity: message.activity,
|
|
1703
|
-
recipient: message.identifier
|
|
1704
|
-
});
|
|
1705
|
-
return;
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
1838
|
await this._getTracer().startActiveSpan("activitypub.dispatch_inbox_listener", { kind: SpanKind.INTERNAL }, async (span) => {
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
activityId: activity.id?.href,
|
|
1713
|
-
activity: message.activity,
|
|
1714
|
-
recipient: message.identifier,
|
|
1715
|
-
trial: message.attempt
|
|
1716
|
-
});
|
|
1717
|
-
span.setStatus({
|
|
1718
|
-
code: SpanStatusCode.ERROR,
|
|
1719
|
-
message: `Unsupported activity type: ${getTypeId(activity).href}`
|
|
1720
|
-
});
|
|
1721
|
-
span.end();
|
|
1722
|
-
return;
|
|
1723
|
-
}
|
|
1724
|
-
const { class: cls, listener } = dispatched;
|
|
1725
|
-
span.updateName(`activitypub.dispatch_inbox_listener ${cls.name}`);
|
|
1726
|
-
try {
|
|
1727
|
-
await listener(context.toInboxContext(message.identifier, message.activity, activity.id?.href, getTypeId(activity).href), activity);
|
|
1728
|
-
} catch (error) {
|
|
1839
|
+
let activity = null;
|
|
1840
|
+
let cacheKey = null;
|
|
1841
|
+
const reportInboxError = async (error) => {
|
|
1729
1842
|
try {
|
|
1730
1843
|
await this.inboxErrorHandler?.(context, error);
|
|
1731
1844
|
} catch (error) {
|
|
1732
1845
|
logger.error("An unexpected error occurred in inbox error handler:\n{error}", {
|
|
1733
1846
|
error,
|
|
1734
1847
|
trial: message.attempt,
|
|
1735
|
-
activityId: activity
|
|
1848
|
+
activityId: activity?.id?.href,
|
|
1736
1849
|
activity: message.activity,
|
|
1737
1850
|
recipient: message.identifier
|
|
1738
1851
|
});
|
|
1739
1852
|
}
|
|
1853
|
+
};
|
|
1854
|
+
const handleRetriableFailure = async (error) => {
|
|
1855
|
+
await reportInboxError(error);
|
|
1740
1856
|
if (this.inboxQueue?.nativeRetrial) {
|
|
1741
1857
|
logger.error("Failed to process the incoming activity {activityId}; backend will handle retry:\n{error}", {
|
|
1742
1858
|
error,
|
|
1743
|
-
activityId: activity
|
|
1859
|
+
activityId: activity?.id?.href,
|
|
1744
1860
|
activity: message.activity,
|
|
1745
1861
|
recipient: message.identifier
|
|
1746
1862
|
});
|
|
@@ -1759,17 +1875,25 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1759
1875
|
logger.error("Failed to process the incoming activity {activityId} (attempt #{attempt}); retry...:\n{error}", {
|
|
1760
1876
|
error,
|
|
1761
1877
|
attempt: message.attempt,
|
|
1762
|
-
activityId: activity
|
|
1878
|
+
activityId: activity?.id?.href,
|
|
1763
1879
|
activity: message.activity,
|
|
1764
1880
|
recipient: message.identifier
|
|
1765
1881
|
});
|
|
1882
|
+
if (this.inboxQueue == null) {
|
|
1883
|
+
span.setStatus({
|
|
1884
|
+
code: SpanStatusCode.ERROR,
|
|
1885
|
+
message: String(error)
|
|
1886
|
+
});
|
|
1887
|
+
span.end();
|
|
1888
|
+
throw error;
|
|
1889
|
+
}
|
|
1766
1890
|
await this.inboxQueue?.enqueue({
|
|
1767
1891
|
...message,
|
|
1768
1892
|
attempt: message.attempt + 1
|
|
1769
1893
|
}, { delay: Temporal.Duration.compare(delay, { seconds: 0 }) < 0 ? Temporal.Duration.from({ seconds: 0 }) : delay });
|
|
1770
1894
|
} else logger.error("Failed to process the incoming activity {activityId} after {trial} attempts; giving up:\n{error}", {
|
|
1771
1895
|
error,
|
|
1772
|
-
activityId: activity
|
|
1896
|
+
activityId: activity?.id?.href,
|
|
1773
1897
|
activity: message.activity,
|
|
1774
1898
|
recipient: message.identifier
|
|
1775
1899
|
});
|
|
@@ -1778,11 +1902,108 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
1778
1902
|
message: String(error)
|
|
1779
1903
|
});
|
|
1780
1904
|
span.end();
|
|
1905
|
+
};
|
|
1906
|
+
let dispatched;
|
|
1907
|
+
let parseInput = void 0;
|
|
1908
|
+
let parseContextLoader = context.contextLoader;
|
|
1909
|
+
try {
|
|
1910
|
+
const hasSignatureField = hasSignature(message.activity);
|
|
1911
|
+
const shouldParseFromNormalizedSignedPayload = message.ldSignatureVerified === true || message.normalizedActivity != null || message.ldSignatureVerified == null && hasSignatureField;
|
|
1912
|
+
const parseContext = hasSignatureField ? {
|
|
1913
|
+
...context,
|
|
1914
|
+
contextLoader: getNormalizationContextLoader(context.contextLoader)
|
|
1915
|
+
} : {
|
|
1916
|
+
...context,
|
|
1917
|
+
contextLoader: wrapContextLoaderForJsonLd(context.contextLoader)
|
|
1918
|
+
};
|
|
1919
|
+
parseContextLoader = parseContext.contextLoader;
|
|
1920
|
+
let normalizedActivity;
|
|
1921
|
+
if (shouldParseFromNormalizedSignedPayload) {
|
|
1922
|
+
normalizedActivity = message.normalizedActivity ?? await compactJsonLd(message.activity, context.contextLoader);
|
|
1923
|
+
assertSafeJsonLd(normalizedActivity);
|
|
1924
|
+
}
|
|
1925
|
+
parseInput = shouldParseFromNormalizedSignedPayload ? detachSignature(normalizedActivity) : hasSignatureField ? detachSignature(message.activity) : message.activity;
|
|
1926
|
+
activity = await Activity.fromJsonLd(parseInput, parseContext);
|
|
1927
|
+
span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
|
|
1928
|
+
if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
|
|
1929
|
+
cacheKey = activity.id == null ? null : [
|
|
1930
|
+
...this.kvPrefixes.activityIdempotence,
|
|
1931
|
+
context.origin,
|
|
1932
|
+
activity.id.href
|
|
1933
|
+
];
|
|
1934
|
+
if (cacheKey != null) {
|
|
1935
|
+
if (await this.kv.get(cacheKey) === true) {
|
|
1936
|
+
logger.debug("Activity {activityId} has already been processed.", {
|
|
1937
|
+
activityId: activity.id?.href,
|
|
1938
|
+
activity: message.activity,
|
|
1939
|
+
recipient: message.identifier
|
|
1940
|
+
});
|
|
1941
|
+
span.end();
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
dispatched = this.inboxListeners?.dispatchWithClass(activity);
|
|
1946
|
+
} catch (error) {
|
|
1947
|
+
if (activity == null && error instanceof RangeError && await hasMalformedKnownTemporalLiteral(parseInput, parseContextLoader)) {
|
|
1948
|
+
await reportInboxError(error);
|
|
1949
|
+
logger.error("Failed to parse the queued incoming activity {activityId}:\n{error}", {
|
|
1950
|
+
error,
|
|
1951
|
+
trial: message.attempt,
|
|
1952
|
+
activityId: null,
|
|
1953
|
+
activity: message.activity,
|
|
1954
|
+
recipient: message.identifier
|
|
1955
|
+
});
|
|
1956
|
+
span.setStatus({
|
|
1957
|
+
code: SpanStatusCode.ERROR,
|
|
1958
|
+
message: String(error)
|
|
1959
|
+
});
|
|
1960
|
+
span.end();
|
|
1961
|
+
return;
|
|
1962
|
+
}
|
|
1963
|
+
if (isPermanentInboxParseError(error)) {
|
|
1964
|
+
await reportInboxError(error);
|
|
1965
|
+
logger.error("Failed to parse the queued incoming activity {activityId}:\n{error}", {
|
|
1966
|
+
error,
|
|
1967
|
+
trial: message.attempt,
|
|
1968
|
+
activityId: activity?.id?.href,
|
|
1969
|
+
activity: message.activity,
|
|
1970
|
+
recipient: message.identifier
|
|
1971
|
+
});
|
|
1972
|
+
span.setStatus({
|
|
1973
|
+
code: SpanStatusCode.ERROR,
|
|
1974
|
+
message: String(error)
|
|
1975
|
+
});
|
|
1976
|
+
span.end();
|
|
1977
|
+
return;
|
|
1978
|
+
}
|
|
1979
|
+
await handleRetriableFailure(error);
|
|
1980
|
+
return;
|
|
1981
|
+
}
|
|
1982
|
+
if (dispatched == null) {
|
|
1983
|
+
logger.error("Unsupported activity type:\n{activity}", {
|
|
1984
|
+
activityId: activity.id?.href,
|
|
1985
|
+
activity: message.activity,
|
|
1986
|
+
recipient: message.identifier,
|
|
1987
|
+
trial: message.attempt
|
|
1988
|
+
});
|
|
1989
|
+
span.setStatus({
|
|
1990
|
+
code: SpanStatusCode.ERROR,
|
|
1991
|
+
message: `Unsupported activity type: ${getTypeId(activity).href}`
|
|
1992
|
+
});
|
|
1993
|
+
span.end();
|
|
1994
|
+
return;
|
|
1995
|
+
}
|
|
1996
|
+
const { class: cls, listener } = dispatched;
|
|
1997
|
+
span.updateName(`activitypub.dispatch_inbox_listener ${cls.name}`);
|
|
1998
|
+
try {
|
|
1999
|
+
await listener(context.toInboxContext(message.identifier, message.activity, activity.id?.href, getTypeId(activity).href), activity);
|
|
2000
|
+
} catch (error) {
|
|
2001
|
+
await handleRetriableFailure(error);
|
|
1781
2002
|
return;
|
|
1782
2003
|
}
|
|
1783
2004
|
if (cacheKey != null) await this.kv.set(cacheKey, true, { ttl: Temporal.Duration.from({ days: 1 }) });
|
|
1784
2005
|
logger.info("Activity {activityId} has been processed.", {
|
|
1785
|
-
activityId: activity
|
|
2006
|
+
activityId: activity?.id?.href,
|
|
1786
2007
|
activity: message.activity,
|
|
1787
2008
|
recipient: message.identifier
|
|
1788
2009
|
});
|
|
@@ -2104,16 +2325,18 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2104
2325
|
onNotAcceptable
|
|
2105
2326
|
});
|
|
2106
2327
|
context = this.#createContext(request, contextData, { documentLoader: await context.getDocumentLoader({ identifier: route.values.identifier ?? route.values.handle }) });
|
|
2107
|
-
case "sharedInbox":
|
|
2328
|
+
case "sharedInbox": {
|
|
2108
2329
|
if (routeName !== "inbox" && this.sharedInboxKeyDispatcher != null) {
|
|
2109
2330
|
const identity = await this.sharedInboxKeyDispatcher(context);
|
|
2110
2331
|
if (identity != null) context = this.#createContext(request, contextData, { documentLoader: "identifier" in identity || "username" in identity || "handle" in identity ? await context.getDocumentLoader(identity) : context.getDocumentLoader(identity) });
|
|
2111
2332
|
}
|
|
2112
2333
|
if (!this.manuallyStartQueue) this._startQueueInternal(contextData);
|
|
2334
|
+
const inboxContextFactory = context.toInboxContext.bind(context);
|
|
2335
|
+
inboxContextFactory[rawInboxContextFactorySymbol] = context.toInboxContext.bind(context);
|
|
2113
2336
|
return await handleInbox(request, {
|
|
2114
2337
|
recipient: route.values.identifier ?? route.values.handle ?? null,
|
|
2115
2338
|
context,
|
|
2116
|
-
inboxContextFactory
|
|
2339
|
+
inboxContextFactory,
|
|
2117
2340
|
kv: this.kv,
|
|
2118
2341
|
kvPrefixes: this.kvPrefixes,
|
|
2119
2342
|
queue: this.inboxQueue,
|
|
@@ -2126,6 +2349,7 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
2126
2349
|
tracerProvider: this.tracerProvider,
|
|
2127
2350
|
idempotencyStrategy: this.idempotencyStrategy
|
|
2128
2351
|
});
|
|
2352
|
+
}
|
|
2129
2353
|
case "following": return await handleCollection(request, {
|
|
2130
2354
|
name: "following",
|
|
2131
2355
|
identifier: route.values.identifier ?? route.values.handle,
|
|
@@ -2876,6 +3100,7 @@ var ContextImpl = class ContextImpl {
|
|
|
2876
3100
|
const routeResult = await routeActivity({
|
|
2877
3101
|
context: this,
|
|
2878
3102
|
json,
|
|
3103
|
+
ldSignatureVerified: false,
|
|
2879
3104
|
activity,
|
|
2880
3105
|
recipient,
|
|
2881
3106
|
inboxListeners: this.federation.inboxListeners,
|
|
@@ -2974,6 +3199,14 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
|
|
|
2974
3199
|
};
|
|
2975
3200
|
var InboxContextImpl = class InboxContextImpl extends ContextImpl {
|
|
2976
3201
|
recipient;
|
|
3202
|
+
/**
|
|
3203
|
+
* The original received activity payload.
|
|
3204
|
+
*
|
|
3205
|
+
* Fedify may normalize a Linked Data Signature payload internally for safe
|
|
3206
|
+
* parsing, but forwarding must keep the sender's payload unchanged so
|
|
3207
|
+
* third-party signatures/proofs remain intact.
|
|
3208
|
+
* @internal
|
|
3209
|
+
*/
|
|
2977
3210
|
activity;
|
|
2978
3211
|
activityId;
|
|
2979
3212
|
activityType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
-
const require_middleware = require("./middleware-
|
|
3
|
+
const require_middleware = require("./middleware-CcRfmHUw.cjs");
|
|
4
4
|
exports.FederationImpl = require_middleware.FederationImpl;
|
package/dist/mod.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_docloader = require("./docloader-
|
|
5
|
-
const require_transformers = require("./transformers-
|
|
4
|
+
const require_docloader = require("./docloader-CB5WT9yk.cjs");
|
|
5
|
+
const require_transformers = require("./transformers-v2GoHgHn.cjs");
|
|
6
6
|
require("./compat/mod.cjs");
|
|
7
|
-
const require_actor = require("./actor-
|
|
8
|
-
const require_middleware = require("./middleware-
|
|
9
|
-
const require_lookup = require("./lookup-
|
|
10
|
-
const require_key = require("./key-
|
|
11
|
-
const require_http = require("./http-
|
|
12
|
-
const require_proof = require("./proof-
|
|
13
|
-
const require_types = require("./types-
|
|
14
|
-
const require_authdocloader = require("./authdocloader-
|
|
7
|
+
const require_actor = require("./actor-BaIbAIQ4.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-CcRfmHUw.cjs");
|
|
9
|
+
const require_lookup = require("./lookup-BK6z2RO5.cjs");
|
|
10
|
+
const require_key = require("./key-D3E68McA.cjs");
|
|
11
|
+
const require_http = require("./http-L4148RPe.cjs");
|
|
12
|
+
const require_proof = require("./proof-BZb-g5fh.cjs");
|
|
13
|
+
const require_types = require("./types-Ck12MwLI.cjs");
|
|
14
|
+
const require_authdocloader = require("./authdocloader-BML29LEF.cjs");
|
|
15
15
|
const require_vocab_mod = require("./vocab/mod.cjs");
|
|
16
16
|
const require_federation_mod = require("./federation/mod.cjs");
|
|
17
17
|
require("./nodeinfo/mod.cjs");
|
package/dist/mod.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryp
|
|
|
7
7
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-_rFs0ik_.cjs";
|
|
8
8
|
import { a as toAcctUrl, c as TraverseCollectionOptions, i as parseFediverseHandle, l as lookupObject, n as FediverseHandle, o as PUBLIC_COLLECTION, r as isFediverseHandle, s as LookupObjectOptions, t as getTypeId, u as traverseCollection } from "./mod-HElaq2UB.cjs";
|
|
9
9
|
import { i as ResourceDescriptor, n as lookupWebFinger } from "./mod-DIMx6YjJ.cjs";
|
|
10
|
-
import { $ as CustomCollectionCursor, A as createFederation, B as RouterRouteResult, C as InboxListenerSetters, D as FederationKvPrefixes, E as CreateFederationOptions, F as Message, G as ActorDispatcher, H as respondWithObject, I as createFederationBuilder, J as AuthorizePredicate, K as ActorHandleMapper, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as CustomCollectionCounter, R as RouterError, S as IdempotencyStrategy, T as Rfc6570Expression, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as FederationBuilder, a as InboxContext, at as ObjectDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as WebFingerLinksDispatcher, d as ActorCallbackSetters, dt as buildCollectionSynchronizationHeader, et as CustomCollectionDispatcher, f as CollectionCallbackSetters, ft as digest, g as Federation, h as Federatable, i as GetSignedKeyOptions, it as ObjectAuthorizePredicate, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as SenderKeyPair, m as CustomCollectionCallbackSetters, n as Context, nt as InboxListener, o as ParseUriResult, ot as OutboxErrorHandler, p as ConstructorWithTypeId, pt as ActivityTransformer, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as RequestContext, st as SharedInboxKeyDispatcher, t as ActorKeyPair, tt as InboxErrorHandler, u as SendActivityOptionsForCollection, ut as PageItems, v as FederationFetchOptions, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, z as RouterOptions } from "./context-
|
|
10
|
+
import { $ as CustomCollectionCursor, A as createFederation, B as RouterRouteResult, C as InboxListenerSetters, D as FederationKvPrefixes, E as CreateFederationOptions, F as Message, G as ActorDispatcher, H as respondWithObject, I as createFederationBuilder, J as AuthorizePredicate, K as ActorHandleMapper, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as CustomCollectionCounter, R as RouterError, S as IdempotencyStrategy, T as Rfc6570Expression, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as FederationBuilder, a as InboxContext, at as ObjectDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as WebFingerLinksDispatcher, d as ActorCallbackSetters, dt as buildCollectionSynchronizationHeader, et as CustomCollectionDispatcher, f as CollectionCallbackSetters, ft as digest, g as Federation, h as Federatable, i as GetSignedKeyOptions, it as ObjectAuthorizePredicate, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as SenderKeyPair, m as CustomCollectionCallbackSetters, n as Context, nt as InboxListener, o as ParseUriResult, ot as OutboxErrorHandler, p as ConstructorWithTypeId, pt as ActivityTransformer, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as RequestContext, st as SharedInboxKeyDispatcher, t as ActorKeyPair, tt as InboxErrorHandler, u as SendActivityOptionsForCollection, ut as PageItems, v as FederationFetchOptions, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, z as RouterOptions } from "./context-jX79cwCB.cjs";
|
|
11
11
|
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, n as InProcessMessageQueueOptions, o as ParallelMessageQueue, r as MessageQueue, t as InProcessMessageQueue } from "./mq-CrItclRD.cjs";
|
|
12
12
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
|
|
13
13
|
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "./runtime/mod.cjs";
|
package/dist/mod.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryp
|
|
|
9
9
|
import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-DPAPnB0R.js";
|
|
10
10
|
import { a as toAcctUrl, c as TraverseCollectionOptions, i as parseFediverseHandle, l as lookupObject, n as FediverseHandle, o as PUBLIC_COLLECTION, r as isFediverseHandle, s as LookupObjectOptions, t as getTypeId, u as traverseCollection } from "./mod-BSwc3_rD.js";
|
|
11
11
|
import { i as ResourceDescriptor, n as lookupWebFinger } from "./mod-BTNpXcPj.js";
|
|
12
|
-
import { $ as CustomCollectionCursor, A as createFederation, B as RouterRouteResult, C as InboxListenerSetters, D as FederationKvPrefixes, E as CreateFederationOptions, F as Message, G as ActorDispatcher, H as respondWithObject, I as createFederationBuilder, J as AuthorizePredicate, K as ActorHandleMapper, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as CustomCollectionCounter, R as RouterError, S as IdempotencyStrategy, T as Rfc6570Expression, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as FederationBuilder, a as InboxContext, at as ObjectDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as WebFingerLinksDispatcher, d as ActorCallbackSetters, dt as buildCollectionSynchronizationHeader, et as CustomCollectionDispatcher, f as CollectionCallbackSetters, ft as digest, g as Federation, h as Federatable, i as GetSignedKeyOptions, it as ObjectAuthorizePredicate, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as SenderKeyPair, m as CustomCollectionCallbackSetters, n as Context, nt as InboxListener, o as ParseUriResult, ot as OutboxErrorHandler, p as ConstructorWithTypeId, pt as ActivityTransformer, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as RequestContext, st as SharedInboxKeyDispatcher, t as ActorKeyPair, tt as InboxErrorHandler, u as SendActivityOptionsForCollection, ut as PageItems, v as FederationFetchOptions, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, z as RouterOptions } from "./context-
|
|
12
|
+
import { $ as CustomCollectionCursor, A as createFederation, B as RouterRouteResult, C as InboxListenerSetters, D as FederationKvPrefixes, E as CreateFederationOptions, F as Message, G as ActorDispatcher, H as respondWithObject, I as createFederationBuilder, J as AuthorizePredicate, K as ActorHandleMapper, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as CustomCollectionCounter, R as RouterError, S as IdempotencyStrategy, T as Rfc6570Expression, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as FederationBuilder, a as InboxContext, at as ObjectDispatcher, b as FederationStartQueueOptions, c as RouteActivityOptions, ct as WebFingerLinksDispatcher, d as ActorCallbackSetters, dt as buildCollectionSynchronizationHeader, et as CustomCollectionDispatcher, f as CollectionCallbackSetters, ft as digest, g as Federation, h as Federatable, i as GetSignedKeyOptions, it as ObjectAuthorizePredicate, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as SenderKeyPair, m as CustomCollectionCallbackSetters, n as Context, nt as InboxListener, o as ParseUriResult, ot as OutboxErrorHandler, p as ConstructorWithTypeId, pt as ActivityTransformer, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as RequestContext, st as SharedInboxKeyDispatcher, t as ActorKeyPair, tt as InboxErrorHandler, u as SendActivityOptionsForCollection, ut as PageItems, v as FederationFetchOptions, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, z as RouterOptions } from "./context-CNkTuNIm.js";
|
|
13
13
|
import { a as MessageQueueListenOptions, i as MessageQueueEnqueueOptions, n as InProcessMessageQueueOptions, o as ParallelMessageQueue, r as MessageQueue, t as InProcessMessageQueue } from "./mq-D_ZZRdby.js";
|
|
14
14
|
import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
|
|
15
15
|
import { GetAuthenticatedDocumentLoaderOptions, exportMultibaseKey, exportSpki, getAuthenticatedDocumentLoader, importMultibaseKey, importPem, importPkcs1, importSpki } from "./runtime/mod.js";
|