@fedify/fedify 2.2.15-dev.2196 → 2.2.16

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 (80) hide show
  1. package/dist/{builder-D8E6s6dI.mjs → builder-2WicIXl5.mjs} +11 -3
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/outgoing-jsonld.test.mjs +1 -1
  5. package/dist/compat/public-audience.test.mjs +1 -1
  6. package/dist/compat/transformers.test.mjs +2 -2
  7. package/dist/{context-Bt2jnbC7.d.ts → context-OkwEpc3-.d.ts} +1 -1
  8. package/dist/{context-Cls_M1HU.d.cts → context-tJbL_Hkw.d.cts} +1 -1
  9. package/dist/{deno-qvNES9lw.mjs → deno-BCQztXLl.mjs} +1 -1
  10. package/dist/{docloader-DDSsh_Jq.mjs → docloader-NG6Mmr-J.mjs} +2 -2
  11. package/dist/federation/builder.test.mjs +38 -2
  12. package/dist/federation/collection.test.mjs +1 -1
  13. package/dist/federation/handler.test.mjs +7 -7
  14. package/dist/federation/idempotency.test.mjs +3 -3
  15. package/dist/federation/inbox.test.mjs +1 -1
  16. package/dist/federation/keycache.test.mjs +33 -2
  17. package/dist/federation/kv.test.mjs +1 -1
  18. package/dist/federation/middleware.test.mjs +122 -7
  19. package/dist/federation/mod.cjs +1 -1
  20. package/dist/federation/mod.d.cts +3 -3
  21. package/dist/federation/mod.d.ts +3 -3
  22. package/dist/federation/mod.js +1 -1
  23. package/dist/federation/send.test.mjs +3 -3
  24. package/dist/federation/temporal.test.mjs +1 -1
  25. package/dist/federation/webfinger.test.mjs +2 -2
  26. package/dist/{http-BW6AJOy7.mjs → http-B72sZOJB.mjs} +2 -2
  27. package/dist/{http-RWKDbjsL.cjs → http-B7mxZjxT.cjs} +1 -1
  28. package/dist/{http-CntX6ab0.js → http-DK5sOqk3.js} +1 -1
  29. package/dist/{key-Zl6BkQxS.mjs → key-DCQAjTMo.mjs} +1 -1
  30. package/dist/{keycache-C1aVprwy.mjs → keycache-Dkc_sflV.mjs} +23 -2
  31. package/dist/{kv-gJ8LYbxX.d.cts → kv-CZKl1IUS.d.cts} +3 -2
  32. package/dist/{kv-D6hNiMTK.d.ts → kv-CxaI4eGo.d.ts} +3 -2
  33. package/dist/{kv-cache-CE9FWYpa.js → kv-cache-BatvhvQ8.js} +1 -1
  34. package/dist/{kv-cache-C6Vsz04k.cjs → kv-cache-DCIQW7aM.cjs} +1 -1
  35. package/dist/{ld-DMr3f6uX.mjs → ld-37J55dno.mjs} +2 -2
  36. package/dist/{middleware-CSK_D6wm.cjs → middleware-BZO3vnP1.cjs} +1 -1
  37. package/dist/{middleware-UrAjyLpb.mjs → middleware-CPmKbXgW.mjs} +1 -1
  38. package/dist/{middleware-Cu0bK3Iq.js → middleware-Cqza2chY.js} +42 -11
  39. package/dist/{middleware-CYTJ-y3g.mjs → middleware-DOTXcNS-.mjs} +24 -21
  40. package/dist/{middleware-BR8TCS1H.cjs → middleware-O_yyvaOf.cjs} +43 -12
  41. package/dist/{mod-C9jqpInC.d.ts → mod-B6LmugJ4.d.ts} +1 -1
  42. package/dist/{mod-DaiJDJdQ.d.ts → mod-DQGjRJUG.d.ts} +1 -1
  43. package/dist/{mod-BYg1qMPB.d.cts → mod-V2vDnYNu.d.cts} +1 -1
  44. package/dist/{mod-DNvnDTS7.d.cts → mod-a6kmB8xD.d.cts} +1 -1
  45. package/dist/mod.cjs +4 -4
  46. package/dist/mod.d.cts +4 -4
  47. package/dist/mod.d.ts +4 -4
  48. package/dist/mod.js +4 -4
  49. package/dist/nodeinfo/client.test.mjs +1 -1
  50. package/dist/nodeinfo/handler.test.mjs +2 -2
  51. package/dist/nodeinfo/types.test.mjs +1 -1
  52. package/dist/otel/exporter.test.mjs +1 -1
  53. package/dist/otel/mod.d.cts +1 -1
  54. package/dist/otel/mod.d.ts +1 -1
  55. package/dist/{outgoing-jsonld-Dc2OXyB-.mjs → outgoing-jsonld-amccRMrV.mjs} +1 -1
  56. package/dist/{owner-CHo1EAg3.mjs → owner-Bou1yabn.mjs} +2 -2
  57. package/dist/{proof-Blxp54sy.mjs → proof-BFSV3hJj.mjs} +4 -4
  58. package/dist/{proof-D6abvk_O.js → proof-BdrKA26Y.js} +1 -1
  59. package/dist/{proof-CHNefbCg.cjs → proof-ZUtbM4a6.cjs} +1 -1
  60. package/dist/{send-ConRtUh3.mjs → send-DwQAYND-.mjs} +2 -2
  61. package/dist/sig/http.test.mjs +62 -3
  62. package/dist/sig/key.test.mjs +1 -1
  63. package/dist/sig/ld.test.mjs +2 -2
  64. package/dist/sig/mod.cjs +2 -2
  65. package/dist/sig/mod.js +2 -2
  66. package/dist/sig/owner.test.mjs +1 -1
  67. package/dist/sig/proof.test.mjs +2 -2
  68. package/dist/{temporal-BIaSZejA.mjs → temporal-BWuGBFaX.mjs} +1 -1
  69. package/dist/utils/docloader.test.mjs +2 -2
  70. package/dist/utils/mod.cjs +1 -1
  71. package/dist/utils/mod.d.cts +1 -1
  72. package/dist/utils/mod.d.ts +1 -1
  73. package/dist/utils/mod.js +1 -1
  74. package/package.json +5 -5
  75. /package/dist/{activity-listener-IojJ9SVl.mjs → activity-listener-ell7W1s9.mjs} +0 -0
  76. /package/dist/{client-CJ4Y0keQ.mjs → client-9F_u23dc.mjs} +0 -0
  77. /package/dist/{collection-DnoYNwBC.mjs → collection-D-HqUuA2.mjs} +0 -0
  78. /package/dist/{kv-CX8qfaad.mjs → kv-mI4Ix2EU.mjs} +0 -0
  79. /package/dist/{public-audience-CS1udGkN.mjs → public-audience-DpJqzPuh.mjs} +0 -0
  80. /package/dist/{types-s4mCTGkT.mjs → types-J53Kw7so.mjs} +0 -0
