@fedify/fedify 2.3.11-dev.2280 → 2.3.11

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 (67) hide show
  1. package/dist/{builder-BMTq0IIl.mjs → builder-7Btilj7D.mjs} +3 -3
  2. package/dist/compat/outgoing-jsonld.test.mjs +1 -1
  3. package/dist/compat/public-audience.test.mjs +1 -1
  4. package/dist/compat/transformers.test.mjs +2 -2
  5. package/dist/{deno-CIT9jSIk.mjs → deno-CigkYYoz.mjs} +1 -1
  6. package/dist/{docloader-CEpR4VWB.mjs → docloader-CtmUD1HH.mjs} +2 -2
  7. package/dist/federation/builder.test.mjs +2 -2
  8. package/dist/federation/circuit-breaker.test.mjs +2 -2
  9. package/dist/federation/collection.test.mjs +1 -1
  10. package/dist/federation/handler.test.mjs +7 -7
  11. package/dist/federation/idempotency.test.mjs +3 -3
  12. package/dist/federation/inbox.test.mjs +1 -1
  13. package/dist/federation/keycache.test.mjs +33 -2
  14. package/dist/federation/kv.test.mjs +1 -1
  15. package/dist/federation/metrics.test.mjs +1 -1
  16. package/dist/federation/middleware.test.mjs +9 -9
  17. package/dist/federation/mod.cjs +1 -1
  18. package/dist/federation/mod.js +1 -1
  19. package/dist/federation/send.test.mjs +3 -3
  20. package/dist/federation/temporal.test.mjs +1 -1
  21. package/dist/federation/webfinger.test.mjs +2 -2
  22. package/dist/{http-CQRKnpjs.mjs → http-BhBWasUr.mjs} +3 -3
  23. package/dist/{http-DWVq2-he.cjs → http-CaOlhdMJ.cjs} +1 -1
  24. package/dist/{http-scNEqjPE.js → http-DkhedU5w.js} +1 -1
  25. package/dist/{key-NKMl9uP8.mjs → key-D7-41D2Y.mjs} +2 -2
  26. package/dist/{keycache-B3qRQNLj.mjs → keycache-Dkc_sflV.mjs} +23 -2
  27. package/dist/{kv-cache-5nQAgy3r.js → kv-cache-CO8YktAt.js} +1 -1
  28. package/dist/{kv-cache-DCTckhOQ.mjs → kv-cache-Cq9rfyvw.mjs} +1 -1
  29. package/dist/{kv-cache-CPnp7Mjw.cjs → kv-cache-f7EeU_KE.cjs} +1 -1
  30. package/dist/{ld-DSQmH7Ld.mjs → ld-DMOVaJei.mjs} +3 -3
  31. package/dist/{metrics-DA3AUcFt.mjs → metrics-BBOiH0AP.mjs} +1 -1
  32. package/dist/{middleware-CtQ4Tx8-.cjs → middleware-BVqyebqV.cjs} +25 -5
  33. package/dist/{middleware-Dg6m3C6L.js → middleware-Bfp2jU_r.js} +25 -5
  34. package/dist/{middleware-BMnttcwk.mjs → middleware-D-nktRVB.mjs} +18 -18
  35. package/dist/{middleware-DLTczpe7.mjs → middleware-DphDrYz9.mjs} +1 -1
  36. package/dist/mod.cjs +4 -4
  37. package/dist/mod.js +4 -4
  38. package/dist/nodeinfo/client.test.mjs +1 -1
  39. package/dist/nodeinfo/handler.test.mjs +2 -2
  40. package/dist/nodeinfo/types.test.mjs +1 -1
  41. package/dist/otel/exporter.test.mjs +1 -1
  42. package/dist/{outgoing-jsonld-HOAywiid.mjs → outgoing-jsonld-D4iTv7uM.mjs} +1 -1
  43. package/dist/{owner-_jWgppYh.mjs → owner-D43mGvcK.mjs} +2 -2
  44. package/dist/{proof-DWA8rjEQ.mjs → proof-CFkgbeti.mjs} +5 -5
  45. package/dist/{proof-DpCVl_CJ.cjs → proof-DciRxAbP.cjs} +1 -1
  46. package/dist/{proof-CQcP6oee.js → proof-tDeK87UD.js} +1 -1
  47. package/dist/{send-3ylmO0zC.mjs → send-CU7KiqBW.mjs} +3 -3
  48. package/dist/sig/http.test.mjs +62 -3
  49. package/dist/sig/key.test.mjs +1 -1
  50. package/dist/sig/ld.test.mjs +2 -2
  51. package/dist/sig/mod.cjs +2 -2
  52. package/dist/sig/mod.js +2 -2
  53. package/dist/sig/owner.test.mjs +1 -1
  54. package/dist/sig/proof.test.mjs +2 -2
  55. package/dist/{temporal-ClmjY2iu.mjs → temporal-B2HFMFsy.mjs} +1 -1
  56. package/dist/utils/docloader.test.mjs +2 -2
  57. package/dist/utils/kv-cache.test.mjs +1 -1
  58. package/dist/utils/mod.cjs +1 -1
  59. package/dist/utils/mod.js +1 -1
  60. package/package.json +7 -7
  61. /package/dist/{activity-listener-ell7W1s9.mjs → activity-listener-tztVvlNb.mjs} +0 -0
  62. /package/dist/{circuit-breaker-CDABzqVf.mjs → circuit-breaker-D1fxthDI.mjs} +0 -0
  63. /package/dist/{client-Ccbsek6u.mjs → client-1He2YuBF.mjs} +0 -0
  64. /package/dist/{collection-CA3V5zyK.mjs → collection-Cc3DVAhE.mjs} +0 -0
  65. /package/dist/{kv-CX8qfaad.mjs → kv-mI4Ix2EU.mjs} +0 -0
  66. /package/dist/{public-audience-jwoSIGUw.mjs → public-audience-Dp4ZScSr.mjs} +0 -0
  67. /package/dist/{types-s4mCTGkT.mjs → types-J53Kw7so.mjs} +0 -0
