@fedify/fedify 2.5.0-dev.2687 → 2.5.0-dev.2726

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 (244) hide show
  1. package/dist/federation/mod.cjs +1 -1
  2. package/dist/federation/mod.js +1 -1
  3. package/dist/{federation-pFFwPyoZ.cjs → federation-C0zalE9W.cjs} +8 -3
  4. package/dist/{http-T7h9GBAN.js → http-BC5Bd3-E.js} +1 -1
  5. package/dist/{http-CXX-QPzs.cjs → http-Dqzgc4Rj.cjs} +1 -1
  6. package/dist/{kv-cache-EFcb1kkU.js → kv-cache-CQ0u0Ry0.js} +1 -1
  7. package/dist/{kv-cache-C6XX_fwz.cjs → kv-cache-ihEHdx1v.cjs} +1 -1
  8. package/dist/{middleware-Bj91r7r2.js → middleware-Bgm3A90j.js} +8 -3
  9. package/dist/mod.cjs +4 -4
  10. package/dist/mod.js +4 -4
  11. package/dist/{portable-collection-Do5QA2oy.js → portable-collection-DZ_XqNUM.js} +1 -1
  12. package/dist/{portable-collection-BOl9oKrt.cjs → portable-collection-nvog8lS6.cjs} +1 -1
  13. package/dist/sig/mod.cjs +2 -2
  14. package/dist/sig/mod.js +2 -2
  15. package/dist/utils/mod.cjs +1 -1
  16. package/dist/utils/mod.js +1 -1
  17. package/package.json +22 -9
  18. package/skills/fedify/SKILL.md +35 -0
  19. package/dist/accept-CPVqki78.mjs +0 -145
  20. package/dist/activity-listener-CELFAodc.mjs +0 -44
  21. package/dist/assert-D1Eafmd_.mjs +0 -23
  22. package/dist/assert_equals-Z6IcEbWU.mjs +0 -987
  23. package/dist/assert_exists-cffSpJ7X.mjs +0 -28
  24. package/dist/assert_false-CPdRnc3E.mjs +0 -23
  25. package/dist/assert_greater_or_equal-BlafOF4-.mjs +0 -31
  26. package/dist/assert_instance_of-mrXWWNY-.mjs +0 -37
  27. package/dist/assert_not_equals-CpPK2t89.mjs +0 -30
  28. package/dist/assert_rejects-CTptdYck.mjs +0 -39
  29. package/dist/assert_strict_equals-CYvBmkpC.mjs +0 -42
  30. package/dist/assert_throws-BYITOvPO.mjs +0 -74
  31. package/dist/assertion_error-B-cx0fFA.mjs +0 -31
  32. package/dist/audience-CHQ-FlLD.mjs +0 -95
  33. package/dist/builder-D1FP_5nQ.mjs +0 -911
  34. package/dist/circuit-breaker-XJ53md4S.mjs +0 -544
  35. package/dist/circuit-breaker-test-utils-DW6YC_Pe.mjs +0 -14
  36. package/dist/client-5SIFzW3q.mjs +0 -441
  37. package/dist/codec-C6rTrpIp.mjs +0 -147
  38. package/dist/collection-CnnP1UAv.mjs +0 -44
  39. package/dist/compat/outgoing-jsonld.test.d.mts +0 -2
  40. package/dist/compat/outgoing-jsonld.test.mjs +0 -257
  41. package/dist/compat/public-audience.test.d.mts +0 -2
  42. package/dist/compat/public-audience.test.mjs +0 -187
  43. package/dist/compat/secured-document.test.d.mts +0 -2
  44. package/dist/compat/secured-document.test.mjs +0 -58
  45. package/dist/compat/transformers.test.d.mts +0 -2
  46. package/dist/compat/transformers.test.mjs +0 -62
  47. package/dist/compound-proof-DSHhnOEW.mjs +0 -1019
  48. package/dist/context-LgGFFSz7.mjs +0 -146
  49. package/dist/deno-C50ikGBU.mjs +0 -8
  50. package/dist/dist-_geWsuaI.mjs +0 -189
  51. package/dist/docloader-BY-SEID0.mjs +0 -136
  52. package/dist/esm-BHXXx4Wx.mjs +0 -1233
  53. package/dist/exporter-DVG68ozH.mjs +0 -263
  54. package/dist/federation/audience.test.d.mts +0 -2
  55. package/dist/federation/audience.test.mjs +0 -130
  56. package/dist/federation/builder.test.d.mts +0 -2
  57. package/dist/federation/builder.test.mjs +0 -396
  58. package/dist/federation/circuit-breaker.test.d.mts +0 -2
  59. package/dist/federation/circuit-breaker.test.mjs +0 -1277
  60. package/dist/federation/collection.test.d.mts +0 -2
  61. package/dist/federation/collection.test.mjs +0 -21
  62. package/dist/federation/compound-fanout.test.d.mts +0 -2
  63. package/dist/federation/compound-fanout.test.mjs +0 -231
  64. package/dist/federation/handler-compound-proof.test.d.mts +0 -2
  65. package/dist/federation/handler-compound-proof.test.mjs +0 -384
  66. package/dist/federation/handler.test.d.mts +0 -2
  67. package/dist/federation/handler.test.mjs +0 -5445
  68. package/dist/federation/hashlink-media.test.d.mts +0 -2
  69. package/dist/federation/hashlink-media.test.mjs +0 -422
  70. package/dist/federation/idempotency.test.d.mts +0 -2
  71. package/dist/federation/idempotency.test.mjs +0 -207
  72. package/dist/federation/inbox-actorless.test.d.mts +0 -2
  73. package/dist/federation/inbox-actorless.test.mjs +0 -522
  74. package/dist/federation/inbox-authentication.test.d.mts +0 -2
  75. package/dist/federation/inbox-authentication.test.mjs +0 -220
  76. package/dist/federation/inbox-report.test.d.mts +0 -2
  77. package/dist/federation/inbox-report.test.mjs +0 -719
  78. package/dist/federation/inbox-view.test.d.mts +0 -2
  79. package/dist/federation/inbox-view.test.mjs +0 -369
  80. package/dist/federation/inbox.test.d.mts +0 -2
  81. package/dist/federation/inbox.test.mjs +0 -139
  82. package/dist/federation/keycache.test.d.mts +0 -2
  83. package/dist/federation/keycache.test.mjs +0 -337
  84. package/dist/federation/kv.test.d.mts +0 -2
  85. package/dist/federation/kv.test.mjs +0 -88
  86. package/dist/federation/metrics.test.d.mts +0 -2
  87. package/dist/federation/metrics.test.mjs +0 -634
  88. package/dist/federation/middleware.test.d.mts +0 -2
  89. package/dist/federation/middleware.test.mjs +0 -9314
  90. package/dist/federation/mq.test.d.mts +0 -2
  91. package/dist/federation/mq.test.mjs +0 -591
  92. package/dist/federation/negotiation.test.d.mts +0 -2
  93. package/dist/federation/negotiation.test.mjs +0 -18
  94. package/dist/federation/outbound-body.test.d.mts +0 -2
  95. package/dist/federation/outbound-body.test.mjs +0 -149
  96. package/dist/federation/outbound-capture.test.d.mts +0 -2
  97. package/dist/federation/outbound-capture.test.mjs +0 -394
  98. package/dist/federation/outbound-dispatch.test.d.mts +0 -2
  99. package/dist/federation/outbound-dispatch.test.mjs +0 -368
  100. package/dist/federation/outbound-document.test.d.mts +0 -2
  101. package/dist/federation/outbound-document.test.mjs +0 -171
  102. package/dist/federation/outbound-provenance.test.d.mts +0 -2
  103. package/dist/federation/outbound-provenance.test.mjs +0 -543
  104. package/dist/federation/outbound-report.test.d.mts +0 -2
  105. package/dist/federation/outbound-report.test.mjs +0 -5475
  106. package/dist/federation/outbound-workers.test.d.mts +0 -2
  107. package/dist/federation/outbound-workers.test.mjs +0 -64
  108. package/dist/federation/outbound-workflow.test.d.mts +0 -2
  109. package/dist/federation/outbound-workflow.test.mjs +0 -154
  110. package/dist/federation/outgoing-proof.test.d.mts +0 -2
  111. package/dist/federation/outgoing-proof.test.mjs +0 -933
  112. package/dist/federation/portable-actor.test.d.mts +0 -2
  113. package/dist/federation/portable-actor.test.mjs +0 -496
  114. package/dist/federation/portable-chain.test.d.mts +0 -2
  115. package/dist/federation/portable-chain.test.mjs +0 -370
  116. package/dist/federation/portable-collection.test.d.mts +0 -2
  117. package/dist/federation/portable-collection.test.mjs +0 -832
  118. package/dist/federation/portable-delivery.test.d.mts +0 -2
  119. package/dist/federation/portable-delivery.test.mjs +0 -845
  120. package/dist/federation/portable-gateway-keys.test.d.mts +0 -2
  121. package/dist/federation/portable-gateway-keys.test.mjs +0 -692
  122. package/dist/federation/portable-inbox.test.d.mts +0 -2
  123. package/dist/federation/portable-inbox.test.mjs +0 -1960
  124. package/dist/federation/portable-parse-uri.test.d.mts +0 -2
  125. package/dist/federation/portable-parse-uri.test.mjs +0 -348
  126. package/dist/federation/portable-route-activity.test.d.mts +0 -2
  127. package/dist/federation/portable-route-activity.test.mjs +0 -259
  128. package/dist/federation/portable.test.d.mts +0 -2
  129. package/dist/federation/portable.test.mjs +0 -1072
  130. package/dist/federation/retry.test.d.mts +0 -2
  131. package/dist/federation/retry.test.mjs +0 -42
  132. package/dist/federation/router.test.d.mts +0 -2
  133. package/dist/federation/router.test.mjs +0 -123
  134. package/dist/federation/send.test.d.mts +0 -2
  135. package/dist/federation/send.test.mjs +0 -1421
  136. package/dist/federation/tasks/codec.test.d.mts +0 -2
  137. package/dist/federation/tasks/codec.test.mjs +0 -302
  138. package/dist/federation/tasks/enqueue.test.d.mts +0 -2
  139. package/dist/federation/tasks/enqueue.test.mjs +0 -1095
  140. package/dist/federation/tasks/tasks.test.d.mts +0 -2
  141. package/dist/federation/tasks/tasks.test.mjs +0 -1229
  142. package/dist/federation/temporal.test.d.mts +0 -2
  143. package/dist/federation/temporal.test.mjs +0 -71
  144. package/dist/federation/webfinger.test.d.mts +0 -2
  145. package/dist/federation/webfinger.test.mjs +0 -944
  146. package/dist/http-BXbQQZDM.mjs +0 -1449
  147. package/dist/inbox-authentication-CgonVRkg.mjs +0 -198
  148. package/dist/inbox-cS97XzOD.mjs +0 -399
  149. package/dist/inbox-view-D-d0Ar6o.mjs +0 -385
  150. package/dist/key-owner-evidence-APB6NpSk.mjs +0 -108
  151. package/dist/keycache-N2opu4-3.mjs +0 -221
  152. package/dist/keys-DIJNHW-Y.mjs +0 -120
  153. package/dist/kv-DBRWVx3Q.mjs +0 -104
  154. package/dist/kv-DCHkaJ9-.mjs +0 -92
  155. package/dist/kv-cache-fgbLHGVL.mjs +0 -121
  156. package/dist/ld-BpkhkDGj.mjs +0 -1752
  157. package/dist/map-local-context-conflict-DOYEEJ3u.mjs +0 -204
  158. package/dist/map-local-create-note-B0SeXJms.mjs +0 -214
  159. package/dist/metrics-Uqf8GomB.mjs +0 -818
  160. package/dist/middleware-DcXzz-YK.mjs +0 -9971
  161. package/dist/middleware-DgwZkvJR.mjs +0 -5
  162. package/dist/mq-eF96QxUT.mjs +0 -288
  163. package/dist/negotiation-BAKO9nih.mjs +0 -96
  164. package/dist/nodeinfo/client.test.d.mts +0 -2
  165. package/dist/nodeinfo/client.test.mjs +0 -1364
  166. package/dist/nodeinfo/handler.test.d.mts +0 -2
  167. package/dist/nodeinfo/handler.test.mjs +0 -94
  168. package/dist/nodeinfo/types.test.d.mts +0 -2
  169. package/dist/nodeinfo/types.test.mjs +0 -192
  170. package/dist/otel/exporter.test.d.mts +0 -2
  171. package/dist/otel/exporter.test.mjs +0 -887
  172. package/dist/outbound-body-CckPA5gc.mjs +0 -83
  173. package/dist/outbound-capture-DVgnRzlf.mjs +0 -184
  174. package/dist/outbound-document-BMgwLXTY.mjs +0 -179
  175. package/dist/outgoing-jsonld-4IJqPYos.mjs +0 -205
  176. package/dist/owner-BVenIFg1.mjs +0 -267
  177. package/dist/portable-collection-DIk9gpjL.mjs +0 -418
  178. package/dist/portable-key-C7pVaHNR.mjs +0 -549
  179. package/dist/portable-key-id-Ca30-hOa.mjs +0 -248
  180. package/dist/proof-BlfZ95--.mjs +0 -1420
  181. package/dist/public-audience--klBIOk1.mjs +0 -197
  182. package/dist/retry-zX5xw5e0.mjs +0 -34
  183. package/dist/router-u5O5KCQr.mjs +0 -156
  184. package/dist/secured-document-CxzZZ9nL.mjs +0 -35
  185. package/dist/send-DEGHPGFk.mjs +0 -710
  186. package/dist/sig/accept.test.d.mts +0 -2
  187. package/dist/sig/accept.test.mjs +0 -416
  188. package/dist/sig/compound-proof-discovery.test.d.mts +0 -2
  189. package/dist/sig/compound-proof-discovery.test.mjs +0 -331
  190. package/dist/sig/compound-proof-producer.test.d.mts +0 -2
  191. package/dist/sig/compound-proof-producer.test.mjs +0 -107
  192. package/dist/sig/compound-proof-verification.test.d.mts +0 -2
  193. package/dist/sig/compound-proof-verification.test.mjs +0 -1017
  194. package/dist/sig/compound-proof.test.d.mts +0 -2
  195. package/dist/sig/compound-proof.test.mjs +0 -411
  196. package/dist/sig/http.test.d.mts +0 -2
  197. package/dist/sig/http.test.mjs +0 -3328
  198. package/dist/sig/key-owner-evidence.test.d.mts +0 -2
  199. package/dist/sig/key-owner-evidence.test.mjs +0 -100
  200. package/dist/sig/key.test.d.mts +0 -2
  201. package/dist/sig/key.test.mjs +0 -1250
  202. package/dist/sig/ld.test.d.mts +0 -2
  203. package/dist/sig/ld.test.mjs +0 -1044
  204. package/dist/sig/mitra-receive-interop.test.d.mts +0 -2
  205. package/dist/sig/mitra-receive-interop.test.mjs +0 -260
  206. package/dist/sig/mitra-send-interop.test.d.mts +0 -2
  207. package/dist/sig/mitra-send-interop.test.mjs +0 -461
  208. package/dist/sig/owner.test.d.mts +0 -2
  209. package/dist/sig/owner.test.mjs +0 -202
  210. package/dist/sig/portable-collection.test.d.mts +0 -2
  211. package/dist/sig/portable-collection.test.mjs +0 -697
  212. package/dist/sig/portable-interop.test.d.mts +0 -2
  213. package/dist/sig/portable-interop.test.mjs +0 -156
  214. package/dist/sig/portable-key-id.test.d.mts +0 -2
  215. package/dist/sig/portable-key-id.test.mjs +0 -67
  216. package/dist/sig/portable-key.test.d.mts +0 -2
  217. package/dist/sig/portable-key.test.mjs +0 -1438
  218. package/dist/sig/proof.test.d.mts +0 -2
  219. package/dist/sig/proof.test.mjs +0 -2638
  220. package/dist/sig/tootik-request-interop.test.d.mts +0 -2
  221. package/dist/sig/tootik-request-interop.test.mjs +0 -190
  222. package/dist/sig/tootik-send-interop.test.d.mts +0 -2
  223. package/dist/sig/tootik-send-interop.test.mjs +0 -331
  224. package/dist/sig/verification.test.d.mts +0 -2
  225. package/dist/sig/verification.test.mjs +0 -310
  226. package/dist/std__assert-DvMDRPes.mjs +0 -8
  227. package/dist/tasks-BCUmQbbz.mjs +0 -77
  228. package/dist/temporal-B4oQ8HpW.mjs +0 -95
  229. package/dist/testing/context.test.d.mts +0 -2
  230. package/dist/testing/context.test.mjs +0 -19
  231. package/dist/testing/kv.test.d.mts +0 -2
  232. package/dist/testing/kv.test.mjs +0 -101
  233. package/dist/testing/mod.d.mts +0 -6099
  234. package/dist/testing/mod.mjs +0 -9
  235. package/dist/testing-vrnD5Uaa.mjs +0 -8
  236. package/dist/types-DE_LV1JB.mjs +0 -46
  237. package/dist/utils/docloader.test.d.mts +0 -2
  238. package/dist/utils/docloader.test.mjs +0 -1076
  239. package/dist/utils/kv-cache.test.d.mts +0 -2
  240. package/dist/utils/kv-cache.test.mjs +0 -261
  241. package/dist/verification-C3954hQh.mjs +0 -5
  242. package/dist/verification-Dpfcw8ml.mjs +0 -105
  243. package/dist/vocab/cjs.test.d.mts +0 -2
  244. package/dist/vocab/cjs.test.mjs +0 -27
