@fedify/fedify 2.3.0-dev.1145 → 2.3.0-dev.1154

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 (68) hide show
  1. package/dist/{builder-ShiR1K6b.mjs → builder-BwSH45lU.mjs} +2 -2
  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-DI2gRbyN.d.cts → context-CRXCkTM6.d.cts} +48 -6
  6. package/dist/{context-DCtsSHDv.d.ts → context-MgCh7YGu.d.ts} +48 -6
  7. package/dist/{deno-h0TWFuEz.mjs → deno-Aas8ryCk.mjs} +1 -1
  8. package/dist/{docloader-BdDN0Aqx.mjs → docloader-_1lh7Dn1.mjs} +2 -2
  9. package/dist/federation/builder.test.mjs +1 -1
  10. package/dist/federation/handler.test.mjs +1363 -44
  11. package/dist/federation/idempotency.test.mjs +2 -2
  12. package/dist/federation/metrics.test.mjs +1 -1
  13. package/dist/federation/middleware.test.mjs +1667 -163
  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 +8 -8
  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/{getMachineId-bsd-etIyxDet.mjs → getMachineId-bsd-BY01PL1n.mjs} +1 -1
  24. package/dist/{getMachineId-darwin-D23zTf4g.mjs → getMachineId-darwin-Dr1gkBkp.mjs} +1 -1
  25. package/dist/{getMachineId-win-Dpap6v5i.mjs → getMachineId-win-QEYwcJiy.mjs} +1 -1
  26. package/dist/{http-B2hxA7dO.js → http-CP1Qje2Q.js} +1 -1
  27. package/dist/{http-QzW9IWfs.mjs → http-DUBr4pJL.mjs} +3 -3
  28. package/dist/{http-7kAB7PVx.cjs → http-bAPHYmg8.cjs} +1 -1
  29. package/dist/{key-Dh2OK1XQ.mjs → key-DVh4I9kS.mjs} +2 -2
  30. package/dist/{kv-cache-DCPp-MT0.cjs → kv-cache-2zYOM6Q7.cjs} +1 -1
  31. package/dist/{kv-cache-EZRIPZXD.mjs → kv-cache-6CA6Rx92.mjs} +1 -1
  32. package/dist/{kv-cache-b22dNkjt.js → kv-cache-azKKIdQE.js} +1 -1
  33. package/dist/{ld-eZbar1rr.mjs → ld-D9435Gn1.mjs} +302 -6
  34. package/dist/{metrics-E0hAHtLZ.mjs → metrics-K7CyLZhK.mjs} +1 -1
  35. package/dist/{middleware-mToCR2tG.mjs → middleware-Bn8SYmaa.mjs} +1 -1
  36. package/dist/{middleware-BUl1BH4x.cjs → middleware-Cu8Lw81i.cjs} +429 -99
  37. package/dist/{middleware-CyJDCmNg.mjs → middleware-DZjXGmiF.mjs} +348 -108
  38. package/dist/{middleware-BrGIM_Ra.js → middleware-tbfw9GfY.js} +428 -99
  39. package/dist/{mod-CI9fduEi.d.cts → mod-C7HOzGqH.d.cts} +1 -1
  40. package/dist/{mod-CkRiJHGA.d.ts → mod-CpQHB3Ys.d.ts} +1 -1
  41. package/dist/mod.cjs +4 -4
  42. package/dist/mod.d.cts +2 -2
  43. package/dist/mod.d.ts +2 -2
  44. package/dist/mod.js +4 -4
  45. package/dist/nodeinfo/handler.test.mjs +1 -1
  46. package/dist/{owner-ByO_Fw6U.mjs → owner-Bt9Zdipr.mjs} +2 -2
  47. package/dist/{proof-jVqClF49.cjs → proof-3YeQ4Z5A.cjs} +353 -3
  48. package/dist/{proof-CSo0S8OK.mjs → proof-CfevUec1.mjs} +3 -3
  49. package/dist/{proof-BkRyFchv.js → proof-CqwCBFaT.js} +300 -4
  50. package/dist/{send-jzrTV1FU.mjs → send-CuS5FYIt.mjs} +3 -3
  51. package/dist/sig/http.test.mjs +2 -2
  52. package/dist/sig/key.test.mjs +1 -1
  53. package/dist/sig/ld.test.mjs +558 -2
  54. package/dist/sig/mod.cjs +2 -2
  55. package/dist/sig/mod.js +2 -2
  56. package/dist/sig/owner.test.mjs +1 -1
  57. package/dist/sig/proof.test.mjs +1 -1
  58. package/dist/temporal-BacpfwuJ.mjs +95 -0
  59. package/dist/testing/mod.d.mts +48 -6
  60. package/dist/utils/docloader.test.mjs +2 -2
  61. package/dist/utils/kv-cache.test.mjs +1 -1
  62. package/dist/utils/mod.cjs +1 -1
  63. package/dist/utils/mod.js +1 -1
  64. package/package.json +6 -6
  65. /package/dist/{execAsync-DCBrgFiV.mjs → execAsync-Dxb7rNf3.mjs} +0 -0
  66. /package/dist/{getMachineId-linux-ObI47Hql.mjs → getMachineId-linux-Bbhofx-s.mjs} +0 -0
  67. /package/dist/{getMachineId-unsupported-Ddu-PFeh.mjs → getMachineId-unsupported-dIOte2Ct.mjs} +0 -0
  68. /package/dist/{retry-v_sGLH1d.mjs → retry-_VvV0h9f.mjs} +0 -0
