@fedify/fedify 2.0.17-dev.1093 → 2.0.18

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.
Files changed (62) hide show
  1. package/dist/{builder-CoG4VXAS.mjs → builder-CtrAeTRY.mjs} +3 -3
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{context-BzRJ49gL.d.cts → context-CJZHWLmz.d.cts} +48 -6
  6. package/dist/{context-CdJ9wAQa.d.ts → context-DnsFj3yK.d.ts} +48 -6
  7. package/dist/{deno-BsTAaG38.mjs → deno-mPpS1a5z.mjs} +1 -1
  8. package/dist/{docloader-BpyzfTRB.mjs → docloader-B-SKc43w.mjs} +2 -2
  9. package/dist/federation/builder.test.mjs +1 -1
  10. package/dist/federation/handler.test.mjs +1358 -41
  11. package/dist/federation/idempotency.test.mjs +2 -2
  12. package/dist/federation/inbox.test.mjs +1 -1
  13. package/dist/federation/middleware.test.mjs +1588 -84
  14. package/dist/federation/mod.cjs +1 -1
  15. package/dist/federation/mod.d.cts +2 -2
  16. package/dist/federation/mod.d.ts +2 -2
  17. package/dist/federation/mod.js +1 -1
  18. package/dist/federation/retry.test.mjs +1 -1
  19. package/dist/federation/send.test.mjs +3 -3
  20. package/dist/federation/temporal.test.d.mts +2 -0
  21. package/dist/federation/temporal.test.mjs +71 -0
  22. package/dist/federation/webfinger.test.mjs +1 -1
  23. package/dist/{http-ejFBVI1I.cjs → http-BL8JVR8k.cjs} +1 -1
  24. package/dist/{http-DBHhHcMm.js → http-C3tabf9n.js} +1 -1
  25. package/dist/{http-ClOkZPVk.mjs → http-CEsXGtbz.mjs} +2 -2
  26. package/dist/{inbox-1iBLYwIM.mjs → inbox-Tsb61Zs7.mjs} +7 -4
  27. package/dist/{key-DgnaBuPQ.mjs → key-BaYP-_dg.mjs} +1 -1
  28. package/dist/{kv-cache-BbfOz_6f.cjs → kv-cache-BsgxbwLm.cjs} +1 -1
  29. package/dist/{kv-cache-eO0dIiEK.js → kv-cache-Dbi0W6UJ.js} +1 -1
  30. package/dist/ld-CAaJNVwd.mjs +550 -0
  31. package/dist/{middleware-Cg0vLx3s.js → middleware-B3xIsf51.js} +396 -71
  32. package/dist/{middleware-C1lbrpLn.mjs → middleware-CXy6C5p8.mjs} +1 -1
  33. package/dist/{middleware-CML7W6o9.cjs → middleware-CmqvwFWM.cjs} +399 -73
  34. package/dist/{middleware-EM8jlXPc.cjs → middleware-DXrzwPDQ.cjs} +1 -1
  35. package/dist/{middleware-CM-lm1Ow.mjs → middleware-qU3blEV5.mjs} +309 -76
  36. package/dist/{mod-CKkpvznG.d.cts → mod-43DJyETz.d.cts} +1 -1
  37. package/dist/{mod-Kzr52ns8.d.ts → mod-COgmn-UO.d.ts} +1 -1
  38. package/dist/mod.cjs +4 -4
  39. package/dist/mod.d.cts +2 -2
  40. package/dist/mod.d.ts +2 -2
  41. package/dist/mod.js +4 -4
  42. package/dist/nodeinfo/handler.test.mjs +1 -1
  43. package/dist/{owner--l5W54LY.mjs → owner-DdHZSQaN.mjs} +2 -2
  44. package/dist/{proof-CJ04SPrP.mjs → proof-Cr7l6UvL.mjs} +2 -2
  45. package/dist/{proof-DNpSHLPH.cjs → proof-DTHPJVvm.cjs} +345 -3
  46. package/dist/{proof-C2fn-J-1.js → proof-wXzMwWVt.js} +298 -4
  47. package/dist/{send-BTHdq66r.mjs → send-ChZJgc6Y.mjs} +2 -2
  48. package/dist/sig/http.test.mjs +2 -2
  49. package/dist/sig/key.test.mjs +1 -1
  50. package/dist/sig/ld.test.mjs +558 -2
  51. package/dist/sig/mod.cjs +2 -2
  52. package/dist/sig/mod.js +2 -2
  53. package/dist/sig/owner.test.mjs +1 -1
  54. package/dist/sig/proof.test.mjs +1 -1
  55. package/dist/temporal-Bxr6zsNS.mjs +95 -0
  56. package/dist/testing/mod.d.mts +48 -6
  57. package/dist/utils/docloader.test.mjs +2 -2
  58. package/dist/utils/mod.cjs +1 -1
  59. package/dist/utils/mod.js +1 -1
  60. package/package.json +5 -5
  61. package/dist/ld-DQmBISTI.mjs +0 -256
  62. /package/dist/{retry-Ddbq3AcK.mjs → retry-B_E3V_Dx.mjs} +0 -0
