@fedify/fedify 2.4.0-dev.2200 → 2.4.0-dev.2219

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 (103) hide show
  1. package/dist/audience-CHQ-FlLD.mjs +95 -0
  2. package/dist/{builder-BGSNMnVH.mjs → builder-C5rYBZ16.mjs} +10 -2
  3. package/dist/compat/mod.d.cts +1 -1
  4. package/dist/compat/mod.d.ts +1 -1
  5. package/dist/compat/public-audience.test.mjs +1 -1
  6. package/dist/compat/transformers.test.mjs +1 -1
  7. package/dist/{compound-proof-Zpg7Fbk9.mjs → compound-proof-D0xY7MBs.mjs} +2 -2
  8. package/dist/{context-B2rlkkyJ.mjs → context-8Tu9kea0.mjs} +2 -0
  9. package/dist/{context-CDcAgm4l.d.cts → context-B6X-t8gI.d.cts} +81 -2
  10. package/dist/{context-9T--NSo4.d.ts → context-CtI307_A.d.ts} +81 -2
  11. package/dist/{deno-CxoV48e0.mjs → deno-Dj1TFhf4.mjs} +1 -1
  12. package/dist/{docloader-U141HKIl.mjs → docloader-CzyJe90o.mjs} +3 -3
  13. package/dist/federation/audience.test.d.mts +2 -0
  14. package/dist/federation/audience.test.mjs +130 -0
  15. package/dist/federation/builder.test.mjs +37 -1
  16. package/dist/federation/compound-fanout.test.mjs +4 -4
  17. package/dist/federation/handler-compound-proof.test.mjs +5 -5
  18. package/dist/federation/handler.test.mjs +7 -7
  19. package/dist/federation/hashlink-media.test.mjs +3 -3
  20. package/dist/federation/idempotency.test.mjs +2 -2
  21. package/dist/federation/metrics.test.mjs +2 -2
  22. package/dist/federation/middleware.test.mjs +125 -9
  23. package/dist/federation/mod.cjs +1 -1
  24. package/dist/federation/mod.d.cts +4 -4
  25. package/dist/federation/mod.d.ts +4 -4
  26. package/dist/federation/mod.js +1 -1
  27. package/dist/federation/outgoing-proof.test.mjs +6 -6
  28. package/dist/federation/portable-actor.test.mjs +4 -4
  29. package/dist/federation/portable-chain.test.mjs +4 -4
  30. package/dist/federation/portable-collection.test.mjs +8 -6
  31. package/dist/federation/portable-delivery.test.d.mts +2 -0
  32. package/dist/federation/portable-delivery.test.mjs +746 -0
  33. package/dist/federation/portable-gateway-keys.test.mjs +6 -6
  34. package/dist/federation/portable-inbox.test.mjs +5 -5
  35. package/dist/federation/portable-parse-uri.test.mjs +2 -2
  36. package/dist/federation/portable-route-activity.test.mjs +3 -3
  37. package/dist/federation/portable.test.mjs +234 -19
  38. package/dist/federation/send.test.mjs +4 -4
  39. package/dist/federation/tasks/enqueue.test.mjs +2 -2
  40. package/dist/federation/tasks/tasks.test.mjs +3 -3
  41. package/dist/federation/temporal.test.mjs +1 -1
  42. package/dist/federation/webfinger.test.mjs +3 -3
  43. package/dist/{federation-Ij8VLHpy.cjs → federation-DC1yfb-8.cjs} +696 -41
  44. package/dist/{http-D8XakCKn.cjs → http-Cuk0w0rp.cjs} +1 -1
  45. package/dist/{http-BQq1Uldg.mjs → http-D-DpP4sd.mjs} +5 -5
  46. package/dist/{http-CshNXXui.js → http-Dx7yMmfw.js} +1 -1
  47. package/dist/{key-DYgoirTo.mjs → key-Djyt1BFx.mjs} +2 -2
  48. package/dist/{kv-BhNbN8Ed.d.cts → kv-B2mzK5tl.d.cts} +3 -2
  49. package/dist/{kv-BhNbN8Ed.d.ts → kv-B2mzK5tl.d.ts} +3 -2
  50. package/dist/{kv-cache-f_GNq0e7.cjs → kv-cache-BmLTVLXc.cjs} +1 -1
  51. package/dist/{kv-cache-Bpnt_Cck.js → kv-cache-CUZOCSKZ.js} +1 -1
  52. package/dist/{kv-cache-D0Mn-VQW.mjs → kv-cache-ecUXfCqW.mjs} +1 -1
  53. package/dist/{ld-eIekvNtm.mjs → ld-CNVWdooi.mjs} +3 -3
  54. package/dist/{metrics-BVpdjsaR.mjs → metrics-BnYleVpg.mjs} +1 -1
  55. package/dist/{middleware-CS3H_4tQ.js → middleware-BdzcazaN.js} +698 -43
  56. package/dist/{middleware-rpYJG85a.mjs → middleware-Bh592bk8.mjs} +1 -1
  57. package/dist/{middleware-BbTJ6C1-.mjs → middleware-C2_LcbL3.mjs} +431 -50
  58. package/dist/{mod-C5Mwx5ty.d.ts → mod-B8MI1mpi.d.ts} +1 -1
  59. package/dist/{mod-B3OBLj5g.d.ts → mod-BhTaDR5H.d.ts} +1 -1
  60. package/dist/{mod-D58KCqUg.d.cts → mod-C7_2j7VT.d.cts} +1 -1
  61. package/dist/{mod-Dp3Ij7sw.d.cts → mod-DFL6IxYQ.d.cts} +1 -1
  62. package/dist/mod.cjs +4 -4
  63. package/dist/mod.d.cts +6 -6
  64. package/dist/mod.d.ts +6 -6
  65. package/dist/mod.js +4 -4
  66. package/dist/nodeinfo/client.test.mjs +1 -1
  67. package/dist/nodeinfo/handler.test.mjs +2 -2
  68. package/dist/otel/mod.d.cts +1 -1
  69. package/dist/otel/mod.d.ts +1 -1
  70. package/dist/{owner-DpxyMeo9.mjs → owner-D_BDPwm2.mjs} +3 -3
  71. package/dist/{portable-collection-BvJ5om91.js → portable-collection-C0c0rUN9.js} +1 -1
  72. package/dist/{portable-collection-DyJwtPz1.cjs → portable-collection-DwJ8YJP2.cjs} +1 -1
  73. package/dist/{portable-collection-DOL3l2C9.mjs → portable-collection-hcONGyUs.mjs} +2 -2
  74. package/dist/{portable-key-B8kTV4n8.mjs → portable-key-B880yVlC.mjs} +1 -1
  75. package/dist/{proof-B9DEHHiO.mjs → proof-z6Prgi5I.mjs} +4 -4
  76. package/dist/{send-CZckda2X.mjs → send-Cw545L_2.mjs} +191 -10
  77. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  78. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  79. package/dist/sig/compound-proof-verification.test.mjs +3 -3
  80. package/dist/sig/compound-proof.test.mjs +3 -3
  81. package/dist/sig/http.test.mjs +3 -3
  82. package/dist/sig/key-owner-evidence.test.mjs +2 -2
  83. package/dist/sig/key.test.mjs +2 -2
  84. package/dist/sig/ld.test.mjs +2 -2
  85. package/dist/sig/mod.cjs +2 -2
  86. package/dist/sig/mod.js +2 -2
  87. package/dist/sig/owner.test.mjs +1 -1
  88. package/dist/sig/portable-collection.test.mjs +2 -2
  89. package/dist/sig/portable-key-id.test.mjs +2 -2
  90. package/dist/sig/portable-key.test.mjs +7 -7
  91. package/dist/sig/proof.test.mjs +4 -4
  92. package/dist/{temporal-Cc1ymEup.mjs → temporal-Cy-8WCod.mjs} +1 -1
  93. package/dist/testing/kv.test.mjs +1 -1
  94. package/dist/testing/mod.d.mts +82 -2
  95. package/dist/testing/mod.mjs +2 -2
  96. package/dist/{testing-C1itIjqW.mjs → testing-t8xDeJZ5.mjs} +1 -1
  97. package/dist/utils/docloader.test.mjs +6 -6
  98. package/dist/utils/kv-cache.test.mjs +2 -2
  99. package/dist/utils/mod.cjs +1 -1
  100. package/dist/utils/mod.d.cts +1 -1
  101. package/dist/utils/mod.d.ts +1 -1
  102. package/dist/utils/mod.js +1 -1
  103. package/package.json +7 -7
