@fedify/fedify 2.1.13 → 2.1.14

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 (62) hide show
  1. package/dist/{builder-BII9kySt.mjs → builder-BBifZZ5G.mjs} +3 -3
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{context-CqlKdpQu.d.ts → context-_l9t359k.d.ts} +48 -6
  6. package/dist/{context-BUEOz39K.d.cts → context-o22vjzS2.d.cts} +48 -6
  7. package/dist/{deno-DsYpa8eE.mjs → deno-bqnW1QlD.mjs} +1 -1
  8. package/dist/{docloader-SiTy_uEf.mjs → docloader-D-Fu0kBF.mjs} +2 -2
  9. package/dist/federation/builder.test.mjs +1 -1
  10. package/dist/federation/handler.test.mjs +1361 -41
  11. package/dist/federation/idempotency.test.mjs +2 -2
  12. package/dist/federation/inbox.test.mjs +1 -1
  13. package/dist/federation/middleware.test.mjs +1588 -84
  14. package/dist/federation/mod.cjs +1 -1
  15. package/dist/federation/mod.d.cts +2 -2
  16. package/dist/federation/mod.d.ts +2 -2
  17. package/dist/federation/mod.js +1 -1
  18. package/dist/federation/retry.test.mjs +1 -1
  19. package/dist/federation/send.test.mjs +3 -3
  20. package/dist/federation/temporal.test.d.mts +2 -0
  21. package/dist/federation/temporal.test.mjs +71 -0
  22. package/dist/federation/webfinger.test.mjs +1 -1
  23. package/dist/{http-LasosqSl.cjs → http-CEXtUHix.cjs} +1 -1
  24. package/dist/{http-BhNk2Qd4.js → http-Cw1EorUA.js} +1 -1
  25. package/dist/{http-sMWapA1W.mjs → http-DvhFwy2E.mjs} +2 -2
  26. package/dist/{inbox-Fz4Sd_YF.mjs → inbox-7b3VYnec.mjs} +7 -4
  27. package/dist/{key-BTwUWGeQ.mjs → key-B3OBz6A_.mjs} +1 -1
  28. package/dist/{kv-cache-P8ilpPhX.cjs → kv-cache-BIapFiSV.cjs} +1 -1
  29. package/dist/{kv-cache-DD4J1hjd.js → kv-cache-C6nynGhh.js} +1 -1
  30. package/dist/ld-DTxYKZTT.mjs +550 -0
  31. package/dist/{middleware-BmExpfep.js → middleware-0vceVN10.js} +403 -78
  32. package/dist/{middleware-DtWhE0Tg.cjs → middleware-BcbU5lKS.cjs} +406 -80
  33. package/dist/{middleware-DSO3rlFW.cjs → middleware-DUT--Qen.cjs} +1 -1
  34. package/dist/{middleware-BwUi2CSK.mjs → middleware-DmT9t0BJ.mjs} +316 -83
  35. package/dist/{middleware-CgSiHODB.mjs → middleware-Li_g_vqz.mjs} +1 -1
  36. package/dist/{mod-2wk2xVOZ.d.cts → mod-0dF0OeGw.d.cts} +1 -1
  37. package/dist/{mod-VlzkKTxt.d.ts → mod-Bv1elC-b.d.ts} +1 -1
  38. package/dist/mod.cjs +4 -4
  39. package/dist/mod.d.cts +2 -2
  40. package/dist/mod.d.ts +2 -2
  41. package/dist/mod.js +4 -4
  42. package/dist/nodeinfo/handler.test.mjs +1 -1
  43. package/dist/{owner-DHom_kgS.mjs → owner-DzcnuWYo.mjs} +2 -2
  44. package/dist/{proof-BGeouI6o.js → proof-CtTT8A7y.js} +298 -4
  45. package/dist/{proof-CXFgG-c1.mjs → proof-DmVGi7mI.mjs} +2 -2
  46. package/dist/{proof-vA6FYR0I.cjs → proof-JEoW3ODq.cjs} +345 -3
  47. package/dist/{send-CPt5iQJ5.mjs → send-5ulOKVCW.mjs} +2 -2
  48. package/dist/sig/http.test.mjs +2 -2
  49. package/dist/sig/key.test.mjs +1 -1
  50. package/dist/sig/ld.test.mjs +558 -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 +1 -1
  55. package/dist/temporal-CmJkd-25.mjs +95 -0
  56. package/dist/testing/mod.d.mts +48 -6
  57. package/dist/utils/docloader.test.mjs +2 -2
  58. package/dist/utils/mod.cjs +1 -1
  59. package/dist/utils/mod.js +1 -1
  60. package/package.json +6 -6
  61. package/dist/ld--_e4kYb3.mjs +0 -256
  62. /package/dist/{retry-B_E3V_Dx.mjs → retry-CJL0poaU.mjs} +0 -0
