@fedify/fedify 2.2.15-dev.2196 → 2.2.15

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 (63) hide show
  1. package/dist/{builder-D8E6s6dI.mjs → builder-CcReUrBQ.mjs} +10 -2
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{context-Bt2jnbC7.d.ts → context-OkwEpc3-.d.ts} +1 -1
  6. package/dist/{context-Cls_M1HU.d.cts → context-tJbL_Hkw.d.cts} +1 -1
  7. package/dist/{deno-qvNES9lw.mjs → deno-duAPwAHH.mjs} +1 -1
  8. package/dist/{docloader-DDSsh_Jq.mjs → docloader-DI88Lx6y.mjs} +2 -2
  9. package/dist/federation/builder.test.mjs +37 -1
  10. package/dist/federation/handler.test.mjs +5 -5
  11. package/dist/federation/idempotency.test.mjs +2 -2
  12. package/dist/federation/middleware.test.mjs +121 -6
  13. package/dist/federation/mod.cjs +1 -1
  14. package/dist/federation/mod.d.cts +3 -3
  15. package/dist/federation/mod.d.ts +3 -3
  16. package/dist/federation/mod.js +1 -1
  17. package/dist/federation/send.test.mjs +3 -3
  18. package/dist/federation/temporal.test.mjs +1 -1
  19. package/dist/federation/webfinger.test.mjs +1 -1
  20. package/dist/{http-RWKDbjsL.cjs → http-CJuCjxWI.cjs} +1 -1
  21. package/dist/{http-CntX6ab0.js → http-DlBFaZ7A.js} +1 -1
  22. package/dist/{http-BW6AJOy7.mjs → http-DytBXprv.mjs} +2 -2
  23. package/dist/{key-Zl6BkQxS.mjs → key-5QlWv3sx.mjs} +1 -1
  24. package/dist/{kv-D6hNiMTK.d.ts → kv-CZKl1IUS.d.cts} +3 -2
  25. package/dist/{kv-gJ8LYbxX.d.cts → kv-CxaI4eGo.d.ts} +3 -2
  26. package/dist/{kv-cache-CE9FWYpa.js → kv-cache-DJ3q30Nl.js} +1 -1
  27. package/dist/{kv-cache-C6Vsz04k.cjs → kv-cache-K6z1D4HS.cjs} +1 -1
  28. package/dist/{ld-DMr3f6uX.mjs → ld-D-oK3e4r.mjs} +2 -2
  29. package/dist/{middleware-Cu0bK3Iq.js → middleware-CYAtT9KB.js} +20 -9
  30. package/dist/{middleware-CYTJ-y3g.mjs → middleware-DTIhauqW.mjs} +19 -16
  31. package/dist/{middleware-BR8TCS1H.cjs → middleware-IHStfDZ2.cjs} +21 -10
  32. package/dist/{middleware-UrAjyLpb.mjs → middleware-ROzi4oVa.mjs} +1 -1
  33. package/dist/{middleware-CSK_D6wm.cjs → middleware-RmEidCmR.cjs} +1 -1
  34. package/dist/{mod-C9jqpInC.d.ts → mod-B6LmugJ4.d.ts} +1 -1
  35. package/dist/{mod-DaiJDJdQ.d.ts → mod-DQGjRJUG.d.ts} +1 -1
  36. package/dist/{mod-BYg1qMPB.d.cts → mod-V2vDnYNu.d.cts} +1 -1
  37. package/dist/{mod-DNvnDTS7.d.cts → mod-a6kmB8xD.d.cts} +1 -1
  38. package/dist/mod.cjs +4 -4
  39. package/dist/mod.d.cts +4 -4
  40. package/dist/mod.d.ts +4 -4
  41. package/dist/mod.js +4 -4
  42. package/dist/nodeinfo/handler.test.mjs +1 -1
  43. package/dist/otel/mod.d.cts +1 -1
  44. package/dist/otel/mod.d.ts +1 -1
  45. package/dist/{owner-CHo1EAg3.mjs → owner-CHkNw8Fk.mjs} +2 -2
  46. package/dist/{proof-D6abvk_O.js → proof-BJ_pqvov.js} +1 -1
  47. package/dist/{proof-CHNefbCg.cjs → proof-DC3IlY_8.cjs} +1 -1
  48. package/dist/{proof-Blxp54sy.mjs → proof-o8Ly9XSp.mjs} +2 -2
  49. package/dist/{send-ConRtUh3.mjs → send-Ck74ndlE.mjs} +2 -2
  50. package/dist/sig/http.test.mjs +2 -2
  51. package/dist/sig/key.test.mjs +1 -1
  52. package/dist/sig/ld.test.mjs +2 -2
  53. package/dist/sig/mod.cjs +2 -2
  54. package/dist/sig/mod.js +2 -2
  55. package/dist/sig/owner.test.mjs +1 -1
  56. package/dist/sig/proof.test.mjs +1 -1
  57. package/dist/{temporal-BIaSZejA.mjs → temporal-8bTjf1mO.mjs} +1 -1
  58. package/dist/utils/docloader.test.mjs +2 -2
  59. package/dist/utils/mod.cjs +1 -1
  60. package/dist/utils/mod.d.cts +1 -1
  61. package/dist/utils/mod.d.ts +1 -1
  62. package/dist/utils/mod.js +1 -1
  63. package/package.json +5 -5