@@ -1,6 +1,6 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_federation = require("../federation-pFFwPyoZ.cjs");
3
+ const require_federation = require("../federation-C0zalE9W.cjs");
4
4
  exports.CircuitBreaker = require_federation.CircuitBreaker;
5
5
  exports.InProcessMessageQueue = require_federation.InProcessMessageQueue;
6
6
  exports.MemoryKvStore = require_federation.MemoryKvStore;
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { a as respondWithObjectIfAcceptable, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as respondWithObject, l as digest, n as handleWebFinger, o as SendActivityError, p as createFederationBuilder, r as createExponentialBackoffPolicy, s as isActorAuthenticated, t as createFederation, u as CircuitBreaker } from "../middleware-Bj91r7r2.js";
3
+ import { a as respondWithObjectIfAcceptable, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as respondWithObject, l as digest, n as handleWebFinger, o as SendActivityError, p as createFederationBuilder, r as createExponentialBackoffPolicy, s as isActorAuthenticated, t as createFederation, u as CircuitBreaker } from "../middleware-Bgm3A90j.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Router as Router$1, RouterError as RouterError$1, assertPath, isPath } from "@fedify/uri-template";
6
6
  import { isEqual } from "es-toolkit";
@@ -1,10 +1,10 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  const require_rolldown_runtime = require("./rolldown-runtime-Dmm3t92W.cjs");
3
3
  const require_transformers = require("./transformers-BalCrSsr.cjs");
