@fedify/fedify 2.1.24 → 2.1.26

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 (81) hide show
  1. package/dist/{builder-BatYe9a2.mjs → builder-9KbL1CoC.mjs} +11 -3
  2. package/dist/{client-DNiBssfx.mjs → client-DM72NZuk.mjs} +7 -3
  3. package/dist/compat/mod.d.cts +1 -1
  4. package/dist/compat/mod.d.ts +1 -1
  5. package/dist/compat/transformers.test.mjs +1 -1
  6. package/dist/{context-D4s0Wk3N.d.cts → context-BNwv9Q1v.d.cts} +1 -1
  7. package/dist/{context-BgU5UWTx.d.ts → context-DLLaDau8.d.ts} +1 -1
  8. package/dist/{deno-BXkm_rws.mjs → deno-ChmEXNOv.mjs} +1 -1
  9. package/dist/docloader-DEVImb5e.mjs +78 -0
  10. package/dist/federation/builder.test.mjs +37 -2
  11. package/dist/federation/collection.test.mjs +1 -1
  12. package/dist/federation/handler.test.mjs +7 -7
  13. package/dist/federation/idempotency.test.mjs +3 -3
  14. package/dist/federation/inbox.test.mjs +1 -1
  15. package/dist/federation/kv.test.mjs +1 -1
  16. package/dist/federation/middleware.test.mjs +249 -7
  17. package/dist/federation/mod.cjs +1 -1
  18. package/dist/federation/mod.d.cts +3 -3
  19. package/dist/federation/mod.d.ts +3 -3
  20. package/dist/federation/mod.js +1 -1
  21. package/dist/federation/mq.test.mjs +98 -43
  22. package/dist/federation/negotiation.test.mjs +1 -1
  23. package/dist/federation/router.test.mjs +1 -1
  24. package/dist/federation/send.test.mjs +68 -5
  25. package/dist/federation/temporal.test.mjs +2 -2
  26. package/dist/federation/webfinger.test.mjs +2 -2
  27. package/dist/{http-7FmLhLDv.cjs → http-BOH-uFLj.cjs} +6 -2
  28. package/dist/{http-UyebnM2c.mjs → http-B_M80hBW.mjs} +7 -3
  29. package/dist/{http-Chr54tTL.js → http-CeK9QmL_.js} +6 -2
  30. package/dist/{inbox-ByQ2iD14.mjs → inbox-B_O6TjZS.mjs} +1 -1
  31. package/dist/{key-A8SuFznD.mjs → key-BJcK-1Av.mjs} +1 -1
  32. package/dist/{kv-gJ8LYbxX.d.cts → kv-CZKl1IUS.d.cts} +3 -2
  33. package/dist/{kv-D6hNiMTK.d.ts → kv-CxaI4eGo.d.ts} +3 -2
  34. package/dist/{kv-cache-DJhBDA9T.cjs → kv-cache-BlOG31SS.cjs} +34 -8
  35. package/dist/{kv-cache-J6hmiAEd.js → kv-cache-CEJICY0R.js} +35 -9
  36. package/dist/{ld-BSvHU-S0.mjs → ld-YAXn6sG8.mjs} +3 -3
  37. package/dist/{middleware-Do50b12a.js → middleware-C-45wr85.js} +30 -10
  38. package/dist/{middleware-Dy18K1xP.mjs → middleware-Co_QOX9H.mjs} +21 -18
  39. package/dist/{middleware-CCYqHlzn.cjs → middleware-DHGVHIUj.cjs} +31 -11
  40. package/dist/{middleware-DvxNTKpl.mjs → middleware-DmTWC5VG.mjs} +1 -1
  41. package/dist/{middleware-Bddj287b.cjs → middleware-dGW2gSDG.cjs} +1 -1
  42. package/dist/{mod-Bx80LUTA.d.cts → mod-BmlfRBmU.d.cts} +1 -1
  43. package/dist/{mod-DcAiY74j.d.ts → mod-CWJNbyju.d.ts} +1 -1
  44. package/dist/{mod-DniKVJ_C.d.cts → mod-Cn9GJ5ex.d.cts} +3 -1
  45. package/dist/{mod-CMK_S-eX.d.ts → mod-DNEgTI8M.d.ts} +3 -1
  46. package/dist/mod.cjs +5 -5
  47. package/dist/mod.d.cts +4 -4
  48. package/dist/mod.d.ts +4 -4
  49. package/dist/mod.js +5 -5
  50. package/dist/nodeinfo/client.test.mjs +50 -2
  51. package/dist/nodeinfo/handler.test.mjs +2 -2
  52. package/dist/nodeinfo/mod.cjs +1 -1
  53. package/dist/nodeinfo/mod.js +1 -1
  54. package/dist/nodeinfo/types.test.mjs +1 -1
  55. package/dist/otel/exporter.test.mjs +1 -1
  56. package/dist/otel/mod.d.cts +1 -1
  57. package/dist/otel/mod.d.ts +1 -1
  58. package/dist/{owner-CaaCVHsG.mjs → owner-B3ZkY-Ov.mjs} +2 -2
  59. package/dist/{proof-BrOQrPQf.js → proof-BeGIkK97.js} +2 -2
  60. package/dist/{proof-_AyA4r7z.mjs → proof-DIGrz49z.mjs} +2 -2
  61. package/dist/{proof-CaCUMcvk.cjs → proof-DzOl2GlQ.cjs} +2 -2
  62. package/dist/{send-B1CRgb14.mjs → send-N2w1IwXT.mjs} +12 -3
  63. package/dist/sig/http.test.mjs +43 -3
  64. package/dist/sig/key.test.mjs +2 -2
  65. package/dist/sig/ld.test.mjs +5 -2
  66. package/dist/sig/mod.cjs +2 -2
  67. package/dist/sig/mod.js +2 -2
  68. package/dist/sig/owner.test.mjs +2 -2
  69. package/dist/sig/proof.test.mjs +2 -2
  70. package/dist/{std__assert-Duiq_YC9.mjs → std__assert-BUOJXi-Z.mjs} +1 -26
  71. package/dist/{temporal-Pmk5ouB1.mjs → temporal-CpT0u5Mx.mjs} +1 -1
  72. package/dist/{types-DWs-qZaY.cjs → types-DRPjmHVV.cjs} +7 -3
  73. package/dist/{types-sXITXcWa.js → types-miAYfiGO.js} +7 -3
  74. package/dist/utils/docloader.test.mjs +299 -3
  75. package/dist/utils/mod.cjs +1 -1
  76. package/dist/utils/mod.d.cts +1 -1
  77. package/dist/utils/mod.d.ts +1 -1
  78. package/dist/utils/mod.js +1 -1
  79. package/dist/vocab/cjs.test.mjs +1 -1
  80. package/package.json +7 -7
  81. package/dist/docloader-DdEK2tXP.mjs +0 -52
