@fedify/fedify 2.2.18 → 2.2.20

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 (86) hide show
  1. package/dist/{builder-DAbQyxmb.mjs → builder-BolQ56ab.mjs} +2 -2
  2. package/dist/{client-CAM_bQXx.d.cts → client-BIBzqEIp.d.cts} +0 -1
  3. package/dist/{client-9F_u23dc.mjs → client-DhxaVgOv.mjs} +113 -64
  4. package/dist/{client-CSddvgWN.d.ts → client-jE7oGvRh.d.ts} +0 -1
  5. package/dist/compat/mod.d.cts +1 -1
  6. package/dist/compat/mod.d.ts +1 -1
  7. package/dist/compat/transformers.test.mjs +1 -1
  8. package/dist/{context-tJbL_Hkw.d.cts → context-CFQGaq5x.d.cts} +28 -2
  9. package/dist/{context-OkwEpc3-.d.ts → context-DdbLVV_k.d.ts} +28 -2
  10. package/dist/{deno-JUTr6LYC.mjs → deno-BUj4roJc.mjs} +1 -1
  11. package/dist/docloader-CbtF_0cD.mjs +125 -0
  12. package/dist/federation/builder.test.mjs +1 -1
  13. package/dist/federation/handler.test.mjs +5 -5
  14. package/dist/federation/idempotency.test.mjs +2 -2
  15. package/dist/federation/inbox.test.mjs +1 -1
  16. package/dist/federation/keycache.test.mjs +18 -7
  17. package/dist/federation/middleware.test.mjs +389 -28
  18. package/dist/federation/mod.cjs +1 -1
  19. package/dist/federation/mod.d.cts +2 -2
  20. package/dist/federation/mod.d.ts +2 -2
  21. package/dist/federation/mod.js +1 -1
  22. package/dist/federation/send.test.mjs +445 -70
  23. package/dist/federation/temporal.test.mjs +1 -1
  24. package/dist/federation/webfinger.test.mjs +1 -1
  25. package/dist/{http-Dl00HXr4.d.ts → http-9IFUxdkp.d.cts} +1 -2
  26. package/dist/{http-OSYYhKM8.js → http-C5g_VrA_.js} +188 -105
  27. package/dist/{http-lCmKCZBI.mjs → http-CQMVisM0.mjs} +195 -97
  28. package/dist/{http-DEH_eppX.cjs → http-D8I7LBfx.cjs} +189 -106
  29. package/dist/{http-DqZhyEso.d.cts → http-SbfezERn.d.ts} +1 -2
  30. package/dist/{inbox-DMATfdEI.mjs → inbox-CD8IDILN.mjs} +1 -1
  31. package/dist/{key-D0ahOVjf.mjs → key-C3o3DGap.mjs} +17 -3
  32. package/dist/{keycache-Dkc_sflV.mjs → keycache-BimEQucx.mjs} +1 -1
  33. package/dist/{kv-cache-B7X4p1y7.js → kv-cache-CSKXXleR.js} +60 -16
  34. package/dist/{kv-cache-CPEV_4nZ.cjs → kv-cache-DC9LcfoC.cjs} +59 -15
  35. package/dist/{ld-CJOXIehz.mjs → ld-ijSr-0AB.mjs} +2 -2
  36. package/dist/{middleware-CHoUjmJm.mjs → middleware-CYAaUTi5.mjs} +79 -39
  37. package/dist/{middleware-QcuVRA-q.cjs → middleware-DNueR0GD.cjs} +185 -60
  38. package/dist/{middleware-D3hx1aiI.cjs → middleware-DmcY2TWS.cjs} +1 -1
  39. package/dist/{middleware-aNUajYPY.js → middleware-sjhz30sm.js} +185 -60
  40. package/dist/{middleware-BgGJEcdp.mjs → middleware-yqqfI7oJ.mjs} +1 -1
  41. package/dist/{mod-B6LmugJ4.d.ts → mod-BRnwh2oy.d.ts} +2 -8
  42. package/dist/{mod-D2JyWtW3.d.cts → mod-BYWp77-z.d.cts} +1 -1
  43. package/dist/{mod-DQGjRJUG.d.ts → mod-BuRRdsfD.d.ts} +1 -1
  44. package/dist/{mod-ej_rLx8h.d.ts → mod-CM5_J_cx.d.ts} +1 -1
  45. package/dist/{mod-a6kmB8xD.d.cts → mod-CVSKw-5H.d.cts} +1 -1
  46. package/dist/{mod-V2vDnYNu.d.cts → mod-Co7LEK9X.d.cts} +2 -8
  47. package/dist/mod.cjs +5 -5
  48. package/dist/mod.d.cts +6 -6
  49. package/dist/mod.d.ts +6 -6
  50. package/dist/mod.js +5 -5
  51. package/dist/nodeinfo/client.test.mjs +337 -19
  52. package/dist/nodeinfo/handler.test.mjs +1 -1
  53. package/dist/nodeinfo/mod.cjs +1 -1
  54. package/dist/nodeinfo/mod.d.cts +1 -1
  55. package/dist/nodeinfo/mod.d.ts +1 -1
  56. package/dist/nodeinfo/mod.js +1 -1
  57. package/dist/otel/exporter.test.mjs +292 -30
  58. package/dist/otel/mod.cjs +36 -30
  59. package/dist/otel/mod.d.cts +13 -0
  60. package/dist/otel/mod.d.ts +13 -0
  61. package/dist/otel/mod.js +36 -30
  62. package/dist/{owner-BUTMEkbn.mjs → owner-B8kXzD0q.mjs} +2 -2
  63. package/dist/{proof-DS1Zl6BX.mjs → proof-CBQOjOgA.mjs} +2 -2
  64. package/dist/{proof-Bm3xyn3D.js → proof-DKX6nASL.js} +1 -1
  65. package/dist/{proof-BeY7TsiS.cjs → proof-qiuGJCD7.cjs} +1 -1
  66. package/dist/{send-fnPrh9Zm.mjs → send-DRpisX_f.mjs} +117 -32
  67. package/dist/sig/http.test.mjs +529 -3
  68. package/dist/sig/key.test.mjs +197 -3
  69. package/dist/sig/ld.test.mjs +47 -2
  70. package/dist/sig/mod.cjs +2 -2
  71. package/dist/sig/mod.d.cts +2 -2
  72. package/dist/sig/mod.d.ts +2 -2
  73. package/dist/sig/mod.js +2 -2
  74. package/dist/sig/owner.test.mjs +46 -1
  75. package/dist/sig/proof.test.mjs +52 -1
  76. package/dist/{temporal-Biz6zK6e.mjs → temporal-BQGEINad.mjs} +1 -1
  77. package/dist/testing/mod.d.mts +26 -1
  78. package/dist/{types-miAYfiGO.js → types-B1_pRFE_.js} +112 -63
  79. package/dist/{types-DRPjmHVV.cjs → types-DOvyymM4.cjs} +111 -62
  80. package/dist/utils/docloader.test.mjs +382 -34
  81. package/dist/utils/mod.cjs +1 -1
  82. package/dist/utils/mod.d.cts +1 -1
  83. package/dist/utils/mod.d.ts +1 -1
  84. package/dist/utils/mod.js +1 -1
  85. package/package.json +6 -6
  86. package/dist/docloader-BGjq1F5U.mjs +0 -81