@@ -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-CntX6ab0.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-DlBFaZ7A.js";
6
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-D6abvk_O.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CE9FWYpa.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-BJ_pqvov.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DJ3q30Nl.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";
@@ -203,6 +203,7 @@ var FederationBuilderImpl = class {
203
203
  * Symbol registry for unique identification of unnamed symbols.
204
204
  */
205
205
  #symbolRegistry = /* @__PURE__ */ new Map();
206
+ #collectionNames = /* @__PURE__ */ new Map();
206
207
  constructor() {
207
208
  this.router = new Router$1();
208
209
  this.objectCallbacks = {};
@@ -224,6 +225,8 @@ var FederationBuilderImpl = class {
224
225
  f.objectTypeIds = { ...this.objectTypeIds };
225
226
  f.collectionCallbacks = { ...this.collectionCallbacks };
226
227
  f.collectionTypeIds = { ...this.collectionTypeIds };
228
+ f.#symbolRegistry = new Map(this.#symbolRegistry);
229
+ f.#collectionNames = new Map(this.#collectionNames);
227
230
  f.inboxPath = this.inboxPath;
228
231
  f.outboxPath = this.outboxPath;
229
232
  f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
@@ -672,6 +675,7 @@ var FederationBuilderImpl = class {
672
675
  if (this.router.has(routeName)) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
673
676
  if (this.collectionCallbacks[name] != null) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
674
677
  if (this.router.add(path, routeName).size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
678
+ this.#collectionNames.set(routeName, name);
675
679
  const callbacks = { dispatcher };
676
680
  this.collectionCallbacks[name] = callbacks;
677
681
  this.collectionTypeIds[name] = itemType;
@@ -708,6 +712,10 @@ var FederationBuilderImpl = class {
708
712
  const routeName = this.#uniqueCollectionId(name);
709
713
  return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
710
714
  }
715
+ /** Resolves a custom collection route to its original name. */
716
+ getCollectionName(routeName) {
717
+ return this.#collectionNames.get(routeName) ?? routeName.replace(/^(collection|orderedCollection):/, "");
718
+ }
711
719
  setOutboxPermanentFailureHandler(handler) {
712
720
  this.outboxPermanentFailureHandler = handler;
713
721
  }
@@ -4102,10 +4110,10 @@ var FederationImpl = class extends FederationBuilderImpl {
4102
4110
  onNotFound
4103
4111
  });
4104
4112
  case "collection": {
4105
- const name = route.name.replace(/^collection:/, "");
4113
+ const name = this.getCollectionName(route.name);
4106
4114
  const callbacks = this.collectionCallbacks[name];
4107
4115
  return await handleCustomCollection(request, {
4108
- name,
4116
+ name: String(name),
4109
4117
  context,
4110
4118
  values: route.values,
4111
4119
  collectionCallbacks: callbacks,
@@ -4115,10 +4123,10 @@ var FederationImpl = class extends FederationBuilderImpl {
4115
4123
  });
4116
4124
  }
4117
4125
  case "orderedCollection": {
4118
- const name = route.name.replace(/^orderedCollection:/, "");
4126
+ const name = this.getCollectionName(route.name);
4119
4127
  const callbacks = this.collectionCallbacks[name];
4120
4128
  return await handleOrderedCollection(request, {
4121
- name,
4129
+ name: String(name),
4122
4130
  context,
4123
4131
  values: route.values,
4124
4132
  collectionCallbacks: callbacks,
@@ -4311,8 +4319,10 @@ var ContextImpl = class ContextImpl {
4311
4319
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
4312
4320
  const match = route.name.match(collectionRegex);
4313
4321
  if (match !== null) {
4314
- const [, type, name] = match;
4322
+ const [, type] = match;
4323
+ const name = this.federation.getCollectionName(route.name);
4315
4324
  const cls = this.federation.collectionTypeIds[name];
4325
+ if (cls == null) return null;
4316
4326
  return {
4317
4327
  type,
4318
4328
  name,
@@ -4674,7 +4684,7 @@ var ContextImpl = class ContextImpl {
4674
4684
  "inbox"
4675
4685
  ]);
4676
4686
  const contextLoader = options.contextLoader ?? this.contextLoader;
4677
- const json = await activity.toJsonLd({ contextLoader });
4687
+ let json = await activity.toJsonLd({ contextLoader });
4678
4688
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
4679
4689
  if (await verifyObject(Activity, json, {
4680
4690
  contextLoader,
@@ -4730,6 +4740,7 @@ var ContextImpl = class ContextImpl {
4730
4740
  }
4731
4741
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
4732
4742
  activity = fetched;
4743
+ json = await fetched.toJsonLd({ contextLoader });
4733
4744
  } else logger.debug("Object Integrity Proofs are verified.", {
4734
4745
  recipient,
4735
4746
  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-qvNES9lw.mjs";
5
+ import { n as version, t as name } from "./deno-duAPwAHH.mjs";
6
6
  import { t as formatAcceptSignature } from "./accept-Dd__NiUL.mjs";
7
- import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-Zl6BkQxS.mjs";
8
- import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-BW6AJOy7.mjs";
9
- import { t as getAuthenticatedDocumentLoader } from "./docloader-DDSsh_Jq.mjs";
7
+ import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-5QlWv3sx.mjs";
8
+ import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-DytBXprv.mjs";
9
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-DI88Lx6y.mjs";
10
10
  import { n as kvCache } from "./kv-cache-FsT1ljhs.mjs";
11
- import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-DMr3f6uX.mjs";
12
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CHo1EAg3.mjs";
11
+ import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-D-oK3e4r.mjs";
12
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CHkNw8Fk.mjs";
13
13
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-Dc2OXyB-.mjs";
14
- import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-Blxp54sy.mjs";
14
+ import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-o8Ly9XSp.mjs";
15
15
  import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-CJ4Y0keQ.mjs";
16
16
  import { t as nodeInfoToJson } from "./types-s4mCTGkT.mjs";
17
- import { t as FederationBuilderImpl } from "./builder-D8E6s6dI.mjs";
17
+ import { t as FederationBuilderImpl } from "./builder-CcReUrBQ.mjs";
18
18
  import { t as buildCollectionSynchronizationHeader } from "./collection-DnoYNwBC.mjs";
19
19
  import { t as KvKeyCache } from "./keycache-C1aVprwy.mjs";
20
20
  import { t as acceptsJsonLd } from "./negotiation-BHtZN6Y1.mjs";
21
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-BIaSZejA.mjs";
21
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-8bTjf1mO.mjs";
22
22
  import { t as createExponentialBackoffPolicy } from "./retry-bMXBL97A.mjs";
23
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-ConRtUh3.mjs";
23
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-Ck74ndlE.mjs";
24
24
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
25
25
  import { lookupWebFinger } from "@fedify/webfinger";
26
26
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -2908,10 +2908,10 @@ var FederationImpl = class extends FederationBuilderImpl {
2908
2908
  onNotFound
2909
2909
  });
2910
2910
  case "collection": {
2911
- const name = route.name.replace(/^collection:/, "");
2911
+ const name = this.getCollectionName(route.name);
2912
2912
  const callbacks = this.collectionCallbacks[name];
2913
2913
  return await handleCustomCollection(request, {
2914
- name,
2914
+ name: String(name),
2915
2915
  context,
2916
2916
  values: route.values,
2917
2917
  collectionCallbacks: callbacks,
@@ -2921,10 +2921,10 @@ var FederationImpl = class extends FederationBuilderImpl {
2921
2921
  });
2922
2922
  }
2923
2923
  case "orderedCollection": {
2924
- const name = route.name.replace(/^orderedCollection:/, "");
2924
+ const name = this.getCollectionName(route.name);
2925
2925
  const callbacks = this.collectionCallbacks[name];
2926
2926
  return await handleOrderedCollection(request, {
2927
- name,
2927
+ name: String(name),
2928
2928
  context,
2929
2929
  values: route.values,
2930
2930
  collectionCallbacks: callbacks,
@@ -3117,8 +3117,10 @@ var ContextImpl = class ContextImpl {
3117
3117
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
3118
3118
  const match = route.name.match(collectionRegex);
3119
3119
  if (match !== null) {
3120
- const [, type, name] = match;
3120
+ const [, type] = match;
3121
+ const name = this.federation.getCollectionName(route.name);
3121
3122
  const cls = this.federation.collectionTypeIds[name];
3123
+ if (cls == null) return null;
3122
3124
  return {
3123
3125
  type,
3124
3126
  name,
@@ -3480,7 +3482,7 @@ var ContextImpl = class ContextImpl {
3480
3482
  "inbox"
3481
3483
  ]);
3482
3484
  const contextLoader = options.contextLoader ?? this.contextLoader;
3483
- const json = await activity.toJsonLd({ contextLoader });
3485
+ let json = await activity.toJsonLd({ contextLoader });
3484
3486
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
3485
3487
  if (await verifyObject(Activity, json, {
3486
3488
  contextLoader,
@@ -3536,6 +3538,7 @@ var ContextImpl = class ContextImpl {
3536
3538
  }
3537
3539
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
3538
3540
  activity = fetched;
3541
+ json = await fetched.toJsonLd({ contextLoader });
3539
3542
  } else logger.debug("Object Integrity Proofs are verified.", {
3540
3543
  recipient,
3541
3544
  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-RWKDbjsL.cjs");
5
+ const require_http = require("./http-CJuCjxWI.cjs");
6
6
  const require_types = require("./types-DRPjmHVV.cjs");
7
- const require_proof = require("./proof-CHNefbCg.cjs");
8
- const require_kv_cache = require("./kv-cache-C6Vsz04k.cjs");
7
+ const require_proof = require("./proof-DC3IlY_8.cjs");
8
+ const require_kv_cache = require("./kv-cache-K6z1D4HS.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");
@@ -204,6 +204,7 @@ var FederationBuilderImpl = class {
204
204
  * Symbol registry for unique identification of unnamed symbols.
205
205
  */
206
206
  #symbolRegistry = /* @__PURE__ */ new Map();
207
+ #collectionNames = /* @__PURE__ */ new Map();
207
208
  constructor() {
208
209
  this.router = new Router();
209
210
  this.objectCallbacks = {};
@@ -212,7 +213,7 @@ var FederationBuilderImpl = class {
212
213
  this.collectionTypeIds = {};
213
214
  }
214
215
  async build(options) {
215
- const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-CSK_D6wm.cjs"));
216
+ const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-RmEidCmR.cjs"));
216
217
  const f = new FederationImpl(options);
217
218
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
218
219
  f.router = this.router.clone();
@@ -225,6 +226,8 @@ var FederationBuilderImpl = class {
225
226
  f.objectTypeIds = { ...this.objectTypeIds };
226
227
  f.collectionCallbacks = { ...this.collectionCallbacks };
227
228
  f.collectionTypeIds = { ...this.collectionTypeIds };
229
+ f.#symbolRegistry = new Map(this.#symbolRegistry);
230
+ f.#collectionNames = new Map(this.#collectionNames);
228
231
  f.inboxPath = this.inboxPath;
229
232
  f.outboxPath = this.outboxPath;
230
233
  f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
@@ -673,6 +676,7 @@ var FederationBuilderImpl = class {
673
676
  if (this.router.has(routeName)) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
674
677
  if (this.collectionCallbacks[name] != null) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
675
678
  if (this.router.add(path, routeName).size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
679
+ this.#collectionNames.set(routeName, name);
676
680
  const callbacks = { dispatcher };
677
681
  this.collectionCallbacks[name] = callbacks;
678
682
  this.collectionTypeIds[name] = itemType;
@@ -709,6 +713,10 @@ var FederationBuilderImpl = class {
709
713
  const routeName = this.#uniqueCollectionId(name);
710
714
  return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
711
715
  }
716
+ /** Resolves a custom collection route to its original name. */
717
+ getCollectionName(routeName) {
718
+ return this.#collectionNames.get(routeName) ?? routeName.replace(/^(collection|orderedCollection):/, "");
719
+ }
712
720
  setOutboxPermanentFailureHandler(handler) {
713
721
  this.outboxPermanentFailureHandler = handler;
714
722
  }
@@ -4095,10 +4103,10 @@ var FederationImpl = class extends FederationBuilderImpl {
4095
4103
  onNotFound
4096
4104
  });
4097
4105
  case "collection": {
4098
- const name = route.name.replace(/^collection:/, "");
4106
+ const name = this.getCollectionName(route.name);
4099
4107
  const callbacks = this.collectionCallbacks[name];
4100
4108
  return await handleCustomCollection(request, {
4101
- name,
4109
+ name: String(name),
4102
4110
  context,
4103
4111
  values: route.values,
4104
4112
  collectionCallbacks: callbacks,
@@ -4108,10 +4116,10 @@ var FederationImpl = class extends FederationBuilderImpl {
4108
4116
  });
4109
4117
  }
4110
4118
  case "orderedCollection": {
4111
- const name = route.name.replace(/^orderedCollection:/, "");
4119
+ const name = this.getCollectionName(route.name);
4112
4120
  const callbacks = this.collectionCallbacks[name];
4113
4121
  return await handleOrderedCollection(request, {
4114
- name,
4122
+ name: String(name),
4115
4123
  context,
4116
4124
  values: route.values,
4117
4125
  collectionCallbacks: callbacks,
@@ -4304,8 +4312,10 @@ var ContextImpl = class ContextImpl {
4304
4312
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
4305
4313
  const match = route.name.match(collectionRegex);
4306
4314
  if (match !== null) {
4307
- const [, type, name] = match;
4315
+ const [, type] = match;
4316
+ const name = this.federation.getCollectionName(route.name);
4308
4317
  const cls = this.federation.collectionTypeIds[name];
4318
+ if (cls == null) return null;
4309
4319
  return {
4310
4320
  type,
4311
4321
  name,
@@ -4667,7 +4677,7 @@ var ContextImpl = class ContextImpl {
4667
4677
  "inbox"
4668
4678
  ]);
4669
4679
  const contextLoader = options.contextLoader ?? this.contextLoader;
4670
- const json = await activity.toJsonLd({ contextLoader });
4680
+ let json = await activity.toJsonLd({ contextLoader });
4671
4681
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
4672
4682
  if (await require_proof.verifyObject(_fedify_vocab.Activity, json, {
4673
4683
  contextLoader,
@@ -4723,6 +4733,7 @@ var ContextImpl = class ContextImpl {
4723
4733
  }
4724
4734
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
4725
4735
  activity = fetched;
4736
+ json = await fetched.toJsonLd({ contextLoader });
4726
4737
  } else logger.debug("Object Integrity Proofs are verified.", {
4727
4738
  recipient,
4728
4739
  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-CYTJ-y3g.mjs";
4
+ import { n as FederationImpl } from "./middleware-DTIhauqW.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-BR8TCS1H.cjs");
3
+ const require_middleware = require("./middleware-IHStfDZ2.cjs");
4
4
  exports.FederationImpl = require_middleware.FederationImpl;
@@ -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
 
@@ -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-Bt2jnbC7.js";
2
+ import { $ as ActorAliasMapper, St as WebFingerLinksDispatcher, et as ActorDispatcher, l as RequestContext, tt as ActorHandleMapper } from "./context-OkwEpc3-.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
 
@@ -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-Cls_M1HU.cjs";
2
+ import { $ as ActorAliasMapper, St as WebFingerLinksDispatcher, et as ActorDispatcher, l as RequestContext, tt as ActorHandleMapper } from "./context-tJbL_Hkw.cjs";
3
3
  import { Span, Tracer } from "@opentelemetry/api";
4
4
 
5
5
  //#region src/federation/webfinger.d.ts
package/dist/mod.cjs CHANGED
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  require("./chunk-DDcVe30Y.cjs");
5
5
  const require_transformers = require("./transformers-NeAONrAq.cjs");
6
6
  require("./compat/mod.cjs");
7
- const require_http = require("./http-RWKDbjsL.cjs");
8
- const require_middleware = require("./middleware-BR8TCS1H.cjs");
7
+ const require_http = require("./http-CJuCjxWI.cjs");
8
+ const require_middleware = require("./middleware-IHStfDZ2.cjs");
9
9
  const require_types = require("./types-DRPjmHVV.cjs");
10
- const require_proof = require("./proof-CHNefbCg.cjs");
11
- const require_kv_cache = require("./kv-cache-C6Vsz04k.cjs");
10
+ const require_proof = require("./proof-DC3IlY_8.cjs");
11
+ const require_kv_cache = require("./kv-cache-K6z1D4HS.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 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-Cls_M1HU.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 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";
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-DNvnDTS7.cjs";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-a6kmB8xD.cjs";
9
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-BYg1qMPB.cjs";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-V2vDnYNu.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 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-Bt2jnbC7.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 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";
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-DaiJDJdQ.js";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-DQGjRJUG.js";
9
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-C9jqpInC.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-B6LmugJ4.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-CntX6ab0.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-Cu0bK3Iq.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-DlBFaZ7A.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-CYAtT9KB.js";
8
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-D6abvk_O.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CE9FWYpa.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-BJ_pqvov.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DJ3q30Nl.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";
@@ -5,7 +5,7 @@ import { r as createRequestContext } from "../context-Dk_tacqz.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-BVFj8-_V.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
8
- import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-CYTJ-y3g.mjs";
8
+ import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-DTIhauqW.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/nodeinfo/handler.test.ts
11
11
  test("handleNodeInfo()", async () => {
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as KvStore, t as KvKey } from "../kv-gJ8LYbxX.cjs";
2
+ import { n as KvStore, t as KvKey } from "../kv-CZKl1IUS.cjs";
3
3
  import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
4
4
  import { ExportResultCode } from "@opentelemetry/core";
5
5
 
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as KvStore, t as KvKey } from "../kv-D6hNiMTK.js";
2
+ import { n as KvStore, t as KvKey } from "../kv-CxaI4eGo.js";
3
3
  import { ExportResultCode } from "@opentelemetry/core";
4
4
  import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
5
5
 
@@ -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-qvNES9lw.mjs";
5
- import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-Zl6BkQxS.mjs";
4
+ import { n as version, t as name } from "./deno-duAPwAHH.mjs";
5
+ import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-5QlWv3sx.mjs";
6
6
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
7
7
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { c as fetchKey, f as validateCryptoKey, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, v as name, y as version } from "./http-CntX6ab0.js";
3
+ import { c as fetchKey, f as validateCryptoKey, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, v as name, y as version } from "./http-DlBFaZ7A.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, PUBLIC_COLLECTION, getTypeId, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,7 +1,7 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  const require_chunk = require("./chunk-DDcVe30Y.cjs");
4
- const require_http = require("./http-RWKDbjsL.cjs");
4
+ const require_http = require("./http-CJuCjxWI.cjs");
5
5
  let _logtape_logtape = require("@logtape/logtape");
6
6
  let _fedify_vocab = require("@fedify/vocab");
7
7
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -1,8 +1,8 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-qvNES9lw.mjs";
5
- import { r as fetchKey, s as validateCryptoKey } from "./key-Zl6BkQxS.mjs";
4
+ import { n as version, t as name } from "./deno-duAPwAHH.mjs";
5
+ import { r as fetchKey, s as validateCryptoKey } from "./key-5QlWv3sx.mjs";
6
6
  import { n as preloadedOnlyDocumentLoader } from "./public-audience-CS1udGkN.mjs";
7
7
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-Dc2OXyB-.mjs";
8
8
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
@@ -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-qvNES9lw.mjs";
5
- import { n as doubleKnock } from "./http-BW6AJOy7.mjs";
4
+ import { n as version, t as name } from "./deno-duAPwAHH.mjs";
5
+ import { n as doubleKnock } from "./http-DytBXprv.mjs";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
7
7
  import { FetchError, UrlError, validatePublicUrl } from "@fedify/vocab-runtime";
8
8
  import { getLogger } from "@logtape/logtape";
@@ -7,8 +7,8 @@ import { r as assertExists, t as assertStringIncludes } from "../std__assert-BVF
7
7
  import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
8
  import { t as assert } from "../assert-BhQd8QHP.mjs";
9
9
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
10
- import { t as exportJwk } from "../key-Zl6BkQxS.mjs";
11
- import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-BW6AJOy7.mjs";
10
+ import { t as exportJwk } from "../key-5QlWv3sx.mjs";
11
+ import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-DytBXprv.mjs";
12
12
  import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
13
13
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
14
14
  import { FetchError, exportSpki } from "@fedify/vocab-runtime";
@@ -6,7 +6,7 @@ import "../std__assert-BVFj8-_V.mjs";
6
6
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { t as assert } from "../assert-BhQd8QHP.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
9
- import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-Zl6BkQxS.mjs";
9
+ import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-5QlWv3sx.mjs";
10
10
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
11
11
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { CryptographicKey, Multikey } from "@fedify/vocab";
@@ -5,9 +5,9 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
6
6
  import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
8
- import { a as generateCryptoKeyPair } from "../key-Zl6BkQxS.mjs";
8
+ import { a as generateCryptoKeyPair } from "../key-5QlWv3sx.mjs";
9
9
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
10
- import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-DMr3f6uX.mjs";
10
+ import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-D-oK3e4r.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { CryptographicKey } from "@fedify/vocab";
13
13
  import { encodeBase64 } from "byte-encodings/base64";
package/dist/sig/mod.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_http = require("../http-RWKDbjsL.cjs");
5
- const require_proof = require("../proof-CHNefbCg.cjs");
4
+ const require_http = require("../http-CJuCjxWI.cjs");
5
+ const require_proof = require("../proof-DC3IlY_8.cjs");
6
6
  exports.attachSignature = require_proof.attachSignature;
7
7
  exports.createProof = require_proof.createProof;
8
8
  exports.createSignature = require_proof.createSignature;
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- 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-CntX6ab0.js";
4
- 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-D6abvk_O.js";
3
+ 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-DlBFaZ7A.js";
4
+ 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-BJ_pqvov.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import "../std__assert-BVFj8-_V.mjs";
6
6
  import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { t as assert } from "../assert-BhQd8QHP.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CHo1EAg3.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CHkNw8Fk.mjs";
10
10
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
12
12
  //#region src/sig/owner.test.ts