@@ -2,23 +2,24 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError } from "./router-CrMLXoOr.mjs";
5
- import { n as version, t as name } from "./deno-BsTAaG38.mjs";
6
- import { a as validateCryptoKey, i as importJwk, t as exportJwk } from "./key-DgnaBuPQ.mjs";
7
- import { l as verifyRequest } from "./http-ClOkZPVk.mjs";
8
- import { t as getAuthenticatedDocumentLoader } from "./docloader-BpyzfTRB.mjs";
5
+ import { n as version, t as name } from "./deno-mPpS1a5z.mjs";
6
+ import { a as validateCryptoKey, i as importJwk, t as exportJwk } from "./key-BaYP-_dg.mjs";
7
+ import { l as verifyRequest } from "./http-CEsXGtbz.mjs";
8
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-B-SKc43w.mjs";
9
9
  import { n as kvCache } from "./kv-cache-DqEKe5E0.mjs";
10
- import { a as signJsonLd, i as hasSignature, o as verifyJsonLd, r as detachSignature } from "./ld-DQmBISTI.mjs";
11
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner--l5W54LY.mjs";
12
- import { n as signObject, r as verifyObject } from "./proof-CJ04SPrP.mjs";
10
+ 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-CAaJNVwd.mjs";
11
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-DdHZSQaN.mjs";
12
+ import { n as signObject, r as verifyObject } from "./proof-Cr7l6UvL.mjs";
13
13
  import { t as getNodeInfo } from "./client-A1UrnX6I.mjs";
14
14
  import { t as nodeInfoToJson } from "./types-C37hquWI.mjs";
15
- import { n as routeActivity } from "./inbox-1iBLYwIM.mjs";
16
- import { t as FederationBuilderImpl } from "./builder-CoG4VXAS.mjs";
15
+ import { n as routeActivity } from "./inbox-Tsb61Zs7.mjs";
16
+ import { t as FederationBuilderImpl } from "./builder-CtrAeTRY.mjs";
17
17
  import { t as buildCollectionSynchronizationHeader } from "./collection-ChgDTHLz.mjs";
18
18
  import { t as KvKeyCache } from "./keycache-DaQ3ndaJ.mjs";
19
19
  import { t as acceptsJsonLd } from "./negotiation-BehA2uul.mjs";
20
- import { t as createExponentialBackoffPolicy } from "./retry-Ddbq3AcK.mjs";
21
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-BTHdq66r.mjs";
20
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-Bxr6zsNS.mjs";
21
+ import { t as createExponentialBackoffPolicy } from "./retry-B_E3V_Dx.mjs";
22
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-ChZJgc6Y.mjs";
22
23
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
23
24
  import { lookupWebFinger } from "@fedify/webfinger";
24
25
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -152,6 +153,33 @@ function handleNodeInfoJrd(_request, context) {
152
153
  }
153
154
  //#endregion
154
155
  //#region src/federation/handler.ts