@@ -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-CIT9jSIk.mjs";
5
- import { t as ActivityListenerSet } from "./activity-listener-ell7W1s9.mjs";
4
+ import { n as version, t as name } from "./deno-CigkYYoz.mjs";
5
+ import { t as ActivityListenerSet } from "./activity-listener-tztVvlNb.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { Router, RouterError, assertPath } from "@fedify/uri-template";
8
8
  import { Tombstone, getTypeId } from "@fedify/vocab";
@@ -81,7 +81,7 @@ var FederationBuilderImpl = class {
81
81
  * specified.
82
82
  */
83
83
  async build(options) {
84
- const { FederationImpl } = await import("./middleware-DLTczpe7.mjs");
84
+ const { FederationImpl } = await import("./middleware-DphDrYz9.mjs");
85
85
  const f = new FederationImpl(options);
86
86
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
87
87
  f.router = this.router.clone();
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import { t as assertStrictEquals } from "../assert_strict_equals-XEgZAlrj.mjs";
6
- import { n as normalizeAttachmentArrays, r as normalizeOutgoingActivityJsonLd, t as isPreloadedContextAttachmentSafe } from "../outgoing-jsonld-HOAywiid.mjs";
6
+ import { n as normalizeAttachmentArrays, r as normalizeOutgoingActivityJsonLd, t as isPreloadedContextAttachmentSafe } from "../outgoing-jsonld-D4iTv7uM.mjs";
7
7
  import { Create, Document, Note, PUBLIC_COLLECTION } from "@fedify/vocab";
8
8
  import { mockDocumentLoader, test } from "@fedify/fixture";
9
9
  //#region src/compat/outgoing-jsonld.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import { t as assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
6
- import { t as normalizePublicAudience } from "../public-audience-jwoSIGUw.mjs";
6
+ import { t as normalizePublicAudience } from "../public-audience-Dp4ZScSr.mjs";
7
7
  import { Create, Follow, Note, PUBLIC_COLLECTION } from "@fedify/vocab";
8
8
  import { test } from "@fedify/fixture";
9
9
  import { getDocumentLoader, preloadedContexts } from "@fedify/vocab-runtime";
@@ -3,8 +3,8 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import { n as assertInstanceOf, t as assert } from "../assert-jSdZMYam.mjs";
6
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
7
- import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware-BMnttcwk.mjs";
6
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
7
+ import { b as autoIdAssigner, n as FederationImpl, y as actorDehydrator } from "../middleware-D-nktRVB.mjs";
8
8
  import { Follow, Person } from "@fedify/vocab";
9
9
  import { test } from "@fedify/fixture";
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.3.11-dev.2280+db3f75fc";
6
+ var version = "2.3.11";
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 { s as validateCryptoKey } from "./key-NKMl9uP8.mjs";
5
- import { n as doubleKnock } from "./http-CQRKnpjs.mjs";
4
+ import { s as validateCryptoKey } from "./key-D7-41D2Y.mjs";
5
+ import { n as doubleKnock } from "./http-BhBWasUr.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
8
8
  import { curry } from "es-toolkit";
@@ -5,8 +5,8 @@ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import { n as assertExists } from "../std__assert-BvGuO4xO.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
7
7
  import { t as assertStrictEquals } from "../assert_strict_equals-XEgZAlrj.mjs";
8
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
9
- import { r as createFederationBuilder } from "../builder-BMTq0IIl.mjs";
8
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
9
+ import { r as createFederationBuilder } from "../builder-7Btilj7D.mjs";
10
10
  import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
11
11
  import { Activity, Note, Person } from "@fedify/vocab";
12
12
  import { test } from "@fedify/fixture";
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import "../std__assert-BvGuO4xO.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
7
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
8
- import { n as normalizeCircuitBreakerOptions, r as parseCircuitBreakerKvState, t as CircuitBreaker } from "../circuit-breaker-CDABzqVf.mjs";
7
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
8
+ import { n as normalizeCircuitBreakerOptions, r as parseCircuitBreakerKvState, t as CircuitBreaker } from "../circuit-breaker-D1fxthDI.mjs";
9
9
  import { t as markCircuitBreakerLegacySweepDone } from "../circuit-breaker-test-utils-Dm5MM6l9.mjs";
10
10
  import { test } from "@fedify/fixture";
11
11
  //#region src/federation/circuit-breaker.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import "../std__assert-BvGuO4xO.mjs";
6
- import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-CA3V5zyK.mjs";
6
+ import { n as digest, t as buildCollectionSynchronizationHeader } from "../collection-Cc3DVAhE.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  import { decodeHex } from "byte-encodings/hex";
9
9
  //#region src/federation/collection.test.ts
@@ -7,14 +7,14 @@ import "../std__assert-BvGuO4xO.mjs";
7
7
  import { n as assertGreaterOrEqual, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
8
8
  import { n as assertInstanceOf, t as assert } from "../assert-jSdZMYam.mjs";
9
9
  import { r as parseAcceptSignature } from "../accept-Dd__NiUL.mjs";
10
- import { a as generateCryptoKeyPair } from "../key-NKMl9uP8.mjs";
11
- import { s as signRequest } from "../http-CQRKnpjs.mjs";
10
+ import { a as generateCryptoKeyPair } from "../key-D7-41D2Y.mjs";
11
+ import { s as signRequest } from "../http-BhBWasUr.mjs";
12
12
  import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
13
- import { a as compactJsonLd, p as signJsonLd } from "../ld-DSQmH7Ld.mjs";
14
- import { r as signObject } from "../proof-DWA8rjEQ.mjs";
15
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
16
- import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-BMnttcwk.mjs";
17
- import { t as ActivityListenerSet } from "../activity-listener-ell7W1s9.mjs";
13
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
14
+ import { a as compactJsonLd, p as signJsonLd } from "../ld-DMOVaJei.mjs";
15
+ import { r as signObject } from "../proof-CFkgbeti.mjs";
16
+ import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-D-nktRVB.mjs";
17
+ import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
18
18
  import { Activity, Create, CryptographicKey, Multikey, Note, Person, Tombstone } from "@fedify/vocab";
19
19
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
20
20
  import { FetchError } from "@fedify/vocab-runtime";
@@ -4,9 +4,9 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import "../std__assert-BvGuO4xO.mjs";
6
6
  import { n as ed25519PrivateKey, r as ed25519PublicKey, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
7
- import { r as signObject } from "../proof-DWA8rjEQ.mjs";
8
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
9
- import { o as createFederation } from "../middleware-BMnttcwk.mjs";
7
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
8
+ import { r as signObject } from "../proof-CFkgbeti.mjs";
9
+ import { o as createFederation } from "../middleware-D-nktRVB.mjs";
10
10
  import { Create, Follow, Person } from "@fedify/vocab";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
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-C-ZRDbaf.mjs";
5
5
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
6
- import { t as ActivityListenerSet } from "../activity-listener-ell7W1s9.mjs";
6
+ import { t as ActivityListenerSet } from "../activity-listener-tztVvlNb.mjs";
7
7
  import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/federation/inbox.test.ts
@@ -3,8 +3,8 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import { n as assertInstanceOf, t as assert } from "../assert-jSdZMYam.mjs";
6
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
7
- import { t as KvKeyCache } from "../keycache-B3qRQNLj.mjs";
6
+ import { t as KvKeyCache } from "../keycache-Dkc_sflV.mjs";
7
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
8
8
  import { CryptographicKey, Multikey } from "@fedify/vocab";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/federation/keycache.test.ts
@@ -101,6 +101,37 @@ test("KvKeyCache fetch error metadata", async () => {
101
101
  await cache.setFetchError(keyId, null);
102
102
  assertEquals(await cache.getFetchError(keyId), void 0);
103
103
  });
104
+ test("KvKeyCache reads legacy fetch errors", async () => {
105
+ const kv = new MemoryKvStore();
106
+ const keyId = new URL("https://example.com/key");
107
+ await kv.set([
108
+ "pk",
109
+ "__fetchError",
110
+ keyId.href
111
+ ], {
112
+ errorName: "FetchError",
113
+ errorMessage: "Legacy failure"
114
+ });
115
+ const result = await new KvKeyCache(kv, ["pk"]).getFetchError(keyId);
116
+ assert(result != null && "error" in result);
117
+ assertEquals(result.error.constructor, Error);
118
+ assertEquals(result.error.name, "FetchError");
119
+ assertEquals(result.error.message, "Legacy failure");
120
+ assertEquals(result.error.cause, void 0);
121
+ });
122
+ test("KvKeyCache keeps unknown error types generic", async () => {
123
+ class CustomError extends Error {}
124
+ const kv = new MemoryKvStore();
125
+ const keyId = new URL("https://example.com/key");
126
+ const error = new CustomError("Custom failure");
127
+ error.name = "FetchError";
128
+ await new KvKeyCache(kv, ["pk"]).setFetchError(keyId, { error });
129
+ const result = await new KvKeyCache(kv, ["pk"]).getFetchError(keyId);
130
+ assert(result != null && "error" in result);
131
+ assertEquals(result.error.constructor, Error);
132
+ assertEquals(result.error.name, "FetchError");
133
+ assertEquals(result.error.message, "Custom failure");
134
+ });
104
135
  test("KvKeyCache unavailable entries expire", async () => {
105
136
  const cache = new KvKeyCache(new MemoryKvStore(), ["pk"], { unavailableKeyTtl: Temporal.Duration.from({ milliseconds: 1 }) });
106
137
  const keyId = new URL("https://example.com/expired");
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import "../std__assert-BvGuO4xO.mjs";
6
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
6
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  //#region src/federation/kv.test.ts
9
9
  test("MemoryKvStore", async (t) => {
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import "../std__assert-BvGuO4xO.mjs";
6
6
  import { t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
7
- import { _ as recordKeyLookup, 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, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-DA3AUcFt.mjs";
7
+ import { _ as recordKeyLookup, 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, m as recordDocumentFetch, p as recordDocumentCache, r as getFederationMetrics, t as classifyFetchError, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "../metrics-BBOiH0AP.mjs";
8
8
  import { createTestMeterProvider, test } from "@fedify/fixture";
9
9
  import { FetchError } from "@fedify/vocab-runtime";
10
10
  import { DataPointType, MeterProvider, MetricReader } from "@opentelemetry/sdk-metrics";
@@ -9,16 +9,16 @@ import { n as assertInstanceOf, t as assert } from "../assert-jSdZMYam.mjs";
9
9
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
10
10
  import { t as assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
11
11
  import { t as assertStrictEquals } from "../assert_strict_equals-XEgZAlrj.mjs";
12
- import { g as recordInboxActivity } from "../metrics-DA3AUcFt.mjs";
13
- import { l as verifyRequest, s as signRequest } from "../http-CQRKnpjs.mjs";
12
+ import { g as recordInboxActivity } from "../metrics-BBOiH0AP.mjs";
13
+ import { l as verifyRequest, s as signRequest } from "../http-BhBWasUr.mjs";
14
14
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
15
- import { t as getAuthenticatedDocumentLoader } from "../docloader-CEpR4VWB.mjs";
16
- import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-DSQmH7Ld.mjs";
17
- import { t as doesActorOwnKey } from "../owner-_jWgppYh.mjs";
18
- import { i as verifyObject, r as signObject } from "../proof-DWA8rjEQ.mjs";
19
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
20
- import { g as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-BMnttcwk.mjs";
21
- import { t as CircuitBreaker } from "../circuit-breaker-CDABzqVf.mjs";
15
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-CtmUD1HH.mjs";
16
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
17
+ import { a as compactJsonLd, h as verifyJsonLd, p as signJsonLd, s as detachSignature } from "../ld-DMOVaJei.mjs";
18
+ import { t as doesActorOwnKey } from "../owner-D43mGvcK.mjs";
19
+ import { i as verifyObject, r as signObject } from "../proof-CFkgbeti.mjs";
20
+ import { g as handleBenchmarkTrigger, i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-D-nktRVB.mjs";
21
+ import { t as CircuitBreaker } from "../circuit-breaker-D1fxthDI.mjs";
22
22
  import { t as markCircuitBreakerLegacySweepDone } from "../circuit-breaker-test-utils-Dm5MM6l9.mjs";
23
23
  import { configure, reset } from "@logtape/logtape";
24
24
  import { RouterError } from "@fedify/uri-template";
@@ -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-CtQ4Tx8-.cjs");
5
+ const require_middleware = require("../middleware-BVqyebqV.cjs");
6
6
  let _logtape_logtape = require("@logtape/logtape");
7
7
  let _fedify_uri_template = require("@fedify/uri-template");
8
8
  let es_toolkit = require("es-toolkit");
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- 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-Dg6m3C6L.js";
3
+ 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-Bfp2jU_r.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Router as Router$1, RouterError as RouterError$1, assertPath, isPath } from "@fedify/uri-template";
6
6
  import { isEqual } from "es-toolkit";
@@ -7,10 +7,10 @@ import "../std__assert-BvGuO4xO.mjs";
7
7
  import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
8
8
  import { n as assertInstanceOf, t as assert } from "../assert-jSdZMYam.mjs";
9
9
  import { t as assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
10
- import { l as verifyRequest } from "../http-CQRKnpjs.mjs";
10
+ import { l as verifyRequest } from "../http-BhBWasUr.mjs";
11
11
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
12
- import { t as doesActorOwnKey } from "../owner-_jWgppYh.mjs";
13
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-3ylmO0zC.mjs";
12
+ import { t as doesActorOwnKey } from "../owner-D43mGvcK.mjs";
13
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "../send-CU7KiqBW.mjs";
14
14
  import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
15
15
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
16
16
  import { FetchError, UrlError } from "@fedify/vocab-runtime";
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
4
4
  import "../std__assert-BvGuO4xO.mjs";
5
5
  import { r as assertFalse } from "../assert_rejects-DN60FHPX.mjs";
6
6
  import { t as assert } from "../assert-jSdZMYam.mjs";
7
- import { t as hasMalformedKnownTemporalLiteral } from "../temporal-ClmjY2iu.mjs";
7
+ import { t as hasMalformedKnownTemporalLiteral } from "../temporal-B2HFMFsy.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,8 +5,8 @@ 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 assertNotEquals } from "../assert_not_equals-DkVK8oqV.mjs";
8
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
9
- import { o as createFederation, s as handleWebFinger } from "../middleware-BMnttcwk.mjs";
8
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
9
+ import { o as createFederation, s as handleWebFinger } from "../middleware-D-nktRVB.mjs";
10
10
  import { Image, Link, Person, Tombstone } from "@fedify/vocab";
11
11
  import { createTestMeterProvider, test } from "@fedify/fixture";
12
12
  //#region src/federation/webfinger.test.ts
@@ -1,10 +1,10 @@
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-CIT9jSIk.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DA3AUcFt.mjs";
4
+ import { n as version, t as name } from "./deno-CigkYYoz.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-BBOiH0AP.mjs";
6
6
  import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-Dd__NiUL.mjs";
7
- import { i as fetchKeyDetailed, s as validateCryptoKey } from "./key-NKMl9uP8.mjs";
7
+ import { i as fetchKeyDetailed, s as validateCryptoKey } from "./key-D7-41D2Y.mjs";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { CryptographicKey } from "@fedify/vocab";
10
10
  import { SpanStatusCode, trace } from "@opentelemetry/api";
@@ -11,7 +11,7 @@ let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conve
11
11
  let byte_encodings_base64 = require("byte-encodings/base64");
12
12
  //#region deno.json
13
13
  var name = "@fedify/fedify";
14
- var version = "2.3.11-dev.2280+db3f75fc";
14
+ var version = "2.3.11";
15
15
  //#endregion
16
16
  //#region src/sig/accept.ts
17
17
  /**
@@ -10,7 +10,7 @@ import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } fro
10
10
  import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
11
11
  //#region deno.json
12
12
  var name = "@fedify/fedify";
13
- var version = "2.3.11-dev.2280+db3f75fc";
13
+ var version = "2.3.11";
14
14
  //#endregion
15
15
  //#region src/sig/accept.ts
16
16
  /**
@@ -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-CIT9jSIk.mjs";
5
- import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-DA3AUcFt.mjs";
4
+ import { n as version, t as name } from "./deno-CigkYYoz.mjs";
5
+ import { _ as recordKeyLookup, n as getDurationMs, t as classifyFetchError } from "./metrics-BBOiH0AP.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";
@@ -2,6 +2,7 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { CryptographicKey, Multikey } from "@fedify/vocab";
5
+ import { FetchError, UrlError } from "@fedify/vocab-runtime";
5
6
  //#region src/federation/keycache.ts
6
7
  const KEY_CACHE_GENERATION = "2";
7
8
  var KvKeyCache = class {
@@ -76,8 +77,15 @@ var KvKeyCache = class {
76
77
  })
77
78
  };
78
79
  else if ("errorName" in cached && typeof cached.errorName === "string" && "errorMessage" in cached && typeof cached.errorMessage === "string") {
79
- const error = new Error(cached.errorMessage);
80
+ let error;
81
+ if ("errorType" in cached && cached.errorType === "FetchError" && "errorUrl" in cached && typeof cached.errorUrl === "string" && URL.canParse(cached.errorUrl)) {
82
+ error = new FetchError(cached.errorUrl);
83
+ error.message = cached.errorMessage;
84
+ } else if ("errorType" in cached && cached.errorType === "UrlError" && "errorReason" in cached && (cached.errorReason === "dns" || cached.errorReason === "disallowed")) error = new UrlError(cached.errorMessage, { reason: cached.errorReason });
85
+ else error = new Error(cached.errorMessage);
80
86
  error.name = cached.errorName;
87
+ if ("errorCause" in cached && cached.errorCause != null && typeof cached.errorCause === "object" && "name" in cached.errorCause && typeof cached.errorCause.name === "string" && "message" in cached.errorCause && typeof cached.errorCause.message === "string") if ("isDomException" in cached.errorCause && cached.errorCause.isDomException === true) error.cause = new DOMException(cached.errorCause.message, cached.errorCause.name);
88
+ else error.cause = Object.assign(new Error(cached.errorCause.message), { name: cached.errorCause.name });
81
89
  return { error };
82
90
  }
83
91
  }
@@ -95,9 +103,22 @@ var KvKeyCache = class {
95
103
  }, { ttl: this.unavailableKeyTtl });
96
104
  return;
97
105
  }
106
+ const cause = error.error.cause;
98
107
  await this.kv.set(this.#getFetchErrorKey(keyId), {
99
108
  errorName: error.error.name,
100
- errorMessage: error.error.message
109
+ errorMessage: error.error.message,
110
+ ...error.error instanceof FetchError ? {
111
+ errorType: "FetchError",
112
+ errorUrl: error.error.url.href
113
+ } : error.error instanceof UrlError ? {
114
+ errorType: "UrlError",
115
+ errorReason: error.error.reason
116
+ } : {},
117
+ ...cause instanceof Error || cause instanceof DOMException ? { errorCause: {
118
+ name: cause.name,
119
+ message: cause.message,
120
+ isDomException: cause instanceof DOMException
121
+ } } : {}
101
122
  }, { ttl: this.unavailableKeyTtl });
102
123
  }
103
124
  };
@@ -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-scNEqjPE.js";
3
+ import { T as recordDocumentCache, f as validateCryptoKey, t as doubleKnock } from "./http-DkhedU5w.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-DA3AUcFt.mjs";
4
+ import { p as recordDocumentCache } from "./metrics-BBOiH0AP.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-DWVq2-he.cjs");
4
+ const require_http = require("./http-CaOlhdMJ.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-CIT9jSIk.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DA3AUcFt.mjs";
6
- import { r as fetchKey, s as validateCryptoKey } from "./key-NKMl9uP8.mjs";
4
+ import { n as version, t as name } from "./deno-CigkYYoz.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-BBOiH0AP.mjs";
6
+ import { r as fetchKey, s as validateCryptoKey } from "./key-D7-41D2Y.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-CIT9jSIk.mjs";
4
+ import { n as version, t as name } from "./deno-CigkYYoz.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 @@ 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-DWVq2-he.cjs");
5
+ const require_http = require("./http-CaOlhdMJ.cjs");
6
6
  const require_types = require("./types-DRPjmHVV.cjs");
7
- const require_proof = require("./proof-DpCVl_CJ.cjs");
8
- const require_kv_cache = require("./kv-cache-CPnp7Mjw.cjs");
7
+ const require_proof = require("./proof-DciRxAbP.cjs");
8
+ const require_kv_cache = require("./kv-cache-f7EeU_KE.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");
@@ -1495,8 +1495,15 @@ var KvKeyCache = class {
1495
1495
  })
1496
1496
  };
1497
1497
  else if ("errorName" in cached && typeof cached.errorName === "string" && "errorMessage" in cached && typeof cached.errorMessage === "string") {
1498
- const error = new Error(cached.errorMessage);
1498
+ let error;
1499
+ if ("errorType" in cached && cached.errorType === "FetchError" && "errorUrl" in cached && typeof cached.errorUrl === "string" && URL.canParse(cached.errorUrl)) {
1500
+ error = new _fedify_vocab_runtime.FetchError(cached.errorUrl);
1501
+ error.message = cached.errorMessage;
1502
+ } else if ("errorType" in cached && cached.errorType === "UrlError" && "errorReason" in cached && (cached.errorReason === "dns" || cached.errorReason === "disallowed")) error = new _fedify_vocab_runtime.UrlError(cached.errorMessage, { reason: cached.errorReason });
1503
+ else error = new Error(cached.errorMessage);
1499
1504
  error.name = cached.errorName;
1505
+ if ("errorCause" in cached && cached.errorCause != null && typeof cached.errorCause === "object" && "name" in cached.errorCause && typeof cached.errorCause.name === "string" && "message" in cached.errorCause && typeof cached.errorCause.message === "string") if ("isDomException" in cached.errorCause && cached.errorCause.isDomException === true) error.cause = new DOMException(cached.errorCause.message, cached.errorCause.name);
1506
+ else error.cause = Object.assign(new Error(cached.errorCause.message), { name: cached.errorCause.name });
1500
1507
  return { error };
1501
1508
  }
1502
1509
  }
@@ -1514,9 +1521,22 @@ var KvKeyCache = class {
1514
1521
  }, { ttl: this.unavailableKeyTtl });
1515
1522
  return;
1516
1523
  }
1524
+ const cause = error.error.cause;
1517
1525
  await this.kv.set(this.#getFetchErrorKey(keyId), {
1518
1526
  errorName: error.error.name,
1519
- errorMessage: error.error.message
1527
+ errorMessage: error.error.message,
1528
+ ...error.error instanceof _fedify_vocab_runtime.FetchError ? {
1529
+ errorType: "FetchError",
1530
+ errorUrl: error.error.url.href
1531
+ } : error.error instanceof _fedify_vocab_runtime.UrlError ? {
1532
+ errorType: "UrlError",
1533
+ errorReason: error.error.reason
1534
+ } : {},
1535
+ ...cause instanceof Error || cause instanceof DOMException ? { errorCause: {
1536
+ name: cause.name,
1537
+ message: cause.message,
1538
+ isDomException: cause instanceof DOMException
1539
+ } } : {}
1520
1540
  }, { ttl: this.unavailableKeyTtl });
1521
1541
  }
1522
1542
  };
@@ -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-scNEqjPE.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-DkhedU5w.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-CQcP6oee.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-5nQAgy3r.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-tDeK87UD.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CO8YktAt.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";
@@ -1494,8 +1494,15 @@ var KvKeyCache = class {
1494
1494
  })
1495
1495
  };
1496
1496
  else if ("errorName" in cached && typeof cached.errorName === "string" && "errorMessage" in cached && typeof cached.errorMessage === "string") {
1497
- const error = new Error(cached.errorMessage);
1497
+ let error;
1498
+ if ("errorType" in cached && cached.errorType === "FetchError" && "errorUrl" in cached && typeof cached.errorUrl === "string" && URL.canParse(cached.errorUrl)) {
1499
+ error = new FetchError(cached.errorUrl);
1500
+ error.message = cached.errorMessage;
1501
+ } else if ("errorType" in cached && cached.errorType === "UrlError" && "errorReason" in cached && (cached.errorReason === "dns" || cached.errorReason === "disallowed")) error = new UrlError(cached.errorMessage, { reason: cached.errorReason });
1502
+ else error = new Error(cached.errorMessage);
1498
1503
  error.name = cached.errorName;
1504
+ if ("errorCause" in cached && cached.errorCause != null && typeof cached.errorCause === "object" && "name" in cached.errorCause && typeof cached.errorCause.name === "string" && "message" in cached.errorCause && typeof cached.errorCause.message === "string") if ("isDomException" in cached.errorCause && cached.errorCause.isDomException === true) error.cause = new DOMException(cached.errorCause.message, cached.errorCause.name);
1505
+ else error.cause = Object.assign(new Error(cached.errorCause.message), { name: cached.errorCause.name });
1499
1506
  return { error };
1500
1507
  }
1501
1508
  }
@@ -1513,9 +1520,22 @@ var KvKeyCache = class {
1513
1520
  }, { ttl: this.unavailableKeyTtl });
1514
1521
  return;
1515
1522
  }
1523
+ const cause = error.error.cause;
1516
1524
  await this.kv.set(this.#getFetchErrorKey(keyId), {
1517
1525
  errorName: error.error.name,
1518
- errorMessage: error.error.message
1526
+ errorMessage: error.error.message,
1527
+ ...error.error instanceof FetchError ? {
1528
+ errorType: "FetchError",
1529
+ errorUrl: error.error.url.href
1530
+ } : error.error instanceof UrlError ? {
1531
+ errorType: "UrlError",
1532
+ errorReason: error.error.reason
1533
+ } : {},
1534
+ ...cause instanceof Error || cause instanceof DOMException ? { errorCause: {
1535
+ name: cause.name,
1536
+ message: cause.message,
1537
+ isDomException: cause instanceof DOMException
1538
+ } } : {}
1519
1539
  }, { ttl: this.unavailableKeyTtl });
1520
1540
  }
1521
1541
  };
@@ -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-CIT9jSIk.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-DA3AUcFt.mjs";
4
+ import { n as version, t as name } from "./deno-CigkYYoz.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-BBOiH0AP.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-NKMl9uP8.mjs";
8
- import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-CQRKnpjs.mjs";
9
- import { t as getAuthenticatedDocumentLoader } from "./docloader-CEpR4VWB.mjs";
10
- import { n as kvCache } from "./kv-cache-DCTckhOQ.mjs";
11
- import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-DSQmH7Ld.mjs";
12
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-_jWgppYh.mjs";
13
- import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-HOAywiid.mjs";
14
- import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-DWA8rjEQ.mjs";
15
- import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-Ccbsek6u.mjs";
16
- import { t as nodeInfoToJson } from "./types-s4mCTGkT.mjs";
17
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-3ylmO0zC.mjs";
18
- import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-BMTq0IIl.mjs";
19
- import { t as CircuitBreaker } from "./circuit-breaker-CDABzqVf.mjs";
20
- import { t as buildCollectionSynchronizationHeader } from "./collection-CA3V5zyK.mjs";
21
- import { t as KvKeyCache } from "./keycache-B3qRQNLj.mjs";
7
+ import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-D7-41D2Y.mjs";
8
+ import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-BhBWasUr.mjs";
9
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-CtmUD1HH.mjs";
10
+ import { n as kvCache } from "./kv-cache-Cq9rfyvw.mjs";
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-DMOVaJei.mjs";
13
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-D43mGvcK.mjs";
14
+ import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-D4iTv7uM.mjs";
15
+ import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-CFkgbeti.mjs";
16
+ import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-1He2YuBF.mjs";
17
+ import { t as nodeInfoToJson } from "./types-J53Kw7so.mjs";
18
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-CU7KiqBW.mjs";
19
+ import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-7Btilj7D.mjs";
20
+ import { t as CircuitBreaker } from "./circuit-breaker-D1fxthDI.mjs";
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-ClmjY2iu.mjs";
23
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-B2HFMFsy.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-BMnttcwk.mjs";
4
+ import { n as FederationImpl } from "./middleware-D-nktRVB.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-DWVq2-he.cjs");
8
- const require_middleware = require("./middleware-CtQ4Tx8-.cjs");
7
+ const require_http = require("./http-CaOlhdMJ.cjs");
8
+ const require_middleware = require("./middleware-BVqyebqV.cjs");
9
9
  const require_types = require("./types-DRPjmHVV.cjs");
10
- const require_proof = require("./proof-DpCVl_CJ.cjs");
11
- const require_kv_cache = require("./kv-cache-CPnp7Mjw.cjs");
10
+ const require_proof = require("./proof-DciRxAbP.cjs");
11
+ const require_kv_cache = require("./kv-cache-f7EeU_KE.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-scNEqjPE.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-Dg6m3C6L.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-DkhedU5w.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-Bfp2jU_r.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-CQcP6oee.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-5nQAgy3r.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-tDeK87UD.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CO8YktAt.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 { t as esm_default } from "../esm-vrlUxr60.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
6
6
  import "../std__assert-BvGuO4xO.mjs";
7
7
  import { n as assertInstanceOf } from "../assert-jSdZMYam.mjs";
8
- import { a as parseProtocol, c as parseUsage, i as parseOutboundService, n as parseInboundService, o as parseServices, r as parseNodeInfo, s as parseSoftware, t as getNodeInfo } from "../client-Ccbsek6u.mjs";
8
+ import { a as parseProtocol, c as parseUsage, i as parseOutboundService, n as parseInboundService, o as parseServices, r as parseNodeInfo, s as parseSoftware, t as getNodeInfo } from "../client-1He2YuBF.mjs";
9
9
  import { configure, reset } from "@logtape/logtape";
10
10
  import { test } from "@fedify/fixture";
11
11
  import { UrlError } from "@fedify/vocab-runtime";
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
4
4
  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
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
8
- import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-BMnttcwk.mjs";
7
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
8
+ import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-D-nktRVB.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/nodeinfo/handler.test.ts
11
11
  test("handleNodeInfo()", async () => {
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import "../std__assert-BvGuO4xO.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
7
- import { t as nodeInfoToJson } from "../types-s4mCTGkT.mjs";
7
+ import { t as nodeInfoToJson } from "../types-J53Kw7so.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/nodeinfo/types.test.ts
10
10
  test("nodeInfoToJson()", () => {
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import "../std__assert-BvGuO4xO.mjs";
6
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
6
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { ExportResultCode } from "@opentelemetry/core";
9
9
  import { SpanKind, SpanStatusCode, TraceFlags } 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 preloadedOnlyDocumentLoader, t as normalizePublicAudience } from "./public-audience-jwoSIGUw.mjs";
4
+ import { n as preloadedOnlyDocumentLoader, t as normalizePublicAudience } from "./public-audience-Dp4ZScSr.mjs";
5
5
  import { getLogger } from "@logtape/logtape";
6
6
  import { preloadedContexts } from "@fedify/vocab-runtime";
7
7
  import jsonld from "@fedify/vocab-runtime/jsonld";
@@ -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-CIT9jSIk.mjs";
5
- import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-NKMl9uP8.mjs";
4
+ import { n as version, t as name } from "./deno-CigkYYoz.mjs";
5
+ import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-D7-41D2Y.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,11 +1,11 @@
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-CIT9jSIk.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DA3AUcFt.mjs";
6
- import { r as fetchKey, s as validateCryptoKey } from "./key-NKMl9uP8.mjs";
7
- import { n as preloadedOnlyDocumentLoader } from "./public-audience-jwoSIGUw.mjs";
8
- import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-HOAywiid.mjs";
4
+ import { n as version, t as name } from "./deno-CigkYYoz.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-BBOiH0AP.mjs";
6
+ import { r as fetchKey, s as validateCryptoKey } from "./key-D7-41D2Y.mjs";
7
+ import { n as preloadedOnlyDocumentLoader } from "./public-audience-Dp4ZScSr.mjs";
8
+ import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-D4iTv7uM.mjs";
9
9
  import { getLogger } from "@logtape/logtape";
10
10
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
11
11
  import { 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-DWVq2-he.cjs");
4
+ const require_http = require("./http-CaOlhdMJ.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,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-scNEqjPE.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-DkhedU5w.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-CIT9jSIk.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics } from "./metrics-DA3AUcFt.mjs";
6
- import { n as doubleKnock } from "./http-CQRKnpjs.mjs";
4
+ import { n as version, t as name } from "./deno-CigkYYoz.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics } from "./metrics-BBOiH0AP.mjs";
6
+ import { n as doubleKnock } from "./http-BhBWasUr.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,11 +7,13 @@ 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-NKMl9uP8.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-CQRKnpjs.mjs";
10
+ import { t as exportJwk } from "../key-D7-41D2Y.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-BhBWasUr.mjs";
12
12
  import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
13
+ import { t as KvKeyCache } from "../keycache-Dkc_sflV.mjs";
14
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
13
15
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
14
- import { FetchError, exportSpki } from "@fedify/vocab-runtime";
16
+ import { FetchError, UrlError, exportSpki } from "@fedify/vocab-runtime";
15
17
  import { encodeBase64 } from "byte-encodings/base64";
16
18
  //#region src/sig/http.test.ts
17
19
  test("signRequest() [draft-cavage]", async () => {
@@ -440,6 +442,63 @@ test("verifyRequestDetailed() records verification duration metric", async (t) =
440
442
  assertFalse("http_signatures.algorithm" in measurements[0].attributes);
441
443
  });
442
444
  });
445
+ test("verifyRequestDetailed() preserves cached key fetch errors", async (t) => {
446
+ const keyId = new URL("https://unreachable.example/actors/alice#main-key");
447
+ const timeout = new FetchError("https://unreachable.example/resolved-key", "Timed out after 100 ms");
448
+ timeout.cause = new DOMException("The operation timed out", "TimeoutError");
449
+ const failures = [
450
+ timeout,
451
+ new UrlError("DNS lookup failed", {
452
+ reason: "dns",
453
+ cause: /* @__PURE__ */ new TypeError("No usable IP addresses")
454
+ }),
455
+ new UrlError("Private IP address is not allowed")
456
+ ];
457
+ for (const failure of failures) await t.step(failure.message, async () => {
458
+ const kv = new MemoryKvStore();
459
+ let fetches = 0;
460
+ const documentLoader = (url) => {
461
+ if (url === keyId.href) {
462
+ fetches++;
463
+ throw failure;
464
+ }
465
+ return mockDocumentLoader(url);
466
+ };
467
+ for (const cached of [false, true]) {
468
+ const result = await verifyRequestDetailed(await signRequest(new Request("https://example.com/inbox", {
469
+ method: "POST",
470
+ body: "Test activity"
471
+ }), rsaPrivateKey2, keyId), {
472
+ documentLoader,
473
+ contextLoader: mockDocumentLoader,
474
+ keyCache: new KvKeyCache(kv, ["pk"])
475
+ });
476
+ assertFalse(result.verified);
477
+ assert(result.reason.type === "keyFetchError");
478
+ assert("error" in result.reason.result);
479
+ const error = result.reason.result.error;
480
+ assertEquals(error.name, failure.name);
481
+ assertEquals(error.message, failure.message);
482
+ if (failure instanceof FetchError) {
483
+ assert(error instanceof FetchError);
484
+ assertEquals(error.url.href, failure.url.href);
485
+ assertEquals(error.response, void 0);
486
+ assert(error.cause instanceof DOMException);
487
+ assertEquals(error.cause.name, "TimeoutError");
488
+ assertEquals(error.cause.message, "The operation timed out");
489
+ } else {
490
+ assert(error instanceof UrlError);
491
+ assertEquals(error.reason, failure.reason);
492
+ if (failure.cause instanceof Error) {
493
+ assert(error.cause instanceof Error);
494
+ assertEquals(error.cause.name, failure.cause.name);
495
+ assertEquals(error.cause.message, failure.cause.message);
496
+ } else assertEquals(error.cause, void 0);
497
+ }
498
+ assertEquals(fetches, 1, cached ? "Cached failure was refetched" : "");
499
+ }
500
+ });
501
+ });
443
502
  test("signRequest() and verifyRequest() [rfc9421] implementation", async () => {
444
503
  const currentTimestamp = 1709626184;
445
504
  const currentTime = Temporal.Instant.from("2024-03-05T08:09:44Z");
@@ -6,7 +6,7 @@ import "../std__assert-BvGuO4xO.mjs";
6
6
  import { t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
7
7
  import { t as assert } from "../assert-jSdZMYam.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
9
- import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-NKMl9uP8.mjs";
9
+ import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-D7-41D2Y.mjs";
10
10
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
11
11
  import { CryptographicKey, Multikey } from "@fedify/vocab";
12
12
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -5,9 +5,9 @@ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
6
6
  import { n as assertInstanceOf, t as assert } from "../assert-jSdZMYam.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
8
- import { a as generateCryptoKeyPair } from "../key-NKMl9uP8.mjs";
8
+ import { a as generateCryptoKeyPair } from "../key-D7-41D2Y.mjs";
9
9
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
10
- import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-DSQmH7Ld.mjs";
10
+ import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-DMOVaJei.mjs";
11
11
  import { CryptographicKey } from "@fedify/vocab";
12
12
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
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-DWVq2-he.cjs");
5
- const require_proof = require("../proof-DpCVl_CJ.cjs");
4
+ const require_http = require("../http-CaOlhdMJ.cjs");
5
+ const require_proof = require("../proof-DciRxAbP.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 { 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-scNEqjPE.js";
4
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof-CQcP6oee.js";
3
+ 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-DkhedU5w.js";
4
+ import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof-tDeK87UD.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import "../std__assert-BvGuO4xO.mjs";
6
6
  import { r as assertFalse } from "../assert_rejects-DN60FHPX.mjs";
7
7
  import { t as assert } from "../assert-jSdZMYam.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-_jWgppYh.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-D43mGvcK.mjs";
10
10
  import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
11
11
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
12
12
  //#region src/sig/owner.test.ts
@@ -6,8 +6,8 @@ import "../std__assert-BvGuO4xO.mjs";
6
6
  import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
7
7
  import { n as assertInstanceOf, t as assert } from "../assert-jSdZMYam.mjs";
8
8
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
9
- import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-HOAywiid.mjs";
10
- import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-DWA8rjEQ.mjs";
9
+ import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-D4iTv7uM.mjs";
10
+ import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-CFkgbeti.mjs";
11
11
  import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
12
12
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
13
13
  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-DSQmH7Ld.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-DMOVaJei.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-vrlUxr60.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 assertRejects } from "../assert_rejects-DN60FHPX.mjs";
8
- import { l as verifyRequest } from "../http-CQRKnpjs.mjs";
8
+ import { l as verifyRequest } from "../http-BhBWasUr.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-BAK-tUlf.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-CEpR4VWB.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-CtmUD1HH.mjs";
11
11
  import { configure, reset } from "@logtape/logtape";
12
12
  import { mockDocumentLoader, test } from "@fedify/fixture";
13
13
  import { FetchError, UrlError } from "@fedify/vocab-runtime";
@@ -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 { n as kvCache, t as MockKvStore } from "../kv-cache-DCTckhOQ.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-Cq9rfyvw.mjs";
5
5
  import { deepStrictEqual, throws } from "node:assert";
6
6
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
7
7
  import { preloadedContexts } from "@fedify/vocab-runtime";
@@ -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-CPnp7Mjw.cjs");
4
+ const require_kv_cache = require("../kv-cache-f7EeU_KE.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-5nQAgy3r.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-CO8YktAt.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.3.11-dev.2280+db3f75fc",
3
+ "version": "2.3.11",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -152,10 +152,10 @@
152
152
  "jsonld": "^9.0.0",
153
153
  "structured-field-values": "^2.0.4",
154
154
  "urlpattern-polyfill": "^10.1.0",
155
- "@fedify/uri-template": "2.3.11-dev.2280+db3f75fc",
156
- "@fedify/vocab": "2.3.11-dev.2280+db3f75fc",
157
- "@fedify/vocab-runtime": "2.3.11-dev.2280+db3f75fc",
158
- "@fedify/webfinger": "2.3.11-dev.2280+db3f75fc"
155
+ "@fedify/uri-template": "2.3.11",
156
+ "@fedify/vocab-runtime": "2.3.11",
157
+ "@fedify/vocab": "2.3.11",
158
+ "@fedify/webfinger": "2.3.11"
159
159
  },
160
160
  "devDependencies": {
161
161
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -167,8 +167,8 @@
167
167
  "tsx": "^4.21.0",
168
168
  "typescript": "^6.0.0",
169
169
  "wrangler": "^4.17.0",
170
- "@fedify/fixture": "2.0.0",
171
- "@fedify/vocab-tools": "^2.3.11-dev.2280+db3f75fc"
170
+ "@fedify/vocab-tools": "^2.3.11",
171
+ "@fedify/fixture": "2.0.0"
172
172
  },
173
173
  "scripts": {
174
174
  "build:self": "tsdown",
File without changes
File without changes