@fedify/fedify 2.4.6-dev.2628 → 2.4.6-dev.2837

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 (89) hide show
  1. package/dist/{builder-kj5boG2l.mjs → builder-DYeeuJIZ.mjs} +2 -2
  2. package/dist/compat/mod.cjs +1 -1
  3. package/dist/compat/mod.js +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{compound-proof-BoNAYSHt.mjs → compound-proof-CxRUa-wY.mjs} +2 -2
  6. package/dist/{deno-ksnVeCA7.mjs → deno-CRpGtqm6.mjs} +1 -1
  7. package/dist/{docloader-BhVNi06k.mjs → docloader-CZtA3Qjh.mjs} +2 -2
  8. package/dist/federation/builder.test.mjs +1 -1
  9. package/dist/federation/compound-fanout.test.mjs +3 -3
  10. package/dist/federation/handler-compound-proof.test.mjs +3 -3
  11. package/dist/federation/handler.test.mjs +4 -4
  12. package/dist/federation/hashlink-media.test.mjs +2 -2
  13. package/dist/federation/idempotency.test.mjs +2 -2
  14. package/dist/federation/inbox-report.test.mjs +5 -5
  15. package/dist/federation/inbox.test.mjs +1 -1
  16. package/dist/federation/metrics.test.mjs +1 -1
  17. package/dist/federation/middleware.test.mjs +7 -7
  18. package/dist/federation/mod.cjs +1 -1
  19. package/dist/federation/mod.js +1 -1
  20. package/dist/federation/outgoing-proof.test.mjs +4 -4
  21. package/dist/federation/portable-actor.test.mjs +3 -3
  22. package/dist/federation/portable-chain.test.mjs +3 -3
  23. package/dist/federation/portable-collection.test.mjs +4 -4
  24. package/dist/federation/portable-delivery.test.mjs +2 -2
  25. package/dist/federation/portable-gateway-keys.test.mjs +5 -5
  26. package/dist/federation/portable-inbox.test.mjs +4 -4
  27. package/dist/federation/portable-parse-uri.test.mjs +1 -1
  28. package/dist/federation/portable-route-activity.test.mjs +2 -2
  29. package/dist/federation/portable.test.mjs +3 -3
  30. package/dist/federation/send.test.mjs +3 -3
  31. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  32. package/dist/federation/tasks/tasks.test.mjs +2 -2
  33. package/dist/federation/temporal.test.mjs +1 -1
  34. package/dist/federation/webfinger.test.mjs +1 -1
  35. package/dist/{federation-BtPz9sr3.cjs → federation-DkIcc4TV.cjs} +4 -4
  36. package/dist/{http-CeVcKQMZ.cjs → http-DWIArxRV.cjs} +6 -5
  37. package/dist/{http-rH230xCD.js → http-DnJvGLuL.js} +6 -5
  38. package/dist/{http-BSARoDPh.mjs → http-G2ORncQt.mjs} +4 -4
  39. package/dist/{inbox-BdZenpZQ.mjs → inbox-WfHbmNbc.mjs} +2 -2
  40. package/dist/{kv-cache-BpGIONmd.cjs → kv-cache-C7b-sBZL.cjs} +1 -1
  41. package/dist/{kv-cache-Cxn7pNMx.mjs → kv-cache-C9jAD4VW.mjs} +1 -1
  42. package/dist/{kv-cache-CNfNI_95.js → kv-cache-CSJwIUzA.js} +1 -1
  43. package/dist/{ld-DJZrjNuN.mjs → ld-CKWvh95H.mjs} +24 -5
  44. package/dist/{metrics-DtxsYIkN.mjs → metrics-Og1y_3kX.mjs} +1 -1
  45. package/dist/{middleware-DyEjt33n.mjs → middleware-BLnbBpsz.mjs} +1 -1
  46. package/dist/{middleware-DblGj642.mjs → middleware-CcNRQv7R.mjs} +104 -104
  47. package/dist/{middleware-DDvck2q9.js → middleware-ClfuKN0B.js} +4 -4
  48. package/dist/mod.cjs +5 -5
  49. package/dist/mod.js +5 -5
  50. package/dist/nodeinfo/handler.test.mjs +1 -1
  51. package/dist/{owner-2vfqhUJw.mjs → owner-DxVC0b0R.mjs} +4 -4
  52. package/dist/{portable-collection-Cs--KD5A.cjs → portable-collection-8BzIIWJb.cjs} +3 -2
  53. package/dist/{portable-collection-B7AQ_dW7.js → portable-collection-Bz3Zn527.js} +3 -2
  54. package/dist/{portable-collection-DKJwGO8S.mjs → portable-collection-pWL8BrQk.mjs} +2 -2
  55. package/dist/{portable-key-DXGepvtD.mjs → portable-key-BGmzMBYm.mjs} +1 -1
  56. package/dist/portable-verifier-CPA86vIP.js +22 -0
  57. package/dist/portable-verifier-DiLU8c9T.cjs +26 -0
  58. package/dist/{proof-DW0FK6Cp.mjs → proof-Cgvg3rEH.mjs} +5 -5
  59. package/dist/{send-CqsocpvF.mjs → send-DheMZ6fh.mjs} +3 -3
  60. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  61. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  62. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  63. package/dist/sig/compound-proof.test.mjs +2 -2
  64. package/dist/sig/http.test.mjs +2 -2
  65. package/dist/sig/key.test.mjs +1 -1
  66. package/dist/sig/ld.test.mjs +1 -1
  67. package/dist/sig/mitra-receive-interop.test.mjs +4 -4
  68. package/dist/sig/mitra-send-interop.test.mjs +3 -3
  69. package/dist/sig/mod.cjs +2 -2
  70. package/dist/sig/mod.js +2 -2
  71. package/dist/sig/owner.test.mjs +1 -1
  72. package/dist/sig/portable-collection.test.mjs +1 -1
  73. package/dist/sig/portable-interop.test.mjs +3 -3
  74. package/dist/sig/portable-key.test.mjs +5 -5
  75. package/dist/sig/proof.test.mjs +3 -3
  76. package/dist/sig/tootik-request-interop.test.mjs +4 -4
  77. package/dist/sig/tootik-send-interop.test.mjs +3 -3
  78. package/dist/sig/verification.test.mjs +3 -3
  79. package/dist/{temporal-Dm2E1-vs.mjs → temporal-B7odHbLs.mjs} +1 -1
  80. package/dist/testing/kv.test.mjs +1 -1
  81. package/dist/{transformers-DAtXl_Kc.js → transformers-BlJ53iKs.js} +3 -2
  82. package/dist/{transformers-BalCrSsr.cjs → transformers-aIK89ibB.cjs} +3 -2
  83. package/dist/utils/docloader.test.mjs +2 -2
  84. package/dist/utils/kv-cache.test.mjs +1 -1
  85. package/dist/utils/mod.cjs +1 -1
  86. package/dist/utils/mod.js +1 -1
  87. package/dist/utils/portable-verifier.test.d.mts +2 -0
  88. package/dist/utils/portable-verifier.test.mjs +126 -0
  89. package/package.json +6 -6