156
+ const rawInboxContextFactorySymbol = Symbol("fedify.rawInboxContextFactory");
157
+ function isRemoteContextLoadingFailure$1(error) {
158
+ return error instanceof Error && typeof error.details === "object" && error.details != null && error.details.code === "loading remote context failed";
159
+ }
160
+ function isPermanentRemoteContextError$1(error) {
161
+ if (!(error instanceof Error) || error.name !== "jsonld.InvalidUrl") return false;
162
+ const details = error.details;
163
+ if (details?.code === "invalid remote context") return true;
164
+ return isRemoteContextLoadingFailure$1(error) && typeof details?.url === "string" && !URL.canParse(details.url) && isClearlyMalformedContextReference(details.url);
165
+ }
166
+ function isInvalidJsonLdError(error) {
167
+ if (!(error instanceof Error)) return false;
168
+ const name = error.name;
169
+ return name === "UnsafeJsonLdError" || error instanceof InvalidContextReferenceError || isPermanentRemoteContextError$1(error) || name === "jsonld.SyntaxError" && !isRemoteContextLoadingFailure$1(error);
170
+ }
171
+ function isValidationTypeError(error) {
172
+ return error instanceof TypeError && (/^(Invalid JSON-LD:|Invalid type:|Unexpected type:)/.test(error.message) || isInvalidUrlTypeError(error));
173
+ }
174
+ function isPermanentActivityParseError(error) {
175
+ return isInvalidJsonLdError(error) || isValidationTypeError(error);
176
+ }
177
+ function hasHttpSignatureHeaders(request) {
178
+ return request.headers.has("Signature") || request.headers.has("Signature-Input");
179
+ }
180
+ function hasObjectIntegrityProof(json) {
181
+ return typeof json === "object" && json != null && "proof" in json;
182
+ }
155
183
  /**
156
184
  * Handles an actor request.
157
185
  * @template TContextData The context data to pass to the context.
@@ -471,35 +499,120 @@ async function handleInboxInternal(request, parameters, span) {
471
499
  });
472
500
  }
473
501
  const keyCache = new KvKeyCache(kv, kvPrefixes.publicKey, ctx);
474
- let ldSigVerified;
475
- try {
476
- ldSigVerified = await verifyJsonLd(json, {
477
- contextLoader: ctx.contextLoader,
478
- documentLoader: ctx.documentLoader,
479
- keyCache,
480
- tracerProvider
502
+ const jsonWithoutSig = detachSignature(json);
503
+ const hasLdSignature = hasSignature(json);
504
+ const canAttemptAlternateAuthAfterLdSignatureFailure = skipSignatureVerification || hasHttpSignatureHeaders(request) || hasObjectIntegrityProof(jsonWithoutSig);
505
+ let deferredLdSignatureError = void 0;
506
+ const respondInvalidActivity = async (error) => {
507
+ logger.error("Failed to parse activity:\n{error}", {
508
+ recipient,
509
+ activity: json,
510
+ error
481
511
  });
482
- } catch (error) {
483
- if (error instanceof Error && error.name === "jsonld.SyntaxError") {
484
- logger.error("Failed to parse JSON-LD:\n{error}", {
512
+ try {
513
+ await inboxErrorHandler?.(ctx, error);
514
+ } catch (error) {
515
+ logger.error("An unexpected error occurred in inbox error handler:\n{error}", {
516
+ error,
517
+ activity: json,
518
+ recipient
519
+ });
520
+ }
521
+ span.setStatus({
522
+ code: SpanStatusCode.ERROR,
523
+ message: `Failed to parse activity:\n${error}`
524
+ });
525
+ return new Response("Invalid activity.", {
526
+ status: 400,
527
+ headers: { "Content-Type": "text/plain; charset=utf-8" }
528
+ });
529
+ };
530
+ let compactedJson = json;
531
+ let compactedJsonWithoutSig = jsonWithoutSig;
532
+ let ldSigVerified = false;
533
+ if (hasLdSignature) {
534
+ try {
535
+ compactedJson = await compactJsonLd(json, ctx.contextLoader);
536
+ } catch (error) {
537
+ if (isInvalidJsonLdError(error)) {
538
+ logger.error("Failed to parse JSON-LD:\n{error}", {
539
+ recipient,
540
+ error
541
+ });
542
+ return new Response("Invalid JSON-LD.", {
543
+ status: 400,
544
+ headers: { "Content-Type": "text/plain; charset=utf-8" }
545
+ });
546
+ }
547
+ if (!canAttemptAlternateAuthAfterLdSignatureFailure) throw error;
548
+ if (!skipSignatureVerification) deferredLdSignatureError = error;
549
+ logger.debug("Failed to normalize JSON-LD for Linked Data Signatures; deferring to another authentication path only if it verifies:\n{error}", {
485
550
  recipient,
486
551
  error
487
552
  });
488
- return new Response("Invalid JSON-LD.", {
489
- status: 400,
490
- headers: { "Content-Type": "text/plain; charset=utf-8" }
491
- });
492
553
  }
493
- ldSigVerified = false;
554
+ if (compactedJson !== json) {
555
+ compactedJsonWithoutSig = detachSignature(compactedJson);
556
+ try {
557
+ ldSigVerified = await verifyCompactJsonLd(compactedJson, {
558
+ contextLoader: ctx.contextLoader,
559
+ documentLoader: ctx.documentLoader,
560
+ keyCache,
561
+ tracerProvider
562
+ });
563
+ } catch (error) {
564
+ if (error instanceof RangeError && await hasMalformedKnownTemporalLiteral(compactedJsonWithoutSig, ctx.contextLoader)) return await respondInvalidActivity(error);
565
+ if (isInvalidJsonLdError(error)) {
566
+ logger.error("Failed to parse JSON-LD:\n{error}", {
567
+ recipient,
568
+ error
569
+ });
570
+ return new Response("Invalid JSON-LD.", {
571
+ status: 400,
572
+ headers: { "Content-Type": "text/plain; charset=utf-8" }
573
+ });
574
+ }
575
+ if (!canAttemptAlternateAuthAfterLdSignatureFailure) throw error;
576
+ if (!skipSignatureVerification) try {
577
+ await Object$1.fromJsonLd(compactedJson, {
578
+ contextLoader: getNormalizationContextLoader(ctx.contextLoader),
579
+ documentLoader: ctx.documentLoader,
580
+ tracerProvider
581
+ });
582
+ } catch (parseError) {
583
+ if (parseError instanceof RangeError && await hasMalformedKnownTemporalLiteral(compactedJsonWithoutSig, ctx.contextLoader)) return await respondInvalidActivity(parseError);
584
+ if (isInvalidJsonLdError(parseError)) {
585
+ logger.error("Failed to parse JSON-LD:\n{error}", {
586
+ recipient,
587
+ error: parseError
588
+ });
589
+ return new Response("Invalid JSON-LD.", {
590
+ status: 400,
591
+ headers: { "Content-Type": "text/plain; charset=utf-8" }
592
+ });
593
+ }
594
+ deferredLdSignatureError = parseError;
595
+ }
596
+ ldSigVerified = false;
597
+ }
598
+ }
494
599
  }
495
- const jsonWithoutSig = detachSignature(json);
496
600
  let activity = null;
497
601
  if (ldSigVerified) {
498
602
  logger.debug("Linked Data Signatures are verified.", {
499
603
  recipient,
500
604
  json
501
605
  });
502
- activity = await Activity.fromJsonLd(jsonWithoutSig, ctx);
606
+ try {
607
+ activity = await Activity.fromJsonLd(compactedJsonWithoutSig, {
608
+ ...ctx,
609
+ contextLoader: getNormalizationContextLoader(ctx.contextLoader)
610
+ });
611
+ } catch (error) {
612
+ if (error instanceof RangeError && await hasMalformedKnownTemporalLiteral(compactedJsonWithoutSig, ctx.contextLoader)) return await respondInvalidActivity(error);
613
+ if (!isPermanentActivityParseError(error)) throw error;
614
+ return await respondInvalidActivity(error);
615
+ }
503
616
  } else {
504
617
  logger.debug("Linked Data Signatures are not verified.", {
505
618
  recipient,
@@ -507,12 +620,21 @@ async function handleInboxInternal(request, parameters, span) {
507
620
  });
508
621
  try {
509
622
  activity = await verifyObject(Activity, jsonWithoutSig, {
510
- contextLoader: ctx.contextLoader,
623
+ contextLoader: wrapContextLoaderForJsonLd(ctx.contextLoader),
511
624
  documentLoader: ctx.documentLoader,
512
625
  keyCache,
513
626
  tracerProvider
514
627
  });
515
628
  } catch (error) {
629
+ if (error instanceof RangeError && await hasMalformedKnownTemporalLiteral(jsonWithoutSig, ctx.contextLoader)) return await respondInvalidActivity(error);
630
+ if (deferredLdSignatureError != null) {
631
+ logger.debug("Object Integrity Proof fallback did not supersede a deferred Linked Data Signature failure:\n{error}", {
632
+ recipient,
633
+ error
634
+ });
635
+ activity = null;
636
+ }
637
+ if (!isPermanentActivityParseError(error)) throw error;
516
638
  logger.error("Failed to parse activity:\n{error}", {
517
639
  recipient,
518
640
  activity: json,
@@ -556,6 +678,7 @@ async function handleInboxInternal(request, parameters, span) {
556
678
  tracerProvider
557
679
  });
558
680
  if (key == null) {
681
+ if (deferredLdSignatureError != null) throw deferredLdSignatureError;
559
682
  logger.error("Failed to verify the request's HTTP Signatures.", { recipient });
560
683
  span.setStatus({
561
684
  code: SpanStatusCode.ERROR,
@@ -568,7 +691,15 @@ async function handleInboxInternal(request, parameters, span) {
568
691
  } else logger.debug("HTTP Signatures are verified.", { recipient });
569
692
  httpSigKey = key;
570
693
  }
571
- activity = await Activity.fromJsonLd(jsonWithoutSig, ctx);
694
+ try {
695
+ activity = await Activity.fromJsonLd(jsonWithoutSig, {
696
+ ...ctx,
697
+ contextLoader: wrapContextLoaderForJsonLd(ctx.contextLoader)
698
+ });
699
+ } catch (error) {
700
+ if (!isPermanentActivityParseError(error)) throw error;
701
+ return await respondInvalidActivity(error);
702
+ }
572
703
  }
573
704
  if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
574
705
  span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
@@ -580,6 +711,7 @@ async function handleInboxInternal(request, parameters, span) {
580
711
  "http_signatures.key_id": httpSigKey?.id?.href ?? ""
581
712
  });
582
713
  if (httpSigKey != null && !await doesActorOwnKey(activity, httpSigKey, ctx)) {
714
+ if (deferredLdSignatureError != null) throw deferredLdSignatureError;
583
715
  logger.error("The signer ({keyId}) and the actor ({actorId}) do not match.", {
584
716
  activity: json,
585
717
  recipient,
@@ -598,10 +730,14 @@ async function handleInboxInternal(request, parameters, span) {
598
730
  const routeResult = await routeActivity({
599
731
  context: ctx,
600
732
  json,
733
+ originalJson: json,
734
+ normalizedActivity: hasLdSignature && compactedJson !== json ? compactedJson : void 0,
735
+ ldSignatureVerified: hasLdSignature ? ldSigVerified : void 0,
601
736
  activity,
602
737
  recipient,
603
738
  inboxListeners,
604
739
  inboxContextFactory,
740
+ listenerInboxContextFactory: ldSigVerified ? inboxContextFactory[rawInboxContextFactorySymbol] : void 0,
605
741
  inboxErrorHandler,
606
742
  kv,
607
743
  kvPrefixes,
@@ -1192,6 +1328,18 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
1192
1328
  }
1193
1329
  //#endregion
1194
1330
  //#region src/federation/middleware.ts
1331
+ function isRemoteContextLoadingFailure(error) {
1332
+ return error instanceof Error && typeof error.details === "object" && error.details != null && error.details.code === "loading remote context failed";
1333
+ }
1334
+ function isPermanentRemoteContextError(error) {
1335
+ if (!(error instanceof Error) || error.name !== "jsonld.InvalidUrl") return false;
1336
+ const details = error.details;
1337
+ if (details?.code === "invalid remote context") return true;
1338
+ return isRemoteContextLoadingFailure(error) && typeof details?.url === "string" && !URL.canParse(details.url) && isClearlyMalformedContextReference(details.url);
1339
+ }
1340
+ function isPermanentInboxParseError(error) {
1341
+ 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));
1342
+ }
1195
1343
  /**
1196
1344
  * Create a new {@link Federation} instance.
1197
1345
  * @param parameters Parameters for initializing the instance.
@@ -1569,7 +1717,7 @@ var FederationImpl = class extends FederationBuilderImpl {
1569
1717
  }
1570
1718
  logger.info("Successfully sent activity {activityId} to {inbox}.", { ...logData });
1571
1719
  }
1572
- async #listenInboxMessage(ctxData, message, span) {
1720
+ async #listenInboxMessage(ctxData, message, _span) {
1573
1721
  const logger = getLogger([
1574
1722
  "fedify",
1575
1723
  "federation",
@@ -1582,60 +1730,28 @@ var FederationImpl = class extends FederationBuilderImpl {
1582
1730
  const identity = await this.sharedInboxKeyDispatcher(context);
1583
1731
  if (identity != null) context = this.#createContext(baseUrl, ctxData, { documentLoader: "identifier" in identity || "username" in identity ? await context.getDocumentLoader(identity) : context.getDocumentLoader(identity) });
1584
1732
  }
1585
- const activity = await Activity.fromJsonLd(message.activity, context);
1586
- span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
1587
- if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
1588
- const cacheKey = activity.id == null ? null : [
1589
- ...this.kvPrefixes.activityIdempotence,
1590
- context.origin,
1591
- activity.id.href
1592
- ];
1593
- if (cacheKey != null) {
1594
- if (await this.kv.get(cacheKey) === true) {
1595
- logger.debug("Activity {activityId} has already been processed.", {
1596
- activityId: activity.id?.href,
1597
- activity: message.activity,
1598
- recipient: message.identifier
1599
- });
1600
- return;
1601
- }
1602
- }
1603
1733
  await this._getTracer().startActiveSpan("activitypub.dispatch_inbox_listener", { kind: SpanKind.INTERNAL }, async (span) => {
1604
- const dispatched = this.inboxListeners?.dispatchWithClass(activity);
1605
- if (dispatched == null) {
1606
- logger.error("Unsupported activity type:\n{activity}", {
1607
- activityId: activity.id?.href,
1608
- activity: message.activity,
1609
- recipient: message.identifier,
1610
- trial: message.attempt
1611
- });
1612
- span.setStatus({
1613
- code: SpanStatusCode.ERROR,
1614
- message: `Unsupported activity type: ${getTypeId(activity).href}`
1615
- });
1616
- span.end();
1617
- return;
1618
- }
1619
- const { class: cls, listener } = dispatched;
1620
- span.updateName(`activitypub.dispatch_inbox_listener ${cls.name}`);
1621
- try {
1622
- await listener(context.toInboxContext(message.identifier, message.activity, activity.id?.href, getTypeId(activity).href), activity);
1623
- } catch (error) {
1734
+ let activity = null;
1735
+ let cacheKey = null;
1736
+ const reportInboxError = async (error) => {
1624
1737
  try {
1625
1738
  await this.inboxErrorHandler?.(context, error);
1626
1739
  } catch (error) {
1627
1740
  logger.error("An unexpected error occurred in inbox error handler:\n{error}", {
1628
1741
  error,
1629
1742
  trial: message.attempt,
1630
- activityId: activity.id?.href,
1743
+ activityId: activity?.id?.href,
1631
1744
  activity: message.activity,
1632
1745
  recipient: message.identifier
1633
1746
  });
1634
1747
  }
1748
+ };
1749
+ const handleRetriableFailure = async (error) => {
1750
+ await reportInboxError(error);
1635
1751
  if (this.inboxQueue?.nativeRetrial) {
1636
1752
  logger.error("Failed to process the incoming activity {activityId}; backend will handle retry:\n{error}", {
1637
1753
  error,
1638
- activityId: activity.id?.href,
1754
+ activityId: activity?.id?.href,
1639
1755
  activity: message.activity,
1640
1756
  recipient: message.identifier
1641
1757
  });
@@ -1654,17 +1770,25 @@ var FederationImpl = class extends FederationBuilderImpl {
1654
1770
  logger.error("Failed to process the incoming activity {activityId} (attempt #{attempt}); retry...:\n{error}", {
1655
1771
  error,
1656
1772
  attempt: message.attempt,
1657
- activityId: activity.id?.href,
1773
+ activityId: activity?.id?.href,
1658
1774
  activity: message.activity,
1659
1775
  recipient: message.identifier
1660
1776
  });
1777
+ if (this.inboxQueue == null) {
1778
+ span.setStatus({
1779
+ code: SpanStatusCode.ERROR,
1780
+ message: String(error)
1781
+ });
1782
+ span.end();
1783
+ throw error;
1784
+ }
1661
1785
  await this.inboxQueue?.enqueue({
1662
1786
  ...message,
1663
1787
  attempt: message.attempt + 1
1664
1788
  }, { delay: Temporal.Duration.compare(delay, { seconds: 0 }) < 0 ? Temporal.Duration.from({ seconds: 0 }) : delay });
1665
1789
  } else logger.error("Failed to process the incoming activity {activityId} after {trial} attempts; giving up:\n{error}", {
1666
1790
  error,
1667
- activityId: activity.id?.href,
1791
+ activityId: activity?.id?.href,
1668
1792
  activity: message.activity,
1669
1793
  recipient: message.identifier
1670
1794
  });
@@ -1673,11 +1797,108 @@ var FederationImpl = class extends FederationBuilderImpl {
1673
1797
  message: String(error)
1674
1798
  });
1675
1799
  span.end();
1800
+ };
1801
+ let dispatched;
1802
+ let parseInput = void 0;
1803
+ let parseContextLoader = context.contextLoader;
1804
+ try {
1805
+ const hasSignatureField = hasSignature(message.activity);
1806
+ const shouldParseFromNormalizedSignedPayload = message.ldSignatureVerified === true || message.normalizedActivity != null || message.ldSignatureVerified == null && hasSignatureField;
1807
+ const parseContext = hasSignatureField ? {
1808
+ ...context,
1809
+ contextLoader: getNormalizationContextLoader(context.contextLoader)
1810
+ } : {
1811
+ ...context,
1812
+ contextLoader: wrapContextLoaderForJsonLd(context.contextLoader)
1813
+ };
1814
+ parseContextLoader = parseContext.contextLoader;
1815
+ let normalizedActivity;
1816
+ if (shouldParseFromNormalizedSignedPayload) {
1817
+ normalizedActivity = message.normalizedActivity ?? await compactJsonLd(message.activity, context.contextLoader);
1818
+ assertSafeJsonLd(normalizedActivity);
1819
+ }
1820
+ parseInput = shouldParseFromNormalizedSignedPayload ? detachSignature(normalizedActivity) : hasSignatureField ? detachSignature(message.activity) : message.activity;
1821
+ activity = await Activity.fromJsonLd(parseInput, parseContext);
1822
+ span.setAttribute("activitypub.activity.type", getTypeId(activity).href);
1823
+ if (activity.id != null) span.setAttribute("activitypub.activity.id", activity.id.href);
1824
+ cacheKey = activity.id == null ? null : [
1825
+ ...this.kvPrefixes.activityIdempotence,
1826
+ context.origin,
1827
+ activity.id.href
1828
+ ];
1829
+ if (cacheKey != null) {
1830
+ if (await this.kv.get(cacheKey) === true) {
1831
+ logger.debug("Activity {activityId} has already been processed.", {
1832
+ activityId: activity.id?.href,
1833
+ activity: message.activity,
1834
+ recipient: message.identifier
1835
+ });
1836
+ span.end();
1837
+ return;
1838
+ }
1839
+ }
1840
+ dispatched = this.inboxListeners?.dispatchWithClass(activity);
1841
+ } catch (error) {
1842
+ if (activity == null && error instanceof RangeError && await hasMalformedKnownTemporalLiteral(parseInput, parseContextLoader)) {
1843
+ await reportInboxError(error);
1844
+ logger.error("Failed to parse the queued incoming activity {activityId}:\n{error}", {
1845
+ error,
1846
+ trial: message.attempt,
1847
+ activityId: null,
1848
+ activity: message.activity,
1849
+ recipient: message.identifier
1850
+ });
1851
+ span.setStatus({
1852
+ code: SpanStatusCode.ERROR,
1853
+ message: String(error)
1854
+ });
1855
+ span.end();
1856
+ return;
1857
+ }
1858
+ if (isPermanentInboxParseError(error)) {
1859
+ await reportInboxError(error);
1860
+ logger.error("Failed to parse the queued incoming activity {activityId}:\n{error}", {
1861
+ error,
1862
+ trial: message.attempt,
1863
+ activityId: activity?.id?.href,
1864
+ activity: message.activity,
1865
+ recipient: message.identifier
1866
+ });
1867
+ span.setStatus({
1868
+ code: SpanStatusCode.ERROR,
1869
+ message: String(error)
1870
+ });
1871
+ span.end();
1872
+ return;
1873
+ }
1874
+ await handleRetriableFailure(error);
1875
+ return;
1876
+ }
1877
+ if (dispatched == null) {
1878
+ logger.error("Unsupported activity type:\n{activity}", {
1879
+ activityId: activity.id?.href,
1880
+ activity: message.activity,
1881
+ recipient: message.identifier,
1882
+ trial: message.attempt
1883
+ });
1884
+ span.setStatus({
1885
+ code: SpanStatusCode.ERROR,
1886
+ message: `Unsupported activity type: ${getTypeId(activity).href}`
1887
+ });
1888
+ span.end();
1889
+ return;
1890
+ }
1891
+ const { class: cls, listener } = dispatched;
1892
+ span.updateName(`activitypub.dispatch_inbox_listener ${cls.name}`);
1893
+ try {
1894
+ await listener(context.toInboxContext(message.identifier, message.activity, activity.id?.href, getTypeId(activity).href), activity);
1895
+ } catch (error) {
1896
+ await handleRetriableFailure(error);
1676
1897
  return;
1677
1898
  }
1678
1899
  if (cacheKey != null) await this.kv.set(cacheKey, true, { ttl: Temporal.Duration.from({ days: 1 }) });
1679
1900
  logger.info("Activity {activityId} has been processed.", {
1680
- activityId: activity.id?.href,
1901
+ activityId: activity?.id?.href,
1681
1902
  activity: message.activity,
1682
1903
  recipient: message.identifier
1683
1904
  });
@@ -2023,16 +2244,18 @@ var FederationImpl = class extends FederationBuilderImpl {
2023
2244
  onNotFound
2024
2245
  });
2025
2246
  context = this.#createContext(request, contextData, { documentLoader: await context.getDocumentLoader({ identifier: route.values.identifier }) });
2026
- case "sharedInbox":
2247
+ case "sharedInbox": {
2027
2248
  if (routeName !== "inbox" && this.sharedInboxKeyDispatcher != null) {
2028
2249
  const identity = await this.sharedInboxKeyDispatcher(context);
2029
2250
  if (identity != null) context = this.#createContext(request, contextData, { documentLoader: "identifier" in identity || "username" in identity ? await context.getDocumentLoader(identity) : context.getDocumentLoader(identity) });
2030
2251
  }
2031
2252
  if (!this.manuallyStartQueue) this._startQueueInternal(contextData);
2253
+ const inboxContextFactory = context.toInboxContext.bind(context);
2254
+ inboxContextFactory[rawInboxContextFactorySymbol] = context.toInboxContext.bind(context);
2032
2255
  return await handleInbox(request, {
2033
2256
  recipient: route.values.identifier ?? null,
2034
2257
  context,
2035
- inboxContextFactory: context.toInboxContext.bind(context),
2258
+ inboxContextFactory,
2036
2259
  kv: this.kv,
2037
2260
  kvPrefixes: this.kvPrefixes,
2038
2261
  queue: this.inboxQueue,
@@ -2045,6 +2268,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2045
2268
  tracerProvider: this.tracerProvider,
2046
2269
  idempotencyStrategy: this.idempotencyStrategy
2047
2270
  });
2271
+ }
2048
2272
  case "following": return await handleCollection(request, {
2049
2273
  name: "following",
2050
2274
  identifier: route.values.identifier,
@@ -2720,6 +2944,7 @@ var ContextImpl = class ContextImpl {
2720
2944
  const routeResult = await routeActivity({
2721
2945
  context: this,
2722
2946
  json,
2947
+ ldSignatureVerified: false,
2723
2948
  activity,
2724
2949
  recipient,
2725
2950
  inboxListeners: this.federation.inboxListeners,
@@ -2818,6 +3043,14 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
2818
3043
  };
2819
3044
  var InboxContextImpl = class InboxContextImpl extends ContextImpl {
2820
3045
  recipient;
3046
+ /**
3047
+ * The original received activity payload.
3048
+ *
3049
+ * Fedify may normalize a Linked Data Signature payload internally for safe
3050
+ * parsing, but forwarding must keep the sender's payload unchanged so
3051
+ * third-party signatures/proofs remain intact.
3052
+ * @internal
3053
+ */
2821
3054
  activity;
