@fedify/fedify 2.0.32-dev.2352 → 2.0.32-dev.2371

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 (47) hide show
  1. package/dist/{builder-B_IDNXPb.mjs → builder-Dwcf0SPM.mjs} +3 -3
  2. package/dist/compat/transformers.test.mjs +1 -1
  3. package/dist/{deno-C2Eds4gr.mjs → deno-CfCk7LPk.mjs} +1 -1
  4. package/dist/{docloader-BLwGLFvJ.mjs → docloader-BxRYbtGA.mjs} +2 -2
  5. package/dist/federation/builder.test.mjs +1 -1
  6. package/dist/federation/handler.test.mjs +6 -6
  7. package/dist/federation/idempotency.test.mjs +2 -2
  8. package/dist/federation/inbox.test.mjs +1 -1
  9. package/dist/federation/middleware.test.mjs +6 -6
  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-DXroQ6E6.cjs → http-BjMtWmmQ.cjs} +66 -5
  16. package/dist/{http-DmGSYD1m.mjs → http-CR7JIBUN.mjs} +2 -2
  17. package/dist/{http-CnI-VUu2.js → http-CiGgxHgz.js} +67 -6
  18. package/dist/{inbox-CEDJX5pS.mjs → inbox-C0odW00W.mjs} +1 -1
  19. package/dist/{key-THr50yva.mjs → key-BA8EiJKh.mjs} +67 -6
  20. package/dist/{kv-cache-Ck3OyM7X.js → kv-cache-BNMvaiQi.js} +1 -1
  21. package/dist/{kv-cache-DVxp-CaJ.cjs → kv-cache-DtEnumbX.cjs} +1 -1
  22. package/dist/{ld-D7f7xz7f.mjs → ld-BQnp1nmZ.mjs} +2 -2
  23. package/dist/{middleware-DG9Ynhxa.js → middleware-BXpO2SxC.js} +3 -3
  24. package/dist/{middleware-w-nBUdkX.cjs → middleware-CEpCCeoc.cjs} +1 -1
  25. package/dist/{middleware-C3NaGGab.cjs → middleware-CbigwcPx.cjs} +4 -4
  26. package/dist/{middleware-DKdfkmft.mjs → middleware-DWej2-Tv.mjs} +1 -1
  27. package/dist/{middleware-C7K0UoCn.mjs → middleware-UBX31A23.mjs} +11 -11
  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-DRRooqxw.mjs → owner-C0hgzD-C.mjs} +2 -2
  32. package/dist/{proof-C95UYw_Y.mjs → proof-COr6pdP0.mjs} +2 -2
  33. package/dist/{proof-BDi_vJy5.js → proof-IqcQqh8h.js} +1 -1
  34. package/dist/{proof-XI-lknar.cjs → proof-TG7BmvT6.cjs} +1 -1
  35. package/dist/{send-BslGDBoh.mjs → send-Dn1hFd7P.mjs} +2 -2
  36. package/dist/sig/http.test.mjs +2 -2
  37. package/dist/sig/key.test.mjs +160 -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-CFur1rEO.mjs → temporal-Dc7vr666.mjs} +1 -1
  44. package/dist/utils/docloader.test.mjs +2 -2
  45. package/dist/utils/mod.cjs +1 -1
  46. package/dist/utils/mod.js +1 -1
  47. package/package.json +5 -5
@@ -2,8 +2,8 @@ import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError, t as Router } from "./router-CrMLXoOr.mjs";
5
- import { n as version, t as name } from "./deno-C2Eds4gr.mjs";
6
- import { t as InboxListenerSet } from "./inbox-CEDJX5pS.mjs";
5
+ import { n as version, t as name } from "./deno-CfCk7LPk.mjs";
6
+ import { t as InboxListenerSet } from "./inbox-C0odW00W.mjs";
7
7
  import { getTypeId } from "@fedify/vocab";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { getLogger } from "@logtape/logtape";
@@ -43,7 +43,7 @@ var FederationBuilderImpl = class {
43
43
  this.collectionTypeIds = {};
44
44
  }
