@fedify/fedify 2.4.6-dev.2837 → 2.4.6

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 (126) hide show
  1. package/dist/attachment-arrays-5yDbmjEb.mjs +16 -0
  2. package/dist/{builder-DYeeuJIZ.mjs → builder-CadJYxhX.mjs} +2 -2
  3. package/dist/callback-DPDs_dxC.d.mts +5280 -0
  4. package/dist/{client-3InDZbba.d.cts → client-DLHsPY7X.d.cts} +16 -0
  5. package/dist/{client-3InDZbba.d.ts → client-DLHsPY7X.d.ts} +16 -0
  6. package/dist/{client-5SIFzW3q.mjs → client-DU3owZBD.mjs} +86 -11
  7. package/dist/compat/attachment-arrays.test.d.mts +2 -0
  8. package/dist/compat/attachment-arrays.test.mjs +255 -0
  9. package/dist/compat/mod.d.cts +1 -1
  10. package/dist/compat/mod.d.ts +1 -1
  11. package/dist/compat/outgoing-jsonld.test.mjs +1 -1
  12. package/dist/compat/transformers.test.mjs +1 -1
  13. package/dist/{compound-proof-CxRUa-wY.mjs → compound-proof-CbWKyg2H.mjs} +2 -2
  14. package/dist/{context-D0gFIgev.d.cts → context-DUwicVx-.d.cts} +31 -14
  15. package/dist/{context-CVOOd9pD.d.ts → context-iGMHITvS.d.ts} +31 -14
  16. package/dist/{deno-CRpGtqm6.mjs → deno-BKSRi6w3.mjs} +1 -1
  17. package/dist/{docloader-CZtA3Qjh.mjs → docloader-BcDiJfFl.mjs} +2 -2
  18. package/dist/federation/attachment-responses.test.d.mts +2 -0
  19. package/dist/federation/attachment-responses.test.mjs +182 -0
  20. package/dist/federation/builder.test.mjs +1 -1
  21. package/dist/federation/compound-fanout.test.mjs +4 -4
  22. package/dist/federation/delivery-attachments.test.d.mts +2 -0
  23. package/dist/federation/delivery-attachments.test.mjs +288 -0
  24. package/dist/federation/handler-compound-proof.test.mjs +3 -3
  25. package/dist/federation/handler.test.mjs +206 -14
  26. package/dist/federation/hashlink-media.test.mjs +2 -2
  27. package/dist/federation/idempotency.test.mjs +2 -2
  28. package/dist/federation/inbox-report.test.mjs +5 -5
  29. package/dist/federation/inbox.test.mjs +1 -1
  30. package/dist/federation/metrics.test.mjs +1 -1
  31. package/dist/federation/middleware.test.mjs +1188 -13
  32. package/dist/federation/mod.cjs +1 -1
  33. package/dist/federation/mod.d.cts +3 -3
  34. package/dist/federation/mod.d.ts +3 -3
  35. package/dist/federation/mod.js +1 -1
  36. package/dist/federation/outgoing-proof.test.mjs +4 -4
  37. package/dist/federation/portable-actor.test.mjs +3 -3
  38. package/dist/federation/portable-chain.test.mjs +3 -3
  39. package/dist/federation/portable-collection.test.mjs +4 -4
  40. package/dist/federation/portable-delivery.test.mjs +2 -2
  41. package/dist/federation/portable-gateway-keys.test.mjs +5 -5
  42. package/dist/federation/portable-inbox.test.mjs +4 -4
  43. package/dist/federation/portable-parse-uri.test.mjs +1 -1
  44. package/dist/federation/portable-route-activity.test.mjs +2 -2
  45. package/dist/federation/portable.test.mjs +3 -3
  46. package/dist/federation/send.test.mjs +293 -3
  47. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  48. package/dist/federation/tasks/tasks.test.mjs +2 -2
  49. package/dist/federation/temporal.test.mjs +25 -1
  50. package/dist/federation/webfinger.test.mjs +1 -1
  51. package/dist/{federation-DkIcc4TV.cjs → federation-CM4nzbhO.cjs} +500 -144
  52. package/dist/{http-G2ORncQt.mjs → http-B6sfb5xN.mjs} +8 -6
  53. package/dist/{http-DnJvGLuL.js → http-BwgldAIk.js} +2798 -2629
  54. package/dist/{http-DWIArxRV.cjs → http-Tj9eQ_rd.cjs} +2634 -2453
  55. package/dist/{inbox-WfHbmNbc.mjs → inbox-B7NVkb8j.mjs} +2 -2
  56. package/dist/{key-VEL1QqHF.d.cts → key-CIdQA7Pc.d.cts} +5 -5
  57. package/dist/{key-CyCcut3h.d.ts → key-CjtBFzaE.d.ts} +5 -5
  58. package/dist/{kv-cache-CSJwIUzA.js → kv-cache-C-5yfTw-.js} +1 -1
  59. package/dist/{kv-cache-C9jAD4VW.mjs → kv-cache-CvWuigft.mjs} +1 -1
  60. package/dist/{kv-cache-C7b-sBZL.cjs → kv-cache-Vbq0yM7W.cjs} +1 -1
  61. package/dist/{ld-CKWvh95H.mjs → ld-BGnZDnia.mjs} +155 -22
  62. package/dist/ld-signature-D1tFSFK8.mjs +23 -0
  63. package/dist/{metrics-Og1y_3kX.mjs → metrics-DHUP4F1-.mjs} +1 -1
  64. package/dist/{middleware-BLnbBpsz.mjs → middleware-CUb31OGG.mjs} +1 -1
  65. package/dist/{middleware-ClfuKN0B.js → middleware-DX8wADUa.js} +451 -97
  66. package/dist/{middleware-CcNRQv7R.mjs → middleware-mRXKHq68.mjs} +355 -86
  67. package/dist/{mod-B1Qt5cQQ.d.ts → mod-B6s6hA4y.d.ts} +3 -3
  68. package/dist/{mod-ss0wBUH1.d.cts → mod-CJf5GcVD.d.cts} +3 -3
  69. package/dist/{mod-makPMVMg.d.cts → mod-CSlxqNto.d.cts} +1 -1
  70. package/dist/{mod-CpyjFA9s.d.ts → mod-D2DiA8u5.d.cts} +29 -7
  71. package/dist/{mod-BTxJG7ZH.d.cts → mod-DKRf1FLm.d.ts} +29 -7
  72. package/dist/{mod-B5COx5Wd.d.ts → mod-Dqu6Dl1k.d.ts} +1 -1
  73. package/dist/mod.cjs +5 -5
  74. package/dist/mod.d.cts +8 -8
  75. package/dist/mod.d.ts +8 -8
  76. package/dist/mod.js +5 -5
  77. package/dist/nodeinfo/client.test.mjs +432 -4
  78. package/dist/nodeinfo/handler.test.mjs +1 -1
  79. package/dist/nodeinfo/mod.cjs +1 -1
  80. package/dist/nodeinfo/mod.d.cts +1 -1
  81. package/dist/nodeinfo/mod.d.ts +1 -1
  82. package/dist/nodeinfo/mod.js +1 -1
  83. package/dist/{outgoing-jsonld-4IJqPYos.mjs → outgoing-jsonld-Dsca6G_Y.mjs} +35 -4
  84. package/dist/{owner-DxVC0b0R.mjs → owner-DEiBiiqR.mjs} +3 -3
  85. package/dist/{portable-collection-8BzIIWJb.cjs → portable-collection--h11WDIi.cjs} +1 -1
  86. package/dist/{portable-collection-pWL8BrQk.mjs → portable-collection-D0-tInp2.mjs} +2 -2
  87. package/dist/{portable-collection-Bz3Zn527.js → portable-collection-M6d5I5JQ.js} +1 -1
  88. package/dist/{portable-key-BGmzMBYm.mjs → portable-key-CyVJpWWJ.mjs} +1 -1
  89. package/dist/{proof-Cgvg3rEH.mjs → proof-C4pwAF2k.mjs} +29 -9
  90. package/dist/{send-DheMZ6fh.mjs → send-ivzJCtb-.mjs} +100 -22
  91. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  92. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  93. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  94. package/dist/sig/compound-proof.test.mjs +3 -3
  95. package/dist/sig/http.test.mjs +2 -2
  96. package/dist/sig/key-types.test.d.mts +162 -0
  97. package/dist/sig/key-types.test.mjs +8 -0
  98. package/dist/sig/key.test.mjs +1 -1
  99. package/dist/sig/ld.test.mjs +572 -7
  100. package/dist/sig/mitra-receive-interop.test.mjs +4 -4
  101. package/dist/sig/mitra-send-interop.test.mjs +3 -3
  102. package/dist/sig/mod.cjs +2 -2
  103. package/dist/sig/mod.d.cts +3 -3
  104. package/dist/sig/mod.d.ts +3 -3
  105. package/dist/sig/mod.js +2 -2
  106. package/dist/sig/owner.test.mjs +1 -1
  107. package/dist/sig/portable-collection.test.mjs +1 -1
  108. package/dist/sig/portable-interop.test.mjs +3 -3
  109. package/dist/sig/portable-key.test.mjs +5 -5
  110. package/dist/sig/proof.test.mjs +100 -6
  111. package/dist/sig/tootik-request-interop.test.mjs +4 -4
  112. package/dist/sig/tootik-send-interop.test.mjs +3 -3
  113. package/dist/sig/verification.test.mjs +3 -3
  114. package/dist/{temporal-B7odHbLs.mjs → temporal-B6OlxwK_.mjs} +3 -5
  115. package/dist/testing/kv.test.mjs +1 -1
  116. package/dist/testing/mod.d.mts +3 -5045
  117. package/dist/{types-DUjZb4i6.js → types-BbCbtwZp.js} +86 -11
  118. package/dist/{types-hKCCjii0.cjs → types-C8gac_AD.cjs} +85 -10
  119. package/dist/utils/docloader.test.mjs +2 -2
  120. package/dist/utils/kv-cache.test.mjs +1 -1
  121. package/dist/utils/mod.cjs +1 -1
  122. package/dist/utils/mod.d.cts +1 -1
  123. package/dist/utils/mod.d.ts +1 -1
  124. package/dist/utils/mod.js +1 -1
  125. package/dist/utils/portable-verifier.test.mjs +3 -3
  126. package/package.json +6 -6
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-VEL1QqHF.cjs";
2
+ import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-CIdQA7Pc.cjs";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BF0L9cMt.cjs";
4
- import { a as CreateSignatureOptions, c as VerifySignatureOptions, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyPortableObject, l as attachSignature, m as verifyJsonLd, n as VerifyPortableObjectOptions, o as SignJsonLdOptions, p as signJsonLd, r as VerifyPortableObjectResult, s as VerifyJsonLdOptions, t as VerifyPortableObjectFailureReason, u as createSignature } from "../mod-BTxJG7ZH.cjs";
5
- export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, 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 };
4
+ import { _ as verifySignature, a as VerifyPortableObjectResult, c as SignJsonLdOptions, d as attachSignature, f as createSignature, g as verifyJsonLd, h as signJsonLd, i as VerifyPortableObjectOptions, l as VerifyJsonLdOptions, m as hasSignatureLike, n as CryptoKeyPairLike, o as verifyPortableObject, p as detachSignature, r as VerifyPortableObjectFailureReason, s as CreateSignatureOptions, t as CryptoKeyLike, u as VerifySignatureOptions } from "../mod-D2DiA8u5.cjs";
5
+ export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, CryptoKeyLike, CryptoKeyPairLike, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, 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 };
package/dist/sig/mod.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-CyCcut3h.js";
2
+ import { A as AcceptSignatureParameters, B as VerifyPortableObjectProofOptions, C as VerifyRequestDetailedResult, D as verifyRequest, E as signRequest, F as validateAcceptSignature, G as signObject, H as VerifyProofOptions, I as CreateProofOptions, J as verifyProof, K as verifyObject, L as SignObjectOptions, M as formatAcceptSignature, N as fulfillAcceptSignature, O as verifyRequestDetailed, P as parseAcceptSignature, R as VerifyObjectOptions, S as SignRequestOptions, T as VerifyRequestOptions, U as createProof, V as VerifyPortableObjectProofResult, W as hasProofLike, a as KeyCache, b as HttpMessageSignaturesSpecDeterminer, c as fetchKeyDetailed, i as FetchKeyResult, j as FulfillAcceptSignatureResult, k as AcceptSignatureMember, l as generateCryptoKeyPair, n as FetchKeyErrorResult, o as exportJwk, q as verifyPortableObjectProof, r as FetchKeyOptions, s as fetchKey, t as FetchKeyDetailedResult, u as importJwk, w as VerifyRequestFailureReason, x as Rfc9421SignRequestOptions, y as HttpMessageSignaturesSpec, z as VerifyPortableObjectProofFailureReason } from "../key-CjtBFzaE.js";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BSzr5-I8.js";
4
- import { a as CreateSignatureOptions, c as VerifySignatureOptions, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyPortableObject, l as attachSignature, m as verifyJsonLd, n as VerifyPortableObjectOptions, o as SignJsonLdOptions, p as signJsonLd, r as VerifyPortableObjectResult, s as VerifyJsonLdOptions, t as VerifyPortableObjectFailureReason, u as createSignature } from "../mod-CpyjFA9s.js";
5
- export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, 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 };
4
+ import { _ as verifySignature, a as VerifyPortableObjectResult, c as SignJsonLdOptions, d as attachSignature, f as createSignature, g as verifyJsonLd, h as signJsonLd, i as VerifyPortableObjectOptions, l as VerifyJsonLdOptions, m as hasSignatureLike, n as CryptoKeyPairLike, o as verifyPortableObject, p as detachSignature, r as VerifyPortableObjectFailureReason, s as CreateSignatureOptions, t as CryptoKeyLike, u as VerifySignatureOptions } from "../mod-DKRf1FLm.js";
5
+ export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, CryptoKeyLike, CryptoKeyPairLike, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, 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 };
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-DnJvGLuL.js";
4
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-Bz3Zn527.js";
3
+ import { A as hasSignatureLike, E as createSignature, H as fetchKeyDetailed, I as verifyJsonLd, L as verifySignature, O as detachSignature, P as signJsonLd, U as generateCryptoKeyPair, V as fetchKey, W as importJwk, _ as verifyObject, a as signRequest, c as verifyRequestDetailed, gt as validateAcceptSignature, h as signObject, ht as parseAcceptSignature, m as hasProofLike, mt as fulfillAcceptSignature, p as createProof, pt as formatAcceptSignature, s as verifyRequest, v as verifyPortableObjectProof, w as attachSignature, x as verifyProof, z as exportJwk } from "../http-BwgldAIk.js";
4
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-M6d5I5JQ.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-DxVC0b0R.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DEiBiiqR.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-pWL8BrQk.mjs";
5
+ import { t as verifyPortableObject } from "../portable-collection-D0-tInp2.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-Cgvg3rEH.mjs";
8
- import { n as getKeyOwner } from "../owner-DxVC0b0R.mjs";
9
- import { t as verifyPortableObject } from "../portable-collection-pWL8BrQk.mjs";
7
+ import { c as verifyPortableObjectProof, d as verifyProof } from "../proof-C4pwAF2k.mjs";
8
+ import { n as getKeyOwner } from "../owner-DEiBiiqR.mjs";
9
+ import { t as verifyPortableObject } from "../portable-collection-D0-tInp2.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-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";
5
+ import { C as fetchKey, _ as verifyJsonLd, h as signJsonLd, w as fetchKeyDetailed } from "../ld-BGnZDnia.mjs";
6
+ import { d as verifyProof, r as createProof } from "../proof-C4pwAF2k.mjs";
7
+ import { n as resolvePortableActorKey } from "../portable-key-CyVJpWWJ.mjs";
8
+ import { m as verifyRequestDetailed, p as verifyRequest, u as signRequest } from "../http-B6sfb5xN.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-DxVC0b0R.mjs";
10
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DEiBiiqR.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";
@@ -10,12 +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 { a as verificationObservation } from "../verification-Dpfcw8ml.mjs";
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-Cgvg3rEH.mjs";
15
- import { p as verifyRequest } from "../http-G2ORncQt.mjs";
13
+ import { c as detachSignature, h as signJsonLd, v as verifySignature } from "../ld-BGnZDnia.mjs";
14
+ import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-Dsca6G_Y.mjs";
15
+ import { a as signObject, c as verifyPortableObjectProof, d as verifyProof, i as hasProofLike, o as verifyMapLocalProof, r as createProof, s as verifyObject } from "../proof-C4pwAF2k.mjs";
16
+ import { p as verifyRequest } from "../http-B6sfb5xN.mjs";
16
17
  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-CZtA3Qjh.mjs";