@@ -2,10 +2,10 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { t as __exportAll } from "./chunk-CRNNMoPX.js";
4
4
  import { r as getDefaultActivityTransformers } from "./transformers-BGMIq1cs.js";
5
- import { a as verifyRequestDetailed, d as importJwk, f as validateCryptoKey, i as verifyRequest, m as formatAcceptSignature, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnock, v as name, y as version } from "./http-OSYYhKM8.js";
6
- import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-miAYfiGO.js";
7
- import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-Bm3xyn3D.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-B7X4p1y7.js";
5
+ import { a as verifyRequestDetailed, d as importJwk, f as validateCryptoKey, i as verifyRequest, m as formatAcceptSignature, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnockScoped, v as name, y as version } from "./http-C5g_VrA_.js";
6
+ import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-B1_pRFE_.js";
7
+ import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-DKX6nASL.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CSKXXleR.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
11
11
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -13,10 +13,11 @@ import { cloneDeep, uniq } from "es-toolkit";
13
13
  import { Router } from "uri-template-router";
14
14
  import { parseTemplate } from "url-template";
15
15
  import { encodeHex } from "byte-encodings/hex";
16
- import { FetchError, UrlError, getDocumentLoader, validatePublicUrl } from "@fedify/vocab-runtime";
16
+ import { FetchError, UrlError, getDocumentLoader } from "@fedify/vocab-runtime";
17
17
  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";