package/dist/mod.d.ts CHANGED
@@ -2,12 +2,12 @@
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CSddvgWN.js";
3
3
  import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-Dl00HXr4.js";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CiBPcC6F.js";
5
- import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as ActivityTransformer, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "./context-Bt2jnbC7.js";
6
- import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-D6hNiMTK.js";
5
+ import { $ as ActorAliasMapper, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as SendActivityError, D as ObjectCallbackSetters, Dt as digest, E as InboxListenerSetters, Et as buildCollectionSynchronizationHeader, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as ActivityTransformer, P as CreateExponentialBackoffPolicyOptions, Q as ParallelMessageQueue, R as Message, S as FederationStartQueueOptions, St as WebFingerLinksDispatcher, T as InboxChallengePolicy, Tt as PageItems, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueEnqueueOptions, Y as MessageQueue, Z as MessageQueueListenOptions, _ as Federatable, _t as OutboxListenerErrorHandler, a as GetSignedKeyOptions, at as CollectionCursor, b as FederationFetchOptions, bt as UnverifiedActivityHandler, c as ParseUriResult, ct as CustomCollectionCursor, d as SendActivityOptions, dt as InboxListener, et as ActorDispatcher, f as SendActivityOptionsForCollection, ft as NodeInfoDispatcher, g as CustomCollectionCallbackSetters, gt as OutboxListener, h as ConstructorWithTypeId, ht as OutboxErrorHandler, i as GetActorOptions, it as CollectionCounter, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as CustomCollectionDispatcher, m as CollectionCallbackSetters, mt as ObjectDispatcher, n as Context, nt as ActorKeyPairsDispatcher, o as InboxContext, ot as CollectionDispatcher, p as ActorCallbackSetters, pt as ObjectAuthorizePredicate, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as AuthorizePredicate, s as OutboxContext, st as CustomCollectionCounter, t as ActorKeyPair, tt as ActorHandleMapper, u as RouteActivityOptions, ut as InboxErrorHandler, v as Federation, vt as OutboxPermanentFailureHandler, w as IdempotencyStrategy, wt as SenderKeyPair, x as FederationOptions, xt as UnverifiedActivityReason, y as FederationBuilder, yt as SharedInboxKeyDispatcher, z as createFederationBuilder } from "./context-OkwEpc3-.js";
6
+ import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-CxaI4eGo.js";
7
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
8
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-DaiJDJdQ.js";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-DQGjRJUG.js";
9
9
  import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-ej_rLx8h.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-C9jqpInC.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-B6LmugJ4.js";