18
- import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place, Translation } from "@fedify/vocab";
18
+ import { n as getAuthenticatedDocumentLoader } from "../docloader-BcDiJfFl.mjs";
19
+ import { Create, DataIntegrityProof, Document, Multikey, Note, OrderedCollectionPage, PUBLIC_COLLECTION, Place, Translation } from "@fedify/vocab";
19
20
  import { decodeMultibase, encodeMultibase, exportDidKey, exportMultibaseKey, formatIri, importMultibaseKey, parseIri } from "@fedify/vocab-runtime";
20
21
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
21
22
  import { decodeHex } from "byte-encodings/hex";
@@ -104,7 +105,7 @@ test("createProof()", async () => {
104
105
  assertEquals(proof.cryptosuite, "eddsa-jcs-2022");
105
106
  assertEquals(proof.verificationMethodId, ed25519PublicKey.id);
106
107
  assertEquals(proof.proofPurpose, "assertionMethod");
107
- assertEquals(proof.proofValue, decodeHex("0e63238fdb50a979a7fbd906b471d328a03504de7aa3a0409fad1500b85d6fecafa2223bfde21ba2eac9446d36f6583c45cb55a98017a0a6a275f50262a4ea06"));
108
+ assertEquals(proof.proofValue, decodeHex("471e7aefd4ce4be462d1d7e1194ccfe3c177e10986740e47b60330e1655a0242202e47d3fa6599a83bf9f989c05a1507907e3bbea44c6391243a8e5c29d8ba00"));
108
109
  assertEquals(proof.created, created);
109
110
  assertEquals(await verifyProof(await create.toJsonLd({
110
111
  format: "compact",
@@ -292,6 +293,71 @@ test("hasProofLike()", () => {
292
293
  proofPurpose: "assertionMethod"
293
294
  } }));
294
295
  });
296
+ test("collection serialization preserves cached object integrity proofs", async () => {
297
+ const options = {
298
+ documentLoader: mockDocumentLoader,
299
+ contextLoader: mockDocumentLoader
300
+ };
301
+ const source = await (await signObject(fep8b32TestVectorActivity, fep8b32TestVectorPrivateKey, fep8b32TestVectorKeyId, {
302
+ ...options,
303
+ created: Temporal.Instant.from("2023-02-24T23:36:38Z")
304
+ })).toJsonLd(options);
305
+ assertInstanceOf(await verifyObject(Create, source, options), Create);
306
+ const cached = await Create.fromJsonLd(source, options);
307
+ const json = await new OrderedCollectionPage({
308
+ id: new URL("https://server.example/outbox?page=1"),
309
+ items: [cached]
310
+ }).toJsonLd(options);
311
+ assertEquals(json.orderedItems[0], source);
312
+ assertEquals(await cached.toJsonLd(), source);
313
+ assertInstanceOf(await verifyObject(Create, json.orderedItems[0], options), Create);
314
+ const restored = await OrderedCollectionPage.fromJsonLd(json, options);
315
+ const items = await Array.fromAsync(restored.getItems(options));
316
+ assertEquals(items.length, 1);
317
+ assertEquals(await items[0].toJsonLd(), source);
318
+ });
319
+ test("signObject() migrates proofs from an older context", async () => {
320
+ const oldContext = [
321
+ "https://w3id.org/identity/v1",
322
+ "https://www.w3.org/ns/activitystreams",
323
+ "https://w3id.org/security/data-integrity/v1"
324
+ ];
325
+ const oldJson = await (await signObject(new Create({
326
+ id: new URL("https://example.com/activities/1"),
327
+ actor: new URL("https://example.com/users/alice")
328
+ }), ed25519PrivateKey, ed25519Multikey.id, {
329
+ contextLoader: mockDocumentLoader,
330
+ context: oldContext
331
+ })).toJsonLd({
332
+ format: "compact",
333
+ contextLoader: mockDocumentLoader,
334
+ context: oldContext
335
+ });
336
+ const json = await (await signObject(await Create.fromJsonLd(oldJson, {
337
+ contextLoader: mockDocumentLoader,
338
+ documentLoader: mockDocumentLoader
339
+ }), ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader })).toJsonLd({
340
+ format: "compact",
341
+ contextLoader: mockDocumentLoader
342
+ });
343
+ const proofs = Array.isArray(json.proof) ? json.proof : [json.proof];
344
+ assertEquals(proofs.length, 1);
345
+ assertEquals(proofs[0].verificationMethod, ed25519Multikey.id.href);
346
+ });
347
+ test("signObject() skips context comparison for proofless objects", async () => {
348
+ const activity = new Create({
349
+ id: new URL("https://example.com/activities/1"),
350
+ actor: new URL("https://example.com/users/alice")
351
+ });
352
+ let unformattedSerializations = 0;
353
+ const originalToJsonLd = activity.toJsonLd.bind(activity);
354
+ Object.defineProperty(activity, "toJsonLd", { value: async (options) => {
355
+ if (options?.format == null) unformattedSerializations++;
356
+ return await originalToJsonLd(options);
357
+ } });
358
+ await signObject(activity, ed25519PrivateKey, ed25519Multikey.id, { contextLoader: mockDocumentLoader });
359
+ assertEquals(unformattedSerializations, 0);
360
+ });
295
361
  test("verifyProof()", async () => {
296
362
  const cache = {};
297
363
  const options = {
@@ -1805,6 +1871,34 @@ test("verifyPortableObjectProof()", async (t) => {
1805
1871
  assertEquals(rejectedRecorder.getMeasurements("activitypub.signature.verification.duration").length, 0);
1806
1872
  });
1807
1873
  });
1874
+ test("signJsonLd() does not invalidate an existing proof", async () => {
1875
+ const options = {
1876
+ documentLoader: mockDocumentLoader,
1877
+ contextLoader: mockDocumentLoader
1878
+ };
1879
+ const note = new Note({
1880
+ id: new URL("https://example.com/notes/1"),
1881
+ attribution: new URL("https://example.com/users/alice"),
1882
+ content: "Hello"
1883
+ });
1884
+ const proof = await createProof(note, ed25519PrivateKey, ed25519PublicKey.id, options);
1885
+ const jsonLd = await note.toJsonLd({
1886
+ format: "compact",
1887
+ contextLoader: mockDocumentLoader
1888
+ });
1889
+ const withProof = {
1890
+ ...jsonLd,
1891
+ proof: await proof.toJsonLd({
1892
+ format: "compact",
1893
+ contextLoader: mockDocumentLoader,
1894
+ context: jsonLd["@context"]
1895
+ })
1896
+ };
1897
+ const signed = await signJsonLd(withProof, rsaPrivateKey2, rsaPublicKey2.id, options);
1898
+ assertEquals(signed["@context"], withProof["@context"]);
1899
+ assertEquals(await verifyProof(detachSignature(signed), proof, options), ed25519Multikey);
1900
+ assertEquals(await verifySignature(signed, options), rsaPublicKey2);
1901
+ });
1808
1902
  test("verifyObject()", async () => {
1809
1903
  const options = {
1810
1904
  documentLoader: mockDocumentLoader,
@@ -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-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";
8
+ import { c as verifyPortableObjectProof } from "../proof-C4pwAF2k.mjs";
9
+ import { m as verifyRequestDetailed } from "../http-B6sfb5xN.mjs";
10
+ import { o as createFederation } from "../middleware-mRXKHq68.mjs";
11
+ import { t as doesActorOwnKey } from "../owner-DEiBiiqR.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-Cgvg3rEH.mjs";
8
- import { m as verifyRequestDetailed } from "../http-G2ORncQt.mjs";
9
- import { t as doesActorOwnKey } from "../owner-DxVC0b0R.mjs";
7
+ import { c as verifyPortableObjectProof } from "../proof-C4pwAF2k.mjs";
8
+ import { m as verifyRequestDetailed } from "../http-B6sfb5xN.mjs";
9
+ import { t as doesActorOwnKey } from "../owner-DEiBiiqR.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-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";
5
+ import { _ as verifyJsonLd, h as signJsonLd } from "../ld-BGnZDnia.mjs";
6
+ import { a as signObject, s as verifyObject } from "../proof-C4pwAF2k.mjs";
7
+ import { m as verifyRequestDetailed, u as signRequest } from "../http-B6sfb5xN.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,15 +1,13 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-CKWvh95H.mjs";
4
+ import { l as getNormalizationContextLoader } from "./ld-BGnZDnia.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
+ import { normalizeDateTimeLiteral } from "@fedify/vocab-runtime/temporal";
6
7
  //#region src/federation/temporal.ts
7
8
  function isPlainObject(value) {
8
9
  return typeof value === "object" && value != null && !Array.isArray(value);
9
10
  }
10
- function normalizeDateTimeLiteral(value) {
11
- return value.substring(19).match(/[Z+-]/) ? value : value + "Z";
12
- }
13
11
  function isMalformedDateTimeLiteral(value) {
14
12
  if (typeof value !== "string") return false;
15
13
  try {
@@ -51,7 +49,7 @@ function hasMalformedExpandedQuestionClosedLiteral(value) {
51
49
  if (typeof literal === "boolean") return false;
52
50
  if (typeof literal !== "string") return false;
53
51
  if (value["@type"] !== XSD_DATE_TIME_IRI) return false;
54
- if (new Date(literal).toString() === "Invalid Date") return false;
52
+ if (new Date(literal).toString() === "Invalid Date" && new Date(normalizeDateTimeLiteral(literal)).toString() === "Invalid Date") return false;
55
53
  return isMalformedDateTimeLiteral(literal);
56
54
  }
57
55
  function hasMalformedExpandedDurationLiteral(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-CcNRQv7R.mjs";
9
+ import { o as createFederation } from "../middleware-mRXKHq68.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();