@@ -1,19 +1,22 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { f as validateCryptoKey, t as doubleKnock } from "./http-Chr54tTL.js";
3
+ import { f as validateCryptoKey, t as doubleKnock } from "./http-CeK9QmL_.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { curry } from "es-toolkit";
6
- import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
6
+ import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
7
7
  //#region src/utils/docloader.ts
8
8
  const logger$1 = getLogger([
9
9
  "fedify",
10
10
  "utils",
11
11
  "docloader"
12
12
  ]);
13
+ const DEFAULT_MAX_REDIRECTION = 20;
13
14
  /**
14
15
  * Gets an authenticated {@link DocumentLoader} for the given identity.
15
16
  * Note that an authenticated document loader intentionally does not cache
16
17
  * the fetched documents.
18
+ * At most 20 HTTP redirects and alternate document links are followed in total
19
+ * per call. Revisiting a URL within that chain throws a {@link FetchError}.
17
20
  * @param identity The identity to get the document loader for.
18
21
  * The actor's key pair.
19
22
  * @param options The options for the document loader.
@@ -23,28 +26,51 @@ const logger$1 = getLogger([
23
26
  */
24
27
  function getAuthenticatedDocumentLoader(identity, { allowPrivateAddress, userAgent, specDeterminer, tracerProvider } = {}) {
25
28
  validateCryptoKey(identity.privateKey);
26
- async function load(url, options) {
27
- await validateUrl(url);
28
- return getRemoteDocument(url, await doubleKnock(createActivityPubRequest(url, { userAgent }), identity, {
29
+ async function load(url, options, redirected = 0, visited = /* @__PURE__ */ new Set()) {
30
+ options?.signal?.throwIfAborted();
31
+ let currentUrl = new URL(url).href;
32
+ await validateUrl(currentUrl);
33
+ visited.add(currentUrl);
34
+ const originalRequest = createActivityPubRequest(currentUrl, { userAgent });
35
+ function follow(nextUrl) {
36
+ options?.signal?.throwIfAborted();
37
+ if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(currentUrl, `Too many redirections (${redirected + 1})`);
38
+ if (visited.has(nextUrl)) throw new FetchError(currentUrl, `Redirect loop detected: ${nextUrl}`);
39
+ redirected++;
40
+ }
41
+ const response = await doubleKnock(originalRequest, identity, {
29
42
  specDeterminer,
30
43
  log: curry(logRequest)(logger$1),
31
44
  tracerProvider,
32
45
  signal: options?.signal,
33
- validateRedirect: validateUrl
34
- }), load);
46
+ validateRedirect: async (nextUrl) => {
47
+ follow(nextUrl);
48
+ await validateUrl(nextUrl);
49
+ visited.add(nextUrl);
50
+ currentUrl = nextUrl;
51
+ }
52
+ });
53
+ return getRemoteDocument(currentUrl, response, (alternateUrl) => {
54
+ follow(alternateUrl);
55
+ return load(alternateUrl, options, redirected, visited);
56
+ });
35
57
  }
36
58
  async function validateUrl(url) {
37
59
  if (!allowPrivateAddress) try {
38
60
  await validatePublicUrl(url);
39
61
  } catch (error) {
40
- if (error instanceof UrlError) logger$1.error("Disallowed private URL: {url}", {
62
+ if (error instanceof UrlError) if (error.reason === "dns") logger$1.debug("DNS lookup failed for {url}", {
63
+ url,
64
+ error
65
+ });
66
+ else logger$1.error("Disallowed private URL: {url}", {
41
67
  url,
42
68
  error
43
69
  });
44
70
  throw error;
45
71
  }
46
72
  }
47
- return load;
73
+ return (url, options) => load(url, options);
48
74
  }
49
75
  //#endregion
50
76
  //#region src/utils/kv-cache.ts
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-BXkm_rws.mjs";
5
- import { r as fetchKey, s as validateCryptoKey } from "./key-A8SuFznD.mjs";
4
+ import { n as version, t as name } from "./deno-ChmEXNOv.mjs";
5
+ import { r as fetchKey, s as validateCryptoKey } from "./key-BJcK-1Av.mjs";
6
6
  import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
7
7
  import { SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
@@ -203,7 +203,7 @@ function normalizeContextReference(reference, baseUrl) {
203
203
  /** @internal */
204
204
  function isInvalidUrlTypeError(error) {
205
205
  const code = error.code;
206
- return error instanceof TypeError && (code === "ERR_INVALID_URL" || /^Invalid URL(?::|$)/.test(error.message) || / cannot be parsed as a URL\.?$/.test(error.message));
206
+ return error instanceof TypeError && (code === "ERR_INVALID_URL" || error.message === "Invalid URL string." || /^Invalid URL(?::|$)/.test(error.message) || / cannot be parsed as a URL\.?$/.test(error.message));
207
207
  }
208
208
  async function applyGraphAliasContext(state, context, documentLoader, remoteContextCache, baseUrl = null, processingContexts = /* @__PURE__ */ new Set()) {
209
209
  if (context === null) return createGraphAliasContextState();
@@ -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-Chr54tTL.js";
6
- import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-sXITXcWa.js";
7
- import { _ as signJsonLd, a as doesActorOwnKey, c as assertSafeJsonLd, f as detachSignature, g as isInvalidUrlTypeError, h as isClearlyMalformedContextReference, m as hasSignature, n as signObject, o as getKeyOwner, p as getNormalizationContextLoader, r as verifyObject, s as InvalidContextReferenceError, u as compactJsonLd, v as verifyCompactJsonLd, x as wrapContextLoaderForJsonLd } from "./proof-BrOQrPQf.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-J6hmiAEd.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-CeK9QmL_.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 signJsonLd, a as doesActorOwnKey, c as assertSafeJsonLd, f as detachSignature, g as isInvalidUrlTypeError, h as isClearlyMalformedContextReference, m as hasSignature, n as signObject, o as getKeyOwner, p as getNormalizationContextLoader, r as verifyObject, s as InvalidContextReferenceError, u as compactJsonLd, v as verifyCompactJsonLd, x as wrapContextLoaderForJsonLd } from "./proof-BeGIkK97.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CEJICY0R.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
11
11
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -327,6 +327,7 @@ var FederationBuilderImpl = class {
327
327
  * Symbol registry for unique identification of unnamed symbols.
328
328
  */
329
329
  #symbolRegistry = /* @__PURE__ */ new Map();
330
+ #collectionNames = /* @__PURE__ */ new Map();
330
331
  constructor() {
331
332
  this.router = new Router$1();
332
333
  this.objectCallbacks = {};
@@ -348,6 +349,8 @@ var FederationBuilderImpl = class {
348
349
  f.objectTypeIds = { ...this.objectTypeIds };
349
350
  f.collectionCallbacks = { ...this.collectionCallbacks };
350
351
  f.collectionTypeIds = { ...this.collectionTypeIds };
352
+ f.#symbolRegistry = new Map(this.#symbolRegistry);
353
+ f.#collectionNames = new Map(this.#collectionNames);
351
354
  f.inboxPath = this.inboxPath;
352
355
  f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
353
356
  f.outboxCallbacks = this.outboxCallbacks == null ? void 0 : { ...this.outboxCallbacks };
@@ -760,6 +763,7 @@ var FederationBuilderImpl = class {
760
763
  if (this.router.has(routeName)) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
761
764
  if (this.collectionCallbacks[name] != null) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
762
765
  if (this.router.add(path, routeName).size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
766
+ this.#collectionNames.set(routeName, name);
763
767
  const callbacks = { dispatcher };
764
768
  this.collectionCallbacks[name] = callbacks;
765
769
  this.collectionTypeIds[name] = itemType;
@@ -796,6 +800,10 @@ var FederationBuilderImpl = class {
796
800
  const routeName = this.#uniqueCollectionId(name);
797
801
  return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
798
802
  }
803
+ /** Resolves a custom collection route to its original name. */
804
+ getCollectionName(routeName) {
805
+ return this.#collectionNames.get(routeName) ?? routeName.replace(/^(collection|orderedCollection):/, "");
806
+ }
799
807
  setOutboxPermanentFailureHandler(handler) {
800
808
  this.outboxPermanentFailureHandler = handler;
801
809
  }
@@ -2470,6 +2478,15 @@ async function sendActivityInternal({ activity, activityId, keys, inbox, allowPr
2470
2478
  if (!allowPrivateAddress) try {
2471
2479
  await validatePublicUrl(url);
2472
2480
  } catch (error) {
2481
+ if (error instanceof UrlError && error.reason === "dns") {
2482
+ logger.error("DNS resolution failed for URL: {url}", {
2483
+ url,
2484
+ error
2485
+ });
2486
+ const failure = new FetchError(url, error.message);
2487
+ failure.cause = error;
2488
+ throw failure;
2489
+ }
2473
2490
  if (error instanceof UrlError) logger.error("Disallowed private URL: {url}", {
2474
2491
  url,
2475
2492
  error
@@ -3803,10 +3820,10 @@ var FederationImpl = class extends FederationBuilderImpl {
3803
3820
  onNotFound
3804
3821
  });
3805
3822
  case "collection": {
3806
- const name = route.name.replace(/^collection:/, "");
3823
+ const name = this.getCollectionName(route.name);
3807
3824
  const callbacks = this.collectionCallbacks[name];
3808
3825
  return await handleCustomCollection(request, {
3809
- name,
3826
+ name: String(name),
3810
3827
  context,
3811
3828
  values: route.values,
3812
3829
  collectionCallbacks: callbacks,
@@ -3816,10 +3833,10 @@ var FederationImpl = class extends FederationBuilderImpl {
3816
3833
  });
3817
3834
  }
3818
3835
  case "orderedCollection": {
3819
- const name = route.name.replace(/^orderedCollection:/, "");
3836
+ const name = this.getCollectionName(route.name);
3820
3837
  const callbacks = this.collectionCallbacks[name];
3821
3838
  return await handleOrderedCollection(request, {
3822
- name,
3839
+ name: String(name),
3823
3840
  context,
3824
3841
  values: route.values,
3825
3842
  collectionCallbacks: callbacks,
@@ -4002,8 +4019,10 @@ var ContextImpl = class ContextImpl {
4002
4019
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
4003
4020
  const match = route.name.match(collectionRegex);
4004
4021
  if (match !== null) {
4005
- const [, type, name] = match;
4022
+ const [, type] = match;
4023
+ const name = this.federation.getCollectionName(route.name);
4006
4024
  const cls = this.federation.collectionTypeIds[name];
4025
+ if (cls == null) return null;
4007
4026
  return {
4008
4027
  type,
4009
4028
  name,
@@ -4350,7 +4369,7 @@ var ContextImpl = class ContextImpl {
4350
4369
  "inbox"
4351
4370
  ]);
4352
4371
  const contextLoader = options.contextLoader ?? this.contextLoader;
4353
- const json = await activity.toJsonLd({ contextLoader });
4372
+ let json = await activity.toJsonLd({ contextLoader });
4354
4373
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
4355
4374
  if (await verifyObject(Activity, json, {
4356
4375
  contextLoader,
@@ -4406,6 +4425,7 @@ var ContextImpl = class ContextImpl {
4406
4425
  }
4407
4426
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
4408
4427
  activity = fetched;
4428
+ json = await fetched.toJsonLd({ contextLoader });
4409
4429
  } else logger.debug("Object Integrity Proofs are verified.", {
4410
4430
  recipient,
4411
4431
  activity: json
@@ -2,25 +2,25 @@ 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-BXkm_rws.mjs";
5
+ import { n as version, t as name } from "./deno-ChmEXNOv.mjs";
6
6
  import { t as formatAcceptSignature } from "./accept-BavzedPB.mjs";
7
- import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-A8SuFznD.mjs";
8
- import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-UyebnM2c.mjs";
9
- import { t as getAuthenticatedDocumentLoader } from "./docloader-DdEK2tXP.mjs";
7
+ import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-BJcK-1Av.mjs";
8
+ import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-B_M80hBW.mjs";
9
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-DEVImb5e.mjs";
10
10
  import { n as kvCache } from "./kv-cache-DqEKe5E0.mjs";
11
- 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-BSvHU-S0.mjs";
12
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CaaCVHsG.mjs";
13
- import { n as signObject, r as verifyObject } from "./proof-_AyA4r7z.mjs";
14
- import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-DNiBssfx.mjs";
11
+ 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-YAXn6sG8.mjs";
12
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-B3ZkY-Ov.mjs";
13
+ import { n as signObject, r as verifyObject } from "./proof-DIGrz49z.mjs";
14
+ import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-DM72NZuk.mjs";
15
15
  import { t as nodeInfoToJson } from "./types-C37hquWI.mjs";
16
- import { n as routeActivity } from "./inbox-ByQ2iD14.mjs";
17
- import { t as FederationBuilderImpl } from "./builder-BatYe9a2.mjs";
16
+ import { n as routeActivity } from "./inbox-B_O6TjZS.mjs";
17
+ import { t as FederationBuilderImpl } from "./builder-9KbL1CoC.mjs";
18
18
  import { t as buildCollectionSynchronizationHeader } from "./collection-ChgDTHLz.mjs";
19
19
  import { t as KvKeyCache } from "./keycache-CaO7wyQA.mjs";
20
20
  import { t as acceptsJsonLd } from "./negotiation-BehA2uul.mjs";
21
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-Pmk5ouB1.mjs";
21
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-CpT0u5Mx.mjs";
22
22
  import { t as createExponentialBackoffPolicy } from "./retry-B_E3V_Dx.mjs";
23
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-B1CRgb14.mjs";
23
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-N2w1IwXT.mjs";
24
24
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
25
25
  import { lookupWebFinger } from "@fedify/webfinger";
26
26
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -2531,10 +2531,10 @@ var FederationImpl = class extends FederationBuilderImpl {
2531
2531
  onNotFound
2532
2532
  });
2533
2533
  case "collection": {
2534
- const name = route.name.replace(/^collection:/, "");
2534
+ const name = this.getCollectionName(route.name);
2535
2535
  const callbacks = this.collectionCallbacks[name];
2536
2536
  return await handleCustomCollection(request, {
2537
- name,
2537
+ name: String(name),
2538
2538
  context,
2539
2539
  values: route.values,
2540
2540
  collectionCallbacks: callbacks,
@@ -2544,10 +2544,10 @@ var FederationImpl = class extends FederationBuilderImpl {
2544
2544
  });
2545
2545
  }
2546
2546
  case "orderedCollection": {
2547
- const name = route.name.replace(/^orderedCollection:/, "");
2547
+ const name = this.getCollectionName(route.name);
2548
2548
  const callbacks = this.collectionCallbacks[name];
2549
2549
  return await handleOrderedCollection(request, {
2550
- name,
2550
+ name: String(name),
2551
2551
  context,
2552
2552
  values: route.values,
2553
2553
  collectionCallbacks: callbacks,
@@ -2730,8 +2730,10 @@ var ContextImpl = class ContextImpl {
2730
2730
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
2731
2731
  const match = route.name.match(collectionRegex);
2732
2732
  if (match !== null) {
2733
- const [, type, name] = match;
2733
+ const [, type] = match;
2734
+ const name = this.federation.getCollectionName(route.name);
2734
2735
  const cls = this.federation.collectionTypeIds[name];
2736
+ if (cls == null) return null;
2735
2737
  return {
2736
2738
  type,
2737
2739
  name,
@@ -3078,7 +3080,7 @@ var ContextImpl = class ContextImpl {
3078
3080
  "inbox"
3079
3081
  ]);
3080
3082
  const contextLoader = options.contextLoader ?? this.contextLoader;
3081
- const json = await activity.toJsonLd({ contextLoader });
3083
+ let json = await activity.toJsonLd({ contextLoader });
3082
3084
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
3083
3085
  if (await verifyObject(Activity, json, {
3084
3086
  contextLoader,
@@ -3134,6 +3136,7 @@ var ContextImpl = class ContextImpl {
3134
3136
  }
3135
3137
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
3136
3138
  activity = fetched;
3139
+ json = await fetched.toJsonLd({ contextLoader });
3137
3140
  } else logger.debug("Object Integrity Proofs are verified.", {
3138
3141
  recipient,
3139
3142
  activity: json
@@ -2,10 +2,10 @@ const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  const require_chunk = require("./chunk-DDcVe30Y.cjs");
4
4
  const require_transformers = require("./transformers-NeAONrAq.cjs");
5
- const require_http = require("./http-7FmLhLDv.cjs");
6
- const require_types = require("./types-DWs-qZaY.cjs");
7
- const require_proof = require("./proof-CaCUMcvk.cjs");
8
- const require_kv_cache = require("./kv-cache-DJhBDA9T.cjs");
5
+ const require_http = require("./http-BOH-uFLj.cjs");
6
+ const require_types = require("./types-DRPjmHVV.cjs");
7
+ const require_proof = require("./proof-DzOl2GlQ.cjs");
8
+ const require_kv_cache = require("./kv-cache-BlOG31SS.cjs");
9
9
  let _logtape_logtape = require("@logtape/logtape");
10
10
  let _fedify_vocab = require("@fedify/vocab");
11
11
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -328,6 +328,7 @@ var FederationBuilderImpl = class {
328
328
  * Symbol registry for unique identification of unnamed symbols.
329
329
  */
330
330
  #symbolRegistry = /* @__PURE__ */ new Map();
331
+ #collectionNames = /* @__PURE__ */ new Map();
331
332
  constructor() {
332
333
  this.router = new Router();
333
334
  this.objectCallbacks = {};
@@ -336,7 +337,7 @@ var FederationBuilderImpl = class {
336
337
  this.collectionTypeIds = {};
337
338
  }
338
339
  async build(options) {
339
- const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-Bddj287b.cjs"));
340
+ const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-dGW2gSDG.cjs"));
340
341
  const f = new FederationImpl(options);
341
342
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
342
343
  f.router = this.router.clone();
@@ -349,6 +350,8 @@ var FederationBuilderImpl = class {
349
350
  f.objectTypeIds = { ...this.objectTypeIds };
350
351
  f.collectionCallbacks = { ...this.collectionCallbacks };
351
352
  f.collectionTypeIds = { ...this.collectionTypeIds };
353
+ f.#symbolRegistry = new Map(this.#symbolRegistry);
354
+ f.#collectionNames = new Map(this.#collectionNames);
352
355
  f.inboxPath = this.inboxPath;
353
356
  f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
354
357
  f.outboxCallbacks = this.outboxCallbacks == null ? void 0 : { ...this.outboxCallbacks };
@@ -761,6 +764,7 @@ var FederationBuilderImpl = class {
761
764
  if (this.router.has(routeName)) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
762
765
  if (this.collectionCallbacks[name] != null) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
763
766
  if (this.router.add(path, routeName).size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
767
+ this.#collectionNames.set(routeName, name);
764
768
  const callbacks = { dispatcher };
765
769
  this.collectionCallbacks[name] = callbacks;
766
770
  this.collectionTypeIds[name] = itemType;
@@ -797,6 +801,10 @@ var FederationBuilderImpl = class {
797
801
  const routeName = this.#uniqueCollectionId(name);
798
802
  return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
799
803
  }
804
+ /** Resolves a custom collection route to its original name. */
805
+ getCollectionName(routeName) {
806
+ return this.#collectionNames.get(routeName) ?? routeName.replace(/^(collection|orderedCollection):/, "");
807
+ }
800
808
  setOutboxPermanentFailureHandler(handler) {
801
809
  this.outboxPermanentFailureHandler = handler;
802
810
  }
@@ -2471,6 +2479,15 @@ async function sendActivityInternal({ activity, activityId, keys, inbox, allowPr
2471
2479
  if (!allowPrivateAddress) try {
2472
2480
  await (0, _fedify_vocab_runtime.validatePublicUrl)(url);
2473
2481
  } catch (error) {
2482
+ if (error instanceof _fedify_vocab_runtime.UrlError && error.reason === "dns") {
2483
+ logger.error("DNS resolution failed for URL: {url}", {
2484
+ url,
2485
+ error
2486
+ });
2487
+ const failure = new _fedify_vocab_runtime.FetchError(url, error.message);
2488
+ failure.cause = error;
2489
+ throw failure;
2490
+ }
2474
2491
  if (error instanceof _fedify_vocab_runtime.UrlError) logger.error("Disallowed private URL: {url}", {
2475
2492
  url,
2476
2493
  error
@@ -3797,10 +3814,10 @@ var FederationImpl = class extends FederationBuilderImpl {
3797
3814
  onNotFound
3798
3815
  });
3799
3816
  case "collection": {
3800
- const name = route.name.replace(/^collection:/, "");
3817
+ const name = this.getCollectionName(route.name);
3801
3818
  const callbacks = this.collectionCallbacks[name];
3802
3819
  return await handleCustomCollection(request, {
3803
- name,
3820
+ name: String(name),
3804
3821
  context,
3805
3822
  values: route.values,
3806
3823
  collectionCallbacks: callbacks,
@@ -3810,10 +3827,10 @@ var FederationImpl = class extends FederationBuilderImpl {
3810
3827
  });
3811
3828
  }
3812
3829
  case "orderedCollection": {
3813
- const name = route.name.replace(/^orderedCollection:/, "");
3830
+ const name = this.getCollectionName(route.name);
3814
3831
  const callbacks = this.collectionCallbacks[name];
3815
3832
  return await handleOrderedCollection(request, {
3816
- name,
3833
+ name: String(name),
3817
3834
  context,
3818
3835
  values: route.values,
3819
3836
  collectionCallbacks: callbacks,
@@ -3996,8 +4013,10 @@ var ContextImpl = class ContextImpl {
3996
4013
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
3997
4014
  const match = route.name.match(collectionRegex);
3998
4015
  if (match !== null) {
3999
- const [, type, name] = match;
4016
+ const [, type] = match;
4017
+ const name = this.federation.getCollectionName(route.name);
4000
4018
  const cls = this.federation.collectionTypeIds[name];
4019
+ if (cls == null) return null;
4001
4020
  return {
4002
4021
  type,
4003
4022
  name,
@@ -4344,7 +4363,7 @@ var ContextImpl = class ContextImpl {
4344
4363
  "inbox"
4345
4364
  ]);
4346
4365
  const contextLoader = options.contextLoader ?? this.contextLoader;
4347
- const json = await activity.toJsonLd({ contextLoader });
4366
+ let json = await activity.toJsonLd({ contextLoader });
4348
4367
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
4349
4368
  if (await require_proof.verifyObject(_fedify_vocab.Activity, json, {
4350
4369
  contextLoader,
@@ -4400,6 +4419,7 @@ var ContextImpl = class ContextImpl {
4400
4419
  }
4401
4420
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
4402
4421
  activity = fetched;
4422
+ json = await fetched.toJsonLd({ contextLoader });
4403
4423
  } else logger.debug("Object Integrity Proofs are verified.", {
4404
4424
  recipient,
4405
4425
  activity: json
@@ -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-Dy18K1xP.mjs";
4
+ import { n as FederationImpl } from "./middleware-Co_QOX9H.mjs";
5
5
  export { FederationImpl };
@@ -1,4 +1,4 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
- const require_middleware = require("./middleware-CCYqHlzn.cjs");
3
+ const require_middleware = require("./middleware-DHGVHIUj.cjs");
4
4
  exports.FederationImpl = require_middleware.FederationImpl;
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Q as ActorHandleMapper, X as ActorAliasMapper, Z as ActorDispatcher, _t as WebFingerLinksDispatcher, s as RequestContext } from "./context-D4s0Wk3N.cjs";
2
+ import { Q as ActorHandleMapper, X as ActorAliasMapper, Z as ActorDispatcher, _t as WebFingerLinksDispatcher, s as RequestContext } from "./context-BNwv9Q1v.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 { Q as ActorHandleMapper, X as ActorAliasMapper, Z as ActorDispatcher, _t as WebFingerLinksDispatcher, s as RequestContext } from "./context-BgU5UWTx.js";
2
+ import { Q as ActorHandleMapper, X as ActorAliasMapper, Z as ActorDispatcher, _t as WebFingerLinksDispatcher, s as RequestContext } from "./context-DLLaDau8.js";
3
3
  import { Span, Tracer } from "@opentelemetry/api";
4
4
 
5
5
  //#region src/federation/webfinger.d.ts
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { n as HttpMessageSignaturesSpecDeterminer } from "./http-DqZhyEso.cjs";
3
- import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
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";
6
6
 
@@ -30,6 +30,8 @@ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOpt
30
30
  * Gets an authenticated {@link DocumentLoader} for the given identity.
31
31
  * Note that an authenticated document loader intentionally does not cache
32
32
  * the fetched documents.
33
+ * At most 20 HTTP redirects and alternate document links are followed in total
34
+ * per call. Revisiting a URL within that chain throws a {@link FetchError}.
33
35
  * @param identity The identity to get the document loader for.
34
36
  * The actor's key pair.
35
37
  * @param options The options for the document loader.
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { n as HttpMessageSignaturesSpecDeterminer } from "./http-Dl00HXr4.js";
3
- import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
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";
6
6
 
@@ -30,6 +30,8 @@ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOpt
30
30
  * Gets an authenticated {@link DocumentLoader} for the given identity.
31
31
  * Note that an authenticated document loader intentionally does not cache
32
32
  * the fetched documents.
33
+ * At most 20 HTTP redirects and alternate document links are followed in total
34
+ * per call. Revisiting a URL within that chain throws a {@link FetchError}.
33
35
  * @param identity The identity to get the document loader for.
34
36
  * The actor's key pair.
35
37
  * @param options The options for the document loader.
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-7FmLhLDv.cjs");
8
- const require_middleware = require("./middleware-CCYqHlzn.cjs");
9
- const require_types = require("./types-DWs-qZaY.cjs");
10
- const require_proof = require("./proof-CaCUMcvk.cjs");
11
- const require_kv_cache = require("./kv-cache-DJhBDA9T.cjs");
7
+ const require_http = require("./http-BOH-uFLj.cjs");
8
+ const require_middleware = require("./middleware-DHGVHIUj.cjs");
9
+ const require_types = require("./types-DRPjmHVV.cjs");
10
+ const require_proof = require("./proof-DzOl2GlQ.cjs");
11
+ const require_kv_cache = require("./kv-cache-BlOG31SS.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,12 +2,12 @@
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 { 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";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-B3hNQCG8.cjs";
5
- import { $ as ActorKeyPairsDispatcher, A as createFederation, B as RouterRouteResult, C as InboxChallengePolicy, Ct as ActivityTransformer, D as FederationKvPrefixes, E as Rfc6570Expression, F as Message, G as InProcessMessageQueueOptions, H as respondWithObject, I as createFederationBuilder, J as MessageQueueListenOptions, K as MessageQueue, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as ActorHandleMapper, R as RouterError, S as IdempotencyStrategy, St as digest, T as ObjectCallbackSetters, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as InProcessMessageQueue, X as ActorAliasMapper, Y as ParallelMessageQueue, Z as ActorDispatcher, _ as FederationBuilder, _t as WebFingerLinksDispatcher, a as InboxContext, at as CustomCollectionCursor, b as FederationStartQueueOptions, bt as PageItems, c as RouteActivityOptions, ct as InboxListener, d as ActorCallbackSetters, dt as ObjectDispatcher, et as AuthorizePredicate, f as CollectionCallbackSetters, ft as OutboxErrorHandler, g as Federation, gt as UnverifiedActivityReason, h as Federatable, ht as UnverifiedActivityHandler, i as GetSignedKeyOptions, it as CustomCollectionCounter, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as NodeInfoDispatcher, m as CustomCollectionCallbackSetters, mt as SharedInboxKeyDispatcher, n as Context, nt as CollectionCursor, o as ParseUriResult, ot as CustomCollectionDispatcher, p as ConstructorWithTypeId, pt as OutboxPermanentFailureHandler, q as MessageQueueEnqueueOptions, r as ForwardActivityOptions, rt as CollectionDispatcher, s as RequestContext, st as InboxErrorHandler, t as ActorKeyPair, tt as CollectionCounter, u as SendActivityOptionsForCollection, ut as ObjectAuthorizePredicate, v as FederationFetchOptions, vt as SendActivityError, w as InboxListenerSetters, x as IdempotencyKeyCallback, xt as buildCollectionSynchronizationHeader, y as FederationOptions, yt as SenderKeyPair, z as RouterOptions } from "./context-D4s0Wk3N.cjs";
6
- import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
5
+ import { $ as ActorKeyPairsDispatcher, A as createFederation, B as RouterRouteResult, C as InboxChallengePolicy, Ct as ActivityTransformer, D as FederationKvPrefixes, E as Rfc6570Expression, F as Message, G as InProcessMessageQueueOptions, H as respondWithObject, I as createFederationBuilder, J as MessageQueueListenOptions, K as MessageQueue, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as ActorHandleMapper, R as RouterError, S as IdempotencyStrategy, St as digest, T as ObjectCallbackSetters, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as InProcessMessageQueue, X as ActorAliasMapper, Y as ParallelMessageQueue, Z as ActorDispatcher, _ as FederationBuilder, _t as WebFingerLinksDispatcher, a as InboxContext, at as CustomCollectionCursor, b as FederationStartQueueOptions, bt as PageItems, c as RouteActivityOptions, ct as InboxListener, d as ActorCallbackSetters, dt as ObjectDispatcher, et as AuthorizePredicate, f as CollectionCallbackSetters, ft as OutboxErrorHandler, g as Federation, gt as UnverifiedActivityReason, h as Federatable, ht as UnverifiedActivityHandler, i as GetSignedKeyOptions, it as CustomCollectionCounter, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as NodeInfoDispatcher, m as CustomCollectionCallbackSetters, mt as SharedInboxKeyDispatcher, n as Context, nt as CollectionCursor, o as ParseUriResult, ot as CustomCollectionDispatcher, p as ConstructorWithTypeId, pt as OutboxPermanentFailureHandler, q as MessageQueueEnqueueOptions, r as ForwardActivityOptions, rt as CollectionDispatcher, s as RequestContext, st as InboxErrorHandler, t as ActorKeyPair, tt as CollectionCounter, u as SendActivityOptionsForCollection, ut as ObjectAuthorizePredicate, v as FederationFetchOptions, vt as SendActivityError, w as InboxListenerSetters, x as IdempotencyKeyCallback, xt as buildCollectionSynchronizationHeader, y as FederationOptions, yt as SenderKeyPair, z as RouterOptions } from "./context-BNwv9Q1v.cjs";
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-Bx80LUTA.cjs";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-BmlfRBmU.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-DiuFTYUt.cjs";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-DniKVJ_C.cjs";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-Cn9GJ5ex.cjs";
11
11
  export * from "@fedify/vocab-runtime";
12
12
 
13
13
  //#region src/mod.d.ts
package/dist/mod.d.ts CHANGED
@@ -2,12 +2,12 @@
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 { 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";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CiBPcC6F.js";
5
- import { $ as ActorKeyPairsDispatcher, A as createFederation, B as RouterRouteResult, C as InboxChallengePolicy, Ct as ActivityTransformer, D as FederationKvPrefixes, E as Rfc6570Expression, F as Message, G as InProcessMessageQueueOptions, H as respondWithObject, I as createFederationBuilder, J as MessageQueueListenOptions, K as MessageQueue, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as ActorHandleMapper, R as RouterError, S as IdempotencyStrategy, St as digest, T as ObjectCallbackSetters, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as InProcessMessageQueue, X as ActorAliasMapper, Y as ParallelMessageQueue, Z as ActorDispatcher, _ as FederationBuilder, _t as WebFingerLinksDispatcher, a as InboxContext, at as CustomCollectionCursor, b as FederationStartQueueOptions, bt as PageItems, c as RouteActivityOptions, ct as InboxListener, d as ActorCallbackSetters, dt as ObjectDispatcher, et as AuthorizePredicate, f as CollectionCallbackSetters, ft as OutboxErrorHandler, g as Federation, gt as UnverifiedActivityReason, h as Federatable, ht as UnverifiedActivityHandler, i as GetSignedKeyOptions, it as CustomCollectionCounter, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as NodeInfoDispatcher, m as CustomCollectionCallbackSetters, mt as SharedInboxKeyDispatcher, n as Context, nt as CollectionCursor, o as ParseUriResult, ot as CustomCollectionDispatcher, p as ConstructorWithTypeId, pt as OutboxPermanentFailureHandler, q as MessageQueueEnqueueOptions, r as ForwardActivityOptions, rt as CollectionDispatcher, s as RequestContext, st as InboxErrorHandler, t as ActorKeyPair, tt as CollectionCounter, u as SendActivityOptionsForCollection, ut as ObjectAuthorizePredicate, v as FederationFetchOptions, vt as SendActivityError, w as InboxListenerSetters, x as IdempotencyKeyCallback, xt as buildCollectionSynchronizationHeader, y as FederationOptions, yt as SenderKeyPair, z as RouterOptions } from "./context-BgU5UWTx.js";
6
- import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-D6hNiMTK.js";
5
+ import { $ as ActorKeyPairsDispatcher, A as createFederation, B as RouterRouteResult, C as InboxChallengePolicy, Ct as ActivityTransformer, D as FederationKvPrefixes, E as Rfc6570Expression, F as Message, G as InProcessMessageQueueOptions, H as respondWithObject, I as createFederationBuilder, J as MessageQueueListenOptions, K as MessageQueue, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as ActorHandleMapper, R as RouterError, S as IdempotencyStrategy, St as digest, T as ObjectCallbackSetters, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as InProcessMessageQueue, X as ActorAliasMapper, Y as ParallelMessageQueue, Z as ActorDispatcher, _ as FederationBuilder, _t as WebFingerLinksDispatcher, a as InboxContext, at as CustomCollectionCursor, b as FederationStartQueueOptions, bt as PageItems, c as RouteActivityOptions, ct as InboxListener, d as ActorCallbackSetters, dt as ObjectDispatcher, et as AuthorizePredicate, f as CollectionCallbackSetters, ft as OutboxErrorHandler, g as Federation, gt as UnverifiedActivityReason, h as Federatable, ht as UnverifiedActivityHandler, i as GetSignedKeyOptions, it as CustomCollectionCounter, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as NodeInfoDispatcher, m as CustomCollectionCallbackSetters, mt as SharedInboxKeyDispatcher, n as Context, nt as CollectionCursor, o as ParseUriResult, ot as CustomCollectionDispatcher, p as ConstructorWithTypeId, pt as OutboxPermanentFailureHandler, q as MessageQueueEnqueueOptions, r as ForwardActivityOptions, rt as CollectionDispatcher, s as RequestContext, st as InboxErrorHandler, t as ActorKeyPair, tt as CollectionCounter, u as SendActivityOptionsForCollection, ut as ObjectAuthorizePredicate, v as FederationFetchOptions, vt as SendActivityError, w as InboxListenerSetters, x as IdempotencyKeyCallback, xt as buildCollectionSynchronizationHeader, y as FederationOptions, yt as SenderKeyPair, z as RouterOptions } from "./context-DLLaDau8.js";
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-DcAiY74j.js";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-CWJNbyju.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-BLDHhuW0.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-CMK_S-eX.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-DNEgTI8M.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-Chr54tTL.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-Do50b12a.js";
8
- import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-sXITXcWa.js";
9
- 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-BrOQrPQf.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-J6hmiAEd.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-CeK9QmL_.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-C-45wr85.js";
8
+ import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-miAYfiGO.js";
9
+ 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-BeGIkK97.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CEJICY0R.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";