45
45
  async build(options) {
46
- const { FederationImpl } = await import("./middleware-DKdfkmft.mjs");
46
+ const { FederationImpl } = await import("./middleware-DWej2-Tv.mjs");
47
47
  const f = new FederationImpl(options);
48
48
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
49
49
  f.router = this.router.clone();
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
6
6
  import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
7
- import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-C7K0UoCn.mjs";
7
+ import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-UBX31A23.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  import { Follow, Person } from "@fedify/vocab";
10
10
  //#region src/compat/transformers.test.ts
@@ -3,6 +3,6 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  //#region deno.json
5
5
  var name = "@fedify/fedify";
6
- var version = "2.0.32-dev.2352+a85795ae";
6
+ var version = "2.0.32-dev.2371+fa0c86b8";
7
7
  //#endregion
8
8
  export { version as n, name as t };
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { o as validateCryptoKey } from "./key-THr50yva.mjs";
5
- import { n as doubleKnock } from "./http-DmGSYD1m.mjs";
4
+ import { o as validateCryptoKey } from "./key-BA8EiJKh.mjs";
5
+ import { n as doubleKnock } from "./http-CR7JIBUN.mjs";
6
6
  import { curry } from "es-toolkit";
7
7
  import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
8
8
  import { getLogger } from "@logtape/logtape";
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { i as assertExists, n as assertStrictEquals } from "../std__assert-BUOJXi-Z.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
8
- import { n as createFederationBuilder } from "../builder-B_IDNXPb.mjs";
8
+ import { n as createFederationBuilder } from "../builder-Dwcf0SPM.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { Activity, Note, Person } from "@fedify/vocab";
11
11
  //#region src/federation/builder.test.ts
@@ -6,14 +6,14 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-BUOJXi-Z.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
8
  import { t as assert } from "../assert-BhQd8QHP.mjs";
9
- import { i as generateCryptoKeyPair } from "../key-THr50yva.mjs";
10
- import { s as signRequest } from "../http-DmGSYD1m.mjs";
9
+ import { i as generateCryptoKeyPair } from "../key-BA8EiJKh.mjs";
10
+ import { s as signRequest } from "../http-CR7JIBUN.mjs";
11
11
  import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-CCxRJhWa.mjs";
12
- import { a as compactJsonLd, f as signJsonLd } from "../ld-D7f7xz7f.mjs";
13
- import { n as signObject } from "../proof-C95UYw_Y.mjs";
12
+ import { a as compactJsonLd, f as signJsonLd } from "../ld-BQnp1nmZ.mjs";
13
+ import { n as signObject } from "../proof-COr6pdP0.mjs";
14
14
  import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
15
- import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-C7K0UoCn.mjs";
16
- import { t as InboxListenerSet } from "../inbox-CEDJX5pS.mjs";
15
+ import { a as createFederation, c as handleCollection, d as handleObject, f as respondWithObject, l as handleCustomCollection, p as respondWithObjectIfAcceptable, s as handleActor, u as handleInbox } from "../middleware-UBX31A23.mjs";
16
+ import { t as InboxListenerSet } from "../inbox-C0odW00W.mjs";
17
17
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
18
18
  import { Create, CryptographicKey, Multikey, Note, Person } from "@fedify/vocab";
19
19
  //#region src/federation/handler.test.ts
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import "../std__assert-BUOJXi-Z.mjs";
6
6
  import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
7
- import { n as signObject } from "../proof-C95UYw_Y.mjs";
7
+ import { n as signObject } from "../proof-COr6pdP0.mjs";
8
8
  import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
9
- import { a as createFederation } from "../middleware-C7K0UoCn.mjs";
9
+ import { a as createFederation } from "../middleware-UBX31A23.mjs";
10
10
  import { mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { Create, Follow, Person } from "@fedify/vocab";
12
12
  //#region src/federation/idempotency.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
6
- import { t as InboxListenerSet } from "../inbox-CEDJX5pS.mjs";
6
+ import { t as InboxListenerSet } from "../inbox-C0odW00W.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
9
9
  //#region src/federation/inbox.test.ts
@@ -9,14 +9,14 @@ import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z
9
9
  import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
10
10
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
11
11
  import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
12
- import { l as verifyRequest, s as signRequest } from "../http-DmGSYD1m.mjs";
12
+ import { l as verifyRequest, s as signRequest } from "../http-CR7JIBUN.mjs";
13
13
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
14
- import { t as getAuthenticatedDocumentLoader } from "../docloader-BLwGLFvJ.mjs";
15
- import { a as compactJsonLd, f as signJsonLd, m as verifyJsonLd, s as detachSignature } from "../ld-D7f7xz7f.mjs";
16
- import { t as doesActorOwnKey } from "../owner-DRRooqxw.mjs";
17
- import { n as signObject, r as verifyObject } from "../proof-C95UYw_Y.mjs";
14
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-BxRYbtGA.mjs";
15
+ import { a as compactJsonLd, f as signJsonLd, m as verifyJsonLd, s as detachSignature } from "../ld-BQnp1nmZ.mjs";
16
+ import { t as doesActorOwnKey } from "../owner-C0hgzD-C.mjs";
17
+ import { n as signObject, r as verifyObject } from "../proof-COr6pdP0.mjs";
18
18
  import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
19
- import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-C7K0UoCn.mjs";
19
+ import { a as createFederation, i as KvSpecDeterminer, n as FederationImpl, r as InboxContextImpl, t as ContextImpl } from "../middleware-UBX31A23.mjs";
20
20
  import { mockDocumentLoader, test } from "@fedify/fixture";
21
21
  import * as vocab from "@fedify/vocab";
22
22
  import { Create, Offer, Person, getTypeId, lookupObject } from "@fedify/vocab";
@@ -2,7 +2,7 @@ const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  require("../chunk-DDcVe30Y.cjs");
5
- const require_middleware = require("../middleware-C3NaGGab.cjs");
5
+ const require_middleware = require("../middleware-CbigwcPx.cjs");
6
6
  let es_toolkit = require("es-toolkit");
7
7
  //#region src/federation/kv.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- 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-DG9Ynhxa.js";
3
+ 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-BXpO2SxC.js";
4
4
  import { isEqual } from "es-toolkit";
5
5
  //#region src/federation/kv.ts
6
6
  /**
@@ -7,10 +7,10 @@ import "../std__assert-BUOJXi-Z.mjs";
7
7
  import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
8
  import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
9
9
  import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
10
- import { l as verifyRequest } from "../http-DmGSYD1m.mjs";
10
+ import { l as verifyRequest } from "../http-CR7JIBUN.mjs";
11
11
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
12
- import { t as doesActorOwnKey } from "../owner-DRRooqxw.mjs";
13
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-BslGDBoh.mjs";
12
+ import { t as doesActorOwnKey } from "../owner-C0hgzD-C.mjs";
13
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-Dn1hFd7P.mjs";
14
14
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
15
15
  import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
16
16
  import { FetchError, UrlError } from "@fedify/vocab-runtime";
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
4
4
  import "../std__assert-BUOJXi-Z.mjs";
5
5
  import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
6
6
  import { t as assert } from "../assert-BhQd8QHP.mjs";
7
- import { t as hasMalformedKnownTemporalLiteral } from "../temporal-CFur1rEO.mjs";
7
+ import { t as hasMalformedKnownTemporalLiteral } from "../temporal-Dc7vr666.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/federation/temporal.test.ts
10
10
  test("hasMalformedKnownTemporalLiteral() detects expanded proof timestamps", async () => {
@@ -5,7 +5,7 @@ import { n as createRequestContext } from "../context-Juj6bdHC.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-BUOJXi-Z.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
8
- import { a as createFederation, o as handleWebFinger } from "../middleware-C7K0UoCn.mjs";
8
+ import { a as createFederation, o as handleWebFinger } from "../middleware-UBX31A23.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { Image, Link, Person } from "@fedify/vocab";
11
11
  //#region src/federation/webfinger.test.ts
@@ -11,9 +11,50 @@ let byte_encodings_base64 = require("byte-encodings/base64");
11
11
  let structured_field_values = require("structured-field-values");
12
12
  //#region deno.json
13
13
  var name = "@fedify/fedify";
14
- var version = "2.0.32-dev.2352+a85795ae";
14
+ var version = "2.0.32-dev.2371+fa0c86b8";
15
15
  //#endregion
16
16
  //#region src/sig/key.ts
17
+ /** Classifies decoding failures without hiding unexpected loader errors. */
18
+ function classifyKeyJsonLdError(error, seen = /* @__PURE__ */ new Set()) {
19
+ if (!(error instanceof Error) || !error.name.startsWith("jsonld.")) return null;
20
+ if (seen.has(error)) throw error;
21
+ seen.add(error);
22
+ const details = error.details;
23
+ if (typeof details?.code !== "string") return null;
24
+ if (details.code !== "loading remote context failed" || !("cause" in details) && !("cause" in error)) return "invalid";
25
+ const cause = "cause" in details ? details.cause : error.cause;
26
+ const nestedFailure = classifyKeyJsonLdError(cause, seen);
27
+ if (nestedFailure != null) return nestedFailure;
28
+ if (cause instanceof SyntaxError) return "invalid";
29
+ if (cause instanceof _fedify_vocab_runtime.FetchError || cause instanceof _fedify_vocab_runtime.UrlError) return "fetch";
30
+ if (cause instanceof Error && [
31
+ "AbortError",
32
+ "TimeoutError",
33
+ "NetworkError"
34
+ ].includes(cause.name)) return "fetch";
35
+ if (cause instanceof TypeError) {
36
+ const urlCode = cause.code;
37
+ if (cause.name === "InvalidContextReferenceError") return "invalid";
38
+ 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";
39
+ const networkCause = cause.cause;
40
+ const code = cause.code ?? networkCause?.code;
41
+ if (typeof code === "string" && [
42
+ "ECONNREFUSED",
43
+ "ECONNRESET",
44
+ "ECONNABORTED",
45
+ "ETIMEDOUT",
46
+ "EHOSTUNREACH",
47
+ "ENETUNREACH",
48
+ "ENOTFOUND",
49
+ "EAI_AGAIN",
50
+ "UND_ERR_CONNECT_TIMEOUT",
51
+ "UND_ERR_HEADERS_TIMEOUT",
52
+ "UND_ERR_BODY_TIMEOUT",
53
+ "UND_ERR_SOCKET"
54
+ ].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";
55
+ }
56
+ throw cause;
57
+ }
17
58
  /**
18
59
  * Checks if the given key is valid and supported. No-op if the key is valid,
19
60
  * otherwise throws an error.
@@ -138,9 +179,11 @@ async function fetchActorDocument(actorId, options = {}) {
138
179
  baseUrl: documentUrl
139
180
  });
140
181
  } catch (error) {
141
- if (!(error instanceof TypeError)) throw error;
142
- logger.debug("The document served at {documentUrl} is not a valid object: {error}", {
182
+ const failure = classifyKeyJsonLdError(error);
183
+ if (failure == null && !(error instanceof TypeError)) throw error;
184
+ logger.debug("Failed to decode the actor document at {documentUrl}: {error}", {
143
185
  documentUrl: documentUrl.href,
186
+ failure: failure ?? "invalid",
144
187
  error
145
188
  });
146
189
  return null;
@@ -294,6 +337,19 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
294
337
  tracerProvider
295
338
  });
296
339
  } catch (e) {
340
+ const failure = classifyKeyJsonLdError(e);
341
+ if (failure != null) {
342
+ logger.debug("Failed to decode key {keyId}: {error}", {
343
+ keyId,
344
+ failure,
345
+ error: e
346
+ });
347
+ await keyCache?.set(cacheKey, null);
348
+ return {
349
+ key: null,
350
+ cached: false
351
+ };
352
+ }
297
353
  if (!(e instanceof TypeError)) throw e;
298
354
  try {
299
355
  object = await cls.fromJsonLd(document, {
@@ -302,8 +358,13 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
302
358
  tracerProvider
303
359
  });
304
360
  } catch (e) {
305
- if (e instanceof TypeError) {
306
- logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
361
+ const failure = classifyKeyJsonLdError(e);
362
+ if (failure != null || e instanceof TypeError) {
363
+ logger.debug("Failed to decode key {keyId}: {error}", {
364
+ keyId,
365
+ failure: failure ?? "invalid",
366
+ error: e
367
+ });
307
368
  await keyCache?.set(cacheKey, null);
308
369
  return {
309
370
  key: null,
@@ -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-C2Eds4gr.mjs";
5
- import { o as validateCryptoKey, r as fetchKey } from "./key-THr50yva.mjs";
4
+ import { n as version, t as name } from "./deno-CfCk7LPk.mjs";
5
+ import { o as validateCryptoKey, r as fetchKey } from "./key-BA8EiJKh.mjs";
6
6
  import { CryptographicKey } from "@fedify/vocab";
7
7
  import { SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { FetchError } from "@fedify/vocab-runtime";
@@ -4,15 +4,56 @@ import { getLogger } from "@logtape/logtape";
4
4
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
5
5
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
6
6
  import { encodeHex } from "byte-encodings/hex";
7
- import { FetchError, getDocumentLoader } from "@fedify/vocab-runtime";
7
+ import { FetchError, UrlError, getDocumentLoader } from "@fedify/vocab-runtime";
8
8
  import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
9
9
  import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
10
10
  import { Item, decodeDict, encodeItem } from "structured-field-values";
11
11
  //#region deno.json
12
12
  var name = "@fedify/fedify";
13
- var version = "2.0.32-dev.2352+a85795ae";
13
+ var version = "2.0.32-dev.2371+fa0c86b8";
14
14
  //#endregion
15
15
  //#region src/sig/key.ts
16
+ /** Classifies decoding failures without hiding unexpected loader errors. */
17
+ function classifyKeyJsonLdError(error, seen = /* @__PURE__ */ new Set()) {
18
+ if (!(error instanceof Error) || !error.name.startsWith("jsonld.")) return null;
19
+ if (seen.has(error)) throw error;
20
+ seen.add(error);
21
+ const details = error.details;
22
+ if (typeof details?.code !== "string") return null;
23
+ if (details.code !== "loading remote context failed" || !("cause" in details) && !("cause" in error)) return "invalid";
24
+ const cause = "cause" in details ? details.cause : error.cause;
25
+ const nestedFailure = classifyKeyJsonLdError(cause, seen);
26
+ if (nestedFailure != null) return nestedFailure;
27
+ if (cause instanceof SyntaxError) return "invalid";
28
+ if (cause instanceof FetchError || cause instanceof UrlError) return "fetch";
29
+ if (cause instanceof Error && [
30
+ "AbortError",
31
+ "TimeoutError",
32
+ "NetworkError"
33
+ ].includes(cause.name)) return "fetch";
34
+ if (cause instanceof TypeError) {
35
+ const urlCode = cause.code;
36
+ if (cause.name === "InvalidContextReferenceError") return "invalid";
37
+ 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";
38
+ const networkCause = cause.cause;
39
+ const code = cause.code ?? networkCause?.code;
40
+ if (typeof code === "string" && [
41
+ "ECONNREFUSED",
42
+ "ECONNRESET",
43
+ "ECONNABORTED",
44
+ "ETIMEDOUT",
45
+ "EHOSTUNREACH",
46
+ "ENETUNREACH",
47
+ "ENOTFOUND",
48
+ "EAI_AGAIN",
49
+ "UND_ERR_CONNECT_TIMEOUT",
50
+ "UND_ERR_HEADERS_TIMEOUT",
51
+ "UND_ERR_BODY_TIMEOUT",
52
+ "UND_ERR_SOCKET"
53
+ ].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";
54
+ }
55
+ throw cause;
56
+ }
16
57
  /**
17
58
  * Checks if the given key is valid and supported. No-op if the key is valid,
18
59
  * otherwise throws an error.
@@ -137,9 +178,11 @@ async function fetchActorDocument(actorId, options = {}) {
137
178
  baseUrl: documentUrl
138
179
  });
139
180
  } catch (error) {
140
- if (!(error instanceof TypeError)) throw error;
141
- logger.debug("The document served at {documentUrl} is not a valid object: {error}", {
181
+ const failure = classifyKeyJsonLdError(error);
182
+ if (failure == null && !(error instanceof TypeError)) throw error;
183
+ logger.debug("Failed to decode the actor document at {documentUrl}: {error}", {
142
184
  documentUrl: documentUrl.href,
185
+ failure: failure ?? "invalid",
143
186
  error
144
187
  });
145
188
  return null;
@@ -293,6 +336,19 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
293
336
  tracerProvider
294
337
  });
295
338
  } catch (e) {
339
+ const failure = classifyKeyJsonLdError(e);
340
+ if (failure != null) {
341
+ logger.debug("Failed to decode key {keyId}: {error}", {
342
+ keyId,
343
+ failure,
344
+ error: e
345
+ });
346
+ await keyCache?.set(cacheKey, null);
347
+ return {
348
+ key: null,
349
+ cached: false
350
+ };
351
+ }
296
352
  if (!(e instanceof TypeError)) throw e;
297
353
  try {
298
354
  object = await cls.fromJsonLd(document, {
@@ -301,8 +357,13 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
301
357
  tracerProvider
302
358
  });
303
359
  } catch (e) {
304
- if (e instanceof TypeError) {
305
- logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
360
+ const failure = classifyKeyJsonLdError(e);
361
+ if (failure != null || e instanceof TypeError) {
362
+ logger.debug("Failed to decode key {keyId}: {error}", {
363
+ keyId,
364
+ failure: failure ?? "invalid",
365
+ error: e
366
+ });
306
367
  await keyCache?.set(cacheKey, null);
307
368
  return {
308
369
  key: null,
@@ -1,7 +1,7 @@
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-C2Eds4gr.mjs";
4
+ import { n as version, t as name } from "./deno-CfCk7LPk.mjs";
5
5
  import { Activity, getTypeId } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
7
7
  import { getLogger } from "@logtape/logtape";
@@ -1,12 +1,53 @@
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-C2Eds4gr.mjs";
4
+ import { n as version, t as name } from "./deno-CfCk7LPk.mjs";
5
5
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
7
- import { getDocumentLoader } from "@fedify/vocab-runtime";
7
+ import { FetchError, UrlError, getDocumentLoader } from "@fedify/vocab-runtime";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  //#region src/sig/key.ts
10
+ /** Classifies decoding failures without hiding unexpected loader errors. */
11
+ function classifyKeyJsonLdError(error, seen = /* @__PURE__ */ new Set()) {
12
+ if (!(error instanceof Error) || !error.name.startsWith("jsonld.")) return null;
13
+ if (seen.has(error)) throw error;
14
+ seen.add(error);
15
+ const details = error.details;
16
+ if (typeof details?.code !== "string") return null;
17
+ if (details.code !== "loading remote context failed" || !("cause" in details) && !("cause" in error)) return "invalid";
18
+ const cause = "cause" in details ? details.cause : error.cause;
19
+ const nestedFailure = classifyKeyJsonLdError(cause, seen);
20
+ if (nestedFailure != null) return nestedFailure;
21
+ if (cause instanceof SyntaxError) return "invalid";
22
+ if (cause instanceof FetchError || cause instanceof UrlError) return "fetch";
23
+ if (cause instanceof Error && [
24
+ "AbortError",
25
+ "TimeoutError",
26
+ "NetworkError"
27
+ ].includes(cause.name)) return "fetch";
28
+ if (cause instanceof TypeError) {
29
+ const urlCode = cause.code;
30
+ if (cause.name === "InvalidContextReferenceError") return "invalid";
31
+ 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";
32
+ const networkCause = cause.cause;
33
+ const code = cause.code ?? networkCause?.code;
34
+ if (typeof code === "string" && [
35
+ "ECONNREFUSED",
36
+ "ECONNRESET",
37
+ "ECONNABORTED",
38
+ "ETIMEDOUT",
39
+ "EHOSTUNREACH",
40
+ "ENETUNREACH",
41
+ "ENOTFOUND",
42
+ "EAI_AGAIN",
43
+ "UND_ERR_CONNECT_TIMEOUT",
44
+ "UND_ERR_HEADERS_TIMEOUT",
45
+ "UND_ERR_BODY_TIMEOUT",
46
+ "UND_ERR_SOCKET"
47
+ ].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";
48
+ }
49
+ throw cause;
50
+ }
10
51
  /**
11
52
  * Checks if the given key is valid and supported. No-op if the key is valid,
12
53
  * otherwise throws an error.
@@ -131,9 +172,11 @@ async function fetchActorDocument(actorId, options = {}) {
131
172
  baseUrl: documentUrl
132
173
  });
133
174
  } catch (error) {
134
- if (!(error instanceof TypeError)) throw error;
135
- logger.debug("The document served at {documentUrl} is not a valid object: {error}", {
175
+ const failure = classifyKeyJsonLdError(error);
176
+ if (failure == null && !(error instanceof TypeError)) throw error;
177
+ logger.debug("Failed to decode the actor document at {documentUrl}: {error}", {
136
178
  documentUrl: documentUrl.href,
179
+ failure: failure ?? "invalid",
137
180
  error
138
181
  });
139
182
  return null;
@@ -287,6 +330,19 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
287
330
  tracerProvider
288
331
  });
289
332
  } catch (e) {
333
+ const failure = classifyKeyJsonLdError(e);
334
+ if (failure != null) {
335
+ logger.debug("Failed to decode key {keyId}: {error}", {
336
+ keyId,
337
+ failure,
338
+ error: e
339
+ });
340
+ await keyCache?.set(cacheKey, null);
341
+ return {
342
+ key: null,
343
+ cached: false
344
+ };
345
+ }
290
346
  if (!(e instanceof TypeError)) throw e;
291
347
  try {
292
348
  object = await cls.fromJsonLd(document, {
@@ -295,8 +351,13 @@ async function fetchKeyInternal(keyId, cls, { documentLoader, contextLoader, key
295
351
  tracerProvider
296
352
  });
297
353
  } catch (e) {
298
- if (e instanceof TypeError) {
299
- logger.debug("Failed to verify; key {keyId} returned an invalid object.", { keyId });
354
+ const failure = classifyKeyJsonLdError(e);
355
+ if (failure != null || e instanceof TypeError) {
356
+ logger.debug("Failed to decode key {keyId}: {error}", {
357
+ keyId,
358
+ failure: failure ?? "invalid",
359
+ error: e
360
+ });
300
361
  await keyCache?.set(cacheKey, null);
301
362
  return {
302
363
  key: null,
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { l as validateCryptoKey, t as doubleKnock } from "./http-CnI-VUu2.js";
3
+ import { l as validateCryptoKey, t as doubleKnock } from "./http-CiGgxHgz.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { curry } from "es-toolkit";
6
6
  import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -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-DXroQ6E6.cjs");
4
+ const require_http = require("./http-BjMtWmmQ.cjs");
5
5
  let _logtape_logtape = require("@logtape/logtape");
6
6
  let es_toolkit = require("es-toolkit");
7
7
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
@@ -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-C2Eds4gr.mjs";
5
- import { o as validateCryptoKey, r as fetchKey } from "./key-THr50yva.mjs";
4
+ import { n as version, t as name } from "./deno-CfCk7LPk.mjs";
5
+ import { o as validateCryptoKey, r as fetchKey } from "./key-BA8EiJKh.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";
@@ -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 { c as importJwk, d as name, f as version, i as exportJwk, l as validateCryptoKey, r as verifyRequest, t as doubleKnock } from "./http-CnI-VUu2.js";
5
+ import { c as importJwk, d as name, f as version, i as exportJwk, l as validateCryptoKey, r as verifyRequest, t as doubleKnock } from "./http-CiGgxHgz.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 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-BDi_vJy5.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-Ck3OyM7X.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-IqcQqh8h.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BNMvaiQi.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";
@@ -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-C3NaGGab.cjs");
3
+ const require_middleware = require("./middleware-CbigwcPx.cjs");
4
4
  exports.FederationImpl = require_middleware.FederationImpl;
@@ -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-DXroQ6E6.cjs");
5
+ const require_http = require("./http-BjMtWmmQ.cjs");
6
6
  const require_types = require("./types-DRPjmHVV.cjs");
7
- const require_proof = require("./proof-XI-lknar.cjs");
8
- const require_kv_cache = require("./kv-cache-DVxp-CaJ.cjs");
7
+ const require_proof = require("./proof-TG7BmvT6.cjs");
8
+ const require_kv_cache = require("./kv-cache-DtEnumbX.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");
@@ -336,7 +336,7 @@ var FederationBuilderImpl = class {
336
336
  this.collectionTypeIds = {};
337
337
  }
338
338
  async build(options) {
339
- const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-w-nBUdkX.cjs"));
339
+ const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-CEpCCeoc.cjs"));
340
340
  const f = new FederationImpl(options);
341
341
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
342
342
  f.router = this.router.clone();
@@ -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-C7K0UoCn.mjs";
4
+ import { n as FederationImpl } from "./middleware-UBX31A23.mjs";
5
5
  export { FederationImpl };
@@ -2,24 +2,24 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError } from "./router-CrMLXoOr.mjs";
5
- import { n as version, t as name } from "./deno-C2Eds4gr.mjs";
6
- import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-THr50yva.mjs";
7
- import { l as verifyRequest } from "./http-DmGSYD1m.mjs";
8
- import { t as getAuthenticatedDocumentLoader } from "./docloader-BLwGLFvJ.mjs";
5
+ import { n as version, t as name } from "./deno-CfCk7LPk.mjs";
6
+ import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-BA8EiJKh.mjs";
7
+ import { l as verifyRequest } from "./http-CR7JIBUN.mjs";
8
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-BxRYbtGA.mjs";
9
9
  import { n as kvCache } from "./kv-cache-BrjuJue8.mjs";
10
- import { a as compactJsonLd, c as getNormalizationContextLoader, d as isInvalidUrlTypeError, f as signJsonLd, g as wrapContextLoaderForJsonLd, l as hasSignature, p as verifyCompactJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as isClearlyMalformedContextReference } from "./ld-D7f7xz7f.mjs";
11
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-DRRooqxw.mjs";
12
- import { n as signObject, r as verifyObject } from "./proof-C95UYw_Y.mjs";
10
+ import { a as compactJsonLd, c as getNormalizationContextLoader, d as isInvalidUrlTypeError, f as signJsonLd, g as wrapContextLoaderForJsonLd, l as hasSignature, p as verifyCompactJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as isClearlyMalformedContextReference } from "./ld-BQnp1nmZ.mjs";
11
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-C0hgzD-C.mjs";
12
+ import { n as signObject, r as verifyObject } from "./proof-COr6pdP0.mjs";
13
13
  import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-BUqbea1d.mjs";
14
14
  import { t as nodeInfoToJson } from "./types-MNlFfxjv.mjs";
15
- import { n as routeActivity } from "./inbox-CEDJX5pS.mjs";
16
- import { t as FederationBuilderImpl } from "./builder-B_IDNXPb.mjs";
15
+ import { n as routeActivity } from "./inbox-C0odW00W.mjs";
16
+ import { t as FederationBuilderImpl } from "./builder-Dwcf0SPM.mjs";
17
17
  import { t as buildCollectionSynchronizationHeader } from "./collection-DI6YzYpd.mjs";
18
18
  import { t as KvKeyCache } from "./keycache-D239uGT9.mjs";
19
19
  import { t as acceptsJsonLd } from "./negotiation-TWEs6Cl8.mjs";
20
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-CFur1rEO.mjs";
20
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-Dc7vr666.mjs";
21
21
  import { t as createExponentialBackoffPolicy } from "./retry-Ddbq3AcK.mjs";
22
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-BslGDBoh.mjs";
22
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-Dn1hFd7P.mjs";
23
23
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
24
24
  import { lookupWebFinger } from "@fedify/webfinger";
25
25
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
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-DXroQ6E6.cjs");
8
- const require_middleware = require("./middleware-C3NaGGab.cjs");
7
+ const require_http = require("./http-BjMtWmmQ.cjs");
8
+ const require_middleware = require("./middleware-CbigwcPx.cjs");
9
9
  const require_types = require("./types-DRPjmHVV.cjs");
10
- const require_proof = require("./proof-XI-lknar.cjs");
11
- const require_kv_cache = require("./kv-cache-DVxp-CaJ.cjs");
10
+ const require_proof = require("./proof-TG7BmvT6.cjs");
11
+ const require_kv_cache = require("./kv-cache-DtEnumbX.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 { c as importJwk, i as exportJwk, n as signRequest, o as fetchKey, r as verifyRequest, s as generateCryptoKeyPair } from "./http-CnI-VUu2.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-DG9Ynhxa.js";
6
+ import { c as importJwk, i as exportJwk, n as signRequest, o as fetchKey, r as verifyRequest, s as generateCryptoKeyPair } from "./http-CiGgxHgz.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-BXpO2SxC.js";
8
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-BDi_vJy5.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-Ck3OyM7X.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-IqcQqh8h.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BNMvaiQi.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 { n as createRequestContext } from "../context-Juj6bdHC.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-BUOJXi-Z.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
8
- import { a as createFederation, h as handleNodeInfoJrd, m as handleNodeInfo } from "../middleware-C7K0UoCn.mjs";
8
+ import { a as createFederation, h as handleNodeInfoJrd, m as handleNodeInfo } from "../middleware-UBX31A23.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-C2Eds4gr.mjs";
5
- import { n as fetchActorDocument, s as verifyKeyOwnership, t as exportJwk } from "./key-THr50yva.mjs";
4
+ import { n as version, t as name } from "./deno-CfCk7LPk.mjs";
5
+ import { n as fetchActorDocument, s as verifyKeyOwnership, t as exportJwk } from "./key-BA8EiJKh.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,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-C2Eds4gr.mjs";
5
- import { o as validateCryptoKey, r as fetchKey } from "./key-THr50yva.mjs";
4
+ import { n as version, t as name } from "./deno-CfCk7LPk.mjs";
5
+ import { o as validateCryptoKey, r as fetchKey } from "./key-BA8EiJKh.mjs";
6
6
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
7
7
  import { SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  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 { a as fetchActorDocument, d as name, f as version, i as exportJwk, l as validateCryptoKey, o as fetchKey, u as verifyKeyOwnership } from "./http-CnI-VUu2.js";
3
+ import { a as fetchActorDocument, d as name, f as version, i as exportJwk, l as validateCryptoKey, o as fetchKey, u as verifyKeyOwnership } from "./http-CiGgxHgz.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, 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-DXroQ6E6.cjs");
4
+ const require_http = require("./http-BjMtWmmQ.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 "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-C2Eds4gr.mjs";
5
- import { n as doubleKnock } from "./http-DmGSYD1m.mjs";
4
+ import { n as version, t as name } from "./deno-CfCk7LPk.mjs";
5
+ import { n as doubleKnock } from "./http-CR7JIBUN.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 { i as assertExists, t as assertStringIncludes } from "../std__assert-BUO
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-THr50yva.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 } from "../http-DmGSYD1m.mjs";
10
+ import { t as exportJwk } from "../key-BA8EiJKh.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 } from "../http-CR7JIBUN.mjs";
12
12
  import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-CCxRJhWa.mjs";
13
13
  import { mockDocumentLoader, test } from "@fedify/fixture";
14
14
  import { FetchError, exportSpki } from "@fedify/vocab-runtime";
@@ -2,14 +2,16 @@ import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
- import "../std__assert-BUOJXi-Z.mjs";
5
+ import { n as assertStrictEquals } from "../std__assert-BUOJXi-Z.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 importJwk, i as generateCryptoKeyPair, o as validateCryptoKey, r as fetchKey, t as exportJwk } from "../key-THr50yva.mjs";
9
+ import { a as importJwk, i as generateCryptoKeyPair, o as validateCryptoKey, r as fetchKey, t as exportJwk } from "../key-BA8EiJKh.mjs";
10
10
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
11
+ import { g as wrapContextLoaderForJsonLd } from "../ld-BQnp1nmZ.mjs";
11
12
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
- import { CryptographicKey, Multikey } from "@fedify/vocab";
13
+ import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
14
+ import { FetchError, UrlError, getDocumentLoader } from "@fedify/vocab-runtime";
13
15
  //#region src/sig/key.test.ts
14
16
  test("validateCryptoKey()", async () => {
15
17
  const pkcs1v15 = await crypto.subtle.generateKey({
@@ -332,6 +334,161 @@ test("fetchKey() returns null for a malformed actor publicKey", async () => {
332
334
  cached: true
333
335
  });
334
336
  });
337
+ for (const cls of [CryptographicKey, Multikey]) for (const location of [
338
+ "actor",
339
+ "key",
340
+ "owner"
341
+ ]) test(`fetchKey() handles JSON-LD context failures in ${cls.name} ${location} documents`, async (t) => {
342
+ const actorId = new URL("https://example.com/context-actor");
343
+ const keyId = new URL(`${actorId.href}#key`);
344
+ const key = cls === CryptographicKey ? rsaPublicKey1.clone({
345
+ id: keyId,
346
+ owner: actorId
347
+ }) : ed25519Multikey.clone({
348
+ id: keyId,
349
+ controller: actorId
350
+ });
351
+ const actorDocument = await new Person({
352
+ id: actorId,
353
+ ...key instanceof CryptographicKey ? { publicKeys: [key] } : { assertionMethods: [key] }
354
+ }).toJsonLd({ contextLoader: mockDocumentLoader });
355
+ const keyDocument = await key.toJsonLd({ contextLoader: mockDocumentLoader });
356
+ const contextUrl = `https://example.com/context/${cls.name}/${location}`;
357
+ const transportErrors = [
358
+ /* @__PURE__ */ new TypeError("fetch failed"),
359
+ /* @__PURE__ */ new TypeError("error reading a body from connection"),
360
+ globalThis.Object.assign(/* @__PURE__ */ new TypeError("The socket connection was closed unexpectedly."), { code: "ECONNRESET" }),
361
+ globalThis.Object.assign(/* @__PURE__ */ new TypeError("Network request failed"), { code: "ECONNRESET" }),
362
+ new TypeError("Network request failed", { cause: globalThis.Object.assign(/* @__PURE__ */ new Error("connection refused"), { code: "ECONNREFUSED" }) }),
363
+ new FetchError(contextUrl, "HTTP 503"),
364
+ new UrlError("DNS lookup failed", { reason: "dns" }),
365
+ globalThis.Object.assign(/* @__PURE__ */ new Error("request aborted"), { name: "AbortError" })
366
+ ];
367
+ const programmingErrors = [
368
+ /* @__PURE__ */ new Error("loader bug"),
369
+ /* @__PURE__ */ new ReferenceError("loader bug"),
370
+ /* @__PURE__ */ new TypeError("loader bug"),
371
+ "loader bug",
372
+ null,
373
+ void 0
374
+ ];
375
+ const cases = [
376
+ { kind: "inline" },
377
+ {
378
+ kind: "url",
379
+ wrapped: false
380
+ },
381
+ {
382
+ kind: "url",
383
+ wrapped: true
384
+ },
385
+ {
386
+ kind: "wrapped",
387
+ error: /* @__PURE__ */ new TypeError("Invalid URL string.")
388
+ },
389
+ {
390
+ kind: "remote",
391
+ document: 123
392
+ },
393
+ {
394
+ kind: "remote",
395
+ document: "not JSON"
396
+ },
397
+ {
398
+ kind: "remote",
399
+ document: { "@context": contextUrl }
400
+ },
401
+ ...transportErrors.map((error) => ({
402
+ kind: "transport",
403
+ error
404
+ })),
405
+ ...programmingErrors.map((error) => ({
406
+ kind: "programming",
407
+ error
408
+ })),
409
+ ...location === "key" ? [{
410
+ kind: "transport",
411
+ error: /* @__PURE__ */ new TypeError("fetch failed"),
412
+ fallback: true
413
+ }, {
414
+ kind: "programming",
415
+ error: /* @__PURE__ */ new ReferenceError("fallback bug"),
416
+ fallback: true
417
+ }] : []
418
+ ];
419
+ for (const scenario of cases) {
420
+ const description = "error" in scenario ? scenario.error instanceof Error ? `${scenario.error.name}: ${scenario.error.message}` : String(scenario.error) : "document" in scenario ? JSON.stringify(scenario.document) : "invalid type mapping";
421
+ await t.step(`${scenario.kind}: ${description}${"fallback" in scenario ? " (fallback)" : ""}`, async () => {
422
+ const cache = {};
423
+ let recovered = false;
424
+ let contextLoads = 0;
425
+ const options = {
426
+ documentLoader(resource) {
427
+ const document = structuredClone(resource === keyId.href && location !== "actor" ? keyDocument : actorDocument);
428
+ if (location === "actor" || location === "key" && resource === keyId.href || location === "owner" && resource === actorId.href) {
429
+ const context = scenario.kind === "inline" ? { broken: {
430
+ "@id": "https://example.com/ns#broken",
431
+ "@type": "not-an-absolute-iri"
432
+ } } : scenario.kind === "url" ? "http://[" : contextUrl;
433
+ document["@context"] = [document["@context"], context].flat();
434
+ }
435
+ return Promise.resolve({
436
+ contextUrl: null,
437
+ documentUrl: resource,
438
+ document
439
+ });
440
+ },
441
+ async contextLoader(resource) {
442
+ if (scenario.kind === "url" && resource === "http://[") {
443
+ const loader = getDocumentLoader();
444
+ return await (scenario.wrapped ? wrapContextLoaderForJsonLd(loader) : loader)(resource);
445
+ }
446
+ if (scenario.kind === "wrapped" && resource === contextUrl) return await wrapContextLoaderForJsonLd(() => Promise.reject(scenario.error))(resource);
447
+ if (resource !== contextUrl) return await mockDocumentLoader(resource);
448
+ contextLoads++;
449
+ if (!recovered && "error" in scenario && (!("fallback" in scenario) || contextLoads > 1)) throw scenario.error;
450
+ return {
451
+ contextUrl: null,
452
+ documentUrl: resource,
453
+ document: !recovered && "document" in scenario ? scenario.document : { "@context": {} }
454
+ };
455
+ },
456
+ keyCache: {
457
+ get: (id) => Promise.resolve(cache[id.href]),
458
+ set(id, value) {
459
+ cache[id.href] = value;
460
+ return Promise.resolve();
461
+ }
462
+ }
463
+ };
464
+ const lookup = () => fetchKey(keyId, cls, options);
465
+ if (scenario.kind === "programming" && "error" in scenario) {
466
+ assertStrictEquals(await assertRejects(lookup), scenario.error);
467
+ assertEquals(cache, {});
468
+ return;
469
+ }
470
+ assertEquals(await lookup(), {
471
+ key: null,
472
+ cached: false
473
+ });
474
+ assertEquals(cache, { [keyId.href]: null });
475
+ const previousLoads = contextLoads;
476
+ assertEquals(await lookup(), {
477
+ key: null,
478
+ cached: true
479
+ });
480
+ assertEquals(contextLoads, previousLoads);
481
+ if (scenario.kind === "transport") {
482
+ delete cache[keyId.href];
483
+ recovered = true;
484
+ const result = await lookup();
485
+ assertEquals(result.cached, false);
486
+ assertEquals(result.key?.id, keyId);
487
+ assert(result.key?.publicKey != null);
488
+ }
489
+ });
490
+ }
491
+ });
335
492
  test("fetchKey() rejects a key whose owner does not link back", async () => {
336
493
  const keyId = "https://attacker.example/key";
337
494
  const keyDocument = await rsaPublicKey1.toJsonLd({ contextLoader: mockDocumentLoader });
@@ -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 { i as generateCryptoKeyPair } from "../key-THr50yva.mjs";
8
+ import { i as generateCryptoKeyPair } from "../key-BA8EiJKh.mjs";
9
9
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
10
- import { a as compactJsonLd, d as isInvalidUrlTypeError, f as signJsonLd, h as verifySignature, i as attachSignature, m as verifyJsonLd, n as UnsafeJsonLdError, o as createSignature, s as detachSignature } from "../ld-D7f7xz7f.mjs";
10
+ import { a as compactJsonLd, d as isInvalidUrlTypeError, f as signJsonLd, h as verifySignature, i as attachSignature, m as verifyJsonLd, n as UnsafeJsonLdError, o as createSignature, s as detachSignature } from "../ld-BQnp1nmZ.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-DXroQ6E6.cjs");
5
- const require_proof = require("../proof-XI-lknar.cjs");
4
+ const require_http = require("../http-BjMtWmmQ.cjs");
5
+ const require_proof = require("../proof-TG7BmvT6.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 { c as importJwk, i as exportJwk, n as signRequest, o as fetchKey, r as verifyRequest, s as generateCryptoKeyPair } from "../http-CnI-VUu2.js";
4
- 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-BDi_vJy5.js";
3
+ import { c as importJwk, i as exportJwk, n as signRequest, o as fetchKey, r as verifyRequest, s as generateCryptoKeyPair } from "../http-CiGgxHgz.js";
4
+ 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-IqcQqh8h.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
@@ -6,7 +6,7 @@ import "../std__assert-BUOJXi-Z.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-CCxRJhWa.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DRRooqxw.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-C0hgzD-C.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
@@ -6,7 +6,7 @@ import "../std__assert-BUOJXi-Z.mjs";
6
6
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { n as assertInstanceOf } from "../assert-BhQd8QHP.mjs";
8
8
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
9
- import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-C95UYw_Y.mjs";
9
+ import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-COr6pdP0.mjs";
10
10
  import { mockDocumentLoader, test } from "@fedify/fixture";
11
11
  import { Create, DataIntegrityProof, Multikey, Note, Place } from "@fedify/vocab";
12
12
  import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-D7f7xz7f.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-BQnp1nmZ.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
6
  //#region src/federation/temporal.ts
7
7
  function isPlainObject(value) {
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-DVILvP5e.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-BUOJXi-Z.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
- import { l as verifyRequest } from "../http-DmGSYD1m.mjs";
8
+ import { l as verifyRequest } from "../http-CR7JIBUN.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-CCxRJhWa.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-BLwGLFvJ.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-BxRYbtGA.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { FetchError, UrlError } from "@fedify/vocab-runtime";
13
13
  import { configure, reset } from "@logtape/logtape";
@@ -1,6 +1,6 @@
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_kv_cache = require("../kv-cache-DVxp-CaJ.cjs");
4
+ const require_kv_cache = require("../kv-cache-DtEnumbX.cjs");
5
5
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
6
6
  exports.kvCache = require_kv_cache.kvCache;
package/dist/utils/mod.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-Ck3OyM7X.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-BNMvaiQi.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.0.32-dev.2352+a85795ae",
3
+ "version": "2.0.32-dev.2371+fa0c86b8",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -144,9 +144,9 @@
144
144
  "uri-template-router": "^1.0.0",
145
145
  "url-template": "^3.1.1",
146
146
  "urlpattern-polyfill": "^10.1.0",
147
- "@fedify/vocab": "2.0.32-dev.2352+a85795ae",
148
- "@fedify/webfinger": "2.0.32-dev.2352+a85795ae",
149
- "@fedify/vocab-runtime": "2.0.32-dev.2352+a85795ae"
147
+ "@fedify/vocab-runtime": "2.0.32-dev.2371+fa0c86b8",
148
+ "@fedify/vocab": "2.0.32-dev.2371+fa0c86b8",
149
+ "@fedify/webfinger": "2.0.32-dev.2371+fa0c86b8"
150
150
  },
151
151
  "devDependencies": {
152
152
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -159,7 +159,7 @@
159
159
  "typescript": "^6.0.0",
160
160
  "wrangler": "^4.17.0",
161
161
  "@fedify/fixture": "2.0.0",
162
- "@fedify/vocab-tools": "^2.0.32-dev.2352+a85795ae"
162
+ "@fedify/vocab-tools": "^2.0.32-dev.2371+fa0c86b8"
163
163
  },
164
164
  "scripts": {
165
165
  "build:self": "tsdown",