4
- const require_http = require("./http-CXX-QPzs.cjs");
4
+ const require_http = require("./http-Dqzgc4Rj.cjs");
5
5
  const require_types = require("./types-hKCCjii0.cjs");
6
- const require_portable_collection = require("./portable-collection-BOl9oKrt.cjs");
7
- const require_kv_cache = require("./kv-cache-C6XX_fwz.cjs");
6
+ const require_portable_collection = require("./portable-collection-nvog8lS6.cjs");
7
+ const require_kv_cache = require("./kv-cache-ihEHdx1v.cjs");
8
8
  let _logtape_logtape = require("@logtape/logtape");
9
9
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
10
10
  let _fedify_uri_template = require("@fedify/uri-template");
@@ -39,6 +39,7 @@ const contextCandidates = [
39
39
  "https://w3id.org/security/v1",
40
40
  "https://w3id.org/identity/v1",
41
41
  "https://gotosocial.org/ns",
42
+ "https://w3id.org/fep/171b",
42
43
  "https://w3id.org/security/data-integrity/v1",
43
44
  "https://w3id.org/security/data-integrity/v2"
44
45
  ];
@@ -89,6 +90,10 @@ const generatedTerms = {
89
90
  emojiReactions: {
90
91
  "@id": "fedibird:emojiReactions",
91
92
  "@type": "@id"
93
+ },
94
+ contextHistory: {
95
+ "@id": "https://w3id.org/fep/171b/contextHistory",
96
+ "@type": "@id"
92
97
  }
93
98
  };