2822
3055
  activityId;
2823
3056
  activityType;
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, mt as WebFingerLinksDispatcher, s as RequestContext } from "./context-BzRJ49gL.cjs";
2
+ import { X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, mt as WebFingerLinksDispatcher, s as RequestContext } from "./context-CJZHWLmz.cjs";
3
3
  import { Span, Tracer } from "@opentelemetry/api";
4
4
 
5
5
  //#region src/federation/webfinger.d.ts
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, mt as WebFingerLinksDispatcher, s as RequestContext } from "./context-CdJ9wAQa.js";
2
+ import { X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, mt as WebFingerLinksDispatcher, s as RequestContext } from "./context-DnsFj3yK.js";
3
3
  import { Span, Tracer } from "@opentelemetry/api";
4
4
 
5
5
  //#region src/federation/webfinger.d.ts
package/dist/mod.cjs CHANGED
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  require("./chunk-DDcVe30Y.cjs");
5
5
  const require_transformers = require("./transformers-NeAONrAq.cjs");
6
6
  require("./compat/mod.cjs");
7
- const require_http = require("./http-ejFBVI1I.cjs");
8
- const require_middleware = require("./middleware-CML7W6o9.cjs");
9
- const require_proof = require("./proof-DNpSHLPH.cjs");
7
+ const require_http = require("./http-BL8JVR8k.cjs");
8
+ const require_middleware = require("./middleware-CmqvwFWM.cjs");
9
+ const require_proof = require("./proof-DTHPJVvm.cjs");
10
10
  const require_types = require("./types-KC4QAoxe.cjs");