@@ -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-h0TWFuEz.mjs";
4
+ import { n as version, t as name } from "./deno-Aas8ryCk.mjs";
5
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";
@@ -73,7 +73,7 @@ var FederationBuilderImpl = class {
73
73
  this.collectionTypeIds = {};
74
74
  }
75
75
  async build(options) {
76
- const { FederationImpl } = await import("./middleware-mToCR2tG.mjs");
76
+ const { FederationImpl } = await import("./middleware-Bn8SYmaa.mjs");
77
77
  const f = new FederationImpl(options);
78
78
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
79
79
  f.router = this.router.clone();
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as Context, vt as ActivityTransformer } from "../context-DI2gRbyN.cjs";
2
+ import { n as Context, vt as ActivityTransformer } from "../context-CRXCkTM6.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 { n as Context, vt as ActivityTransformer } from "../context-DCtsSHDv.js";
2
+ import { n as Context, vt as ActivityTransformer } from "../context-MgCh7YGu.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-C-ZRDbaf.mjs";
5
5
  import { t as assertInstanceOf } from "../assert_instance_of-DBC5X09g.mjs";
6
6
  import { t as assert } from "../assert-OguE97r2.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
8
- import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-CyJDCmNg.mjs";
8
+ import { n as FederationImpl, v as actorDehydrator, y as autoIdAssigner } from "../middleware-DZjXGmiF.mjs";
9
9
  import { Follow, Person } from "@fedify/vocab";
10
10
  import { test } from "@fedify/fixture";
11
11
  //#region src/compat/transformers.test.ts