@@ -2,8 +2,8 @@ import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError, t as Router } from "./router-CrMLXoOr.mjs";
5
- import { n as version, t as name } from "./deno-DsYpa8eE.mjs";
6
- import { t as InboxListenerSet } from "./inbox-Fz4Sd_YF.mjs";
5
+ import { n as version, t as name } from "./deno-bqnW1QlD.mjs";
6
+ import { t as InboxListenerSet } from "./inbox-7b3VYnec.mjs";
7
7
  import { getTypeId } from "@fedify/vocab";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { getLogger } from "@logtape/logtape";
@@ -43,7 +43,7 @@ var FederationBuilderImpl = class {
43
43
  this.collectionTypeIds = {};
44
44
  }
45
45
  async build(options) {
46
- const { FederationImpl } = await import("./middleware-CgSiHODB.mjs");
46
+ const { FederationImpl } = await import("./middleware-Li_g_vqz.mjs");
47
47
  const f = new FederationImpl(options);
48
48
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
49
49
  f.router = this.router.clone();
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Ct as ActivityTransformer, n as Context } from "../context-BUEOz39K.cjs";
2
+ import { Ct as ActivityTransformer, n as Context } from "../context-o22vjzS2.cjs";
3
3
  import { Activity } from "@fedify/vocab";
4
4
 
5
5
  //#region src/compat/transformers.d.ts
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Ct as ActivityTransformer, n as Context } from "../context-CqlKdpQu.js";
2
+ import { Ct as ActivityTransformer, n as Context } from "../context-_l9t359k.js";
3
3
  import { Activity } from "@fedify/vocab";
4
4
 
5
5
  //#region src/compat/transformers.d.ts
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
6
6
  import { t as assert } from "../assert-ddO5KLpe.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
8
- import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-BwUi2CSK.mjs";
8
+ import { _ as autoIdAssigner, g as actorDehydrator, n as FederationImpl } from "../middleware-DmT9t0BJ.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { Follow, Person } from "@fedify/vocab";
11
11
  //#region src/compat/transformers.test.ts