11
- const require_kv_cache = require("./kv-cache-BbfOz_6f.cjs");
11
+ const require_kv_cache = require("./kv-cache-BsgxbwLm.cjs");
12
12
  const require_federation_mod = require("./federation/mod.cjs");
13
13
  require("./nodeinfo/mod.cjs");
14
14
  require("./runtime/mod.cjs");
package/dist/mod.d.cts CHANGED
@@ -2,10 +2,10 @@
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CAM_bQXx.cjs";
3
3
  import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "./http-RYvZHWMc.cjs";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-DEvZuyOE.cjs";
5
- import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, bt as ActivityTransformer, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "./context-BzRJ49gL.cjs";
5
+ import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, bt as ActivityTransformer, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "./context-CJZHWLmz.cjs";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
7
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
8
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-CKkpvznG.cjs";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-43DJyETz.cjs";
9
9
  import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "./mod-CB6pc2pw.cjs";
10
10
  import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-B2zB0rDg.cjs";
11
11
  export * from "@fedify/vocab-runtime";
package/dist/mod.d.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CSddvgWN.js";
3
3
  import { a as signRequest, c as FetchKeyResult, d as fetchKey, f as generateCryptoKeyPair, i as VerifyRequestOptions, l as KeyCache, n as HttpMessageSignaturesSpecDeterminer, o as verifyRequest, p as importJwk, r as SignRequestOptions, s as FetchKeyOptions, t as HttpMessageSignaturesSpec, u as exportJwk } from "./http-C4D0ajx0.js";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CnngXDNJ.js";