@@ -483,6 +483,42 @@ interface InboxMessage {
483
483
  readonly id: ReturnType<typeof crypto.randomUUID>;
484
484
  readonly baseUrl: string;
485
485
  readonly activity: unknown;
486
+ /**
487
+ * The normalized JSON-LD representation of a signed inbox activity that
488
+ * Fedify already compacted successfully while accepting the request. Queue
489
+ * workers can reuse this producer-side parse cache under stricter loader or
490
+ * network constraints without changing the raw payload preserved for
491
+ * forwarding.
492
+ *
493
+ * This may exist even when {@link ldSignatureVerified} is `false`, because
494
+ * fallback-authenticated traffic and already-queued backlog items can still
495
+ * depend on the cached normalized form to avoid re-fetching remote custom
496
+ * contexts during worker processing.
497
+ *
498
+ * This is optional for backward compatibility with messages that were
499
+ * queued by older Fedify versions or that were already in a queue before
500
+ * upgrading.
501
+ *
502
+ * Fedify keeps this on the queued message itself instead of an external
503
+ * sidecar because generic queue backends do not provide reliable lifecycle
504
+ * guarantees for auxiliary storage across retries and redeliveries.
505
+ *
506
+ * @internal
507
+ */
508
+ readonly normalizedActivity?: unknown;
509
+ /**
510
+ * Whether the producer actually verified the Linked Data Signature before
511
+ * queueing this message. This lets workers distinguish verified LDS replay
512
+ * from other authenticated inbox traffic that merely happened to include a
513
+ * signature block. This provenance marker is separate from the optional
514
+ * normalizedActivity parse cache.
515
+ *
516
+ * `undefined` preserves backward compatibility with older queued messages
517
+ * that predate this marker.
518
+ *
519
+ * @internal
520
+ */
521
+ readonly ldSignatureVerified?: boolean;
486
522
  readonly started: string;
487
523
  readonly attempt: number;
488
524
  readonly identifier: string | null;
@@ -2269,9 +2305,12 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2269
2305
  * Forwards a received activity to the recipients' inboxes. The forwarded
2270
2306
  * activity will be signed in HTTP Signatures by the forwarder, but its
2271
2307
  * payload will not be modified, i.e., Linked Data Signatures and Object
2272
- * Integrity Proofs will not be added. Therefore, if the activity is not
2273
- * signed (i.e., it has neither Linked Data Signatures nor Object Integrity
2274
- * Proofs), the recipient probably will not trust the activity.
2308
+ * Integrity Proofs will not be added. Even when Fedify internally
2309
+ * normalizes a Linked Data Signature activity for parsing, this method still
2310
+ * forwards the original received payload so the sender's signatures/proofs
2311
+ * are preserved as-is. Therefore, if the activity is not signed (i.e., it
2312
+ * has neither Linked Data Signatures nor Object Integrity Proofs), the
2313
+ * recipient probably will not trust the activity.
2275
2314
  * @param forwarder The forwarder's identifier or the forwarder's username
2276
2315
  * or the forwarder's key pair(s).
2277
2316
  * @param recipients The recipients of the activity.
@@ -2287,9 +2326,12 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2287
2326
  * Forwards a received activity to the recipients' inboxes. The forwarded
2288
2327
  * activity will be signed in HTTP Signatures by the forwarder, but its
2289
2328
  * payload will not be modified, i.e., Linked Data Signatures and Object
2290
- * Integrity Proofs will not be added. Therefore, if the activity is not
2291
- * signed (i.e., it has neither Linked Data Signatures nor Object Integrity
2292
- * Proofs), the recipient probably will not trust the activity.
2329
+ * Integrity Proofs will not be added. Even when Fedify internally
2330
+ * normalizes a Linked Data Signature activity for parsing, this method still
2331
+ * forwards the original received payload so the sender's signatures/proofs
2332
+ * are preserved as-is. Therefore, if the activity is not signed (i.e., it
2333
+ * has neither Linked Data Signatures nor Object Integrity Proofs), the
2334
+ * recipient probably will not trust the activity.
2293
2335
  * @param forwarder The forwarder's identifier or the forwarder's username.
2294
2336
  * @param recipients In this case, it must be `"followers"`.
2295
2337
  * @param options Options for forwarding the activity.
@@ -485,6 +485,42 @@ interface InboxMessage {
485
485
  readonly id: ReturnType<typeof crypto.randomUUID>;
486
486
  readonly baseUrl: string;
487
487
  readonly activity: unknown;
488
+ /**
489
+ * The normalized JSON-LD representation of a signed inbox activity that
490
+ * Fedify already compacted successfully while accepting the request. Queue
491
+ * workers can reuse this producer-side parse cache under stricter loader or
492
+ * network constraints without changing the raw payload preserved for
493
+ * forwarding.
494
+ *
495
+ * This may exist even when {@link ldSignatureVerified} is `false`, because
496
+ * fallback-authenticated traffic and already-queued backlog items can still
497
+ * depend on the cached normalized form to avoid re-fetching remote custom
498
+ * contexts during worker processing.
499
+ *
500
+ * This is optional for backward compatibility with messages that were
501
+ * queued by older Fedify versions or that were already in a queue before
502
+ * upgrading.
503
+ *
504
+ * Fedify keeps this on the queued message itself instead of an external
505
+ * sidecar because generic queue backends do not provide reliable lifecycle
506
+ * guarantees for auxiliary storage across retries and redeliveries.
507
+ *
508
+ * @internal
509
+ */
510
+ readonly normalizedActivity?: unknown;
511
+ /**
512
+ * Whether the producer actually verified the Linked Data Signature before
513
+ * queueing this message. This lets workers distinguish verified LDS replay
514
+ * from other authenticated inbox traffic that merely happened to include a
515
+ * signature block. This provenance marker is separate from the optional
516
+ * normalizedActivity parse cache.
517
+ *
518
+ * `undefined` preserves backward compatibility with older queued messages
519
+ * that predate this marker.
520
+ *
521
+ * @internal
522
+ */
523
+ readonly ldSignatureVerified?: boolean;
488
524
  readonly started: string;
489
525
  readonly attempt: number;
490
526
  readonly identifier: string | null;
@@ -2271,9 +2307,12 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2271
2307
  * Forwards a received activity to the recipients' inboxes. The forwarded
2272
2308
  * activity will be signed in HTTP Signatures by the forwarder, but its
2273
2309
  * payload will not be modified, i.e., Linked Data Signatures and Object
2274
- * Integrity Proofs will not be added. Therefore, if the activity is not
2275
- * signed (i.e., it has neither Linked Data Signatures nor Object Integrity
2276
- * Proofs), the recipient probably will not trust the activity.
2310
+ * Integrity Proofs will not be added. Even when Fedify internally
2311
+ * normalizes a Linked Data Signature activity for parsing, this method still
2312
+ * forwards the original received payload so the sender's signatures/proofs
2313
+ * are preserved as-is. Therefore, if the activity is not signed (i.e., it
2314
+ * has neither Linked Data Signatures nor Object Integrity Proofs), the
2315
+ * recipient probably will not trust the activity.
2277
2316
  * @param forwarder The forwarder's identifier or the forwarder's username
2278
2317
  * or the forwarder's key pair(s).
2279
2318
  * @param recipients The recipients of the activity.
@@ -2289,9 +2328,12 @@ interface InboxContext<TContextData> extends Context<TContextData> {
2289
2328
  * Forwards a received activity to the recipients' inboxes. The forwarded
2290
2329
  * activity will be signed in HTTP Signatures by the forwarder, but its
2291
2330
  * payload will not be modified, i.e., Linked Data Signatures and Object
2292
- * Integrity Proofs will not be added. Therefore, if the activity is not
2293
- * signed (i.e., it has neither Linked Data Signatures nor Object Integrity
2294
- * Proofs), the recipient probably will not trust the activity.
2331
+ * Integrity Proofs will not be added. Even when Fedify internally
2332
+ * normalizes a Linked Data Signature activity for parsing, this method still
2333
+ * forwards the original received payload so the sender's signatures/proofs
2334
+ * are preserved as-is. Therefore, if the activity is not signed (i.e., it
2335
+ * has neither Linked Data Signatures nor Object Integrity Proofs), the
2336
+ * recipient probably will not trust the activity.
2295
2337
  * @param forwarder The forwarder's identifier or the forwarder's username.
2296
2338
  * @param recipients In this case, it must be `"followers"`.
2297
2339
  * @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.3.0-dev.1145+3fe78022";
6
+ var version = "2.3.0-dev.1154+8db5848a";
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-Dh2OK1XQ.mjs";
5
- import { n as doubleKnock } from "./http-QzW9IWfs.mjs";
4
+ import { o as validateCryptoKey } from "./key-DVh4I9kS.mjs";
5
+ import { n as doubleKnock } from "./http-DUBr4pJL.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
8
8
  import { curry } from "es-toolkit";
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import { r as assertExists } from "../std__assert-BBjXFNOb.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
8
- import { r as createFederationBuilder } from "../builder-ShiR1K6b.mjs";
8
+ import { r as createFederationBuilder } from "../builder-BwSH45lU.mjs";
9
9
  import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
10
10
  import { Activity, Note, Person } from "@fedify/vocab";
11
11
  import { test } from "@fedify/fixture";