@@ -4,14 +4,14 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { l as verifyPortableObjectProofPolicy, o as verifyMapLocalProof } from "../proof-B9DEHHiO.mjs";
7
+ import { l as verifyPortableObjectProofPolicy, o as verifyMapLocalProof } from "../proof-z6Prgi5I.mjs";
8
8
  import { n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
9
- import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, o as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-Zpg7Fbk9.mjs";
9
+ import { a as verifyCompoundPortableObjectProofs, i as inspectCompoundPortableObjectApplicability, o as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-D0xY7MBs.mjs";
10
10
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
11
11
  import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
12
12
  import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
13
- import { mockDocumentLoader, test } from "@fedify/fixture";
14
13
  import { encodeMultibase, exportDidKey, parseIri } from "@fedify/vocab-runtime";
14
+ import { mockDocumentLoader, test } from "@fedify/fixture";
15
15
  import serialize from "json-canon";
16
16
  //#region src/sig/compound-proof-verification.test.ts
17
17
  const limits = {
@@ -6,14 +6,14 @@ import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
7
  import { n as preloadedOnlyDocumentLoader } from "../public-audience--klBIOk1.mjs";
8
8
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
9
- import { a as signObject, d as verifyProof } from "../proof-B9DEHHiO.mjs";
9
+ import { a as signObject, d as verifyProof } from "../proof-z6Prgi5I.mjs";
10
10
  import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
11
- import { o as verifyCompoundProofDocuments } from "../compound-proof-Zpg7Fbk9.mjs";
11
+ import { o as verifyCompoundProofDocuments } from "../compound-proof-D0xY7MBs.mjs";
12
12
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
13
13
  import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
14
14
  import { Create, DataIntegrityProof, Note, Question } from "@fedify/vocab";
15
- import { mockDocumentLoader, test } from "@fedify/fixture";
16
15
  import { encodeMultibase, exportDidKey, parseIri } from "@fedify/vocab-runtime";
16
+ import { mockDocumentLoader, test } from "@fedify/fixture";
17
17
  import { encodeHex } from "byte-encodings/hex";
18
18
  import jsonld from "@fedify/vocab-runtime/jsonld";
19
19
  import serialize from "json-canon";
@@ -12,12 +12,12 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
12
12
  import "../std__assert-DvMDRPes.mjs";
13
13
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
14
14
  import { t as assert } from "../assert-D1Eafmd_.mjs";
15
- import { n as exportJwk } from "../key-DYgoirTo.mjs";
16
- import { a as listRequestSignatures, c as selectRequestSignature, f as verifyRequest, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, p as verifyRequestDetailed, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-BQq1Uldg.mjs";
15
+ import { n as exportJwk } from "../key-Djyt1BFx.mjs";
16
+ import { a as listRequestSignatures, c as selectRequestSignature, f as verifyRequest, i as formatRfc9421SignatureParameters, l as signRequest, n as doubleKnock, o as parseRfc9421Signature, p as verifyRequestDetailed, r as formatRfc9421Signature, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as timingSafeEqual } from "../http-D-DpP4sd.mjs";
17
17
  import { a as rsaPrivateKey3, i as rsaPrivateKey2, l as rsaPublicKey5, n as ed25519PrivateKey, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
18
18
  import { t as KvKeyCache } from "../keycache-Da8A8mZa.mjs";
19
- import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
20
19
  import { FetchError, exportSpki, getDocumentLoader } from "@fedify/vocab-runtime";
20
+ import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
21
21
  import { encodeBase64 } from "byte-encodings/base64";
22
22
  //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert_string_includes.js
23
23
  /**
@@ -1,16 +1,16 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
+ import { n as getCanonicalPortableId } from "../portable-key-id-Ca30-hOa.mjs";
4
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
6
  import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
6
7
  import "../std__assert-DvMDRPes.mjs";
7
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
- import { n as getCanonicalPortableId } from "../portable-key-id-Ca30-hOa.mjs";
9
9
  import { a as promoteKeyOwnerEvidence, i as parseKeyOwnerEvidence, n as attachKeyOwnerEvidence, r as getVerifiedKeyOwnerEvidence } from "../key-owner-evidence-APB6NpSk.mjs";
10
10
  import { r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
11
11
  import { CryptographicKey, Person } from "@fedify/vocab";
12
- import { test } from "@fedify/fixture";
13
12
  import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
13
+ import { test } from "@fedify/fixture";
14
14
  //#region src/sig/key-owner-evidence.test.ts
15
15
  const did = await exportDidKey(ed25519PublicKey.publicKey);
16
16
  const rawActorId = `ap://${did}/actors/alice`;
@@ -6,11 +6,11 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
8
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
9
- import { a as fetchKeyDetailed, c as validateCryptoKey, i as fetchKey, n as exportJwk, o as generateCryptoKeyPair, s as importJwk } from "../key-DYgoirTo.mjs";
9
+ import { a as fetchKeyDetailed, c as validateCryptoKey, i as fetchKey, n as exportJwk, o as generateCryptoKeyPair, s as importJwk } from "../key-Djyt1BFx.mjs";
10
10
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
11
11
  import { CryptographicKey, Multikey } from "@fedify/vocab";
12
- import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
13
12
  import { FetchError, exportDidKey } from "@fedify/vocab-runtime";
13
+ import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
14
14
  //#region src/sig/key.test.ts
15
15
  test("validateCryptoKey()", async () => {
16
16
  const pkcs1v15 = await crypto.subtle.generateKey({
@@ -8,8 +8,8 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
9
9
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { o as generateCryptoKeyPair } from "../key-DYgoirTo.mjs";
12
- 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-eIekvNtm.mjs";
11
+ import { o as generateCryptoKeyPair } from "../key-Djyt1BFx.mjs";
12
+ 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-CNVWdooi.mjs";
13
13
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
14
14
  import { CryptographicKey } from "@fedify/vocab";
15
15
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
package/dist/sig/mod.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_http = require("../http-D8XakCKn.cjs");
4
- const require_portable_collection = require("../portable-collection-DyJwtPz1.cjs");
3
+ const require_http = require("../http-Cuk0w0rp.cjs");
4
+ const require_portable_collection = require("../portable-collection-DwJ8YJP2.cjs");
5
5
  exports.attachSignature = require_http.attachSignature;
6
6
  exports.createProof = require_http.createProof;
7
7
  exports.createSignature = require_http.createSignature;
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { D as createSignature, H as fetchKeyDetailed, I as verifyJsonLd, L as verifySignature, O as detachSignature, P as signJsonLd, T as attachSignature, U as generateCryptoKeyPair, V as fetchKey, W as importJwk, _ as verifyObject, _t as validateAcceptSignature, a as signRequest, c as verifyRequestDetailed, gt as parseAcceptSignature, h as signObject, ht as fulfillAcceptSignature, j as hasSignatureLike, m as hasProofLike, mt as formatAcceptSignature, p as createProof, s as verifyRequest, v as verifyPortableObjectProof, x as verifyProof, z as exportJwk } from "../http-CshNXXui.js";
4
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-BvJ5om91.js";
3
+ import { D as createSignature, H as fetchKeyDetailed, I as verifyJsonLd, L as verifySignature, O as detachSignature, P as signJsonLd, T as attachSignature, U as generateCryptoKeyPair, V as fetchKey, W as importJwk, _ as verifyObject, _t as validateAcceptSignature, a as signRequest, c as verifyRequestDetailed, gt as parseAcceptSignature, h as signObject, ht as fulfillAcceptSignature, j as hasSignatureLike, m as hasProofLike, mt as formatAcceptSignature, p as createProof, s as verifyRequest, v as verifyPortableObjectProof, x as verifyProof, z as exportJwk } from "../http-Dx7yMmfw.js";
4
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-C0c0rUN9.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, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DpxyMeo9.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-D_BDPwm2.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
@@ -2,10 +2,10 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
5
- import { t as verifyPortableObject } from "../portable-collection-DOL3l2C9.mjs";
5
+ import { t as verifyPortableObject } from "../portable-collection-hcONGyUs.mjs";
6
6
  import { Collection, CollectionPage, Note, OrderedCollection, Person, traverseCollection } from "@fedify/vocab";
7
- import { test } from "@fedify/fixture";
8
7
  import { FetchError, encodeMultibase, exportDidKey, preloadedContexts } from "@fedify/vocab-runtime";
8
+ import { test } from "@fedify/fixture";
9
9
  import { deepStrictEqual, ok, strictEqual } from "node:assert/strict";
10
10
  import serialize from "json-canon";
11
11
  //#region src/sig/portable-collection.test.ts
@@ -1,14 +1,14 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
+ import { f as isSameObjectId, t as getAuthenticationOrigin } from "../portable-key-id-Ca30-hOa.mjs";
4
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
6
  import { t as assertFalse } from "../assert_false-CPdRnc3E.mjs";
6
7
  import "../std__assert-DvMDRPes.mjs";
7
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
- import { f as isSameObjectId, t as getAuthenticationOrigin } from "../portable-key-id-Ca30-hOa.mjs";
9
9
  import { r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
10
- import { test } from "@fedify/fixture";
11
10
  import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
11
+ import { test } from "@fedify/fixture";
12
12
  //#region src/sig/portable-key-id.test.ts
13
13
  const did = await exportDidKey(ed25519PublicKey.publicKey);
14
14
  const otherDid = await exportDidKey((await crypto.subtle.generateKey("Ed25519", true, ["sign", "verify"])).publicKey);
@@ -2,17 +2,17 @@ import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
- import { a as fetchKeyDetailed, i as fetchKey } from "../key-DYgoirTo.mjs";
6
- import { h as verifyJsonLd, p as signJsonLd } from "../ld-eIekvNtm.mjs";
7
- import { d as verifyProof, r as createProof } from "../proof-B9DEHHiO.mjs";
8
- import { n as resolvePortableActorKey } from "../portable-key-B8kTV4n8.mjs";
9
- import { f as verifyRequest, l as signRequest, p as verifyRequestDetailed } from "../http-BQq1Uldg.mjs";
5
+ import { a as fetchKeyDetailed, i as fetchKey } from "../key-Djyt1BFx.mjs";
6
+ import { h as verifyJsonLd, p as signJsonLd } from "../ld-CNVWdooi.mjs";
7
+ import { d as verifyProof, r as createProof } from "../proof-z6Prgi5I.mjs";
8
+ import { n as resolvePortableActorKey } from "../portable-key-B880yVlC.mjs";
9
+ import { f as verifyRequest, l as signRequest, p as verifyRequestDetailed } from "../http-D-DpP4sd.mjs";
10
10
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
11
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DpxyMeo9.mjs";
11
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-D_BDPwm2.mjs";
12
12
  import { t as KvKeyCache } from "../keycache-Da8A8mZa.mjs";
13
13
  import { Create, CryptographicKey, Multikey, Note, Person } from "@fedify/vocab";
14
- import { test } from "@fedify/fixture";
15
14
  import { FetchError, encodeMultibase, exportDidKey, exportSpki, parseIri, preloadedContexts } from "@fedify/vocab-runtime";
15
+ import { test } from "@fedify/fixture";
16
16
  import { deepStrictEqual, ok, strictEqual } from "node:assert/strict";
17
17
  import serialize from "json-canon";
18
18
  //#region src/sig/portable-key.test.ts
@@ -10,13 +10,13 @@ import "../std__assert-DvMDRPes.mjs";
10
10
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
11
11
  import { t as assert } from "../assert-D1Eafmd_.mjs";
12
12
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
13
- import { a as signObject, c as verifyPortableObjectProof, d as verifyProof, i as hasProofLike, r as createProof, s as verifyObject } from "../proof-B9DEHHiO.mjs";
14
- import { f as verifyRequest } from "../http-BQq1Uldg.mjs";
13
+ import { a as signObject, c as verifyPortableObjectProof, d as verifyProof, i as hasProofLike, r as createProof, s as verifyObject } from "../proof-z6Prgi5I.mjs";
14
+ import { f as verifyRequest } from "../http-D-DpP4sd.mjs";
15
15
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
16
- import { t as getAuthenticatedDocumentLoader } from "../docloader-U141HKIl.mjs";
16
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-CzyJe90o.mjs";
17
17
  import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place, Translation } from "@fedify/vocab";
18
- import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
19
18
  import { decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
19
+ import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
20
20
  import { decodeHex } from "byte-encodings/hex";
21
21
  import serialize from "json-canon";
22
22
  //#region src/sig/proof.test.ts
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-eIekvNtm.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-CNVWdooi.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
6
  //#region src/federation/temporal.ts
7
7
  function isPlainObject(value) {
@@ -6,7 +6,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
6
  import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
7
7
  import { n as baseOptions, o as stringSchema, t as MockQueue } from "../tasks-IG3pHfvZ.mjs";
8
8
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
9
- import { o as createFederation } from "../middleware-BbTJ6C1-.mjs";
9
+ import { o as createFederation } from "../middleware-C2_LcbL3.mjs";
10
10
  //#region src/testing/kv.test.ts
11
11
  test("ManualClockKvStore keeps an entry at its exact expiration instant", async () => {
12
12
  const kv = new ManualClockKvStore();
@@ -782,14 +782,15 @@ interface KvStore {
782
782
  /**
783
783
  * Gets the value for the given key.
784
784
  * @param key The key to get the value for.
785
- * @returns The value for the key, or `undefined` if the key does not exist.
785
+ * @returns The value for the key, including `null` if stored, or `undefined`
786
+ * if the key does not exist.
786
787
  * @template T The type of the value to get.
787
788
  */
788
789
  get<T = unknown>(key: KvKey): Promise<T | undefined>;
789
790
  /**
790
791
  * Sets the value for the given key.
791
792
  * @param key The key to set the value for.
792
- * @param value The value to set.
793
+ * @param value The value to set. `null` is a storable value.
793
794
  * @param options Additional options for setting the value.
794
795
  */
795
796
  set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
@@ -1253,6 +1254,18 @@ interface FanoutMessage {
1253
1254
  readonly inboxes: Readonly<Record<string, {
1254
1255
  readonly actorIds: readonly string[];
1255
1256
  readonly sharedInbox: boolean;
1257
+ /**
1258
+ * The canonical form of the FEP-ef61 portable inbox that the inbox
1259
+ * stands for.
1260
+ * @internal
1261
+ */
1262
+ readonly portableInbox?: string;
1263
+ /**
1264
+ * The compatible identifiers of the portable inbox on each gateway to
1265
+ * deliver through, in order.
1266
+ * @internal
1267
+ */
1268
+ readonly gatewayInboxes?: readonly string[];
1256
1269
  }>>;
1257
1270
  readonly activity: unknown;
1258
1271
  readonly activityId?: string;
@@ -1296,6 +1309,27 @@ interface OutboxMessage {
1296
1309
  * @internal
1297
1310
  */
1298
1311
  readonly circuitHeldSince?: string;
1312
+ /**
1313
+ * The canonical form of the FEP-ef61 portable inbox that {@link inbox}, its
1314
+ * compatible identifier on a gateway, stands for.
1315
+ * @internal
1316
+ */
1317
+ readonly portableInbox?: string;
1318
+ /**
1319
+ * The compatible identifiers of the FEP-ef61 portable inbox on each gateway
1320
+ * that is still to be tried, in order. {@link inbox} is the first one.
1321
+ * If there is more than one, the activity is delivered through the first
1322
+ * gateway that accepts it.
1323
+ * @internal
1324
+ */
1325
+ readonly gatewayInboxes?: readonly string[];
1326
+ /**
1327
+ * The times before which each of {@link gatewayInboxes} must not be tried
1328
+ * again, as their responses' `Retry-After` headers requested, keyed by
1329
+ * the inbox URL, in ISO 8601.
1330
+ * @internal
1331
+ */
1332
+ readonly gatewayNotBefore?: Readonly<Record<string, string>>;
1299
1333
  readonly traceContext: Readonly<Record<string, string>>;
1300
1334
  }
1301
1335
  /**
@@ -4170,6 +4204,52 @@ interface RequestContext<TContextData> extends Context<TContextData> {
4170
4204
  * [instance actor]: https://swicg.github.io/activitypub-http-signature/#instance-actor
4171
4205
  */
4172
4206
  getSignedKeyOwner(options: GetKeyOwnerOptions): Promise<Actor | null>;
4207
+ /**
4208
+ * Checks whether the request is signed by an actor who belongs to
4209
+ * the intended audience of an object, i.e., the owner of the signed key
4210
+ * (see {@link RequestContext.getSignedKeyOwner}) is one of the object's
4211
+ * `to`, `cc`, `bto`, `bcc`, and `audience`, or a member of one of them
4212
+ * according to the `isMember` option.
4213
+ *
4214
+ * Everyone belongs to the audience of a publicly addressed object, so it
4215
+ * returns `true` for such an object even if the request is not signed.
4216
+ *
4217
+ * This can be used in authorization predicates for serving non-public
4218
+ * objects, which [FEP-ef61] requires of gateways serving portable objects.
4219
+ * [FEP-ef61] portable IDs are compared by their canonical forms, so
4220
+ * an `ap:` URI, an `ap+ef61:` URI, and a compatible identifier on any
4221
+ * gateway refer to the same actor.
4222
+ *
4223
+ * [FEP-ef61]: https://w3id.org/fep/ef61
4224
+ *
4225
+ * @param object The object whose audience is checked.
4226
+ * @param options Options for checking the audience.
4227
+ * @returns `true` if the object is publicly addressed, or the request is
4228
+ * signed by an actor who belongs to its audience.
4229
+ * @since 2.4.0
4230
+ */
4231
+ isSignedByAudience(object: Object$1, options?: IsSignedByAudienceOptions): Promise<boolean>;
4232
+ }
4233
+ /**
4234
+ * Options for {@link RequestContext.isSignedByAudience} method.
4235
+ * @since 2.4.0
4236
+ */
4237
+ interface IsSignedByAudienceOptions extends GetKeyOwnerOptions {
4238
+ /**
4239
+ * Checks whether the actor who signed the request is a member of
4240
+ * an addressee of the object that is not the actor itself, e.g.,
4241
+ * a followers collection. Fedify does not resolve collections by itself,
4242
+ * as only the application can tell their members reliably.
4243
+ *
4244
+ * It is called for each such addressee in order until it returns `true`.
4245
+ * If it is omitted, only the actors that the object addresses directly
4246
+ * belong to its audience.
4247
+ * @param addressee The ID of the addressee, e.g., the ID of a followers
4248
+ * collection.
4249
+ * @param actor The actor who signed the request.
4250
+ * @returns `true` if the actor is a member of the addressee.
4251
+ */
4252
+ isMember?: (addressee: URL, actor: Actor) => boolean | Promise<boolean>;
4173
4253
  }
4174
4254
  /**
4175
4255
  * A context for inbox listeners.
@@ -2,8 +2,8 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { r as testDefinitions } from "../dist-DJQM4u7i.mjs";
5
- import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-B2rlkkyJ.mjs";
5
+ import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-8Tu9kea0.mjs";
6
6
  import { t as ManualClockKvStore } from "../kv-DBRWVx3Q.mjs";
7
7
  import { a as numberSchema, i as makeSchema, n as baseOptions, o as stringSchema, r as envelopeSchema, t as MockQueue } from "../tasks-IG3pHfvZ.mjs";
8
- import "../testing-C1itIjqW.mjs";
8
+ import "../testing-t8xDeJZ5.mjs";
9
9
  export { ManualClockKvStore, MockQueue, baseOptions, createInboxContext, createOutboxContext, createRequestContext, envelopeSchema, makeSchema, numberSchema, stringSchema, testDefinitions };
@@ -2,7 +2,7 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import "./dist-DJQM4u7i.mjs";
5
- import "./context-B2rlkkyJ.mjs";
5
+ import "./context-8Tu9kea0.mjs";
6
6
  import "./kv-DBRWVx3Q.mjs";
7
7
  import "./tasks-IG3pHfvZ.mjs";
8
8
  export {};
@@ -5,12 +5,12 @@ import { t as esm_default } from "../esm-BHXXx4Wx.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
8
- import { f as verifyRequest } from "../http-BQq1Uldg.mjs";
8
+ import { f as verifyRequest } from "../http-D-DpP4sd.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-U141HKIl.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-CzyJe90o.mjs";
11
11
  import { configure, reset } from "@logtape/logtape";
12
- import { mockDocumentLoader, test } from "@fedify/fixture";
13
12
  import { FetchError, UrlError } from "@fedify/vocab-runtime";
13
+ import { mockDocumentLoader, test } from "@fedify/fixture";
14
14
  import dns from "node:dns/promises";
15
15
  import { deepStrictEqual, ok, rejects } from "node:assert/strict";
16
16
  //#region src/utils/docloader.test.ts
@@ -567,16 +567,16 @@ test("getAuthenticatedDocumentLoader() times out", async (t) => {
567
567
  let requests = 0;
568
568
  esm_default.get(url, async () => {
569
569
  requests++;
570
- await delay(80);
570
+ await delay(200);
571
571
  return new Response(null, { status: 401 });
572
572
  });
573
573
  try {
574
574
  await rejects(getAuthenticatedDocumentLoader(identity, {
575
575
  allowPrivateAddress: true,
576
- timeout: 120
576
+ timeout: 300
577
577
  })(url), (e) => assertTimeoutFetchError(e, url));
578
578
  deepStrictEqual(requests, 2);
579
- await delay(100);
579
+ await delay(250);
580
580
  deepStrictEqual(requests, 2);
581
581
  } finally {
582
582
  esm_default.hardReset();
@@ -1,10 +1,10 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as kvCache, t as MockKvStore } from "../kv-cache-D0Mn-VQW.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-ecUXfCqW.mjs";
5
+ import { preloadedContexts } from "@fedify/vocab-runtime";
5
6
  import { deepStrictEqual, throws } from "node:assert";
6
7
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
7
- import { preloadedContexts } from "@fedify/vocab-runtime";
8
8
  //#region src/utils/kv-cache.test.ts
9
9
  test("kvCache()", async (t) => {
10
10
  const kv = new MockKvStore();
@@ -1,5 +1,5 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_kv_cache = require("../kv-cache-f_GNq0e7.cjs");
3
+ const require_kv_cache = require("../kv-cache-BmLTVLXc.cjs");
4
4
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
5
5
  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-Dp3Ij7sw.cjs";
2
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-DFL6IxYQ.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-C5Mwx5ty.js";
2
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-B8MI1mpi.js";
3
3
  export { getAuthenticatedDocumentLoader, kvCache };
package/dist/utils/mod.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-Bpnt_Cck.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-CUZOCSKZ.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.4.0-dev.2200+e588a43c",
3
+ "version": "2.4.0-dev.2219+eb70f060",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -151,10 +151,10 @@
151
151
  "structured-field-values": "^2.0.4",
152
152
  "temporal-polyfill": "^1.0.1",
153
153
  "urlpattern-polyfill": "^10.1.0",
154
- "@fedify/uri-template": "2.4.0-dev.2200+e588a43c",
155
- "@fedify/vocab": "2.4.0-dev.2200+e588a43c",
156
- "@fedify/vocab-runtime": "2.4.0-dev.2200+e588a43c",
157
- "@fedify/webfinger": "2.4.0-dev.2200+e588a43c"
154
+ "@fedify/uri-template": "2.4.0-dev.2219+eb70f060",
155
+ "@fedify/vocab": "2.4.0-dev.2219+eb70f060",
156
+ "@fedify/vocab-runtime": "2.4.0-dev.2219+eb70f060",
157
+ "@fedify/webfinger": "2.4.0-dev.2219+eb70f060"
158
158
  },
159
159
  "devDependencies": {
160
160
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -166,8 +166,8 @@
166
166
  "tsx": "^4.21.0",
167
167
  "typescript": "^6.0.0",
168
168
  "wrangler": "^4.17.0",
169
- "@fedify/fixture": "2.0.0",
170
- "@fedify/vocab-tools": "^2.4.0-dev.2200+e588a43c"
169
+ "@fedify/vocab-tools": "^2.4.0-dev.2219+eb70f060",
170
+ "@fedify/fixture": "2.0.0"
171
171
  },
172
172
  "scripts": {
173
173
  "build:self": "tsdown",