5
- import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, bt as ActivityTransformer, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "./context-CdJ9wAQa.js";
5
+ import { $ as AuthorizePredicate, A as CreateExponentialBackoffPolicyOptions, B as RespondWithObjectOptions, C as InboxListenerSetters, D as FederationOrigin, E as FederationKvPrefixes, F as createFederationBuilder, G as MessageQueue, H as respondWithObjectIfAcceptable, I as Router, J as ParallelMessageQueue, K as MessageQueueEnqueueOptions, L as RouterError, M as RetryPolicy, N as createExponentialBackoffPolicy, O as FederationQueueOptions, P as Message, Q as ActorKeyPairsDispatcher, R as RouterOptions, S as IdempotencyStrategy, T as Rfc6570Expression, U as InProcessMessageQueue, V as respondWithObject, W as InProcessMessageQueueOptions, X as ActorDispatcher, Y as ActorAliasMapper, Z as ActorHandleMapper, _ as FederationBuilder, _t as PageItems, a as InboxContext, at as CustomCollectionDispatcher, b as FederationStartQueueOptions, bt as ActivityTransformer, c as RouteActivityOptions, ct as NodeInfoDispatcher, d as ActorCallbackSetters, dt as OutboxErrorHandler, et as CollectionCounter, f as CollectionCallbackSetters, ft as OutboxPermanentFailureHandler, g as Federation, gt as SenderKeyPair, h as Federatable, ht as SendActivityError, i as GetSignedKeyOptions, it as CustomCollectionCursor, j as RetryContext, k as createFederation, l as SendActivityOptions, lt as ObjectAuthorizePredicate, m as CustomCollectionCallbackSetters, mt as WebFingerLinksDispatcher, n as Context, nt as CollectionDispatcher, o as ParseUriResult, ot as InboxErrorHandler, p as ConstructorWithTypeId, pt as SharedInboxKeyDispatcher, q as MessageQueueListenOptions, r as ForwardActivityOptions, rt as CustomCollectionCounter, s as RequestContext, st as InboxListener, t as ActorKeyPair, tt as CollectionCursor, u as SendActivityOptionsForCollection, ut as ObjectDispatcher, v as FederationFetchOptions, vt as buildCollectionSynchronizationHeader, w as ObjectCallbackSetters, x as IdempotencyKeyCallback, y as FederationOptions, yt as digest, z as RouterRouteResult } from "./context-DnsFj3yK.js";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-D6hNiMTK.js";
7
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
8
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-Kzr52ns8.js";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-COgmn-UO.js";
9
9
  import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "./mod-CiQNNAQL.js";