11
11
  export * from "@fedify/vocab-runtime";
12
12
 
13
13
  //#region src/mod.d.ts
package/dist/mod.js CHANGED
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "./chunk-CRNNMoPX.js";
4
4
  import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
5
5
  import "./compat/mod.js";
6
- import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-CntX6ab0.js";
7
- import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-Cu0bK3Iq.js";
6
+ import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "./http-DK5sOqk3.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-Cqza2chY.js";
8
8
  import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-miAYfiGO.js";
9
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-D6abvk_O.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CE9FWYpa.js";
9
+ import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-BdrKA26Y.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BatvhvQ8.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 { t as esm_default } from "../esm-DVILvP5e.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-BVFj8-_V.mjs";
7
7
  import { n as assertInstanceOf } from "../assert-BhQd8QHP.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-CJ4Y0keQ.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-9F_u23dc.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { UrlError } from "@fedify/vocab-runtime";
11
11
  import { configure, reset } from "@logtape/logtape";
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
4
4
  import { r as createRequestContext } from "../context-Dk_tacqz.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
6
6
  import "../std__assert-BVFj8-_V.mjs";
7
- import { t as MemoryKvStore } from "../kv-CX8qfaad.mjs";
8
- import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-CYTJ-y3g.mjs";
7
+ import { t as MemoryKvStore } from "../kv-mI4Ix2EU.mjs";
8
+ import { _ as handleNodeInfoJrd, g as handleNodeInfo, o as createFederation } from "../middleware-DOTXcNS-.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-Ew3jOFa3.mjs";
5
5
  import "../std__assert-BVFj8-_V.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.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-Ew3jOFa3.mjs";
5
5
  import "../std__assert-BVFj8-_V.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
  import { SpanKind, SpanStatusCode, TraceFlags } from "@opentelemetry/api";
9
9
  import { getLogger } from "@logtape/logtape";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as KvStore, t as KvKey } from "../kv-gJ8LYbxX.cjs";
2
+ import { n as KvStore, t as KvKey } from "../kv-CZKl1IUS.cjs";
3
3
  import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
4
4
  import { ExportResultCode } from "@opentelemetry/core";
5
5
 
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as KvStore, t as KvKey } from "../kv-D6hNiMTK.js";
2
+ import { n as KvStore, t as KvKey } from "../kv-CxaI4eGo.js";
3
3
  import { ExportResultCode } from "@opentelemetry/core";
4
4
  import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
5
5
 
@@ -1,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-CS1udGkN.mjs";
4
+ import { n as preloadedOnlyDocumentLoader, t as normalizePublicAudience } from "./public-audience-DpJqzPuh.mjs";
5
5
  import { preloadedContexts } from "@fedify/vocab-runtime";
6
6
  import { getLogger } from "@logtape/logtape";
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-qvNES9lw.mjs";
5
- import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-Zl6BkQxS.mjs";
4
+ import { n as version, t as name } from "./deno-BCQztXLl.mjs";
5
+ import { c as verifyKeyOwnership, n as fetchActorDocument, t as exportJwk } from "./key-DCQAjTMo.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,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-qvNES9lw.mjs";
5
- import { r as fetchKey, s as validateCryptoKey } from "./key-Zl6BkQxS.mjs";
6
- import { n as preloadedOnlyDocumentLoader } from "./public-audience-CS1udGkN.mjs";
7
- import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-Dc2OXyB-.mjs";
4
+ import { n as version, t as name } from "./deno-BCQztXLl.mjs";
5
+ import { r as fetchKey, s as validateCryptoKey } from "./key-DCQAjTMo.mjs";
6
+ import { n as preloadedOnlyDocumentLoader } from "./public-audience-DpJqzPuh.mjs";
7
+ import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-amccRMrV.mjs";
8
8
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
9
9
  import { SpanStatusCode, trace } from "@opentelemetry/api";