18
18
  import jsonld from "@fedify/vocab-runtime/jsonld";
19
19
  import { lookupWebFinger } from "@fedify/webfinger";
20
+ import { openDirectFetch, openPublicFetch } from "@fedify/vocab-runtime/internal";
20
21
  import { domainToASCII } from "node:url";
21
22
  //#region src/federation/activity-listener.ts
22
23
  var ActivityListenerSet = class {
@@ -935,7 +936,7 @@ async function routeActivity({ context: ctx, json, originalJson, normalizedActiv
935
936
  }
936
937
  //#endregion
937
938
  //#region src/federation/keycache.ts
938
- const KEY_CACHE_GENERATION = "2";
939
+ const KEY_CACHE_GENERATION = "3";
939
940
  var KvKeyCache = class {
940
941
  kv;
941
942
  prefix;
@@ -2737,9 +2738,10 @@ function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
2737
2738
  *
2738
2739
  * @param parameters The parameters for sending the activity.
2739
2740
  * See also {@link SendActivityParameters}.
2741
+ * @param deps The dependencies, for tests.
2740
2742
  * @throws {Error} If the activity fails to send.
2741
2743
  */
2742
- function sendActivity(options) {
2744
+ function sendActivity(options, deps = {}) {
2743
2745
  const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
2744
2746
  return tracerProvider.getTracer(name, version).startActiveSpan("activitypub.send_activity", {
2745
2747
  kind: SpanKind.CLIENT,
@@ -2751,7 +2753,7 @@ function sendActivity(options) {
2751
2753
  await sendActivityInternal({
2752
2754
  ...options,
2753
2755
  tracerProvider
2754
- }, span);
2756
+ }, span, deps);
2755
2757
  } catch (e) {
2756
2758
  span.setStatus({
2757
2759
  code: SpanStatusCode.ERROR,
@@ -2785,21 +2787,25 @@ async function readLimitedResponseBody(response, maxBytes) {
2785
2787
  totalBytes += value.length;
2786
2788
  }
2787
2789
  } finally {
2790
+ if (truncated) reader.cancel().catch(() => {});
2788
2791
  reader.releaseLock();
2789
2792
  }
2790
2793
  let result = chunks.join("");
2791
2794
  if (truncated) result += "… (truncated)";
2792
2795
  return result;
2793
2796
  }
2794
- async function sendActivityInternal({ activity, activityId, keys, inbox, allowPrivateAddress, headers, specDeterminer, tracerProvider }, span) {
2797
+ async function sendActivityInternal({ activity, activityId, keys, inbox, allowPrivateAddress, headers, specDeterminer, tracerProvider }, span, deps) {
2795
2798
  const logger = getLogger([
2796
2799
  "fedify",
2797
2800
  "federation",
2798
2801
  "outbox"
2799
2802
  ]);
2800
- async function validateUrl(url) {
2801
- if (!allowPrivateAddress) try {
2802
- await validatePublicUrl(url);
2803
+ const openUnvalidatedHop = deps.openHop ?? (allowPrivateAddress ? openDirectFetch : (url) => openPublicFetch(url));
2804
+ let opened = false;
2805
+ async function openHop(url) {
2806
+ let session;
2807
+ try {
2808
+ session = await openUnvalidatedHop(url);
2803
2809
  } catch (error) {
2804
2810
  if (error instanceof UrlError && error.reason === "dns") {
2805
2811
  logger.error("DNS resolution failed for URL: {url}", {
@@ -2816,8 +2822,9 @@ async function sendActivityInternal({ activity, activityId, keys, inbox, allowPr
2816
2822
  });
2817
2823
  throw error;
2818
2824
  }
2825
+ opened = true;
2826
+ return session;
2819
2827
  }
2820
- await validateUrl(inbox.href);
2821
2828
  headers = new Headers(headers);
2822
2829
  headers.set("Content-Type", "application/activity+json");
2823
2830
  const request = new Request(inbox, {
@@ -2838,36 +2845,30 @@ async function sendActivityInternal({ activity, activityId, keys, inbox, allowPr
2838
2845
  privateKey: pair.privateKey
2839
2846
  }))
2840
2847
  });
2841
- let response;
2848
+ let outcome;
2842
2849
  try {
2843
- response = rsaKey == null ? await fetchWithValidatedRedirects(request, validateUrl) : await doubleKnock(request, rsaKey, {
2850
+ outcome = rsaKey == null ? await fetchWithValidatedRedirects(request, openHop, (response) => consumeSendActivityResponse(response, inbox)) : await doubleKnockScoped(request, rsaKey, {
2844
2851
  tracerProvider,
2845
- specDeterminer,
2846
- validateRedirect: validateUrl
2847
- });
2852
+ specDeterminer
2853
+ }, openHop, (response) => consumeSendActivityResponse(response, inbox));
2848
2854
  } catch (error) {
2849
- logger.error("Failed to send activity {activityId} to {inbox}:\n{error}", {
2855
+ if (opened) logger.error("Failed to send activity {activityId} to {inbox}:\n{error}", {
2850
2856
  activityId,
2851
2857
  inbox: inbox.href,
2852
2858
  error
2853
2859
  });
2854
2860
  throw error;
2855
2861
  }
2856
- if (!response.ok) {
2857
- let error;
2858
- try {
2859
- error = await readLimitedResponseBody(response, MAX_ERROR_RESPONSE_BODY_BYTES);
2860
- } catch (_) {
2861
- error = "";
2862
- }
2862
+ if (!outcome.ok) {
2863
+ const { status, statusText, error } = outcome;
2863
2864
  logger.error("Failed to send activity {activityId} to {inbox} ({status} {statusText}):\n{error}", {
2864
2865
  activityId,
2865
2866
  inbox: inbox.href,
2866
- status: response.status,
2867
- statusText: response.statusText,
2867
+ status,
2868
+ statusText,
2868
2869
  error
2869
2870
  });
2870
- throw new SendActivityError(inbox, response.status, `Failed to send activity ${activityId} to ${inbox.href} (${response.status} ${response.statusText}):\n${error}`, error);
2871
+ throw new SendActivityError(inbox, status, `Failed to send activity ${activityId} to ${inbox.href} (${status} ${statusText}):\n${error}`, error);
2871
2872
  }
2872
2873
  span.addEvent("activitypub.activity.sent", {
2873
2874
  "activitypub.activity.json": JSON.stringify(activity),
@@ -2875,10 +2876,74 @@ async function sendActivityInternal({ activity, activityId, keys, inbox, allowPr
2875
2876
  "activitypub.activity.id": activityId ?? ""
2876
2877
  });
2877
2878
  }
2878
- async function fetchWithValidatedRedirects(request, validateUrl) {
2879
+ /**
2880
+ * Starts cancelling the body of a response without waiting for it to settle.
2881
+ * The cancellation of a branch of a tee (e.g., a body cloned by a fetch mock)
2882
+ * settles only after the other branch is cancelled too, per the Streams
2883
+ * standard, so awaiting it could block forever. Failures are only logged.
2884
+ */
2885
+ function cancelResponseBody(response, url) {
2886
+ response.body?.cancel().catch((error) => {
2887
+ getLogger([
2888
+ "fedify",
2889
+ "federation",
2890
+ "outbox"
2891
+ ]).debug("Failed to cancel the response body from {url}: {error}", {
2892
+ url,
2893
+ error
2894
+ });
2895
+ });
2896
+ }
2897
+ /**
2898
+ * Reads what is needed from the final response of a delivery while its
2899
+ * session is open: the body of a successful response is cancelled, and at
2900
+ * most 1 KiB of an error response body is read.
2901
+ */
2902
+ async function consumeSendActivityResponse(response, inbox) {
2903
+ if (response.ok) {
2904
+ cancelResponseBody(response, response.url || inbox.href);
2905
+ return { ok: true };
2906
+ }
2907
+ let error;
2908
+ try {
2909
+ error = await readLimitedResponseBody(response, MAX_ERROR_RESPONSE_BODY_BYTES);
2910
+ } catch (_) {
2911
+ error = "";
2912
+ }
2913
+ return {
2914
+ ok: false,
2915
+ status: response.status,
2916
+ statusText: response.statusText,
2917
+ error
2918
+ };
2919
+ }
2920
+ /**
2921
+ * Sends a request without signing it, following redirects manually like the
2922
+ * Fetch standard does. Every hop is opened with `openHop()`, which validates
2923
+ * the destination, after the previous hop is closed. The final response is
2924
+ * passed to `consume()`, and its session is closed after that.
2925
+ * This is exported only for tests; it is not exported from any entry point.
2926
+ * @param request The request to send.
2927
+ * @param openHop The function to open a session for each hop.
2928
+ * @param consume The function to consume the final response.
2929
+ * @returns The value returned by `consume`.
2930
+ */
2931
+ async function fetchWithValidatedRedirects(request, openHop, consume) {
2932
+ const logger = getLogger([
2933
+ "fedify",
2934
+ "federation",
2935
+ "outbox"
2936
+ ]);
2879
2937
  let body = await request.clone().text();
2880
2938
  for (let redirects = 0;; redirects++) {
2881
- const response = await fetch(request, { redirect: "manual" });
2939
+ const session = await openHop(request.url);
2940
+ let response;
2941
+ try {
2942
+ response = await session.fetch(request, { redirect: "manual" });
2943
+ } catch (error) {
2944
+ await closeAfterError(session, logger);
2945
+ throw error;
2946
+ }
2882
2947
  const location = response.headers.get("Location");
2883
2948
  if (![
2884
2949
  301,
@@ -2886,11 +2951,21 @@ async function fetchWithValidatedRedirects(request, validateUrl) {
2886
2951
  303,
2887
2952
  307,
2888
2953
  308
2889
- ].includes(response.status) || location == null) return response;
2890
- await response.body?.cancel();
2954
+ ].includes(response.status) || location == null) try {
2955
+ return await consume(response);
2956
+ } catch (error) {
2957
+ logger.debug("Failed to consume the response from {url}; closing the session: {error}", {
2958
+ url: request.url,
2959
+ error
2960
+ });
2961
+ throw error;
2962
+ } finally {
2963
+ await session.close();
2964
+ }
2965
+ cancelResponseBody(response, request.url);
2966
+ await session.close();
2891
2967
  if (redirects >= 20) throw new TypeError("Too many redirects");
2892
2968
  const url = new URL(location, request.url);
2893
- await validateUrl(url.href);
2894
2969
  const headers = new Headers(request.headers);
2895
2970
  if (url.origin !== new URL(request.url).origin) {
2896
2971
  headers.delete("Authorization");
@@ -2918,6 +2993,16 @@ async function fetchWithValidatedRedirects(request, validateUrl) {
2918
2993
  });
2919
2994
  }
2920
2995
  }
2996
+ async function closeAfterError(session, logger) {
2997
+ try {
2998
+ await session.close();
2999
+ } catch (error) {
3000
+ logger.debug("Failed to close the session for {url}: {error}", {
3001
+ url: session.url.href,
3002
+ error
3003
+ });
3004
+ }
3005
+ }
2921
3006
  /**
2922
3007
  * An error that is thrown when an activity fails to send to a remote inbox.
2923
3008
  * It contains structured information about the failure, including the HTTP
@@ -4914,43 +4999,83 @@ var RequestContextImpl = class RequestContextImpl extends ContextImpl {
4914
4999
  }
4915
5000
  }), values);
4916
5001
  }
4917
- #signedKey = void 0;
5002
+ #signedKey = null;
5003
+ #signedKeyOwner = null;
5004
+ #signatureChecks = /* @__PURE__ */ new WeakMap();
5005
+ #getSignatureCheck(documentLoader, contextLoader) {
5006
+ let checks = this.#signatureChecks.get(documentLoader);
5007
+ if (checks == null) {
5008
+ checks = /* @__PURE__ */ new WeakMap();
5009
+ this.#signatureChecks.set(documentLoader, checks);
5010
+ }
5011
+ let check = checks.get(contextLoader);
5012
+ if (check == null) {
5013
+ check = {};
5014
+ checks.set(contextLoader, check);
5015
+ }
5016
+ return check;
5017
+ }
4918
5018
  async getSignedKey(options = {}) {
4919
5019
  if (this.#signedKey != null) return this.#signedKey;
4920
- return this.#signedKey = await verifyRequest(this.request, {
5020
+ const documentLoader = options.documentLoader ?? this.documentLoader;
5021
+ const contextLoader = options.contextLoader ?? this.contextLoader;
5022
+ const check = this.#getSignatureCheck(documentLoader, contextLoader);
5023
+ if (check.key != null) return check.key;
5024
+ const promise = verifyRequest(this.request, {
4921
5025
  ...this,
4922
- contextLoader: options.contextLoader ?? this.contextLoader,
4923
- documentLoader: options.documentLoader ?? this.documentLoader,
5026
+ contextLoader,
5027
+ documentLoader,
4924
5028
  timeWindow: this.federation.signatureTimeWindow,
4925
5029
  tracerProvider: options.tracerProvider ?? this.tracerProvider
5030
+ }).then((key) => {
5031
+ if (key != null) this.#signedKey ??= key;
5032
+ return key;
5033
+ }).catch((error) => {
5034
+ if (check.key === promise) check.key = void 0;
5035
+ throw error;
4926
5036
  });
5037
+ check.key = promise;
5038
+ return await promise;
4927
5039
  }
4928
- #signedKeyOwner = void 0;
4929
5040
  async getSignedKeyOwner(options = {}) {
4930
5041
  if (this.#signedKeyOwner != null) return this.#signedKeyOwner;
4931
- const key = await this.getSignedKey(options);
4932
- if (key == null) return this.#signedKeyOwner = null;
4933
- try {
4934
- return this.#signedKeyOwner = await getKeyOwner(key, {
4935
- contextLoader: options.contextLoader ?? this.contextLoader,
4936
- documentLoader: options.documentLoader ?? this.documentLoader,
4937
- tracerProvider: options.tracerProvider ?? this.tracerProvider
4938
- });
4939
- } catch (error) {
4940
- if (error instanceof FetchError) {
4941
- getLogger([
4942
- "fedify",
4943
- "federation",
4944
- "actor"
4945
- ]).warn("Failed to fetch the key owner {keyOwner} of {keyId} while verifying the request signature; treating the request as unauthenticated: {error}", {
4946
- keyId: key.id?.href,
4947
- keyOwner: error.url.href,
4948
- error
4949
- });
4950
- return this.#signedKeyOwner = null;
5042
+ const normalizedOptions = {
5043
+ documentLoader: options.documentLoader ?? this.documentLoader,
5044
+ contextLoader: options.contextLoader ?? this.contextLoader,
5045
+ tracerProvider: options.tracerProvider ?? this.tracerProvider
5046
+ };
5047
+ const check = this.#getSignatureCheck(normalizedOptions.documentLoader, normalizedOptions.contextLoader);
5048
+ if (check.owner != null) return check.owner;
5049
+ const promise = this.getSignedKey(normalizedOptions).then(async (key) => {
5050
+ if (key == null) {
5051
+ if (check.owner === promise) check.owner = void 0;
5052
+ return null;
4951
5053
  }
5054
+ try {
5055
+ const owner = await getKeyOwner(key, normalizedOptions);
5056
+ if (owner != null) this.#signedKeyOwner ??= owner;
5057
+ return owner;
5058
+ } catch (error) {
5059
+ if (error instanceof FetchError) {
5060
+ getLogger([
5061
+ "fedify",
5062
+ "federation",
5063
+ "actor"
5064
+ ]).warn("Failed to fetch the key owner {keyOwner} of {keyId} while verifying the request signature; treating the request as unauthenticated: {error}", {
5065
+ keyId: key.id?.href,
5066
+ keyOwner: error.url.href,
5067
+ error
5068
+ });
5069
+ return null;
5070
+ }
5071
+ throw error;
5072
+ }
5073
+ }).catch((error) => {
5074
+ if (check.owner === promise) check.owner = void 0;
4952
5075
  throw error;
4953
- }
5076
+ });
5077
+ check.owner = promise;
5078
+ return await promise;
4954
5079
  }
4955
5080
  };
4956
5081
  function forwardActivity(ctx, loggerCategory, forwarder, recipients, options) {
@@ -1,5 +1,5 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as FederationImpl } from "./middleware-CHoUjmJm.mjs";
4
+ import { n as FederationImpl } from "./middleware-CYAaUTi5.mjs";
5
5
  export { FederationImpl };
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as HttpMessageSignaturesSpecDeterminer } from "./http-Dl00HXr4.js";
2
+ import { n as HttpMessageSignaturesSpecDeterminer } from "./http-SbfezERn.js";
3
3
  import { n as KvStore, t as KvKey } from "./kv-CxaI4eGo.js";
4
4
  import { TracerProvider } from "@opentelemetry/api";
5
5
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
@@ -42,13 +42,7 @@ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOpt
42
42
  declare function getAuthenticatedDocumentLoader(identity: {
43
43
  keyId: URL;
44
44
  privateKey: CryptoKey;
45
- }, {
46
- allowPrivateAddress,
47
- maxRedirection,
48
- userAgent,
49
- specDeterminer,
50
- tracerProvider
51
- }?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
45
+ }, options?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
52
46
  //#endregion
53
47
  //#region src/utils/kv-cache.d.ts
54
48
  /**
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { S as KeyCache } from "./http-DqZhyEso.cjs";
2
+ import { S as KeyCache } from "./http-9IFUxdkp.cjs";
3
3
  import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
4
4
  import { DocumentLoader } from "@fedify/vocab-runtime";
5
5
  import { TracerProvider } from "@opentelemetry/api";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { $ as ActorAliasMapper, St as WebFingerLinksDispatcher, et as ActorDispatcher, l as RequestContext, tt as ActorHandleMapper } from "./context-OkwEpc3-.js";
2
+ import { $ as ActorAliasMapper, St as WebFingerLinksDispatcher, et as ActorDispatcher, l as RequestContext, tt as ActorHandleMapper } from "./context-DdbLVV_k.js";
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 { S as KeyCache } from "./http-Dl00HXr4.js";
2
+ import { S as KeyCache } from "./http-SbfezERn.js";
3
3
  import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
4
4
  import { TracerProvider } from "@opentelemetry/api";
5
5
  import { DocumentLoader } from "@fedify/vocab-runtime";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { $ as ActorAliasMapper, St as WebFingerLinksDispatcher, et as ActorDispatcher, l as RequestContext, tt as ActorHandleMapper } from "./context-tJbL_Hkw.cjs";
2
+ import { $ as ActorAliasMapper, St as WebFingerLinksDispatcher, et as ActorDispatcher, l as RequestContext, tt as ActorHandleMapper } from "./context-CFQGaq5x.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 { n as HttpMessageSignaturesSpecDeterminer } from "./http-DqZhyEso.cjs";
2
+ import { n as HttpMessageSignaturesSpecDeterminer } from "./http-9IFUxdkp.cjs";
3
3
  import { n as KvStore, t as KvKey } from "./kv-CZKl1IUS.cjs";
4
4
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
5
5
  import { TracerProvider } from "@opentelemetry/api";
@@ -42,13 +42,7 @@ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOpt
42
42
  declare function getAuthenticatedDocumentLoader(identity: {
43
43
  keyId: URL;
44
44
  privateKey: CryptoKey;
45
- }, {
46
- allowPrivateAddress,
47
- maxRedirection,
48
- userAgent,
49
- specDeterminer,
50
- tracerProvider
51
- }?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
45
+ }, options?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
52
46
  //#endregion
53
47
  //#region src/utils/kv-cache.d.ts
54
48
  /**
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-DEH_eppX.cjs");
8
- const require_middleware = require("./middleware-QcuVRA-q.cjs");
9
- const require_types = require("./types-DRPjmHVV.cjs");
10
- const require_proof = require("./proof-BeY7TsiS.cjs");
11
- const require_kv_cache = require("./kv-cache-CPEV_4nZ.cjs");
7
+ const require_http = require("./http-D8I7LBfx.cjs");
8
+ const require_middleware = require("./middleware-DNueR0GD.cjs");
9
+ const require_types = require("./types-DOvyymM4.cjs");
10
+ const require_proof = require("./proof-qiuGJCD7.cjs");
11
+ const require_kv_cache = require("./kv-cache-DC9LcfoC.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
@@ -1,13 +1,13 @@
1
1
  /// <reference lib="esnext.temporal" />
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
- import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-DqZhyEso.cjs";
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-BIBzqEIp.cjs";
3
+ import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-9IFUxdkp.cjs";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-B3hNQCG8.cjs";
5
- import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as ActivityTransformer, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "./context-tJbL_Hkw.cjs";
5
+ import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as ActivityTransformer, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "./context-CFQGaq5x.cjs";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-CZKl1IUS.cjs";
7
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
8
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-a6kmB8xD.cjs";
9
- import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-D2JyWtW3.cjs";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-V2vDnYNu.cjs";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-CVSKw-5H.cjs";
9
+ import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-BYWp77-z.cjs";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-Co7LEK9X.cjs";
11
11
  export * from "@fedify/vocab-runtime";
12
12
 
13
13
  //#region src/mod.d.ts
package/dist/mod.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  /// <reference lib="esnext.temporal" />
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
- import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-Dl00HXr4.js";
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-jE7oGvRh.js";
3
+ import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-SbfezERn.js";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CiBPcC6F.js";
5
- import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as ActivityTransformer, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "./context-OkwEpc3-.js";
5
+ import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as ActivityTransformer, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "./context-DdbLVV_k.js";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-CxaI4eGo.js";
7
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
8
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-DQGjRJUG.js";
9
- import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-ej_rLx8h.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-B6LmugJ4.js";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-BuRRdsfD.js";
9
+ import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-CM5_J_cx.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-BRnwh2oy.js";
11
11
  export * from "@fedify/vocab-runtime";
12
12
 
13
13
  //#region src/mod.d.ts
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 { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-OSYYhKM8.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-aNUajYPY.js";
8
- import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-miAYfiGO.js";
9
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-Bm3xyn3D.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-B7X4p1y7.js";
6
+ import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-C5g_VrA_.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-sjhz30sm.js";
8
+ import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-B1_pRFE_.js";
9
+ import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-DKX6nASL.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CSKXXleR.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";