@fedify/fedify 2.3.12-dev.2365 → 2.3.12

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 (48) hide show
  1. package/dist/{builder-BOLaWLNy.mjs → builder-B6ixdT3y.mjs} +2 -2
  2. package/dist/compat/transformers.test.mjs +1 -1
  3. package/dist/{deno-DSS6EkPl.mjs → deno-D4dcoVfF.mjs} +1 -1
  4. package/dist/{docloader-Ds5k4A6d.mjs → docloader-NOKfswJV.mjs} +2 -2
  5. package/dist/federation/builder.test.mjs +1 -1
  6. package/dist/federation/handler.test.mjs +5 -5
  7. package/dist/federation/idempotency.test.mjs +2 -2
  8. package/dist/federation/metrics.test.mjs +1 -1
  9. package/dist/federation/middleware.test.mjs +7 -7
  10. package/dist/federation/mod.cjs +1 -1
  11. package/dist/federation/mod.js +1 -1
  12. package/dist/federation/send.test.mjs +3 -3
  13. package/dist/federation/temporal.test.mjs +1 -1
  14. package/dist/federation/webfinger.test.mjs +1 -1
  15. package/dist/{http-DdaLQHim.cjs → http-D_Xrr6kp.cjs} +109 -11
  16. package/dist/{http-LMsqGo8j.js → http-DkyUBs_T.js} +110 -12
  17. package/dist/{http-D9h6mQdq.mjs → http-HjidyDfF.mjs} +3 -3
  18. package/dist/{key-vnmAGZ3_.mjs → key-Dg-NXm4K.mjs} +111 -13
  19. package/dist/{kv-cache-Dz7_SbVI.js → kv-cache-BhGeZk_o.js} +1 -1
  20. package/dist/{kv-cache-CQuscHxa.mjs → kv-cache-BpVwvcSI.mjs} +1 -1
  21. package/dist/{kv-cache-ClCz-B0L.cjs → kv-cache-BwnC6JGt.cjs} +1 -1
  22. package/dist/{ld-BRqKkOSf.mjs → ld-C1wveXXf.mjs} +3 -3
  23. package/dist/{metrics-Z0UkrR_1.mjs → metrics-cIaMxG0v.mjs} +1 -1
  24. package/dist/{middleware-B-CIN962.js → middleware-CnrzVu9i.js} +3 -3
  25. package/dist/{middleware-DanzltB1.cjs → middleware-DhOFTXmo.cjs} +3 -3
  26. package/dist/{middleware-RTcKhytV.mjs → middleware-I-XlrRVl.mjs} +12 -12
  27. package/dist/{middleware-C_kPmXE6.mjs → middleware-VxPpU0h_.mjs} +1 -1
  28. package/dist/mod.cjs +4 -4
  29. package/dist/mod.js +4 -4
  30. package/dist/nodeinfo/handler.test.mjs +1 -1
  31. package/dist/{owner-B0rmuoQB.mjs → owner-CFKfE85G.mjs} +2 -2
  32. package/dist/{proof-CKczQTG0.cjs → proof-DBxu6g2K.cjs} +1 -1
  33. package/dist/{proof-B7mAFVed.mjs → proof-DtpGEj0u.mjs} +3 -3
  34. package/dist/{proof-Bau45ZUZ.js → proof-HU__qtUD.js} +1 -1
  35. package/dist/{send-BFukz_kE.mjs → send-CwMea5r6.mjs} +3 -3
  36. package/dist/sig/http.test.mjs +2 -2
  37. package/dist/sig/key.test.mjs +209 -3
  38. package/dist/sig/ld.test.mjs +2 -2
  39. package/dist/sig/mod.cjs +2 -2
  40. package/dist/sig/mod.js +2 -2
  41. package/dist/sig/owner.test.mjs +1 -1
  42. package/dist/sig/proof.test.mjs +1 -1
  43. package/dist/{temporal-n6j0MNF9.mjs → temporal-ClSXyHyu.mjs} +1 -1
  44. package/dist/utils/docloader.test.mjs +2 -2
  45. package/dist/utils/kv-cache.test.mjs +1 -1
  46. package/dist/utils/mod.cjs +1 -1
  47. package/dist/utils/mod.js +1 -1
  48. package/package.json +7 -7