10
10
  import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-CD1youdZ.js";
11
11
  export * from "@fedify/vocab-runtime";
package/dist/mod.js CHANGED
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "./chunk-CRNNMoPX.js";
4
4
  import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
5
5
  import "./compat/mod.js";
6
- import { a as fetchKey, i as exportJwk, n as signRequest, o as generateCryptoKeyPair, r as verifyRequest, s as importJwk } from "./http-DBHhHcMm.js";
7
- import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-Cg0vLx3s.js";
8
- import { a as doesActorOwnKey, c as createSignature, d as signJsonLd, f as verifyJsonLd, i as verifyProof, l as detachSignature, n as signObject, o as getKeyOwner, p as verifySignature, r as verifyObject, s as attachSignature, t as createProof } from "./proof-C2fn-J-1.js";
6
+ import { a as fetchKey, i as exportJwk, n as signRequest, o as generateCryptoKeyPair, r as verifyRequest, s as importJwk } from "./http-C3tabf9n.js";
7
+ import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-B3xIsf51.js";
8
+ import { _ as signJsonLd, a as doesActorOwnKey, b as verifySignature, d as createSignature, f as detachSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, r as verifyObject, t as createProof, y as verifyJsonLd } from "./proof-wXzMwWVt.js";
9
9
  import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-CAY3OdLq.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-eO0dIiEK.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-Dbi0W6UJ.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";