@@ -2,9 +2,9 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { d as isPortableUri } from "./portable-key-id-Ca30-hOa.mjs";
5
- import { n as version, t as name } from "./deno-ksnVeCA7.mjs";
6
- import { n as getDurationMs, r as getFederationMetrics } from "./metrics-DtxsYIkN.mjs";
7
- import { r as doubleKnockScoped } from "./http-BSARoDPh.mjs";
5
+ import { n as version, t as name } from "./deno-CRpGtqm6.mjs";
6
+ import { n as getDurationMs, r as getFederationMetrics } from "./metrics-Og1y_3kX.mjs";
7
+ import { r as doubleKnockScoped } from "./http-G2ORncQt.mjs";
8
8
  import { getLogger } from "@logtape/logtape";
9
9
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
10
10
  import { FetchError, UrlError, canonicalizePortableUri, getFe34Origin, isGatewayUrl, toCompatibleEf61Id } from "@fedify/vocab-runtime";
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
- import { a as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-BoNAYSHt.mjs";
6
+ import { a as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-CxRUa-wY.mjs";
7
7
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/sig/compound-proof-discovery.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
- import { a as inspectCompoundPortableObjectApplicability, i as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-BoNAYSHt.mjs";
6
+ import { a as inspectCompoundPortableObjectApplicability, i as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-CxRUa-wY.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  //#region src/sig/compound-proof-producer.test.ts
9
9
  const portableId = "ap+ef61://did:key:z6MkAlice/objects/1";
@@ -4,9 +4,9 @@ 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-DW0FK6Cp.mjs";
7
+ import { l as verifyPortableObjectProofPolicy, o as verifyMapLocalProof } from "../proof-Cgvg3rEH.mjs";
8
8
  import { n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
9
- import { a as inspectCompoundPortableObjectApplicability, o as verifyCompoundPortableObjectProofs, s as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-BoNAYSHt.mjs";
9
+ import { a as inspectCompoundPortableObjectApplicability, o as verifyCompoundPortableObjectProofs, s as verifyCompoundProofDocuments, t as containsCompoundPortableObject } from "../compound-proof-CxRUa-wY.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";
@@ -6,9 +6,9 @@ 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-DW0FK6Cp.mjs";
9
+ import { a as signObject, d as verifyProof } from "../proof-Cgvg3rEH.mjs";
10
10
  import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
11
- import { s as verifyCompoundProofDocuments } from "../compound-proof-BoNAYSHt.mjs";
11
+ import { s as verifyCompoundProofDocuments } from "../compound-proof-CxRUa-wY.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";
@@ -12,8 +12,8 @@ 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 { y as exportJwk } from "../ld-DJZrjNuN.mjs";
16
- import { a as formatRfc9421SignatureParameters, c as parseRfc9421SignatureInput, d as timingSafeEqual, i as formatRfc9421Signature, l as selectRequestSignature, m as verifyRequestDetailed, n as doubleKnock, o as listRequestSignatures, p as verifyRequest, r as doubleKnockScoped, s as parseRfc9421Signature, t as createRfc9421SignatureBase, u as signRequest } from "../http-BSARoDPh.mjs";
15
+ import { y as exportJwk } from "../ld-CKWvh95H.mjs";
16
+ import { a as formatRfc9421SignatureParameters, c as parseRfc9421SignatureInput, d as timingSafeEqual, i as formatRfc9421Signature, l as selectRequestSignature, m as verifyRequestDetailed, n as doubleKnock, o as listRequestSignatures, p as verifyRequest, r as doubleKnockScoped, s as parseRfc9421Signature, t as createRfc9421SignatureBase, u as signRequest } from "../http-G2ORncQt.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-N2opu4-3.mjs";
19
19
  import { configure, reset } from "@logtape/logtape";
@@ -8,7 +8,7 @@ import "../std__assert-DvMDRPes.mjs";
8
8
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
9
9
  import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { C as generateCryptoKeyPair, S as fetchKeyDetailed, T as validateCryptoKey, _ as wrapContextLoaderForJsonLd, w as importJwk, x as fetchKey, y as exportJwk } from "../ld-DJZrjNuN.mjs";
11
+ import { C as generateCryptoKeyPair, S as fetchKeyDetailed, T as validateCryptoKey, _ as wrapContextLoaderForJsonLd, w as importJwk, x as fetchKey, y as exportJwk } from "../ld-CKWvh95H.mjs";
12
12
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
13
13
  import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
14
14
  import { FetchError, UrlError, exportDidKey, getDocumentLoader } from "@fedify/vocab-runtime";
@@ -8,7 +8,7 @@ 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 { C as generateCryptoKeyPair, 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-DJZrjNuN.mjs";
11
+ import { C as generateCryptoKeyPair, 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-CKWvh95H.mjs";
12
12
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
13
13
  import { CryptographicKey } from "@fedify/vocab";
14
14
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -5,10 +5,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
- import { c as verifyPortableObjectProof } from "../proof-DW0FK6Cp.mjs";
9
- import { m as verifyRequestDetailed } from "../http-BSARoDPh.mjs";
10
- import { o as createFederation } from "../middleware-DblGj642.mjs";
11
- import { t as doesActorOwnKey } from "../owner-2vfqhUJw.mjs";
8
+ import { c as verifyPortableObjectProof } from "../proof-Cgvg3rEH.mjs";
9
+ import { m as verifyRequestDetailed } from "../http-G2ORncQt.mjs";
10
+ import { o as createFederation } from "../middleware-CcNRQv7R.mjs";
11
+ import { t as doesActorOwnKey } from "../owner-DxVC0b0R.mjs";
12
12
  import { Create, Person } from "@fedify/vocab";
13
13
  import { canonicalizePortableUri, decodeMultibase, importDidKey } from "@fedify/vocab-runtime";
14
14
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -4,9 +4,9 @@ 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 { c as verifyPortableObjectProof } from "../proof-DW0FK6Cp.mjs";
8
- import { m as verifyRequestDetailed } from "../http-BSARoDPh.mjs";
9
- import { t as doesActorOwnKey } from "../owner-2vfqhUJw.mjs";
7
+ import { c as verifyPortableObjectProof } from "../proof-Cgvg3rEH.mjs";
8
+ import { m as verifyRequestDetailed } from "../http-G2ORncQt.mjs";
9
+ import { t as doesActorOwnKey } from "../owner-DxVC0b0R.mjs";
10
10
  import { Create } from "@fedify/vocab";
11
11
  import { canonicalizePortableUri, decodeMultibase, fromCompatibleEf61Id, importDidKey } from "@fedify/vocab-runtime";
12
12
  import { 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-CeVcKQMZ.cjs");
4
- const require_portable_collection = require("../portable-collection-Cs--KD5A.cjs");
3
+ const require_http = require("../http-DWIArxRV.cjs");
4
+ const require_portable_collection = require("../portable-collection-8BzIIWJb.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-rH230xCD.js";
4
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-B7AQ_dW7.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-DnJvGLuL.js";
4
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-Bz3Zn527.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-2vfqhUJw.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DxVC0b0R.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,7 +2,7 @@ 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-DKJwGO8S.mjs";
5
+ import { t as verifyPortableObject } from "../portable-collection-pWL8BrQk.mjs";
6
6
  import { Collection, CollectionPage, Note, OrderedCollection, Person, traverseCollection } from "@fedify/vocab";
7
7
  import { FetchError, encodeMultibase, exportDidKey, preloadedContexts } from "@fedify/vocab-runtime";
8
8
  import { test } from "@fedify/fixture";
@@ -4,9 +4,9 @@ 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 { c as verifyPortableObjectProof, d as verifyProof } from "../proof-DW0FK6Cp.mjs";
8
- import { n as getKeyOwner } from "../owner-2vfqhUJw.mjs";
9
- import { t as verifyPortableObject } from "../portable-collection-DKJwGO8S.mjs";
7
+ import { c as verifyPortableObjectProof, d as verifyProof } from "../proof-Cgvg3rEH.mjs";
8
+ import { n as getKeyOwner } from "../owner-DxVC0b0R.mjs";
9
+ import { t as verifyPortableObject } from "../portable-collection-pWL8BrQk.mjs";
10
10
  import { Application, DataIntegrityProof, lookupObject } from "@fedify/vocab";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  //#region test-vectors/fep-ef61/tootik-v0.25.4/actor.json
@@ -2,12 +2,12 @@ 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 { S as fetchKeyDetailed, h as verifyJsonLd, p as signJsonLd, x as fetchKey } from "../ld-DJZrjNuN.mjs";
6
- import { d as verifyProof, r as createProof } from "../proof-DW0FK6Cp.mjs";
7
- import { n as resolvePortableActorKey } from "../portable-key-DXGepvtD.mjs";
8
- import { m as verifyRequestDetailed, p as verifyRequest, u as signRequest } from "../http-BSARoDPh.mjs";
5
+ import { S as fetchKeyDetailed, h as verifyJsonLd, p as signJsonLd, x as fetchKey } from "../ld-CKWvh95H.mjs";
6
+ import { d as verifyProof, r as createProof } from "../proof-Cgvg3rEH.mjs";
7
+ import { n as resolvePortableActorKey } from "../portable-key-BGmzMBYm.mjs";
8
+ import { m as verifyRequestDetailed, p as verifyRequest, u as signRequest } from "../http-G2ORncQt.mjs";
9
9
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
10
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-2vfqhUJw.mjs";
10
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DxVC0b0R.mjs";
11
11
  import { t as KvKeyCache } from "../keycache-N2opu4-3.mjs";
12
12
  import { Create, CryptographicKey, Multikey, Note, Person } from "@fedify/vocab";
13
13
  import { FetchError, encodeMultibase, exportDidKey, exportSpki, parseIri, preloadedContexts } from "@fedify/vocab-runtime";
@@ -11,10 +11,10 @@ import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
11
11
  import { t as assert } from "../assert-D1Eafmd_.mjs";
12
12
  import { a as verificationObservation } from "../verification-Dpfcw8ml.mjs";
13
13
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
14
- import { a as signObject, c as verifyPortableObjectProof, d as verifyProof, i as hasProofLike, o as verifyMapLocalProof, r as createProof, s as verifyObject } from "../proof-DW0FK6Cp.mjs";
15
- import { p as verifyRequest } from "../http-BSARoDPh.mjs";
14
+ import { a as signObject, c as verifyPortableObjectProof, d as verifyProof, i as hasProofLike, o as verifyMapLocalProof, r as createProof, s as verifyObject } from "../proof-Cgvg3rEH.mjs";
15
+ import { p as verifyRequest } from "../http-G2ORncQt.mjs";
16
16
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
17
- import { n as getAuthenticatedDocumentLoader } from "../docloader-BhVNi06k.mjs";
17
+ import { n as getAuthenticatedDocumentLoader } from "../docloader-CZtA3Qjh.mjs";
18
18
  import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place, Translation } from "@fedify/vocab";
19
19
  import { decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
20
20
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -5,10 +5,10 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
- import { c as verifyPortableObjectProof } from "../proof-DW0FK6Cp.mjs";
9
- import { m as verifyRequestDetailed } from "../http-BSARoDPh.mjs";
10
- import { o as createFederation } from "../middleware-DblGj642.mjs";
11
- import { t as doesActorOwnKey } from "../owner-2vfqhUJw.mjs";
8
+ import { c as verifyPortableObjectProof } from "../proof-Cgvg3rEH.mjs";
9
+ import { m as verifyRequestDetailed } from "../http-G2ORncQt.mjs";
10
+ import { o as createFederation } from "../middleware-CcNRQv7R.mjs";
11
+ import { t as doesActorOwnKey } from "../owner-DxVC0b0R.mjs";
12
12
  import { Follow, Person } from "@fedify/vocab";
13
13
  import { mockDocumentLoader, test } from "@fedify/fixture";
14
14
  import { encodeHex } from "byte-encodings/hex";
@@ -4,9 +4,9 @@ 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 { c as verifyPortableObjectProof } from "../proof-DW0FK6Cp.mjs";
8
- import { m as verifyRequestDetailed } from "../http-BSARoDPh.mjs";
9
- import { t as doesActorOwnKey } from "../owner-2vfqhUJw.mjs";
7
+ import { c as verifyPortableObjectProof } from "../proof-Cgvg3rEH.mjs";
8
+ import { m as verifyRequestDetailed } from "../http-G2ORncQt.mjs";
9
+ import { t as doesActorOwnKey } from "../owner-DxVC0b0R.mjs";
10
10
  import { Create } from "@fedify/vocab";
11
11
  import { decodeMultibase, importDidKey } from "@fedify/vocab-runtime";
12
12
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -2,9 +2,9 @@ import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { a as verificationObservation } from "../verification-Dpfcw8ml.mjs";
5
- import { h as verifyJsonLd, p as signJsonLd } from "../ld-DJZrjNuN.mjs";
6
- import { a as signObject, s as verifyObject } from "../proof-DW0FK6Cp.mjs";
7
- import { m as verifyRequestDetailed, u as signRequest } from "../http-BSARoDPh.mjs";
5
+ import { h as verifyJsonLd, p as signJsonLd } from "../ld-CKWvh95H.mjs";
6
+ import { a as signObject, s as verifyObject } from "../proof-Cgvg3rEH.mjs";
7
+ import { m as verifyRequestDetailed, u as signRequest } from "../http-G2ORncQt.mjs";
8
8
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
9
9
  import { Activity, Create, CryptographicKey, Multikey } from "@fedify/vocab";
10
10
  import { FetchError } from "@fedify/vocab-runtime";
@@ -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-DJZrjNuN.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-CKWvh95H.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-DblGj642.mjs";
9
+ import { o as createFederation } from "../middleware-CcNRQv7R.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();
@@ -1,5 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
+ import { t as getDefaultPortableObjectVerifier } from "./portable-verifier-CPA86vIP.js";
3
4
  import { getLogger } from "@logtape/logtape";
4
5
  //#region src/compat/transformers.ts
5
6
  const logger = getLogger([
@@ -29,7 +30,7 @@ function autoIdAssigner(activity, context) {
29
30
  if (activity.id != null) return activity;
30
31
  const id = new URL(`/#${activity.constructor.name}/${crypto.randomUUID()}`, context.origin);
31
32
  logger.warn("As the activity to send does not have an id, a new id {id} has been generated for it. However, it is recommended to explicitly set the id for the activity.", { id: id.href });
32
- return activity.clone({ id });
33
+ return activity.clone({ id }, { verifyPortableObject: getDefaultPortableObjectVerifier(activity) });
33
34
  }
34
35
  /**
35
36
  * An activity transformer that dehydrates the actor property of an activity
@@ -78,7 +79,7 @@ function autoIdAssigner(activity, context) {
78
79
  */
79
80
  function actorDehydrator(activity, _context) {
80
81
  if (activity.actorIds.length < 1) return activity;
81
- return activity.clone({ actors: activity.actorIds });
82
+ return activity.clone({ actors: activity.actorIds }, { verifyPortableObject: getDefaultPortableObjectVerifier(activity) });
82
83
  }
83
84
  /**
84
85
  * Gets the default activity transformers that are applied to all outgoing
@@ -1,4 +1,5 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
+ const require_portable_verifier = require("./portable-verifier-DiLU8c9T.cjs");
2
3
  //#region src/compat/transformers.ts
3
4
  const logger = (0, require("@logtape/logtape").getLogger)([
4
5
  "fedify",
@@ -27,7 +28,7 @@ function autoIdAssigner(activity, context) {
27
28
  if (activity.id != null) return activity;
28
29
  const id = new URL(`/#${activity.constructor.name}/${crypto.randomUUID()}`, context.origin);
29
30
  logger.warn("As the activity to send does not have an id, a new id {id} has been generated for it. However, it is recommended to explicitly set the id for the activity.", { id: id.href });
30
- return activity.clone({ id });
31
+ return activity.clone({ id }, { verifyPortableObject: require_portable_verifier.getDefaultPortableObjectVerifier(activity) });
31
32
  }
32
33
  /**
33
34
  * An activity transformer that dehydrates the actor property of an activity
@@ -76,7 +77,7 @@ function autoIdAssigner(activity, context) {
76
77
  */
77
78
  function actorDehydrator(activity, _context) {
78
79
  if (activity.actorIds.length < 1) return activity;
79
- return activity.clone({ actors: activity.actorIds });
80
+ return activity.clone({ actors: activity.actorIds }, { verifyPortableObject: require_portable_verifier.getDefaultPortableObjectVerifier(activity) });
80
81
  }
81
82
  /**
82
83
  * Gets the default activity transformers that are applied to all outgoing
@@ -5,9 +5,9 @@ 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 { p as verifyRequest } from "../http-BSARoDPh.mjs";
8
+ import { p as verifyRequest } from "../http-G2ORncQt.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-DIJNHW-Y.mjs";
10
- import { n as getAuthenticatedDocumentLoader, t as createAuthenticatedDocumentLoader } from "../docloader-BhVNi06k.mjs";
10
+ import { n as getAuthenticatedDocumentLoader, t as createAuthenticatedDocumentLoader } from "../docloader-CZtA3Qjh.mjs";
11
11
  import { configure, reset } from "@logtape/logtape";
12
12
  import { FetchError, UrlError } from "@fedify/vocab-runtime";
13
13
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -1,7 +1,7 @@
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-Cxn7pNMx.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-C9jAD4VW.mjs";
5
5
  import { preloadedContexts } from "@fedify/vocab-runtime";
6
6
  import { deepStrictEqual, throws } from "node:assert";
7
7
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -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-BpGIONmd.cjs");
3
+ const require_kv_cache = require("../kv-cache-C7b-sBZL.cjs");
4
4
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
5
5
  exports.kvCache = require_kv_cache.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-CNfNI_95.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-CSJwIUzA.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
@@ -0,0 +1,2 @@
1
+ import { Temporal } from "temporal-polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
@@ -0,0 +1,126 @@
1
+ import "temporal-polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
+ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
+ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
7
+ import "../std__assert-DvMDRPes.mjs";
8
+ import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
9
+ import { D as getDefaultPortableObjectVerifier } from "../ld-CKWvh95H.mjs";
10
+ import { a as signObject, r as createProof } from "../proof-Cgvg3rEH.mjs";
11
+ import { n as ed25519PrivateKey, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
12
+ import { O as actorDehydrator, k as autoIdAssigner, n as FederationImpl } from "../middleware-CcNRQv7R.mjs";
13
+ import { configure, reset } from "@logtape/logtape";
14
+ import { Create, Follow, Note } from "@fedify/vocab";
15
+ import { mockDocumentLoader, test } from "@fedify/fixture";
16
+ //#region src/utils/portable-verifier.test.ts
17
+ const did = "did:key:z6Mkabc";
18
+ const compatibleNoteId = `https://gw.example/.well-known/apgateway/${did}/objects/1`;
19
+ const documentLoader = (url) => {
20
+ if (url !== compatibleNoteId) return mockDocumentLoader(url);
21
+ return Promise.resolve({
22
+ contextUrl: null,
23
+ documentUrl: url,
24
+ document: {
25
+ "@context": "https://www.w3.org/ns/activitystreams",
26
+ id: `ap://${did}/objects/1`,
27
+ type: "Note",
28
+ content: "Portable note"
29
+ }
30
+ });
31
+ };
32
+ function createRecordingVerifier() {
33
+ const verifier = Object.assign(async () => {
34
+ verifier.calls++;
35
+ return { verified: true };
36
+ }, { calls: 0 });
37
+ return verifier;
38
+ }
39
+ /**
40
+ * Runs the callback while collecting warnings of the category that `clone()`
41
+ * logs when it drops a default verifier.
42
+ */
43
+ async function collectPortableWarnings(callback) {
44
+ const records = [];
45
+ await reset();
46
+ try {
47
+ await configure({
48
+ sinks: { buffer: (record) => records.push(record) },
49
+ loggers: [{
50
+ category: [
51
+ "fedify",
52
+ "vocab",
53
+ "portable"
54
+ ],
55
+ sinks: ["buffer"]
56
+ }, {
57
+ category: ["logtape", "meta"],
58
+ sinks: []
59
+ }]
60
+ });
61
+ await callback();
62
+ } finally {
63
+ await reset();
64
+ }
65
+ return records;
66
+ }
67
+ /** Asserts that the object verifies its portable references with `verifier`. */
68
+ async function assertVerifiesWith(object, verifier) {
69
+ const before = verifier.calls;
70
+ assertInstanceOf(await object.getObject({
71
+ documentLoader,
72
+ contextLoader: mockDocumentLoader
73
+ }), Note);
74
+ assertEquals(verifier.calls, before + 1);
75
+ }
76
+ test("getDefaultPortableObjectVerifier()", () => {
77
+ const verifier = createRecordingVerifier();
78
+ assertStrictEquals(getDefaultPortableObjectVerifier(new Note({}, { verifyPortableObject: verifier })), verifier);
79
+ assertStrictEquals(getDefaultPortableObjectVerifier(new Note({})), void 0);
80
+ assertStrictEquals(getDefaultPortableObjectVerifier({}), void 0);
81
+ });
82
+ test("signObject() keeps the default portable object verifier", async () => {
83
+ const verifier = createRecordingVerifier();
84
+ const create = new Create({
85
+ id: new URL("https://example.com/activities/1"),
86
+ actor: new URL("https://example.com/users/alice"),
87
+ object: new URL(compatibleNoteId)
88
+ }, {
89
+ contextLoader: mockDocumentLoader,
90
+ verifyPortableObject: verifier
91
+ });
92
+ let signed;
93
+ assertEquals(await collectPortableWarnings(async () => {
94
+ await createProof(create, ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader });
95
+ signed = await signObject(create, ed25519PrivateKey, ed25519Multikey.id, {
96
+ contextLoader: mockDocumentLoader,
97
+ documentLoader: mockDocumentLoader
98
+ });
99
+ }), []);
100
+ assertInstanceOf(signed, Create);
101
+ await assertVerifiesWith(signed, verifier);
102
+ });
103
+ test("default activity transformers keep the default portable object verifier", async () => {
104
+ const context = new FederationImpl({ kv: new MemoryKvStore() }).createContext(new URL("http://example.com/"));
105
+ const verifier = createRecordingVerifier();
106
+ const follow = new Follow({
107
+ actor: new URL("http://example.com/actors/1"),
108
+ object: new URL(compatibleNoteId)
109
+ }, {
110
+ contextLoader: mockDocumentLoader,
111
+ verifyPortableObject: verifier
112
+ });
113
+ let assigned;
114
+ let dehydrated;
115
+ assertEquals(await collectPortableWarnings(() => {
116
+ assigned = autoIdAssigner(follow, context);
117
+ dehydrated = actorDehydrator(assigned.clone({ actor: new URL("http://example.com/actors/1") }, { verifyPortableObject: verifier }), context);
118
+ return Promise.resolve();
119
+ }), []);
120
+ assertInstanceOf(assigned, Follow);
121
+ assertInstanceOf(dehydrated, Follow);
122
+ await assertVerifiesWith(assigned, verifier);
123
+ await assertVerifiesWith(dehydrated, verifier);
124
+ });
125
+ //#endregion
126
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.4.6-dev.2628+2a78382f",
3
+ "version": "2.4.6-dev.2837+bb303087",
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.6-dev.2628+2a78382f",
155
- "@fedify/vocab": "2.4.6-dev.2628+2a78382f",
156
- "@fedify/webfinger": "2.4.6-dev.2628+2a78382f",
157
- "@fedify/vocab-runtime": "2.4.6-dev.2628+2a78382f"
154
+ "@fedify/uri-template": "2.4.6-dev.2837+bb303087",
155
+ "@fedify/vocab-runtime": "2.4.6-dev.2837+bb303087",
156
+ "@fedify/vocab": "2.4.6-dev.2837+bb303087",
157
+ "@fedify/webfinger": "2.4.6-dev.2837+bb303087"
158
158
  },
159
159
  "devDependencies": {
160
160
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -167,7 +167,7 @@
167
167
  "typescript": "^6.0.0",
168
168
  "wrangler": "^4.17.0",
169
169
  "@fedify/fixture": "2.0.0",
170
- "@fedify/vocab-tools": "^2.4.6-dev.2628+2a78382f"
170
+ "@fedify/vocab-tools": "^2.4.6-dev.2837+bb303087"
171
171
  },
172
172
  "scripts": {
173
173
  "build:self": "tsdown",