@@ -1,13 +1,72 @@
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-DSS6EkPl.mjs";
5
- import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-Z0UkrR_1.mjs";
4
+ import { n as version, t as name } from "./deno-D4dcoVfF.mjs";
5
+ import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-cIaMxG0v.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
- import { FetchError, getDocumentLoader } from "@fedify/vocab-runtime";
9
+ import { FetchError, UrlError, getDocumentLoader } from "@fedify/vocab-runtime";
10
10
  //#region src/sig/key.ts
11
+ /** Classifies decoding failures without hiding unexpected loader errors. */
12
+ function classifyKeyJsonLdError(error, seen = /* @__PURE__ */ new Set()) {
13
+ if (!(error instanceof Error) || !error.name.startsWith("jsonld.")) return null;
14
+ if (seen.has(error)) throw error;
15
+ seen.add(error);
16
+ const details = error.details;
17
+ if (typeof details?.code !== "string") return null;
18
+ if (details.code !== "loading remote context failed" || !("cause" in details) && !("cause" in error)) return "invalid";
19
+ const cause = "cause" in details ? details.cause : error.cause;
20
+ const nestedFailure = classifyKeyJsonLdError(cause, seen);
21
+ if (nestedFailure != null) return nestedFailure;
22
+ if (cause instanceof SyntaxError) return "invalid";
23
+ if (cause instanceof FetchError || cause instanceof UrlError) return "fetch";
24
+ if (cause instanceof Error && [
25
+ "AbortError",
26
+ "TimeoutError",
27
+ "NetworkError"
28
+ ].includes(cause.name)) return "fetch";
29
+ if (cause instanceof TypeError) {
30
+ const urlCode = cause.code;
31
+ if (cause.name === "InvalidContextReferenceError") return "invalid";
32
+ if (urlCode === "ERR_INVALID_URL" || cause.message === "Invalid URL string." || /^Invalid URL(?::|$)/.test(cause.message) || / cannot be parsed as a URL\.?$/.test(cause.message)) return typeof details.url === "string" && /^[A-Za-z][A-Za-z0-9+.-]*:/.test(details.url) && !URL.canParse(details.url) ? "invalid" : "fetch";
33
+ const networkCause = cause.cause;
34
+ const code = cause.code ?? networkCause?.code;
35
+ if (typeof code === "string" && [
36
+ "ECONNREFUSED",
37
+ "ECONNRESET",
38
+ "ECONNABORTED",
39
+ "ETIMEDOUT",
40
+ "EHOSTUNREACH",
41
+ "ENETUNREACH",
42
+ "ENOTFOUND",
43
+ "EAI_AGAIN",
44
+ "UND_ERR_CONNECT_TIMEOUT",
45
+ "UND_ERR_HEADERS_TIMEOUT",
46
+ "UND_ERR_BODY_TIMEOUT",
47
+ "UND_ERR_SOCKET"
48
+ ].includes(code) || /^(fetch failed|Failed to fetch|error sending request|error reading a body from connection|Unable to connect|ConnectionRefused|Network connection lost|The socket connection was closed unexpectedly)/.test(cause.message)) return "fetch";
49
+ }
50
+ throw cause;
51
+ }
52
+ /** Carries a context transport failure through the key decoding boundary. */
53
+ var KeyContextFetchError = class extends Error {
54
+ error;
55
+ constructor(error) {
56
+ super("Failed to fetch a key's JSON-LD context.", { cause: error });
57
+ this.error = error;
58
+ }
59
+ };
60
+ function contextFetchError(error) {
61
+ const seen = /* @__PURE__ */ new Set();
62
+ while (error instanceof Error && !seen.has(error)) {
63
+ seen.add(error);
64
+ const details = error.details;
65
+ if (!error.name.startsWith("jsonld.") || details?.code !== "loading remote context failed") break;
66
+ error = "cause" in details ? details.cause : error.cause;
67
+ }
68
+ return new KeyContextFetchError(error);
69
+ }
11
70
  /**
12
71
  * Checks if the given key is valid and supported. No-op if the key is valid,
13
72
  * otherwise throws an error.
@@ -102,6 +161,9 @@ async function importJwk(jwk, type) {
102
161
  * @internal
103
162
  */