10
10
  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 { c as fetchKey, f as validateCryptoKey, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, v as name, y as version } from "./http-CntX6ab0.js";
3
+ import { c as fetchKey, f as validateCryptoKey, o as exportJwk, p as verifyKeyOwnership, s as fetchActorDocument, v as name, y as version } from "./http-DK5sOqk3.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, PUBLIC_COLLECTION, getTypeId, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,7 +1,7 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  const require_chunk = require("./chunk-DDcVe30Y.cjs");
4
- const require_http = require("./http-RWKDbjsL.cjs");
4
+ const require_http = require("./http-B7mxZjxT.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-qvNES9lw.mjs";
5
- import { n as doubleKnock } from "./http-BW6AJOy7.mjs";
4
+ import { n as version, t as name } from "./deno-BCQztXLl.mjs";
5
+ import { n as doubleKnock } from "./http-B72sZOJB.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,11 +7,13 @@ import { r as assertExists, t as assertStringIncludes } from "../std__assert-BVF
7
7
  import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
8
  import { t as assert } from "../assert-BhQd8QHP.mjs";
9
9
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
10
- import { t as exportJwk } from "../key-Zl6BkQxS.mjs";
11
- import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-BW6AJOy7.mjs";
10
+ import { t as exportJwk } from "../key-DCQAjTMo.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-B72sZOJB.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 { 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 () => {
@@ -230,6 +232,63 @@ test("verifyRequestDetailed() records failure details on span", async () => {
230
232
  assertEquals(span.attributes["http_signatures.key_id"], keyId.href);
231
233
  assertEquals(span.attributes["http_signatures.key_fetch_status"], 410);
232
234
  });
235
+ test("verifyRequestDetailed() preserves cached key fetch errors", async (t) => {
236
+ const keyId = new URL("https://unreachable.example/actors/alice#main-key");
237
+ const timeout = new FetchError("https://unreachable.example/resolved-key", "Timed out after 100 ms");
238
+ timeout.cause = new DOMException("The operation timed out", "TimeoutError");
239
+ const failures = [
240
+ timeout,
241
+ new UrlError("DNS lookup failed", {
242
+ reason: "dns",
243
+ cause: /* @__PURE__ */ new TypeError("No usable IP addresses")
244
+ }),
245
+ new UrlError("Private IP address is not allowed")
246
+ ];
247
+ for (const failure of failures) await t.step(failure.message, async () => {
248
+ const kv = new MemoryKvStore();
249
+ let fetches = 0;
250
+ const documentLoader = (url) => {
251
+ if (url === keyId.href) {
252
+ fetches++;
253
+ throw failure;
254
+ }
255
+ return mockDocumentLoader(url);
256
+ };
257
+ for (const cached of [false, true]) {
258
+ const result = await verifyRequestDetailed(await signRequest(new Request("https://example.com/inbox", {
259
+ method: "POST",
260
+ body: "Test activity"
261
+ }), rsaPrivateKey2, keyId), {
262
+ documentLoader,
263
+ contextLoader: mockDocumentLoader,
264
+ keyCache: new KvKeyCache(kv, ["pk"])
265
+ });
266
+ assertFalse(result.verified);
267
+ assert(result.reason.type === "keyFetchError");
268
+ assert("error" in result.reason.result);
269
+ const error = result.reason.result.error;
270
+ assertEquals(error.name, failure.name);
271
+ assertEquals(error.message, failure.message);
272
+ if (failure instanceof FetchError) {
273
+ assert(error instanceof FetchError);
274
+ assertEquals(error.url.href, failure.url.href);
275
+ assertEquals(error.response, void 0);
276
+ assert(error.cause instanceof DOMException);
277
+ assertEquals(error.cause.name, "TimeoutError");
278
+ assertEquals(error.cause.message, "The operation timed out");
279
+ } else {
280
+ assert(error instanceof UrlError);
281
+ assertEquals(error.reason, failure.reason);
282
+ if (failure.cause instanceof Error) {
283
+ assert(error.cause instanceof Error);
284
+ assertEquals(error.cause.name, failure.cause.name);
285
+ assertEquals(error.cause.message, failure.cause.message);
286
+ } else assertEquals(error.cause, void 0);
287
+ }
288
+ assertEquals(fetches, 1, cached ? "Cached failure was refetched" : "");
289
+ }
290
+ });
291
+ });
233
292
  test("signRequest() and verifyRequest() [rfc9421] implementation", async () => {
234
293
  const currentTimestamp = 1709626184;
235
294
  const currentTime = Temporal.Instant.from("2024-03-05T08:09:44Z");
@@ -6,7 +6,7 @@ import "../std__assert-BVFj8-_V.mjs";
6
6
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { t as assert } from "../assert-BhQd8QHP.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
9
- import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-Zl6BkQxS.mjs";
9
+ import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-DCQAjTMo.mjs";
10
10
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
11
11
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { CryptographicKey, Multikey } from "@fedify/vocab";
@@ -5,9 +5,9 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
6
6
  import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
8
- import { a as generateCryptoKeyPair } from "../key-Zl6BkQxS.mjs";
8
+ import { a as generateCryptoKeyPair } from "../key-DCQAjTMo.mjs";
9
9
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-BAK-tUlf.mjs";
10
- import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-DMr3f6uX.mjs";
10
+ import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-37J55dno.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { CryptographicKey } from "@fedify/vocab";
13
13
  import { encodeBase64 } from "byte-encodings/base64";
package/dist/sig/mod.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_http = require("../http-RWKDbjsL.cjs");
5
- const require_proof = require("../proof-CHNefbCg.cjs");
4
+ const require_http = require("../http-B7mxZjxT.cjs");
5
+ const require_proof = require("../proof-ZUtbM4a6.cjs");
6
6
  exports.attachSignature = require_proof.attachSignature;
7
7
  exports.createProof = require_proof.createProof;
8
8
  exports.createSignature = require_proof.createSignature;
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-CntX6ab0.js";
4
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof-D6abvk_O.js";
3
+ import { _ as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, g as parseAcceptSignature, h as fulfillAcceptSignature, i as verifyRequest, l as fetchKeyDetailed, m as formatAcceptSignature, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-DK5sOqk3.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-BdrKA26Y.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import "../std__assert-BVFj8-_V.mjs";
6
6
  import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { t as assert } from "../assert-BhQd8QHP.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-BAK-tUlf.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CHo1EAg3.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-Bou1yabn.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,8 +6,8 @@ import "../std__assert-BVFj8-_V.mjs";
6
6
  import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
7
7
  import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.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-Dc2OXyB-.mjs";
10
- import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-Blxp54sy.mjs";
9
+ import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-amccRMrV.mjs";
10
+ import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-BFSV3hJj.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
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-DMr3f6uX.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-37J55dno.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-BVFj8-_V.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
8
- import { l as verifyRequest } from "../http-BW6AJOy7.mjs";
8
+ import { l as verifyRequest } from "../http-B72sZOJB.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-BAK-tUlf.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-DDSsh_Jq.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-NG6Mmr-J.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-C6Vsz04k.cjs");
4
+ const require_kv_cache = require("../kv-cache-DCIQW7aM.cjs");
5
5
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
6
6
  exports.kvCache = require_kv_cache.kvCache;
@@ -1,3 +1,3 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-BYg1qMPB.cjs";
2
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-V2vDnYNu.cjs";
3
3
  export { getAuthenticatedDocumentLoader, kvCache };
@@ -1,3 +1,3 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-C9jqpInC.js";
2
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-B6LmugJ4.js";
3
3
  export { getAuthenticatedDocumentLoader, 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-CE9FWYpa.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-BatvhvQ8.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.2.15-dev.2196+10201be2",
3
+ "version": "2.2.16",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -153,9 +153,9 @@
153
153
  "uri-template-router": "^1.0.0",
154
154
  "url-template": "^3.1.1",
155
155
  "urlpattern-polyfill": "^10.1.0",
156
- "@fedify/vocab": "2.2.15-dev.2196+10201be2",
157
- "@fedify/webfinger": "2.2.15-dev.2196+10201be2",
158
- "@fedify/vocab-runtime": "2.2.15-dev.2196+10201be2"
156
+ "@fedify/webfinger": "2.2.16",
157
+ "@fedify/vocab": "2.2.16",
158
+ "@fedify/vocab-runtime": "2.2.16"
159
159
  },
160
160
  "devDependencies": {
161
161
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -168,7 +168,7 @@
168
168
  "typescript": "^6.0.0",
169
169
  "wrangler": "^4.17.0",
170
170
  "@fedify/fixture": "2.0.0",
171
- "@fedify/vocab-tools": "^2.2.15-dev.2196+10201be2"
171
+ "@fedify/vocab-tools": "^2.2.16"
172
172
  },
173
173
  "scripts": {
174
174
  "build:self": "tsdown",
File without changes
File without changes