94
99
  function sameDefinition(value, expected) {
@@ -15,7 +15,7 @@ import serialize from "json-canon";
15
15
  import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
16
16
  //#region deno.json
17
17
  var name = "@fedify/fedify";
18
- var version = "2.5.0-dev.2687+924da5ce";
18
+ var version = "2.5.0-dev.2726+da549263";
19
19
  //#endregion
20
20
  //#region src/sig/portable-key-id.ts
21
21
  const COMPATIBLE_KEY_ID_PATH_PATTERN = /^\/\.well-known\/apgateway\/did(?::|%3A)/i;
@@ -17,7 +17,7 @@ json_canon = require_rolldown_runtime.__toESM(json_canon, 1);
17
17
  let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
18
18
  //#region deno.json
19
19
  var name = "@fedify/fedify";
20
- var version = "2.5.0-dev.2687+924da5ce";
20
+ var version = "2.5.0-dev.2726+da549263";
21
21
  //#endregion
22
22
  //#region src/sig/portable-key-id.ts
23
23
  const COMPATIBLE_KEY_ID_PATH_PATTERN = /^\/\.well-known\/apgateway\/did(?::|%3A)/i;
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { X as validateCryptoKey, dt as recordDocumentCache, t as doubleKnockScoped } from "./http-T7h9GBAN.js";
3
+ import { X as validateCryptoKey, dt as recordDocumentCache, t as doubleKnockScoped } from "./http-BC5Bd3-E.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, resolveDocumentLoaderTimeout, withDocumentLoaderTimeout } from "@fedify/vocab-runtime";
6
6
  import { curry } from "es-toolkit";
@@ -1,5 +1,5 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
- const require_http = require("./http-CXX-QPzs.cjs");
2
+ const require_http = require("./http-Dqzgc4Rj.cjs");
3
3
  let _logtape_logtape = require("@logtape/logtape");
4
4
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
5
5
  let es_toolkit = require("es-toolkit");
@@ -2,10 +2,10 @@ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { t as __exportAll } from "./rolldown-runtime-BC-Eo5Mj.js";
4
4
  import { r as getDefaultActivityTransformers } from "./transformers-DAtXl_Kc.js";
5
- import { $ as getVerifiedKeyOwnerEvidence, A as compactJsonLd, At as getRawCanonicalPortableId, B as verifyCompactJsonLdDetailed, C as verifyPortableObjectProofWithRoot, Ct as observeAttempt, D as InvalidContextReferenceError, Dt as getCanonicalPortableId, E as normalizeOutgoingActivityJsonLd, Et as getAuthenticationOrigin, F as hasSignatureLike, Ft as isPortableUri, I as isClearlyMalformedContextReference, It as isSameObjectId, L as isInvalidUrlTypeError, M as detachSignature, Mt as isCompatibleKeyId, N as getNormalizationContextLoader, Nt as isPortableId, O as assertSafeJsonLd, Ot as getGatewayKeyBase, P as hasSignature, Pt as isPortableKeyId, Q as MAX_PORTABLE_KEY_TTL, R as markEffectiveContextLoader, Rt as name, S as verifyPortableObjectProofPolicy, Tt as verificationObservation, U as wrapContextLoaderForJsonLd, W as exportJwk, X as validateCryptoKey, Y as importJwk, _ as signObject, _t as registerQueueDepthGauge, at as isAbortError, b as verifyObjectDetailed, c as verifyRequestDetailed, ct as recordCollectionPageItems, d as InvalidPortableObjectIdError, f as classifyFep2277CoreType, ft as recordFanoutRecipients, g as preparePortableObjectProofPolicy, gt as recordWebFingerHandle, h as hasProofLike, ht as recordOutboxEnqueue, i as selectRequestSignature, it as instrumentDocumentLoader, jt as hasPortableActor, kt as getPortableDid, lt as recordCollectionRequest, m as getProofSigner, mt as recordOutboxActivity, n as listRequestSignatures, nt as getFederationMetrics, o as validateMaxSignatures, ot as recordCircuitBreakerStateChange, pt as recordInboxActivity, r as parseRfc9421SignatureInput, rt as getRemoteHost, s as verifyRequest, st as recordCollectionDispatchDuration, t as doubleKnockScoped, tt as getDurationMs, ut as recordCollectionTotalItems, v as verifyMapLocalProof, vt as preloadedOnlyDocumentLoader, w as verifyPreparedPortableObjectProofPolicy, wt as snapshotKey, x as verifyPortableObjectProof, y as verifyObject, yt as formatAcceptSignature, z as signJsonLd, zt as version } from "./http-T7h9GBAN.js";
5
+ import { $ as getVerifiedKeyOwnerEvidence, A as compactJsonLd, At as getRawCanonicalPortableId, B as verifyCompactJsonLdDetailed, C as verifyPortableObjectProofWithRoot, Ct as observeAttempt, D as InvalidContextReferenceError, Dt as getCanonicalPortableId, E as normalizeOutgoingActivityJsonLd, Et as getAuthenticationOrigin, F as hasSignatureLike, Ft as isPortableUri, I as isClearlyMalformedContextReference, It as isSameObjectId, L as isInvalidUrlTypeError, M as detachSignature, Mt as isCompatibleKeyId, N as getNormalizationContextLoader, Nt as isPortableId, O as assertSafeJsonLd, Ot as getGatewayKeyBase, P as hasSignature, Pt as isPortableKeyId, Q as MAX_PORTABLE_KEY_TTL, R as markEffectiveContextLoader, Rt as name, S as verifyPortableObjectProofPolicy, Tt as verificationObservation, U as wrapContextLoaderForJsonLd, W as exportJwk, X as validateCryptoKey, Y as importJwk, _ as signObject, _t as registerQueueDepthGauge, at as isAbortError, b as verifyObjectDetailed, c as verifyRequestDetailed, ct as recordCollectionPageItems, d as InvalidPortableObjectIdError, f as classifyFep2277CoreType, ft as recordFanoutRecipients, g as preparePortableObjectProofPolicy, gt as recordWebFingerHandle, h as hasProofLike, ht as recordOutboxEnqueue, i as selectRequestSignature, it as instrumentDocumentLoader, jt as hasPortableActor, kt as getPortableDid, lt as recordCollectionRequest, m as getProofSigner, mt as recordOutboxActivity, n as listRequestSignatures, nt as getFederationMetrics, o as validateMaxSignatures, ot as recordCircuitBreakerStateChange, pt as recordInboxActivity, r as parseRfc9421SignatureInput, rt as getRemoteHost, s as verifyRequest, st as recordCollectionDispatchDuration, t as doubleKnockScoped, tt as getDurationMs, ut as recordCollectionTotalItems, v as verifyMapLocalProof, vt as preloadedOnlyDocumentLoader, w as verifyPreparedPortableObjectProofPolicy, wt as snapshotKey, x as verifyPortableObjectProof, y as verifyObject, yt as formatAcceptSignature, z as signJsonLd, zt as version } from "./http-BC5Bd3-E.js";
6
6
  import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-DUjZb4i6.js";
7
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-Do5QA2oy.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-EFcb1kkU.js";
7
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-DZ_XqNUM.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CQ0u0Ry0.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { FetchError, UrlError, canonicalizePortableUri, decodeMultibase, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, isGatewayUrl, parseDigestMultibase, parseHashlink, parseIri, preloadedContexts, resolveDocumentLoaderTimeout, toCompatibleEf61Id } from "@fedify/vocab-runtime";
11
11
  import { Router, RouterError, assertPath } from "@fedify/uri-template";
@@ -38,6 +38,7 @@ const contextCandidates = [
38
38
  "https://w3id.org/security/v1",
39
39
  "https://w3id.org/identity/v1",
40
40
  "https://gotosocial.org/ns",
41
+ "https://w3id.org/fep/171b",
41
42
  "https://w3id.org/security/data-integrity/v1",
42
43
  "https://w3id.org/security/data-integrity/v2"
43
44
  ];
@@ -88,6 +89,10 @@ const generatedTerms = {
88
89
  emojiReactions: {
89
90
  "@id": "fedibird:emojiReactions",
90
91
  "@type": "@id"
92
+ },
93
+ contextHistory: {
94
+ "@id": "https://w3id.org/fep/171b/contextHistory",
95
+ "@type": "@id"
91
96
  }
92
97
  };
93
98
  function sameDefinition(value, expected) {
package/dist/mod.cjs CHANGED
@@ -3,11 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("./rolldown-runtime-Dmm3t92W.cjs");
4
4
  const require_transformers = require("./transformers-BalCrSsr.cjs");
5
5
  require("./compat/mod.cjs");
6
- const require_federation = require("./federation-pFFwPyoZ.cjs");
7
- const require_http = require("./http-CXX-QPzs.cjs");
6
+ const require_federation = require("./federation-C0zalE9W.cjs");
7
+ const require_http = require("./http-Dqzgc4Rj.cjs");
8
8
  const require_types = require("./types-hKCCjii0.cjs");
9
- const require_portable_collection = require("./portable-collection-BOl9oKrt.cjs");
10
- const require_kv_cache = require("./kv-cache-C6XX_fwz.cjs");
9
+ const require_portable_collection = require("./portable-collection-nvog8lS6.cjs");
10
+ const require_kv_cache = require("./kv-cache-ihEHdx1v.cjs");
11
11
  require("./nodeinfo/mod.cjs");
12
12
  require("./runtime/mod.cjs");
13
13
  require("./sig/mod.cjs");
package/dist/mod.js CHANGED
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "./rolldown-runtime-BC-Eo5Mj.js";
4
4
  import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-DAtXl_Kc.js";
5
5
  import "./compat/mod.js";
6
- import { a as respondWithObjectIfAcceptable, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as respondWithObject, l as digest, n as handleWebFinger, o as SendActivityError, p as createFederationBuilder, r as createExponentialBackoffPolicy, s as isActorAuthenticated, t as createFederation, u as CircuitBreaker } from "./middleware-Bj91r7r2.js";
7
- import { F as hasSignatureLike, H as verifySignature, J as generateCryptoKeyPair, K as fetchKey, M as detachSignature, St as validateAcceptSignature, T as verifyProof, V as verifyJsonLd, W as exportJwk, Y as importJwk, _ as signObject, a as signRequest, bt as fulfillAcceptSignature, c as verifyRequestDetailed, h as hasProofLike, j as createSignature, k as attachSignature, p as createProof, q as fetchKeyDetailed, s as verifyRequest, x as verifyPortableObjectProof, xt as parseAcceptSignature, y as verifyObject, yt as formatAcceptSignature, z as signJsonLd } from "./http-T7h9GBAN.js";
6
+ import { a as respondWithObjectIfAcceptable, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as respondWithObject, l as digest, n as handleWebFinger, o as SendActivityError, p as createFederationBuilder, r as createExponentialBackoffPolicy, s as isActorAuthenticated, t as createFederation, u as CircuitBreaker } from "./middleware-Bgm3A90j.js";
7
+ import { F as hasSignatureLike, H as verifySignature, J as generateCryptoKeyPair, K as fetchKey, M as detachSignature, St as validateAcceptSignature, T as verifyProof, V as verifyJsonLd, W as exportJwk, Y as importJwk, _ as signObject, a as signRequest, bt as fulfillAcceptSignature, c as verifyRequestDetailed, h as hasProofLike, j as createSignature, k as attachSignature, p as createProof, q as fetchKeyDetailed, s as verifyRequest, x as verifyPortableObjectProof, xt as parseAcceptSignature, y as verifyObject, yt as formatAcceptSignature, z as signJsonLd } from "./http-BC5Bd3-E.js";
8
8
  import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-DUjZb4i6.js";
9
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-Do5QA2oy.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-EFcb1kkU.js";
9
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "./portable-collection-DZ_XqNUM.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CQ0u0Ry0.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { $ as getVerifiedKeyOwnerEvidence, C as verifyPortableObjectProofWithRoot, Dt as getCanonicalPortableId, Ft as isPortableUri, G as fetchActorDocument, Lt as isSamePublicKey$1, Mt as isCompatibleKeyId, Nt as isPortableId, Rt as name, W as exportJwk, Z as verifyKeyOwnership, et as parseKeyOwnerEvidence, l as fetchPortableGatewayKey, u as resolvePortableActorKey, x as verifyPortableObjectProof, zt as version } from "./http-T7h9GBAN.js";
3
+ import { $ as getVerifiedKeyOwnerEvidence, C as verifyPortableObjectProofWithRoot, Dt as getCanonicalPortableId, Ft as isPortableUri, G as fetchActorDocument, Lt as isSamePublicKey$1, Mt as isCompatibleKeyId, Nt as isPortableId, Rt as name, W as exportJwk, Z as verifyKeyOwnership, et as parseKeyOwnerEvidence, l as fetchPortableGatewayKey, u as resolvePortableActorKey, x as verifyPortableObjectProof, zt as version } from "./http-BC5Bd3-E.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { canonicalizePortableUri, formatIri, fromCompatibleEf61Id, getDocumentLoader, getFe34Origin, parseIri } from "@fedify/vocab-runtime";
6
6
  import { CollectionPage, CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
@@ -1,5 +1,5 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
- const require_http = require("./http-CXX-QPzs.cjs");
2
+ const require_http = require("./http-Dqzgc4Rj.cjs");
3
3
  let _logtape_logtape = require("@logtape/logtape");
4
4
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
5
5
  let _fedify_vocab = require("@fedify/vocab");
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-CXX-QPzs.cjs");
4
- const require_portable_collection = require("../portable-collection-BOl9oKrt.cjs");
3
+ const require_http = require("../http-Dqzgc4Rj.cjs");
4
+ const require_portable_collection = require("../portable-collection-nvog8lS6.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 { F as hasSignatureLike, H as verifySignature, J as generateCryptoKeyPair, K as fetchKey, M as detachSignature, St as validateAcceptSignature, T as verifyProof, V as verifyJsonLd, W as exportJwk, Y as importJwk, _ as signObject, a as signRequest, bt as fulfillAcceptSignature, c as verifyRequestDetailed, h as hasProofLike, j as createSignature, k as attachSignature, p as createProof, q as fetchKeyDetailed, s as verifyRequest, x as verifyPortableObjectProof, xt as parseAcceptSignature, y as verifyObject, yt as formatAcceptSignature, z as signJsonLd } from "../http-T7h9GBAN.js";
4
- import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-Do5QA2oy.js";
3
+ import { F as hasSignatureLike, H as verifySignature, J as generateCryptoKeyPair, K as fetchKey, M as detachSignature, St as validateAcceptSignature, T as verifyProof, V as verifyJsonLd, W as exportJwk, Y as importJwk, _ as signObject, a as signRequest, bt as fulfillAcceptSignature, c as verifyRequestDetailed, h as hasProofLike, j as createSignature, k as attachSignature, p as createProof, q as fetchKeyDetailed, s as verifyRequest, x as verifyPortableObjectProof, xt as parseAcceptSignature, y as verifyObject, yt as formatAcceptSignature, z as signJsonLd } from "../http-BC5Bd3-E.js";
4
+ import { n as doesActorOwnKey, r as getKeyOwner, t as verifyPortableObject } from "../portable-collection-DZ_XqNUM.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 };
@@ -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-C6XX_fwz.cjs");
3
+ const require_kv_cache = require("../kv-cache-ihEHdx1v.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-EFcb1kkU.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-CQ0u0Ry0.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "2.5.0-dev.2687+924da5ce",
3
+ "version": "2.5.0-dev.2726+da549263",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -30,7 +30,20 @@
30
30
  "type": "module",
31
31
  "files": [
32
32
  "dist",
33
- "skills"
33
+ "skills",
34
+ "!dist/**/*.test.{js,cjs,mjs,ts,cts,mts}",
35
+ "!dist/**/*.test.d.{ts,cts,mts}",
36
+ "!dist/**/*.test.*.map",
37
+ "!dist/**/*.bench.{js,cjs,mjs,ts,cts,mts}",
38
+ "!dist/**/*.bench.d.{ts,cts,mts}",
39
+ "!dist/**/*.bench.*.map",
40
+ "!dist/**/*.snap",
41
+ "!dist/**/__snapshots__/**",
42
+ "!dist/**/__fixtures__/**",
43
+ "!dist/**/test/**",
44
+ "!dist/**/tests/**",
45
+ "!dist/**/testdata/**",
46
+ "!dist/**/fixtures/**"
34
47
  ],
35
48
  "agents": {
36
49
  "skills": [
@@ -151,10 +164,10 @@
151
164
  "structured-field-values": "^2.0.4",
152
165
  "temporal-polyfill": "^1.0.1",
153
166
  "urlpattern-polyfill": "^10.1.0",
154
- "@fedify/uri-template": "2.5.0-dev.2687+924da5ce",
155
- "@fedify/vocab": "2.5.0-dev.2687+924da5ce",
156
- "@fedify/vocab-runtime": "2.5.0-dev.2687+924da5ce",
157
- "@fedify/webfinger": "2.5.0-dev.2687+924da5ce"
167
+ "@fedify/uri-template": "2.5.0-dev.2726+da549263",
168
+ "@fedify/vocab": "2.5.0-dev.2726+da549263",
169
+ "@fedify/vocab-runtime": "2.5.0-dev.2726+da549263",
170
+ "@fedify/webfinger": "2.5.0-dev.2726+da549263"
158
171
  },
159
172
  "devDependencies": {
160
173
  "@std/assert": "npm:@jsr/std__assert@^0.226.0",
@@ -166,16 +179,16 @@
166
179
  "typescript": "^6.0.3",
167
180
  "wrangler": "^4.17.0",
168
181
  "@fedify/fixture": "2.0.0",
169
- "@fedify/vocab-tools": "^2.5.0-dev.2687+924da5ce"
182
+ "@fedify/vocab-tools": "^2.5.0-dev.2726+da549263"
170
183
  },
171
184
  "scripts": {
172
185
  "build:self": "tsdown",
173
186
  "build": "pnpm --filter @fedify/fedify... run build:self",
174
187
  "prepublish": "pnpm build",
175
188
  "pretest": "pnpm build",
176
- "test": "cd dist/ && node --test",
189
+ "test": "cd dist-tests/ && node --test",
177
190
  "pretest:bun": "pnpm build",
178
- "test:bun": "cd dist/ && bun test --timeout 60000",
191
+ "test:bun": "cd dist-tests/ && bun test --timeout 60000",
179
192
  "test:cfworkers": "deno task codegen && wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx scripts/check_cfworkers.ts && node --import=tsx src/cfworkers/client.ts"
180
193
  }
181
194
  }
@@ -324,6 +324,31 @@ in-tree *src/webfinger*.
324
324
 
325
325
  `fromJsonLd()` and `toJsonLd()` are asynchronous; always `await` them.
326
326
 
327
+ In Fedify 2.5.0 and later, `Object` subclasses support FEP-171b history
328
+ references through `contextHistory` or `contextHistories` constructor options
329
+ (`URL` or `Collection` values, including ordered collections and pages). Read
330
+ `contextHistoryId` and `contextHistoryIds` without fetching; use
331
+ `getContextHistory()` and `getContextHistories()` to resolve the first or all
332
+ history collections. Output uses an inline context mapping, and the published
333
+ FEP-171b context is preloaded for input. In `@fedify/backfill`, opt in with
334
+ `contextSource: "history-first"` to read the seed's first history reference.
335
+ Omitting the option keeps the existing `context` source. Absent or unavailable
336
+ history (`null`, an ordinary loader error, or a non-collection result) falls
337
+ back to the first `context` ID, using the remaining request budget. Once a
338
+ history collection is resolved, it stays selected even if empty or no
339
+ items can be yielded. Later history references are not tried, and sources are
340
+ not merged. Portable history references are passed to the configured backfill
341
+ loader for resolution and verification. Existing strategies control post
342
+ extraction; later explicitly configured strategies can still run. This does not
343
+ discover history on ancestors or replay updates and deletions. Histories
344
+ containing only `Add(Create(...))` activities yield nothing and do not trigger
345
+ `context` fallback.
346
+
347
+ Since Fedify 2.5.0, pass `dereference: false` to vocabulary accessors to read
348
+ embedded or cached objects without fetching references. Singular accessors
349
+ return `null` when fetching is required; plural accessors skip those values.
350
+ Origin and portable-object trust checks still apply. The default is `true`.
351
+
327
352
  `clone()` is shallow: it copies property arrays but shares nested vocabulary
328
353
  objects and URLs. In Fedify 2.5.0 and later, use synchronous `deepClone()` to
329
354
  resolve nested properties without hydrating the source's objects. Replacement
@@ -336,6 +361,16 @@ overrides: `deepClone()` snapshots the existing indices of large sparse arrays.
336
361
  Entries added during copying are not visited, so their nested objects may
337
362
  remain shared. Copying preserves array length and holes.
338
363
 
364
+ To read a property that has no typed accessor, such as an application's
365
+ extension, use `getRawPropertyValues(object, propertyIri)` or
366
+ `getRawPropertyValue()` from `@fedify/vocab` (Fedify 2.5.0 and later) instead
367
+ of digging through `toJsonLd()` output. Pass the full property IRI, never a
368
+ compact IRI like `as:content` or a term; prefixes are not expanded. The
369
+ results are untyped expanded JSON-LD values, unverified like any received
370
+ data, so validate them before use. For properties Fedify does support, the
371
+ functions return the current typed values encoded back, not the received
372
+ document.
373
+
339
374
  > [!WARNING]
340
375
  > `crossOrigin: "trust"` on vocabulary deserialization trusts embedded
341
376
  > objects without re-fetching. Treat it as you would
@@ -1,145 +0,0 @@
1
- import "temporal-polyfill";
2
- import "urlpattern-polyfill";
3
- globalThis.addEventListener = () => {};
4
- import { getLogger } from "@logtape/logtape";
5
- import { Item, decodeDict, encodeDict } from "structured-field-values";
6
- //#region src/sig/accept.ts
7
- /**
8
- * `Accept-Signature` header parsing, serialization, and validation utilities
9
- * for RFC 9421 §5 challenge-response negotiation.
10
- *
11
- * @module
12
- */
13
- /**
14
- * Parses an `Accept-Signature` header value (RFC 9421 §5.1) into an
15
- * array of {@link AcceptSignatureMember} objects.
16
- *
17
- * The `Accept-Signature` field is a Dictionary Structured Field
18
- * (RFC 8941 §3.2). Each dictionary member describes a single
19
- * requested message signature.
20
- *
21
- * On parse failure (malformed or empty header), returns an empty array.
22
- *
23
- * @param header The raw `Accept-Signature` header value string.
24
- * @returns An array of parsed members. Empty if the header is
25
- * malformed or empty.
26
- * @since 2.1.0
27
- */
28
- function parseAcceptSignature(header) {
29
- try {
30
- return parseEachSignature(decodeDict(header));
31
- } catch {
32
- getLogger([
33
- "fedify",
34
- "sig",
35
- "http"
36
- ]).warn("Failed to parse Accept-Signature header: {header}", { header });
37
- return [];
38
- }
39
- }
40
- const compactObject = (obj) => Object.fromEntries(Object.entries(obj).filter(([_, v]) => v !== void 0));
41
- const parseEachSignature = (dict) => Object.entries(dict).filter(([_, item]) => Array.isArray(item.value)).map(([label, item]) => ({
42
- label,
43
- components: item.value.filter((subitem) => typeof subitem.value === "string").map((subitem) => ({
44
- value: subitem.value,
45
- params: subitem.params ?? {}
46
- })),
47
- parameters: compactParams(item)
48
- }));
49
- const compactParams = (item) => {
50
- const { keyid, alg, created, expires, nonce, tag } = item.params ?? {};
51
- return compactObject({
52
- keyid: stringOrUndefined(keyid),
53
- alg: stringOrUndefined(alg),
54
- created: trueOrUndefined(created),
55
- expires: trueOrUndefined(expires),
56
- nonce: stringOrUndefined(nonce),
57
- tag: stringOrUndefined(tag)
58
- });
59
- };
60
- const stringOrUndefined = (v) => typeof v === "string" ? v : void 0;
61
- const trueOrUndefined = (v) => v === true ? true : void 0;
62
- /**
63
- * Serializes an array of {@link AcceptSignatureMember} objects into an
64
- * `Accept-Signature` header value string (RFC 9421 §5.1).
65
- *
66
- * The output is a Dictionary Structured Field (RFC 8941 §3.2).
67
- *
68
- * @param members The members to serialize.
69
- * @returns The serialized header value string.
70
- * @since 2.1.0
71
- */
72
- function formatAcceptSignature(members) {
73
- const items = members.map((member) => [member.label, new Item(compToItems(member), compactParameters(member))]);
74
- return encodeDict(Object.fromEntries(items));
75
- }
76
- const compToItems = (member) => member.components.map((c) => new Item(c.value, c.params));
77
- const compactParameters = (member) => {
78
- const { keyid, alg, created, expires, nonce, tag } = member.parameters;
79
- return compactObject({
80
- keyid,
81
- alg,
82
- created,
83
- expires,
84
- nonce,
85
- tag
86
- });
87
- };
88
- /**
89
- * Filters out {@link AcceptSignatureMember} entries whose covered
90
- * components include response-only identifiers (`@status`) that are
91
- * not applicable to request-target messages, as required by
92
- * [RFC 9421 §5](https://www.rfc-editor.org/rfc/rfc9421#section-5).
93
- *
94
- * A warning is logged for each discarded entry.
95
- *
96
- * @param members The parsed `Accept-Signature` entries to validate.
97
- * @returns Only entries that are valid for request-target messages.
98
- * @since 2.1.0
99
- */
100
- function validateAcceptSignature(members) {
101
- const logger = getLogger([
102
- "fedify",
103
- "sig",
104
- "http"
105
- ]);
106
- return members.filter((member) => {
107
- if (member.components.every((c) => c.value !== "@status")) return true;
108
- logLabel(logger, member.label);
109
- return false;
110
- });
111
- }
112
- const logLabel = (logger, label) => logger.warn("Discarding Accept-Signature member {label}: covered components include response-only identifier @status.", { label });
113
- /**
114
- * Attempts to translate an {@link AcceptSignatureMember} challenge into
115
- * RFC 9421 signing options that the local signer can fulfill.
116
- *
117
- * Returns `null` if the challenge cannot be fulfilled—for example, if
118
- * the requested `alg` or `keyid` is incompatible with the local key.
119
- *
120
- * Safety constraints:
121
- * - `alg`: only honored if it matches `localAlg`.
122
- * - `keyid`: only honored if it matches `localKeyId`.
123
- * - `components`: passed through exactly as requested, per RFC 9421 §5.2.
124
- * - `nonce`, `tag`, and `expires` are passed through directly.
125
- *
126
- * @param entry The challenge entry from the `Accept-Signature` header.
127
- * @param localKeyId The local key identifier (e.g., the actor key URL).
128
- * @param localAlg The algorithm of the local private key
129
- * (e.g., `"rsa-v1_5-sha256"`).
130
- * @returns Signing options if the challenge can be fulfilled, or `null`.
131
- * @since 2.1.0
132
- */
133
- function fulfillAcceptSignature(entry, localKeyId, localAlg) {
134
- if (entry.parameters.alg != null && entry.parameters.alg !== localAlg) return null;
135
- if (entry.parameters.keyid != null && entry.parameters.keyid !== localKeyId) return null;
136
- return {
137
- label: entry.label,
138
- components: entry.components,
139
- nonce: entry.parameters.nonce,
140
- tag: entry.parameters.tag,
141
- expires: entry.parameters.expires
142
- };
143
- }
144
- //#endregion
145
- export { validateAcceptSignature as i, fulfillAcceptSignature as n, parseAcceptSignature as r, formatAcceptSignature as t };
@@ -1,44 +0,0 @@
1
- import "temporal-polyfill";
2
- import "urlpattern-polyfill";
3
- globalThis.addEventListener = () => {};
4
- import { Activity } from "@fedify/vocab";
5
- //#region src/federation/activity-listener.ts
6
- var ActivityListenerSet = class {
7
- #listeners;
8
- constructor() {
9
- this.#listeners = /* @__PURE__ */ new Map();
10
- }
11
- clone() {
12
- const Clone = this.constructor;
13
- const clone = new Clone();
14
- clone.#listeners = new Map(this.#listeners);
15
- return clone;
16
- }
17
- add(type, listener, options = {}) {
18
- if (this.#listeners.has(type)) throw new TypeError("Listener already set for this type.");
19
- this.#listeners.set(type, {
20
- listener,
21
- options: { ...options }
22
- });
23
- }
24
- dispatchWithClass(activity) {
25
- let cls = activity.constructor;
26
- while (cls != null) {
27
- if (this.#listeners.has(cls)) break;
28
- if (cls === Activity) return null;
29
- cls = globalThis.Object.getPrototypeOf(cls);
30
- }
31
- if (cls == null) return null;
32
- const { listener, options } = this.#listeners.get(cls);
33
- return {
34
- class: cls,
35
- listener,
36
- options
37
- };
38
- }
39
- dispatch(activity) {
40
- return this.dispatchWithClass(activity)?.listener ?? null;
41
- }
42
- };
43
- //#endregion
44
- export { ActivityListenerSet as t };
@@ -1,23 +0,0 @@
1
- import "temporal-polyfill";
2
- import "urlpattern-polyfill";
3
- globalThis.addEventListener = () => {};
4
- import { t as AssertionError } from "./assertion_error-B-cx0fFA.mjs";
5
- //#region ../../node_modules/.pnpm/@jsr+std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js
6
- /**
7
- * Make an assertion, error will be thrown if `expr` does not have truthy value.
8
- *
9
- * @example Usage
10
- * ```ts no-eval
11
- * import { assert } from "@std/assert/assert";
12
- *
13
- * assert("hello".includes("ello")); // Doesn't throw
14
- * assert("hello".includes("world")); // Throws
15
- * ```
16
- *
17
- * @param expr The expression to test.
18
- * @param msg The optional message to display if the assertion fails.
19
- */ function assert(expr, msg = "") {
20
- if (!expr) throw new AssertionError(msg);
21
- }
22
- //#endregion
23
- export { assert as t };