@@ -706,6 +706,42 @@ interface InboxMessage {
706
706
  readonly id: ReturnType<typeof crypto.randomUUID>;
707
707
  readonly baseUrl: string;
708
708
  readonly activity: unknown;
709
+ /**
710
+ * The normalized JSON-LD representation of a signed inbox activity that
711
+ * Fedify already compacted successfully while accepting the request. Queue
712
+ * workers can reuse this producer-side parse cache under stricter loader or
713
+ * network constraints without changing the raw payload preserved for
714
+ * forwarding.
715
+ *
716
+ * This may exist even when {@link ldSignatureVerified} is `false`, because
717
+ * fallback-authenticated traffic and already-queued backlog items can still
718
+ * depend on the cached normalized form to avoid re-fetching remote custom
719
+ * contexts during worker processing.
720
+ *
721
+ * This is optional for backward compatibility with messages that were
722
+ * queued by older Fedify versions or that were already in a queue before
723
+ * upgrading.
724
+ *
725
+ * Fedify keeps this on the queued message itself instead of an external
726
+ * sidecar because generic queue backends do not provide reliable lifecycle
727
+ * guarantees for auxiliary storage across retries and redeliveries.
728
+ *
729
+ * @internal
730
+ */
731
+ readonly normalizedActivity?: unknown;
732
+ /**
733
+ * Whether the producer actually verified the Linked Data Signature before
734
+ * queueing this message. This lets workers distinguish verified LDS replay
735
+ * from other authenticated inbox traffic that merely happened to include a
736
+ * signature block. This provenance marker is separate from the optional
737
+ * normalizedActivity parse cache.
738
+ *
739
+ * `undefined` preserves backward compatibility with older queued messages
740
+ * that predate this marker.
741
+ *
742
+ * @internal
743
+ */
744
+ readonly ldSignatureVerified?: boolean;
709
745
  readonly started: string;
710
746
  readonly attempt: number;
711
747
  readonly identifier: string | null;
@@ -2356,9 +2392,12 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2356
2392
  * Forwards a received activity to the recipients' inboxes. The forwarded
2357
2393
  * activity will be signed in HTTP Signatures by the forwarder, but its
2358
2394
  * payload will not be modified, i.e., Linked Data Signatures and Object
2359
- * Integrity Proofs will not be added. Therefore, if the activity is not
2360
- * signed (i.e., it has neither Linked Data Signatures nor Object Integrity
2361
- * Proofs), the recipient probably will not trust the activity.
2395
+ * Integrity Proofs will not be added. Even when Fedify internally
2396
+ * normalizes a Linked Data Signature activity for parsing, this method still
2397
+ * forwards the original received payload so the sender's signatures/proofs
2398
+ * are preserved as-is. Therefore, if the activity is not signed (i.e., it
2399
+ * has neither Linked Data Signatures nor Object Integrity Proofs), the
2400
+ * recipient probably will not trust the activity.
2362
2401
  * @param forwarder The forwarder's identifier or the forwarder's username
2363
2402
  * or the forwarder's key pair(s).
2364
2403
  * @param recipients The recipients of the activity.
@@ -2374,9 +2413,12 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2374
2413
  * Forwards a received activity to the recipients' inboxes. The forwarded
2375
2414
  * activity will be signed in HTTP Signatures by the forwarder, but its
2376
2415
  * payload will not be modified, i.e., Linked Data Signatures and Object
2377
- * Integrity Proofs will not be added. Therefore, if the activity is not
2378
- * signed (i.e., it has neither Linked Data Signatures nor Object Integrity
2379
- * Proofs), the recipient probably will not trust the activity.
2416
+ * Integrity Proofs will not be added. Even when Fedify internally
2417
+ * normalizes a Linked Data Signature activity for parsing, this method still
2418
+ * forwards the original received payload so the sender's signatures/proofs
2419
+ * are preserved as-is. Therefore, if the activity is not signed (i.e., it
2420
+ * has neither Linked Data Signatures nor Object Integrity Proofs), the
2421
+ * recipient probably will not trust the activity.
2380
2422
  * @param forwarder The forwarder's identifier or the forwarder's username.
2381
2423
  * @param recipients In this case, it must be `"followers"`.
2382
2424
  * @param options Options for forwarding the activity.
@@ -706,6 +706,42 @@ interface InboxMessage {
706
706
  readonly id: ReturnType<typeof crypto.randomUUID>;
707
707
  readonly baseUrl: string;
708
708
  readonly activity: unknown;
709
+ /**
710
+ * The normalized JSON-LD representation of a signed inbox activity that
711
+ * Fedify already compacted successfully while accepting the request. Queue
712
+ * workers can reuse this producer-side parse cache under stricter loader or
713
+ * network constraints without changing the raw payload preserved for
714
+ * forwarding.
715
+ *
716
+ * This may exist even when {@link ldSignatureVerified} is `false`, because
717
+ * fallback-authenticated traffic and already-queued backlog items can still
718
+ * depend on the cached normalized form to avoid re-fetching remote custom
719
+ * contexts during worker processing.
720
+ *
721
+ * This is optional for backward compatibility with messages that were
722
+ * queued by older Fedify versions or that were already in a queue before
723
+ * upgrading.
724
+ *
725
+ * Fedify keeps this on the queued message itself instead of an external
726
+ * sidecar because generic queue backends do not provide reliable lifecycle
727
+ * guarantees for auxiliary storage across retries and redeliveries.
728
+ *
729
+ * @internal
730
+ */
731
+ readonly normalizedActivity?: unknown;
732
+ /**
733
+ * Whether the producer actually verified the Linked Data Signature before
734
+ * queueing this message. This lets workers distinguish verified LDS replay
735
+ * from other authenticated inbox traffic that merely happened to include a
736
+ * signature block. This provenance marker is separate from the optional
737
+ * normalizedActivity parse cache.
738
+ *
739
+ * `undefined` preserves backward compatibility with older queued messages
740
+ * that predate this marker.
741
+ *
742
+ * @internal
743
+ */
744
+ readonly ldSignatureVerified?: boolean;
709
745
  readonly started: string;
710
746
  readonly attempt: number;
711
747
  readonly identifier: string | null;
@@ -2356,9 +2392,12 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2356
2392
  * Forwards a received activity to the recipients' inboxes. The forwarded
2357
2393
  * activity will be signed in HTTP Signatures by the forwarder, but its
2358
2394
  * payload will not be modified, i.e., Linked Data Signatures and Object
2359
- * Integrity Proofs will not be added. Therefore, if the activity is not
2360
- * signed (i.e., it has neither Linked Data Signatures nor Object Integrity
2361
- * Proofs), the recipient probably will not trust the activity.
2395
+ * Integrity Proofs will not be added. Even when Fedify internally
2396
+ * normalizes a Linked Data Signature activity for parsing, this method still
2397
+ * forwards the original received payload so the sender's signatures/proofs
2398
+ * are preserved as-is. Therefore, if the activity is not signed (i.e., it
2399
+ * has neither Linked Data Signatures nor Object Integrity Proofs), the
2400
+ * recipient probably will not trust the activity.
2362
2401
  * @param forwarder The forwarder's identifier or the forwarder's username
2363
2402
  * or the forwarder's key pair(s).
2364
2403
  * @param recipients The recipients of the activity.
@@ -2374,9 +2413,12 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2374
2413
  * Forwards a received activity to the recipients' inboxes. The forwarded
2375
2414
  * activity will be signed in HTTP Signatures by the forwarder, but its
2376
2415
  * payload will not be modified, i.e., Linked Data Signatures and Object
2377
- * Integrity Proofs will not be added. Therefore, if the activity is not
2378
- * signed (i.e., it has neither Linked Data Signatures nor Object Integrity
2379
- * Proofs), the recipient probably will not trust the activity.
2416
+ * Integrity Proofs will not be added. Even when Fedify internally
2417
+ * normalizes a Linked Data Signature activity for parsing, this method still
2418
+ * forwards the original received payload so the sender's signatures/proofs
2419
+ * are preserved as-is. Therefore, if the activity is not signed (i.e., it
2420
+ * has neither Linked Data Signatures nor Object Integrity Proofs), the
2421
+ * recipient probably will not trust the activity.
2380
2422
  * @param forwarder The forwarder's identifier or the forwarder's username.
2381
2423
  * @param recipients In this case, it must be `"followers"`.
2382
2424
  * @param options Options for forwarding the activity.
@@ -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.1.13";
6
+ var version = "2.1.14";
7
7
  //#endregion
8
8
  export { version as n, name as t };
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { o as validateCryptoKey } from "./key-BTwUWGeQ.mjs";
5
- import { n as doubleKnock } from "./http-sMWapA1W.mjs";
4
+ import { o as validateCryptoKey } from "./key-B3OBz6A_.mjs";
5
+ import { n as doubleKnock } from "./http-DvhFwy2E.mjs";
6
6
  import { curry } from "es-toolkit";
7
7
  import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
8
8
  import { getLogger } from "@logtape/logtape";
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
5
5
  import { a as assertExists } from "../std__assert-Duiq_YC9.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-tL2TOE9X.mjs";
8
- import { n as createFederationBuilder } from "../builder-BII9kySt.mjs";
8
+ import { n as createFederationBuilder } from "../builder-BBifZZ5G.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  import { Activity, Note, Person } from "@fedify/vocab";
11
11
  //#region src/federation/builder.test.ts