104
163
  async function fetchActorDocument(actorId, options = {}) {
164
+ return await fetchActorDocumentInternal(actorId, options, false);
165
+ }
166
+ async function fetchActorDocumentInternal(actorId, options, propagateContextFetchErrors) {
105
167
  const logger = getLogger([
106
168
  "fedify",
107
169
  "sig",
@@ -132,9 +194,12 @@ async function fetchActorDocument(actorId, options = {}) {
132
194
  baseUrl: documentUrl
133
195
  });
134
196
  } catch (error) {
135
- if (!(error instanceof TypeError)) throw error;
136
- logger.debug("The document served at {documentUrl} is not a valid object: {error}", {
197
+ const failure = classifyKeyJsonLdError(error);
198
+ if (failure === "fetch" && propagateContextFetchErrors) throw contextFetchError(error);
199
+ if (failure == null && !(error instanceof TypeError)) throw error;
200
+ logger.debug("Failed to decode the actor document at {documentUrl}: {error}", {
137
201
  documentUrl: documentUrl.href,
202
+ failure: failure ?? "invalid",
138
203
  error
139
204
  });
140
205
  return null;
@@ -173,6 +238,9 @@ async function fetchActorDocument(actorId, options = {}) {
173
238
  * @internal
174
239
  */
175
240
  async function verifyKeyOwnership(key, options = {}) {
241
+ return await verifyKeyOwnershipInternal(key, options, false);
242
+ }
243
+ async function verifyKeyOwnershipInternal(key, options, propagateContextFetchErrors) {
176
244
  const logger = getLogger([
177
245
  "fedify",
178
246
  "sig",
@@ -182,7 +250,7 @@ async function verifyKeyOwnership(key, options = {}) {
182
250
  if (keyId == null) return null;
183
251
  const claimedOwnerId = key instanceof CryptographicKey ? key.ownerId : key.controllerId;
184
252
  if (claimedOwnerId == null) return null;
185
- const owner = await fetchActorDocument(claimedOwnerId, options);
253
+ const owner = await fetchActorDocumentInternal(claimedOwnerId, options, propagateContextFetchErrors);
186
254
  if (owner == null) {
187
255
  logger.debug("The owner ({claimedOwnerId}) that key {keyId} claims could not be resolved.", {
188
256
  keyId: keyId.href,
@@ -334,6 +402,21 @@ async function resolveFetchedKey(document, cacheKey, documentUrl, keyId, cls, {
334
402
  tracerProvider
335
403
  });
336
404
  } catch (e) {
405
+ const failure = classifyKeyJsonLdError(e);
406
+ if (failure === "fetch") throw contextFetchError(e);
407
+ if (failure != null) {
408
+ logger.debug("Failed to decode key {keyId}: {error}", {
409
+ keyId,
410
+ failure,
411
+ error: e
412
+ });
413
+ await keyCache?.set(cacheKey, null);
414
+ await clearFetchErrorMetadata(cacheKey, keyCache);
415
+ return {
416
+ key: null,
417
+ cached: false
418
+ };
419
+ }
337
420
  if (!(e instanceof TypeError)) throw e;
338
421
  try {
339
422
  object = await cls.fromJsonLd(document, {
@@ -342,8 +425,14 @@ async function resolveFetchedKey(document, cacheKey, documentUrl, keyId, cls, {
342
425
  tracerProvider
343
426
  });
344
427
  } catch (e) {
345
- if (e instanceof TypeError) {
346
- logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
428
+ const failure = classifyKeyJsonLdError(e);
429
+ if (failure === "fetch") throw contextFetchError(e);
430
+ if (failure != null || e instanceof TypeError) {
431
+ logger.debug("Failed to decode key {keyId}: {error}", {
432
+ keyId,
433
+ failure: failure ?? "invalid",
434
+ error: e
435
+ });
347
436
  await keyCache?.set(cacheKey, null);
348
437
  await clearFetchErrorMetadata(cacheKey, keyCache);
349
438
  return {
@@ -435,16 +524,17 @@ async function resolveFetchedKey(document, cacheKey, documentUrl, keyId, cls, {
435
524
  const claimedOwnerId = key instanceof CryptographicKey ? key.ownerId : key.controllerId;
436
525
  if (ownerDocument != null && claimedOwnerId == null) key = key instanceof CryptographicKey ? key.clone({ owner: ownerDocument.id }) : key.clone({ controller: ownerDocument.id });
437
526
  else if (claimedOwnerId != null && claimedOwnerId.href !== ownerDocument?.id?.href) {
438
- if (await verifyKeyOwnership(key, {
527
+ if (await verifyKeyOwnershipInternal(key, {
439
528
  documentLoader,
440
529
  contextLoader,
441
530
  tracerProvider
442
- }) == null) {
531
+ }, true) == null) {
443
532
  logger.debug("Failed to verify; the owner {claimedOwnerId} that key {keyId} claims does not list the key as its own.", {
444
533
  keyId,
445
534
  claimedOwnerId: claimedOwnerId.href
446
535
  });
447
536
  await keyCache?.set(cacheKey, null);
537
+ await clearFetchErrorMetadata(cacheKey, keyCache);
448
538
  return {
449
539
  key: null,
450
540
  cached: false
@@ -495,9 +585,17 @@ async function fetchKeyWithResult(cacheKey, cls, options, onCachedUnavailable, o
495
585
  outcome = classified;
496
586
  return errored;
497
587
  }
498
- const resolved = await resolveFetchedKey(document, cacheKey, documentUrl, keyId, cls, options, logger);
499
- outcome = { result: resolved.key != null ? "fetched" : "invalid" };
500
- return resolved;
588
+ try {
589
+ const resolved = await resolveFetchedKey(document, cacheKey, documentUrl, keyId, cls, options, logger);
590
+ outcome = { result: resolved.key != null ? "fetched" : "invalid" };
591
+ return resolved;
592
+ } catch (error) {
593
+ if (!(error instanceof KeyContextFetchError)) throw error;
594
+ const classified = classifyFetchError(error.error);
595
+ const errored = await onFetchError(error.error, cacheKey, keyId, keyCache, logger);
596
+ outcome = classified;
597
+ return errored;
598
+ }
501
599
  } finally {
502
600
  recordKeyLookup(options.meterProvider, {
503
601
  durationMs: getDurationMs(start),
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { T as recordDocumentCache, f as validateCryptoKey, t as doubleKnock } from "./http-LMsqGo8j.js";
3
+ import { T as recordDocumentCache, f as validateCryptoKey, t as doubleKnock } from "./http-DkyUBs_T.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
6
6
  import { curry } from "es-toolkit";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { p as recordDocumentCache } from "./metrics-Z0UkrR_1.mjs";
4
+ import { p as recordDocumentCache } from "./metrics-cIaMxG0v.mjs";
5
5
  import { getLogger } from "@logtape/logtape";
6
6
  import { preloadedContexts } from "@fedify/vocab-runtime";
7
7
  //#region src/utils/kv-cache.ts
@@ -1,7 +1,7 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  require("./chunk-DDcVe30Y.cjs");
4
- const require_http = require("./http-DdaLQHim.cjs");
4
+ const require_http = require("./http-D_Xrr6kp.cjs");
5
5
  let _logtape_logtape = require("@logtape/logtape");
6
6
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
7
7
  let es_toolkit = require("es-toolkit");
@@ -1,9 +1,9 @@
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-DSS6EkPl.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-Z0UkrR_1.mjs";
6
- import { r as fetchKey, s as validateCryptoKey } from "./key-vnmAGZ3_.mjs";
4
+ import { n as version, t as name } from "./deno-D4dcoVfF.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-cIaMxG0v.mjs";
6
+ import { r as fetchKey, s as validateCryptoKey } from "./key-Dg-NXm4K.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
9
9
  import { SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,7 +1,7 @@
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-DSS6EkPl.mjs";
4
+ import { n as version, t as name } from "./deno-D4dcoVfF.mjs";
5
5
  import { metrics } from "@opentelemetry/api";
6
6
  import { FetchError } from "@fedify/vocab-runtime";
7
7
  //#region src/federation/metrics.ts
@@ -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 recordWebFingerHandle, C as recordCollectionRequest, D as recordInboxActivity, E as recordFanoutRecipients, I as name, L as version, M as formatAcceptSignature, O as recordOutboxActivity, S as recordCollectionPageItems, _ as instrumentDocumentLoader, a as verifyRequestDetailed, b as recordCircuitBreakerStateChange, d as importJwk, f as validateCryptoKey, g as getRemoteHost, h as getFederationMetrics, i as verifyRequest, j as registerQueueDepthGauge, k as recordOutboxEnqueue, m as getDurationMs, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnock, v as isAbortError, w as recordCollectionTotalItems, x as recordCollectionDispatchDuration } from "./http-LMsqGo8j.js";
5
+ import { A as recordWebFingerHandle, C as recordCollectionRequest, D as recordInboxActivity, E as recordFanoutRecipients, I as name, L as version, M as formatAcceptSignature, O as recordOutboxActivity, S as recordCollectionPageItems, _ as instrumentDocumentLoader, a as verifyRequestDetailed, b as recordCircuitBreakerStateChange, d as importJwk, f as validateCryptoKey, g as getRemoteHost, h as getFederationMetrics, i as verifyRequest, j as registerQueueDepthGauge, k as recordOutboxEnqueue, m as getDurationMs, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnock, v as isAbortError, w as recordCollectionTotalItems, x as recordCollectionDispatchDuration } from "./http-DkyUBs_T.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-Bau45ZUZ.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-Dz7_SbVI.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-HU__qtUD.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BhGeZk_o.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { Router, RouterError, assertPath } from "@fedify/uri-template";
11
11
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
@@ -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-DdaLQHim.cjs");
5
+ const require_http = require("./http-D_Xrr6kp.cjs");
6
6
  const require_types = require("./types-DRPjmHVV.cjs");
7
- const require_proof = require("./proof-CKczQTG0.cjs");
8
- const require_kv_cache = require("./kv-cache-ClCz-B0L.cjs");
7
+ const require_proof = require("./proof-DBxu6g2K.cjs");
8
+ const require_kv_cache = require("./kv-cache-BwnC6JGt.cjs");
9
9
  let _logtape_logtape = require("@logtape/logtape");
10
10
  let _fedify_uri_template = require("@fedify/uri-template");
11
11
  let _fedify_vocab = require("@fedify/vocab");
@@ -1,26 +1,26 @@
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-DSS6EkPl.mjs";
5
- import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-Z0UkrR_1.mjs";
4
+ import { n as version, t as name } from "./deno-D4dcoVfF.mjs";
5
+ import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-cIaMxG0v.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-vnmAGZ3_.mjs";
8
- import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-D9h6mQdq.mjs";
9
- import { t as getAuthenticatedDocumentLoader } from "./docloader-Ds5k4A6d.mjs";
10
- import { n as kvCache } from "./kv-cache-CQuscHxa.mjs";
7
+ import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-Dg-NXm4K.mjs";
8
+ import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-HjidyDfF.mjs";
9
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-NOKfswJV.mjs";
10
+ import { n as kvCache } from "./kv-cache-BpVwvcSI.mjs";
11
11
  import { t as KvKeyCache } from "./keycache-Dkc_sflV.mjs";
12
- 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-BRqKkOSf.mjs";
13
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-B0rmuoQB.mjs";
12
+ 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-C1wveXXf.mjs";
13
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CFKfE85G.mjs";
14
14
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-D4iTv7uM.mjs";
15
- import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-B7mAFVed.mjs";
15
+ import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-DtpGEj0u.mjs";
16
16
  import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-1He2YuBF.mjs";
17
17
  import { t as nodeInfoToJson } from "./types-J53Kw7so.mjs";
18
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-BFukz_kE.mjs";
19
- import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-BOLaWLNy.mjs";
18
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-CwMea5r6.mjs";
19
+ import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-B6ixdT3y.mjs";
20
20
  import { t as CircuitBreaker } from "./circuit-breaker-D1fxthDI.mjs";
21
21
  import { t as buildCollectionSynchronizationHeader } from "./collection-Cc3DVAhE.mjs";
22
22
  import { t as acceptsJsonLd } from "./negotiation-CDW-_gUU.mjs";
23
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-n6j0MNF9.mjs";
23
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-ClSXyHyu.mjs";
24
24
  import { t as createExponentialBackoffPolicy } from "./retry-_VvV0h9f.mjs";
25
25
  import { getLogger, withContext } from "@logtape/logtape";
26
26
  import { RouterError } from "@fedify/uri-template";
@@ -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-RTcKhytV.mjs";
4
+ import { n as FederationImpl } from "./middleware-I-XlrRVl.mjs";
5
5
  export { FederationImpl };
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-DdaLQHim.cjs");
8
- const require_middleware = require("./middleware-DanzltB1.cjs");
7
+ const require_http = require("./http-D_Xrr6kp.cjs");
8
+ const require_middleware = require("./middleware-DhOFTXmo.cjs");
9
9
  const require_types = require("./types-DRPjmHVV.cjs");
10
- const require_proof = require("./proof-CKczQTG0.cjs");
11
- const require_kv_cache = require("./kv-cache-ClCz-B0L.cjs");
10
+ const require_proof = require("./proof-DBxu6g2K.cjs");
11
+ const require_kv_cache = require("./kv-cache-BwnC6JGt.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.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 { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-LMsqGo8j.js";
7
- import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "./middleware-B-CIN962.js";
6
+ import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-DkyUBs_T.js";
7
+ import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "./middleware-CnrzVu9i.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-Bau45ZUZ.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-Dz7_SbVI.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-HU__qtUD.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BhGeZk_o.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError } 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-CxbCIptr.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
6
6
  import "../std__assert-BvGuO4xO.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
8
- import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-RTcKhytV.mjs";
8
+ import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-I-XlrRVl.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/nodeinfo/handler.test.ts
11
11
  test("handleNodeInfo()", async () => {
@@ -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-DSS6EkPl.mjs";
5
- import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-vnmAGZ3_.mjs";
4
+ import { n as version, t as name } from "./deno-D4dcoVfF.mjs";
5
+ import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-Dg-NXm4K.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
8
8
  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-DdaLQHim.cjs");
4
+ const require_http = require("./http-D_Xrr6kp.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,9 +1,9 @@
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-DSS6EkPl.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-Z0UkrR_1.mjs";
6
- import { r as fetchKey, s as validateCryptoKey } from "./key-vnmAGZ3_.mjs";
4
+ import { n as version, t as name } from "./deno-D4dcoVfF.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-cIaMxG0v.mjs";
6
+ import { r as fetchKey, s as validateCryptoKey } from "./key-Dg-NXm4K.mjs";
7
7
  import { n as preloadedOnlyDocumentLoader } from "./public-audience-Dp4ZScSr.mjs";
8
8
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-D4iTv7uM.mjs";
9
9
  import { getLogger } from "@logtape/logtape";
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { I as name, L as version, c as fetchKey, f as validateCryptoKey, h as getFederationMetrics, m as getDurationMs, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, y as measureSignatureKeyFetch } from "./http-LMsqGo8j.js";
3
+ import { I as name, L as version, c as fetchKey, f as validateCryptoKey, h as getFederationMetrics, m as getDurationMs, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, y as measureSignatureKeyFetch } from "./http-DkyUBs_T.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,9 +1,9 @@
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-DSS6EkPl.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics } from "./metrics-Z0UkrR_1.mjs";
6
- import { n as doubleKnock } from "./http-D9h6mQdq.mjs";
4
+ import { n as version, t as name } from "./deno-D4dcoVfF.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics } from "./metrics-cIaMxG0v.mjs";
6
+ import { n as doubleKnock } from "./http-HjidyDfF.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { FetchError, UrlError, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -7,8 +7,8 @@ import { n as assertExists, t as assertStringIncludes } from "../std__assert-BvG
7
7
  import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
8
8
  import { t as assert } from "../assert-jSdZMYam.mjs";
9
9
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
10
- import { t as exportJwk } from "../key-vnmAGZ3_.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-D9h6mQdq.mjs";
10
+ import { t as exportJwk } from "../key-Dg-NXm4K.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-HjidyDfF.mjs";
12
12
  import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
13
13
  import { t as KvKeyCache } from "../keycache-Dkc_sflV.mjs";
14
14
  import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";