@fedify/fedify 1.6.1-dev.869 → 1.6.1-dev.873

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 (457) hide show
  1. package/dist/{vocab/actor.js → actor-DhyIYEBl.js} +5 -4
  2. package/dist/{vocab/actor.d.ts → actor-lFlm8FYo.d.ts} +2 -2
  3. package/dist/actor-trV1ExpS.js +36173 -0
  4. package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert.js → assert-Dv75vaGI.js} +2 -1
  5. package/dist/assert_equals-ClvzlhZu.js +1020 -0
  6. package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_instance_of.js → assert_instance_of--9UCVKsi.js} +2 -1
  7. package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_is_error.js → assert_is_error-D162gXcM.js} +2 -2
  8. package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_not_equals.js → assert_not_equals-Cyf5m9Ke.js} +2 -2
  9. package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_rejects.js → assert_rejects-FOHCtlD2.js} +23 -3
  10. package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_throws.js → assert_throws-CRfQJvVx.js} +3 -2
  11. package/dist/authdocloader-4i4HAp9R.js +51 -0
  12. package/dist/{runtime/authdocloader.js → authdocloader-BXgFJugo.js} +5 -4
  13. package/dist/{federation/builder.js → builder-Bh56oIkr.js} +6 -5
  14. package/dist/{_virtual/rolldown_runtime.js → chunk-HsBuZ-b2.js} +1 -0
  15. package/dist/{nodeinfo/client.js → client-BoT1mhNh.js} +3 -2
  16. package/dist/client-Dw1pCSIt.d.ts +299 -0
  17. package/dist/{federation/collection.js → collection-QaGK9TVn.js} +1 -0
  18. package/dist/compat/mod.d.ts +12 -2
  19. package/dist/compat/mod.js +2 -1
  20. package/dist/compat/transformers.test.d.ts +2 -1
  21. package/dist/compat/transformers.test.js +32 -8
  22. package/dist/{testing/context.js → context-B2499YhO.js} +5 -4
  23. package/dist/context-CzJXjNR8.d.ts +2034 -0
  24. package/dist/{x/denokv.js → denokv-iB_ggPGm.js} +3 -1
  25. package/dist/{testing/docloader.js → docloader-09nVWLAZ.js} +1 -0
  26. package/dist/{runtime/contexts.js → docloader-CMlE_DQr.js} +420 -1
  27. package/dist/{runtime/docloader.d.ts → docloader-DTRsVZPo.d.ts} +1 -1
  28. package/dist/docloader-lJiW6zUk.js +4594 -0
  29. package/dist/esm-BxIKwi-M.js +1221 -0
  30. package/dist/federation/builder.test.d.ts +2 -1
  31. package/dist/federation/builder.test.js +21 -7
  32. package/dist/federation/collection.test.d.ts +2 -1
  33. package/dist/federation/collection.test.js +11 -3
  34. package/dist/federation/handler.test.d.ts +2 -1
  35. package/dist/federation/handler.test.js +40 -12
  36. package/dist/federation/inbox.test.d.ts +2 -1
  37. package/dist/federation/inbox.test.js +12 -5
  38. package/dist/federation/keycache.test.d.ts +2 -1
  39. package/dist/federation/keycache.test.js +12 -7
  40. package/dist/federation/kv.test.d.ts +2 -1
  41. package/dist/federation/kv.test.js +11 -3
  42. package/dist/federation/middleware.test.d.ts +2 -1
  43. package/dist/federation/middleware.test.js +107 -26
  44. package/dist/federation/mod.d.ts +13 -13
  45. package/dist/federation/mod.js +12 -8
  46. package/dist/federation/mq.test.d.ts +2 -1
  47. package/dist/federation/mq.test.js +153 -6
  48. package/dist/federation/retry.test.d.ts +2 -1
  49. package/dist/federation/retry.test.js +5 -5
  50. package/dist/federation/router.test.d.ts +2 -1
  51. package/dist/federation/router.test.js +11 -6
  52. package/dist/federation/send.test.d.ts +2 -1
  53. package/dist/federation/send.test.js +25 -13
  54. package/dist/{federation/mq.js → federation-Bmj7soSg.js} +47 -1
  55. package/dist/{node_modules/.pnpm/@jsr_hongminhee__deno-mock-fetch@0.3.2/node_modules/@jsr/hongminhee__deno-mock-fetch/router.js → hongminhee__deno-mock-fetch-DJKLj_H-.js} +96 -1
  56. package/dist/http-BImJcLfv.d.ts +258 -0
  57. package/dist/{sig/http.js → http-CFQSpmJT.js} +5 -4
  58. package/dist/http-DtHTiemN.js +720 -0
  59. package/dist/{federation/inbox.js → inbox-DkHjiHqX.js} +4 -3
  60. package/dist/key-B5Eb05gk.js +16 -0
  61. package/dist/key-BYBj-UD-.js +10 -0
  62. package/dist/key-CkoTQfVN.js +262 -0
  63. package/dist/{sig/key.js → key-a7_2L5_Z.js} +2 -4
  64. package/dist/{federation/keycache.js → keycache-D8j8RFWf.js} +2 -1
  65. package/dist/{testing/keys.js → keys-DxEMe-K1.js} +2 -2
  66. package/dist/{federation/kv.js → kv-DohFOP2C.js} +1 -0
  67. package/dist/{runtime/langstr.js → langstr-DbWheeIS.js} +1 -0
  68. package/dist/{sig/ld.js → ld-I1s-XiQ5.js} +6 -6
  69. package/dist/{vocab/lookup.js → lookup--9t_F8FE.js} +5 -5
  70. package/dist/lookup-BDLFt_tc.js +131 -0
  71. package/dist/{webfinger/lookup.js → lookup-BUFWWv5q.js} +1 -3
  72. package/dist/{webfinger/jrd.d.ts → lookup-DAfStZtI.d.ts} +41 -1
  73. package/dist/middleware-BPXHlM9G.js +17 -0
  74. package/dist/middleware-ByU_X6O9.js +33 -0
  75. package/dist/middleware-CNVKIPYL.js +3525 -0
  76. package/dist/{federation/middleware.js → middleware-ewowwb4s.js} +957 -105
  77. package/dist/mod-1pDWKvUL.d.ts +2 -0
  78. package/dist/{runtime/key.d.ts → mod-BxwG4X3V.d.ts} +52 -7
  79. package/dist/{compat/transformers.d.ts → mod-CeLnlsqE.d.ts} +3 -4
  80. package/dist/{vocab/lookup.d.ts → mod-DysVoXOu.d.ts} +98 -3
  81. package/dist/mod-GIh5OYxW.d.ts +2 -0
  82. package/dist/{sig/ld.d.ts → mod-XT0mRthe.d.ts} +126 -4
  83. package/dist/mod-g0xFzAP9.d.ts +2 -0
  84. package/dist/mod.d.ts +18 -34
  85. package/dist/mod.js +17 -27
  86. package/dist/multibase-DeCHcK8L.js +316 -0
  87. package/dist/nodeinfo/client.test.d.ts +2 -1
  88. package/dist/nodeinfo/client.test.js +15 -4
  89. package/dist/nodeinfo/handler.test.d.ts +2 -1
  90. package/dist/nodeinfo/handler.test.js +39 -7
  91. package/dist/nodeinfo/mod.d.ts +4 -3
  92. package/dist/nodeinfo/mod.js +3 -3
  93. package/dist/nodeinfo/semver.test.d.ts +2 -1
  94. package/dist/nodeinfo/semver.test.js +11 -4
  95. package/dist/nodeinfo/types.test.d.ts +2 -1
  96. package/dist/nodeinfo/types.test.js +12 -4
  97. package/dist/{sig/owner.js → owner-2Gouxs6Y.js} +4 -4
  98. package/dist/{sig/owner.d.ts → owner-BjpObx-L.d.ts} +4 -6
  99. package/dist/proof-BcNfBguh.js +595 -0
  100. package/dist/{sig/proof.js → proof-CJ291J94.js} +5 -4
  101. package/dist/{federation/retry.js → retry-BiIhZWgD.js} +1 -0
  102. package/dist/{federation/router.js → router-D_aVZZUc.js} +1 -0
  103. package/dist/runtime/authdocloader.test.d.ts +2 -1
  104. package/dist/runtime/authdocloader.test.js +24 -9
  105. package/dist/runtime/docloader.test.d.ts +2 -1
  106. package/dist/runtime/docloader.test.js +15 -11
  107. package/dist/runtime/key.test.d.ts +2 -1
  108. package/dist/runtime/key.test.js +19 -4
  109. package/dist/runtime/langstr.test.d.ts +2 -1
  110. package/dist/runtime/langstr.test.js +11 -3
  111. package/dist/runtime/mod.d.ts +5 -4
  112. package/dist/runtime/mod.js +7 -4
  113. package/dist/runtime/multibase/multibase.test.d.ts +2 -1
  114. package/dist/runtime/multibase/multibase.test.js +11 -5
  115. package/dist/runtime/url.test.d.ts +2 -1
  116. package/dist/runtime/url.test.js +7 -6
  117. package/dist/{nodeinfo/semver.js → semver-CbbIgUsa.js} +1 -0
  118. package/dist/{federation/send.js → send-BFMnzlj7.js} +3 -2
  119. package/dist/sig/http.test.d.ts +2 -1
  120. package/dist/sig/http.test.js +23 -12
  121. package/dist/sig/key.test.d.ts +2 -1
  122. package/dist/sig/key.test.js +21 -8
  123. package/dist/sig/ld.test.d.ts +2 -1
  124. package/dist/sig/ld.test.js +19 -11
  125. package/dist/sig/mod.d.ts +7 -5
  126. package/dist/sig/mod.js +7 -5
  127. package/dist/sig/owner.test.d.ts +2 -1
  128. package/dist/sig/owner.test.js +23 -9
  129. package/dist/sig/proof.test.d.ts +2 -1
  130. package/dist/sig/proof.test.js +22 -10
  131. package/dist/std__assert-CaBUULmX.js +151 -0
  132. package/dist/testing/docloader.test.d.ts +2 -1
  133. package/dist/testing/docloader.test.js +11 -3
  134. package/dist/testing/mod.d.ts +1 -0
  135. package/dist/testing/mod.js +2 -136
  136. package/dist/testing-jcGLO9Lp.js +143 -0
  137. package/dist/{compat/transformers.js → transformers-jxj-4o2K.js} +1 -1
  138. package/dist/{vocab/type.js → type-D2s5lmbZ.js} +1 -0
  139. package/dist/{nodeinfo/types.js → types-CqoqWDkp.js} +2 -1
  140. package/dist/types-Cx0IUMu0.js +457 -0
  141. package/dist/{runtime/url.js → url-kTAI6_KP.js} +1 -0
  142. package/dist/vocab/actor.test.d.ts +2 -1
  143. package/dist/vocab/actor.test.js +5853 -14
  144. package/dist/vocab/lookup.test.d.ts +2 -1
  145. package/dist/vocab/lookup.test.js +20 -7
  146. package/dist/vocab/mod.d.ts +5 -5
  147. package/dist/vocab/mod.js +4 -5
  148. package/dist/vocab/type.test.d.ts +2 -1
  149. package/dist/vocab/type.test.js +9 -4
  150. package/dist/vocab/vocab.test.d.ts +2 -1
  151. package/dist/vocab/vocab.test.js +2440 -15
  152. package/dist/{vocab/vocab.d.ts → vocab-CLWdoo7y.d.ts} +21 -9
  153. package/dist/{vocab/vocab.js → vocab-Dwop3xOF.js} +331 -182
  154. package/dist/vocab-uQObf7P6.js +172 -0
  155. package/dist/webfinger/handler.test.d.ts +2 -1
  156. package/dist/webfinger/handler.test.js +39 -7
  157. package/dist/webfinger/lookup.test.d.ts +2 -1
  158. package/dist/webfinger/lookup.test.js +14 -4
  159. package/dist/webfinger/mod.d.ts +4 -2
  160. package/dist/webfinger/mod.js +3 -1
  161. package/dist/x/cfworkers.d.ts +49 -0
  162. package/dist/x/cfworkers.js +73 -0
  163. package/dist/x/cfworkers.test.d.ts +3 -0
  164. package/dist/x/cfworkers.test.js +153 -0
  165. package/dist/x/hono.d.ts +11 -2
  166. package/dist/x/sveltekit.d.ts +11 -2
  167. package/package.json +6 -1
  168. package/dist/codegen/fs.js +0 -23
  169. package/dist/codegen/schema.js +0 -88
  170. package/dist/codegen/type.js +0 -392
  171. package/dist/compat/types.d.ts +0 -18
  172. package/dist/deno.js +0 -137
  173. package/dist/federation/builder.d.ts +0 -19
  174. package/dist/federation/callback.d.ts +0 -211
  175. package/dist/federation/collection.d.ts +0 -36
  176. package/dist/federation/context.d.ts +0 -757
  177. package/dist/federation/federation.d.ts +0 -689
  178. package/dist/federation/handler.d.ts +0 -44
  179. package/dist/federation/handler.js +0 -543
  180. package/dist/federation/middleware.d.ts +0 -101
  181. package/dist/federation/negotiation.js +0 -63
  182. package/dist/federation/retry.d.ts +0 -71
  183. package/dist/federation/router.d.ts +0 -92
  184. package/dist/federation/send.d.ts +0 -29
  185. package/dist/node_modules/.pnpm/@jsr_hongminhee__deno-mock-fetch@0.3.2/node_modules/@jsr/hongminhee__deno-mock-fetch/mod.js +0 -101
  186. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_equals.js +0 -49
  187. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_exists.js +0 -32
  188. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_false.js +0 -26
  189. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater.js +0 -34
  190. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_greater_or_equal.js +0 -34
  191. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_strict_equals.js +0 -53
  192. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_string_includes.js +0 -32
  193. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assertion_error.js +0 -33
  194. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/equal.js +0 -79
  195. package/dist/node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/mod.js +0 -19
  196. package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/assertion_state.js +0 -177
  197. package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/build_message.js +0 -101
  198. package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/diff.js +0 -274
  199. package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/diff_str.js +0 -148
  200. package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/format.js +0 -37
  201. package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/mod.js +0 -10
  202. package/dist/node_modules/.pnpm/@jsr_std__internal@1.0.7/node_modules/@jsr/std__internal/styles.js +0 -172
  203. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/assert_path.js +0 -11
  204. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/constants.js +0 -10
  205. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/dirname.js +0 -14
  206. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/from_file_url.js +0 -13
  207. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/normalize.js +0 -14
  208. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/normalize_string.js +0 -60
  209. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/strip_trailing_separators.js +0 -15
  210. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_os.js +0 -9
  211. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/extname.js +0 -4
  212. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/format.js +0 -4
  213. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/from_file_url.js +0 -34
  214. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/glob_to_regexp.js +0 -4
  215. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/is_absolute.js +0 -4
  216. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/join.js +0 -4
  217. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/join_globs.js +0 -4
  218. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/mod.js +0 -5
  219. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/normalize.js +0 -4
  220. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/normalize_glob.js +0 -4
  221. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/parse.js +0 -4
  222. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/_util.js +0 -13
  223. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/dirname.js +0 -54
  224. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/from_file_url.js +0 -27
  225. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/join.js +0 -47
  226. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/normalize.js +0 -59
  227. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/relative.js +0 -4
  228. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/resolve.js +0 -4
  229. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/to_file_url.js +0 -4
  230. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/to_namespaced_path.js +0 -4
  231. package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/from_file_url.js +0 -31
  232. package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/_strip.js +0 -17
  233. package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/dirname.js +0 -38
  234. package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/join.js +0 -36
  235. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_chars.js +0 -47
  236. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_dumper_state.js +0 -4
  237. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_loader_state.js +0 -884
  238. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_schema.js +0 -120
  239. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/binary.js +0 -92
  240. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/bool.js +0 -41
  241. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/float.js +0 -58
  242. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/int.js +0 -118
  243. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/map.js +0 -18
  244. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/merge.js +0 -14
  245. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/nil.js +0 -23
  246. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/omap.js +0 -31
  247. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/pairs.js +0 -22
  248. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/regexp.js +0 -29
  249. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/seq.js +0 -14
  250. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/set.js +0 -17
  251. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/str.js +0 -14
  252. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/timestamp.js +0 -57
  253. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_type/undefined.js +0 -24
  254. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/_utils.js +0 -17
  255. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/mod.js +0 -5
  256. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/parse.js +0 -54
  257. package/dist/node_modules/.pnpm/@jsr_std__yaml@1.0.6/node_modules/@jsr/std__yaml/stringify.js +0 -4
  258. package/dist/node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.js +0 -68
  259. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/AlwaysShrinkableArbitrary.js +0 -30
  260. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/ArrayArbitrary.js +0 -203
  261. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/ArrayInt64Arbitrary.js +0 -122
  262. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/BigIntArbitrary.js +0 -63
  263. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/ConstantArbitrary.js +0 -58
  264. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/FrequencyArbitrary.js +0 -136
  265. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/IntegerArbitrary.js +0 -64
  266. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/LazyArbitrary.js +0 -29
  267. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/StringUnitArbitrary.js +0 -45
  268. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/TupleArbitrary.js +0 -74
  269. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/WithShrinkFromOtherArbitrary.js +0 -40
  270. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/AnyArbitraryBuilder.js +0 -97
  271. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/BoxedArbitraryBuilder.js +0 -13
  272. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/CharacterArbitraryBuilder.js +0 -17
  273. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/RestrictedIntegerArbitraryBuilder.js +0 -23
  274. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/builders/TypedIntArrayArbitraryBuilder.js +0 -32
  275. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/data/GraphemeRanges.js +0 -990
  276. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ArrayInt64.js +0 -98
  277. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/BiasNumericRange.js +0 -53
  278. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/BuildSlicedGenerator.js +0 -15
  279. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/CustomEqualSet.js +0 -27
  280. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DepthContext.js +0 -24
  281. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DoubleHelpers.js +0 -96
  282. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/DoubleOnlyHelpers.js +0 -25
  283. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatHelpers.js +0 -57
  284. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatOnlyHelpers.js +0 -26
  285. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/FloatingOnlyHelpers.js +0 -26
  286. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/GraphemeRangesHelpers.js +0 -58
  287. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/MaxLengthFromMinLength.js +0 -72
  288. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/NoUndefinedAsContext.js +0 -16
  289. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/QualifiedObjectConstraints.js +0 -58
  290. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SameValueSet.js +0 -41
  291. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SameValueZeroSet.js +0 -33
  292. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ShrinkBigInt.js +0 -37
  293. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/ShrinkInteger.js +0 -41
  294. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/SlicesForStringBuilder.js +0 -74
  295. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/StrictlyEqualSet.js +0 -38
  296. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/helpers/TokenizeString.js +0 -47
  297. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/implementations/NoopSlicedGenerator.js +0 -21
  298. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/implementations/SlicedBasedGenerator.js +0 -53
  299. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/ArrayToMap.js +0 -16
  300. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/ArrayToSet.js +0 -16
  301. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/CodePointsToString.js +0 -17
  302. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToCharString.js +0 -20
  303. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToMappedConstant.js +0 -69
  304. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/IndexToPrintableIndex.js +0 -18
  305. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/KeyValuePairsToObject.js +0 -42
  306. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/PatternsToString.js +0 -32
  307. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/TimeToDate.js +0 -30
  308. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/_internals/mappers/UnboxedToBoxed.js +0 -22
  309. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/anything.js +0 -14
  310. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/array.js +0 -22
  311. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/bigInt.js +0 -38
  312. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/boolean.js +0 -24
  313. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/constant.js +0 -13
  314. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/constantFrom.js +0 -14
  315. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/date.js +0 -30
  316. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/dictionary.js +0 -27
  317. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/double.js +0 -54
  318. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/float.js +0 -60
  319. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/float32Array.js +0 -22
  320. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/float64Array.js +0 -22
  321. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/fullUnicode.js +0 -24
  322. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/fullUnicodeString.js +0 -20
  323. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/int16Array.js +0 -15
  324. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/int32Array.js +0 -15
  325. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/int8Array.js +0 -15
  326. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/integer.js +0 -26
  327. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/letrec.js +0 -28
  328. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/mapToConstant.js +0 -26
  329. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/maxSafeInteger.js +0 -15
  330. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/nat.js +0 -17
  331. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/noBias.js +0 -11
  332. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/oneof.js +0 -31
  333. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/sparseArray.js +0 -68
  334. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/string.js +0 -32
  335. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/tuple.js +0 -13
  336. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint16Array.js +0 -15
  337. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint32Array.js +0 -15
  338. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint8Array.js +0 -15
  339. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uint8ClampedArray.js +0 -15
  340. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/arbitrary/uniqueArray.js +0 -47
  341. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/arbitrary/definition/Arbitrary.js +0 -184
  342. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/arbitrary/definition/Value.js +0 -31
  343. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js +0 -19
  344. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/IRawProperty.js +0 -12
  345. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/IgnoreEqualValuesProperty.js +0 -52
  346. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/Property.generic.js +0 -77
  347. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/Property.js +0 -22
  348. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/SkipAfterProperty.js +0 -61
  349. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/TimeoutProperty.js +0 -52
  350. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/property/UnbiasedProperty.js +0 -29
  351. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/DecorateProperty.js +0 -26
  352. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/Runner.js +0 -61
  353. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/RunnerIterator.js +0 -47
  354. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/SourceValuesIterator.js +0 -35
  355. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/Tosser.js +0 -33
  356. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/configuration/GlobalParameters.js +0 -12
  357. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/configuration/QualifiedParameters.js +0 -121
  358. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/configuration/VerbosityLevel.js +0 -14
  359. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/reporter/ExecutionStatus.js +0 -14
  360. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/reporter/RunExecution.js +0 -116
  361. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/utils/PathWalker.js +0 -24
  362. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/runner/utils/RunDetailsFormatter.js +0 -135
  363. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/symbols.js +0 -15
  364. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/random/generator/Random.js +0 -48
  365. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/stream/LazyIterableIterator.js +0 -24
  366. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/stream/Stream.js +0 -84
  367. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/stream/StreamHelpers.js +0 -50
  368. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/utils/apply.js +0 -28
  369. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/utils/globals.js +0 -309
  370. package/dist/node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/utils/stringify.js +0 -217
  371. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/CallHistory.js +0 -94
  372. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/FetchMock.js +0 -143
  373. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/IsSubsetOf.js +0 -103
  374. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Matchers.js +0 -195
  375. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/RequestUtils.js +0 -83
  376. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Route.js +0 -137
  377. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Router.js +0 -181
  378. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/StatusTextMap.js +0 -73
  379. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/TypeDescriptor.js +0 -97
  380. package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/index.js +0 -11
  381. package/dist/node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js +0 -87
  382. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UniformArrayIntDistribution.js +0 -20
  383. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UniformBigIntDistribution.js +0 -20
  384. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UniformIntDistribution.js +0 -20
  385. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformArrayIntDistribution.js +0 -20
  386. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js +0 -32
  387. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js +0 -43
  388. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js +0 -139
  389. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformArrayIntDistributionInternal.js +0 -26
  390. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformIntDistributionInternal.js +0 -14
  391. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/LinearCongruential.js +0 -53
  392. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/MersenneTwister.js +0 -114
  393. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/RandomGenerator.js +0 -26
  394. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/XorShift.js +0 -83
  395. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/generator/XoroShiro.js +0 -83
  396. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/pure-rand-default.js +0 -44
  397. package/dist/node_modules/.pnpm/pure-rand@6.1.0/node_modules/pure-rand/lib/esm/pure-rand.js +0 -22
  398. package/dist/node_modules/.pnpm/regexparam@3.0.0/node_modules/regexparam/dist/index.js +0 -37
  399. package/dist/nodeinfo/client.d.ts +0 -96
  400. package/dist/nodeinfo/handler.js +0 -46
  401. package/dist/nodeinfo/semver.d.ts +0 -78
  402. package/dist/nodeinfo/types.d.ts +0 -140
  403. package/dist/runtime/authdocloader.d.ts +0 -56
  404. package/dist/runtime/docloader.js +0 -291
  405. package/dist/runtime/key.js +0 -156
  406. package/dist/runtime/langstr.d.ts +0 -24
  407. package/dist/runtime/multibase/base.js +0 -32
  408. package/dist/runtime/multibase/constants.js +0 -172
  409. package/dist/runtime/multibase/index.js +0 -57
  410. package/dist/runtime/multibase/rfc4648.js +0 -61
  411. package/dist/runtime/multibase/util.js +0 -21
  412. package/dist/sig/http.d.ts +0 -143
  413. package/dist/sig/key.d.ts +0 -125
  414. package/dist/sig/proof.d.ts +0 -134
  415. package/dist/testing/fixtures/example.com/person.js +0 -29
  416. package/dist/testing/fixtures/example.com/person2.js +0 -48
  417. package/dist/vocab/constants.d.ts +0 -24
  418. package/dist/vocab/constants.js +0 -17
  419. package/dist/vocab/type.d.ts +0 -107
  420. package/dist/webfinger/handler.js +0 -140
  421. package/dist/webfinger/lookup.d.ts +0 -47
  422. /package/dist/{node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_object_match.js → compat-Bb5myD13.js} +0 -0
  423. /package/dist/{testing/fixtures → fixtures}/activitypub.academy/users/brauca_darradiul.json +0 -0
  424. /package/dist/{testing/fixtures → fixtures}/example.com/announce.json +0 -0
  425. /package/dist/{testing/fixtures → fixtures}/example.com/collection.json +0 -0
  426. /package/dist/{testing/fixtures → fixtures}/example.com/create.json +0 -0
  427. /package/dist/{testing/fixtures → fixtures}/example.com/cross-origin-actor.json +0 -0
  428. /package/dist/{testing/fixtures → fixtures}/example.com/hong-gildong.json +0 -0
  429. /package/dist/{testing/fixtures → fixtures}/example.com/invite.json +0 -0
  430. /package/dist/{testing/fixtures → fixtures}/example.com/key.json +0 -0
  431. /package/dist/{testing/fixtures → fixtures}/example.com/key2.json +0 -0
  432. /package/dist/{testing/fixtures → fixtures}/example.com/object.json +0 -0
  433. /package/dist/{testing/fixtures → fixtures}/example.com/orderedcollectionpage.json +0 -0
  434. /package/dist/{testing/fixtures → fixtures}/example.com/paged/a.json +0 -0
  435. /package/dist/{testing/fixtures → fixtures}/example.com/paged/b.json +0 -0
  436. /package/dist/{testing/fixtures → fixtures}/example.com/paged-collection.json +0 -0
  437. /package/dist/{testing/fixtures → fixtures}/example.com/person.json +0 -0
  438. /package/dist/{testing/fixtures → fixtures}/example.com/person2.json +0 -0
  439. /package/dist/{testing/fixtures → fixtures}/example.com/test.json +0 -0
  440. /package/dist/{testing/fixtures → fixtures}/example.com/users/handle.json +0 -0
  441. /package/dist/{testing/fixtures → fixtures}/example.com/wrong-type.json +0 -0
  442. /package/dist/{testing/fixtures → fixtures}/remote.domain/users/bob.json +0 -0
  443. /package/dist/{testing/fixtures → fixtures}/server.example/users/alice.json +0 -0
  444. /package/dist/{testing/fixtures → fixtures}/w3id.org/identity/v1.json +0 -0
  445. /package/dist/{testing/fixtures → fixtures}/w3id.org/security/data-integrity/v1.json +0 -0
  446. /package/dist/{testing/fixtures → fixtures}/w3id.org/security/multikey/v1.json +0 -0
  447. /package/dist/{testing/fixtures → fixtures}/w3id.org/security/v1.json +0 -0
  448. /package/dist/{testing/fixtures → fixtures}/wizard.casa/users/hongminhee.json +0 -0
  449. /package/dist/{testing/fixtures → fixtures}/www.w3.org/ns/activitystreams.json +0 -0
  450. /package/dist/{testing/fixtures → fixtures}/www.w3.org/ns/did/v1.json +0 -0
  451. /package/dist/{federation/kv.d.ts → kv-BmsWxOQ2.d.ts} +0 -0
  452. /package/dist/{federation/mq.d.ts → mq-Bue016Tz.d.ts} +0 -0
  453. /package/dist/{node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/basename.js → nodeinfo-CyEbLjHs.js} +0 -0
  454. /package/dist/{node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/common.js → runtime-BSkOVUWM.js} +0 -0
  455. /package/dist/{node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/constants.js → sig-BXJO--F9.js} +0 -0
  456. /package/dist/{codegen → vocab}/schema.yaml +0 -0
  457. /package/dist/{node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/dirname.js → webfinger-C3GIyXIg.js} +0 -0
@@ -0,0 +1,720 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+
5
+ import { deno_default } from "./docloader-lJiW6zUk.js";
6
+ import { CryptographicKey } from "./actor-trV1ExpS.js";
7
+ import { fetchKey, validateCryptoKey } from "./key-a7_2L5_Z.js";
8
+ import { getLogger } from "@logtape/logtape";
9
+ import { SpanStatusCode, trace } from "@opentelemetry/api";
10
+ import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
11
+ import { encodeHex } from "byte-encodings/hex";
12
+ import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
13
+ import { Item, decodeDict, encodeItem } from "structured-field-values";
14
+
15
+ //#region sig/http.ts
16
+ /**
17
+ * Signs a request using the given private key.
18
+ * @param request The request to sign.
19
+ * @param privateKey The private key to use for signing.
20
+ * @param keyId The key ID to use for the signature. It will be used by the
21
+ * verifier.
22
+ * @returns The signed request.
23
+ * @throws {TypeError} If the private key is invalid or unsupported.
24
+ */
25
+ async function signRequest(request, privateKey, keyId, options = {}) {
26
+ validateCryptoKey(privateKey, "private");
27
+ const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
28
+ const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
29
+ return await tracer.startActiveSpan("http_signatures.sign", async (span) => {
30
+ try {
31
+ const spec = options.spec ?? "draft-cavage-http-signatures-12";
32
+ let signed;
33
+ if (spec === "rfc9421") signed = await signRequestRfc9421(request, privateKey, keyId, span, options.currentTime);
34
+ else signed = await signRequestDraft(request, privateKey, keyId, span, options.currentTime);
35
+ if (span.isRecording()) {
36
+ span.setAttribute(ATTR_HTTP_REQUEST_METHOD, signed.method);
37
+ span.setAttribute(ATTR_URL_FULL, signed.url);
38
+ for (const [name, value] of signed.headers) span.setAttribute(ATTR_HTTP_REQUEST_HEADER(name), value);
39
+ span.setAttribute("http_signatures.key_id", keyId.href);
40
+ }
41
+ return signed;
42
+ } catch (error) {
43
+ span.setStatus({
44
+ code: SpanStatusCode.ERROR,
45
+ message: String(error)
46
+ });
47
+ throw error;
48
+ } finally {
49
+ span.end();
50
+ }
51
+ });
52
+ }
53
+ async function signRequestDraft(request, privateKey, keyId, span, currentTime) {
54
+ if (privateKey.algorithm.name !== "RSASSA-PKCS1-v1_5") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
55
+ const url = new URL(request.url);
56
+ const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
57
+ const headers = new Headers(request.headers);
58
+ if (!headers.has("Host")) headers.set("Host", url.host);
59
+ if (!headers.has("Digest") && body != null) {
60
+ const digest = await crypto.subtle.digest("SHA-256", body);
61
+ headers.set("Digest", `SHA-256=${encodeBase64(digest)}`);
62
+ if (span.isRecording()) span.setAttribute("http_signatures.digest.sha-256", encodeHex(digest));
63
+ }
64
+ if (!headers.has("Date")) headers.set("Date", currentTime == null ? new Date().toUTCString() : new Date(currentTime.toString()).toUTCString());
65
+ const serialized = [["(request-target)", `${request.method.toLowerCase()} ${url.pathname}`], ...headers];
66
+ const headerNames = serialized.map(([name]) => name);
67
+ const message = serialized.map(([name, value]) => `${name}: ${value.trim()}`).join("\n");
68
+ const signature = await crypto.subtle.sign("RSASSA-PKCS1-v1_5", privateKey, new TextEncoder().encode(message));
69
+ const sigHeader = `keyId="${keyId.href}",algorithm="rsa-sha256",headers="${headerNames.join(" ")}",signature="${encodeBase64(signature)}"`;
70
+ headers.set("Signature", sigHeader);
71
+ if (span.isRecording()) {
72
+ span.setAttribute("http_signatures.algorithm", "rsa-sha256");
73
+ span.setAttribute("http_signatures.signature", encodeHex(signature));
74
+ }
75
+ return new Request(request, {
76
+ headers,
77
+ body
78
+ });
79
+ }
80
+ function formatRfc9421SignatureParameters(params) {
81
+ return `alg="${params.algorithm}";keyid="${params.keyId.href}";created=${params.created}`;
82
+ }
83
+ /**
84
+ * Creates a signature base for a request according to RFC 9421.
85
+ * @param request The request to create a signature base for.
86
+ * @param components The components to include in the signature base.
87
+ * @param parameters The signature parameters to include in the signature base.
88
+ * @returns The signature base as a string.
89
+ */
90
+ function createRfc9421SignatureBase(request, components, parameters) {
91
+ const url = new URL(request.url);
92
+ const baseComponents = [];
93
+ for (const component of components) {
94
+ let value;
95
+ if (component === "@method") value = request.method.toUpperCase();
96
+ else if (component === "@target-uri") value = request.url;
97
+ else if (component === "@authority") value = url.host;
98
+ else if (component === "@scheme") value = url.protocol.slice(0, -1);
99
+ else if (component === "@request-target") value = `${request.method.toLowerCase()} ${url.pathname}${url.search}`;
100
+ else if (component === "@path") value = url.pathname;
101
+ else if (component === "@query") value = url.search.startsWith("?") ? url.search.slice(1) : url.search;
102
+ else if (component === "@query-param") throw new Error("@query-param requires a parameter name");
103
+ else if (component === "@status") throw new Error("@status is only valid for responses");
104
+ else if (component.startsWith("@")) throw new Error(`Unsupported derived component: ${component}`);
105
+ else value = request.headers.get(component) || "";
106
+ baseComponents.push(`"${component}": ${value}`);
107
+ }
108
+ const sigComponents = components.map((c) => `"${c}"`).join(" ");
109
+ baseComponents.push(`"@signature-params": (${sigComponents});${parameters}`);
110
+ return baseComponents.join("\n");
111
+ }
112
+ /**
113
+ * Formats a signature using rfc9421 format.
114
+ * @param signature The raw signature bytes.
115
+ * @param components The components that were signed.
116
+ * @param parameters The signature parameters.
117
+ * @returns The formatted signature string.
118
+ */
119
+ function formatRfc9421Signature(signature, components, parameters) {
120
+ const signatureInputValue = `sig1=("${components.join("\" \"")}");${parameters}`;
121
+ const signatureValue = `sig1=:${encodeBase64(signature)}:`;
122
+ return [signatureInputValue, signatureValue];
123
+ }
124
+ /**
125
+ * Parse RFC 9421 Signature-Input header.
126
+ * @param signatureInput The Signature-Input header value.
127
+ * @returns Parsed signature input parameters.
128
+ */
129
+ function parseRfc9421SignatureInput(signatureInput) {
130
+ let dict;
131
+ try {
132
+ dict = decodeDict(signatureInput);
133
+ } catch (error) {
134
+ getLogger([
135
+ "fedify",
136
+ "sig",
137
+ "http"
138
+ ]).debug("Failed to parse Signature-Input header: {signatureInput}", {
139
+ signatureInput,
140
+ error
141
+ });
142
+ return {};
143
+ }
144
+ const result = {};
145
+ for (const [label, item] of Object.entries(dict)) {
146
+ if (!Array.isArray(item.value) || typeof item.params.keyid !== "string" || typeof item.params.created !== "number") continue;
147
+ const components = item.value.map((subitem) => subitem.value).filter((v) => typeof v === "string");
148
+ const params = encodeItem(new Item(0, item.params));
149
+ result[label] = {
150
+ keyId: item.params.keyid,
151
+ alg: item.params.alg,
152
+ created: item.params.created,
153
+ components,
154
+ parameters: params.slice(params.indexOf(";") + 1)
155
+ };
156
+ }
157
+ return result;
158
+ }
159
+ /**
160
+ * Parse RFC 9421 Signature header.
161
+ * @param signature The Signature header value.
162
+ * @returns Parsed signature values.
163
+ */
164
+ function parseRfc9421Signature(signature) {
165
+ let dict;
166
+ try {
167
+ dict = decodeDict(signature);
168
+ } catch (error) {
169
+ getLogger([
170
+ "fedify",
171
+ "sig",
172
+ "http"
173
+ ]).debug("Failed to parse Signature header: {signature}", {
174
+ signature,
175
+ error
176
+ });
177
+ return {};
178
+ }
179
+ const result = {};
180
+ for (const [key, value] of Object.entries(dict)) if (value.value instanceof Uint8Array) result[key] = value.value;
181
+ return result;
182
+ }
183
+ async function signRequestRfc9421(request, privateKey, keyId, span, currentTime) {
184
+ if (privateKey.algorithm.name !== "RSASSA-PKCS1-v1_5") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
185
+ const url = new URL(request.url);
186
+ const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
187
+ const headers = new Headers(request.headers);
188
+ if (!headers.has("Host")) headers.set("Host", url.host);
189
+ if (!headers.has("Content-Digest") && body != null) {
190
+ const digest = await crypto.subtle.digest("SHA-256", body);
191
+ headers.set("Content-Digest", `sha-256=:${encodeBase64(digest)}:`);
192
+ if (span.isRecording()) span.setAttribute("http_signatures.digest.sha-256", encodeHex(digest));
193
+ }
194
+ const created = (currentTime ?? Temporal.Now.instant()).epochMilliseconds / 1e3;
195
+ const components = [
196
+ "@method",
197
+ "@target-uri",
198
+ "@authority",
199
+ "host",
200
+ "date"
201
+ ];
202
+ if (body != null) components.push("content-digest");
203
+ const signatureParams = formatRfc9421SignatureParameters({
204
+ algorithm: "rsa-v1_5-sha256",
205
+ keyId,
206
+ created
207
+ });
208
+ const signatureBase = createRfc9421SignatureBase(new Request(request.url, {
209
+ method: request.method,
210
+ headers
211
+ }), components, signatureParams);
212
+ const signatureBytes = await crypto.subtle.sign("RSASSA-PKCS1-v1_5", privateKey, new TextEncoder().encode(signatureBase));
213
+ const [signatureInput, signature] = formatRfc9421Signature(signatureBytes, components, signatureParams);
214
+ headers.set("Signature-Input", signatureInput);
215
+ headers.set("Signature", signature);
216
+ if (span.isRecording()) {
217
+ span.setAttribute("http_signatures.algorithm", "rsa-v1_5-sha256");
218
+ span.setAttribute("http_signatures.signature", encodeHex(signatureBytes));
219
+ span.setAttribute("http_signatures.created", created.toString());
220
+ }
221
+ return new Request(request, {
222
+ headers,
223
+ body
224
+ });
225
+ }
226
+ const supportedHashAlgorithms = {
227
+ "sha": "SHA-1",
228
+ "sha-256": "SHA-256",
229
+ "sha-512": "SHA-512"
230
+ };
231
+ /**
232
+ * Verifies the signature of a request.
233
+ *
234
+ * Note that this function consumes the request body, so it should not be used
235
+ * if the request body is already consumed. Consuming the request body after
236
+ * calling this function is okay, since this function clones the request
237
+ * under the hood.
238
+ *
239
+ * @param request The request to verify.
240
+ * @param options Options for verifying the request.
241
+ * @returns The public key of the verified signature, or `null` if the signature
242
+ * could not be verified.
243
+ */
244
+ async function verifyRequest(request, options = {}) {
245
+ const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
246
+ const tracer = tracerProvider.getTracer(deno_default.name, deno_default.version);
247
+ return await tracer.startActiveSpan("http_signatures.verify", async (span) => {
248
+ if (span.isRecording()) {
249
+ span.setAttribute(ATTR_HTTP_REQUEST_METHOD, request.method);
250
+ span.setAttribute(ATTR_URL_FULL, request.url);
251
+ for (const [name, value] of request.headers) span.setAttribute(ATTR_HTTP_REQUEST_HEADER(name), value);
252
+ }
253
+ try {
254
+ let spec = options.spec;
255
+ if (spec == null) spec = request.headers.has("Signature-Input") ? "rfc9421" : "draft-cavage-http-signatures-12";
256
+ let key;
257
+ if (spec === "rfc9421") key = await verifyRequestRfc9421(request, span, options);
258
+ else key = await verifyRequestDraft(request, span, options);
259
+ if (key == null) span.setStatus({ code: SpanStatusCode.ERROR });
260
+ return key;
261
+ } catch (error) {
262
+ span.setStatus({
263
+ code: SpanStatusCode.ERROR,
264
+ message: String(error)
265
+ });
266
+ throw error;
267
+ } finally {
268
+ span.end();
269
+ }
270
+ });
271
+ }
272
+ async function verifyRequestDraft(request, span, { documentLoader, contextLoader, timeWindow, currentTime, keyCache, tracerProvider } = {}) {
273
+ const logger = getLogger([
274
+ "fedify",
275
+ "sig",
276
+ "http"
277
+ ]);
278
+ if (request.bodyUsed) {
279
+ logger.error("Failed to verify; the request body is already consumed.", { url: request.url });
280
+ return null;
281
+ } else if (request.body?.locked) {
282
+ logger.error("Failed to verify; the request body is locked.", { url: request.url });
283
+ return null;
284
+ }
285
+ const originalRequest = request;
286
+ request = request.clone();
287
+ const dateHeader = request.headers.get("Date");
288
+ if (dateHeader == null) {
289
+ logger.debug("Failed to verify; no Date header found.", { headers: Object.fromEntries(request.headers.entries()) });
290
+ return null;
291
+ }
292
+ const sigHeader = request.headers.get("Signature");
293
+ if (sigHeader == null) {
294
+ logger.debug("Failed to verify; no Signature header found.", { headers: Object.fromEntries(request.headers.entries()) });
295
+ return null;
296
+ }
297
+ const digestHeader = request.headers.get("Digest");
298
+ if (request.method !== "GET" && request.method !== "HEAD" && digestHeader == null) {
299
+ logger.debug("Failed to verify; no Digest header found.", { headers: Object.fromEntries(request.headers.entries()) });
300
+ return null;
301
+ }
302
+ let body = null;
303
+ if (digestHeader != null) {
304
+ body = await request.arrayBuffer();
305
+ const digests = digestHeader.split(",").map((pair) => pair.includes("=") ? pair.split("=", 2) : [pair, ""]);
306
+ let matched = false;
307
+ for (let [algo, digestBase64] of digests) {
308
+ algo = algo.trim().toLowerCase();
309
+ if (!(algo in supportedHashAlgorithms)) continue;
310
+ let digest;
311
+ try {
312
+ digest = decodeBase64(digestBase64);
313
+ } catch (error) {
314
+ logger.debug("Failed to verify; invalid base64 encoding: {digest}.", {
315
+ digest: digestBase64,
316
+ error
317
+ });
318
+ return null;
319
+ }
320
+ if (span.isRecording()) span.setAttribute(`http_signatures.digest.${algo}`, encodeHex(digest));
321
+ const expectedDigest = await crypto.subtle.digest(supportedHashAlgorithms[algo], body);
322
+ if (!timingSafeEqual(digest, new Uint8Array(expectedDigest))) {
323
+ logger.debug("Failed to verify; digest mismatch ({algorithm}): {digest} != {expectedDigest}.", {
324
+ algorithm: algo,
325
+ digest: digestBase64,
326
+ expectedDigest: encodeBase64(expectedDigest)
327
+ });
328
+ return null;
329
+ }
330
+ matched = true;
331
+ }
332
+ if (!matched) {
333
+ logger.debug("Failed to verify; no supported digest algorithm found. Supported: {supportedAlgorithms}; found: {algorithms}.", {
334
+ supportedAlgorithms: Object.keys(supportedHashAlgorithms),
335
+ algorithms: digests.map(([algo]) => algo)
336
+ });
337
+ return null;
338
+ }
339
+ }
340
+ const date = Temporal.Instant.from(new Date(dateHeader).toISOString());
341
+ const now = currentTime ?? Temporal.Now.instant();
342
+ if (timeWindow !== false) {
343
+ const tw = timeWindow ?? { hours: 1 };
344
+ if (Temporal.Instant.compare(date, now.add(tw)) > 0) {
345
+ logger.debug("Failed to verify; Date is too far in the future.", {
346
+ date: date.toString(),
347
+ now: now.toString()
348
+ });
349
+ return null;
350
+ } else if (Temporal.Instant.compare(date, now.subtract(tw)) < 0) {
351
+ logger.debug("Failed to verify; Date is too far in the past.", {
352
+ date: date.toString(),
353
+ now: now.toString()
354
+ });
355
+ return null;
356
+ }
357
+ }
358
+ const sigValues = Object.fromEntries(sigHeader.split(",").map((pair) => pair.match(/^\s*([A-Za-z]+)="([^"]*)"\s*$/)).filter((m) => m != null).map((m) => m.slice(1, 3)));
359
+ if (!("keyId" in sigValues)) {
360
+ logger.debug("Failed to verify; no keyId field found in the Signature header.", { signature: sigHeader });
361
+ return null;
362
+ } else if (!("headers" in sigValues)) {
363
+ logger.debug("Failed to verify; no headers field found in the Signature header.", { signature: sigHeader });
364
+ return null;
365
+ } else if (!("signature" in sigValues)) {
366
+ logger.debug("Failed to verify; no signature field found in the Signature header.", { signature: sigHeader });
367
+ return null;
368
+ }
369
+ const { keyId, headers, signature } = sigValues;
370
+ span?.setAttribute("http_signatures.key_id", keyId);
371
+ if ("algorithm" in sigValues) span?.setAttribute("http_signatures.algorithm", sigValues.algorithm);
372
+ const { key, cached } = await fetchKey(new URL(keyId), CryptographicKey, {
373
+ documentLoader,
374
+ contextLoader,
375
+ keyCache,
376
+ tracerProvider
377
+ });
378
+ if (key == null) return null;
379
+ const headerNames = headers.split(/\s+/g);
380
+ if (!headerNames.includes("(request-target)") || !headerNames.includes("date")) {
381
+ logger.debug("Failed to verify; required headers missing in the Signature header: {headers}.", { headers });
382
+ return null;
383
+ }
384
+ if (body != null && !headerNames.includes("digest")) {
385
+ logger.debug("Failed to verify; required headers missing in the Signature header: {headers}.", { headers });
386
+ return null;
387
+ }
388
+ const message = headerNames.map((name) => `${name}: ` + (name == "(request-target)" ? `${request.method.toLowerCase()} ${new URL(request.url).pathname}` : name == "host" ? request.headers.get("host") ?? new URL(request.url).host : request.headers.get(name))).join("\n");
389
+ const sig = decodeBase64(signature);
390
+ span?.setAttribute("http_signatures.signature", encodeHex(sig));
391
+ const verified = await crypto.subtle.verify("RSASSA-PKCS1-v1_5", key.publicKey, sig, new TextEncoder().encode(message));
392
+ if (!verified) {
393
+ if (cached) {
394
+ logger.debug("Failed to verify with the cached key {keyId}; signature {signature} is invalid. Retrying with the freshly fetched key...", {
395
+ keyId,
396
+ signature,
397
+ message
398
+ });
399
+ return await verifyRequest(originalRequest, {
400
+ documentLoader,
401
+ contextLoader,
402
+ timeWindow,
403
+ currentTime,
404
+ keyCache: {
405
+ get: () => Promise.resolve(void 0),
406
+ set: async (keyId$1, key$1) => await keyCache?.set(keyId$1, key$1)
407
+ }
408
+ });
409
+ }
410
+ logger.debug("Failed to verify with the fetched key {keyId}; signature {signature} is invalid. Check if the key is correct or if the signed message is correct. The message to sign is:\n{message}", {
411
+ keyId,
412
+ signature,
413
+ message
414
+ });
415
+ return null;
416
+ }
417
+ return key;
418
+ }
419
+ /**
420
+ * RFC 9421 map of algorithm identifiers to WebCrypto algorithms
421
+ */
422
+ const rfc9421AlgorithmMap = {
423
+ "rsa-v1_5-sha256": {
424
+ name: "RSASSA-PKCS1-v1_5",
425
+ hash: "SHA-256"
426
+ },
427
+ "rsa-v1_5-sha512": {
428
+ name: "RSASSA-PKCS1-v1_5",
429
+ hash: "SHA-512"
430
+ },
431
+ "rsa-pss-sha512": {
432
+ name: "RSA-PSS",
433
+ hash: "SHA-512"
434
+ },
435
+ "ecdsa-p256-sha256": {
436
+ name: "ECDSA",
437
+ hash: "SHA-256"
438
+ },
439
+ "ecdsa-p384-sha384": {
440
+ name: "ECDSA",
441
+ hash: "SHA-384"
442
+ },
443
+ "ed25519": { name: "Ed25519" }
444
+ };
445
+ /**
446
+ * Verifies a Content-Digest header according to RFC 9421.
447
+ * @param digestHeader The Content-Digest header value.
448
+ * @param body The message body to verify against.
449
+ * @returns Whether the digest is valid.
450
+ */
451
+ async function verifyRfc9421ContentDigest(digestHeader, body) {
452
+ const digests = digestHeader.split(",").map((pair) => {
453
+ pair = pair.trim();
454
+ const pos = pair.indexOf("=");
455
+ const algo = pos < 0 ? pair : pair.slice(0, pos);
456
+ const value = pos < 0 ? "" : pair.slice(pos + 1);
457
+ return {
458
+ algo: algo.trim().toLowerCase(),
459
+ value: value.trim()
460
+ };
461
+ });
462
+ for (const { algo, value } of digests) {
463
+ let hashAlgo;
464
+ if (algo === "sha-256") hashAlgo = "SHA-256";
465
+ else if (algo === "sha-512") hashAlgo = "SHA-512";
466
+ else continue;
467
+ const base64Match = value.match(/^:([^:]+):$/);
468
+ if (!base64Match) continue;
469
+ let digest;
470
+ try {
471
+ digest = decodeBase64(base64Match[1]);
472
+ } catch {
473
+ continue;
474
+ }
475
+ const calculatedDigest = await crypto.subtle.digest(hashAlgo, body);
476
+ if (timingSafeEqual(digest, new Uint8Array(calculatedDigest))) return true;
477
+ }
478
+ return false;
479
+ }
480
+ async function verifyRequestRfc9421(request, span, { documentLoader, contextLoader, timeWindow, currentTime, keyCache, tracerProvider } = {}) {
481
+ const logger = getLogger([
482
+ "fedify",
483
+ "sig",
484
+ "http"
485
+ ]);
486
+ if (request.bodyUsed) {
487
+ logger.error("Failed to verify; the request body is already consumed.", { url: request.url });
488
+ return null;
489
+ } else if (request.body?.locked) {
490
+ logger.error("Failed to verify; the request body is locked.", { url: request.url });
491
+ return null;
492
+ }
493
+ const originalRequest = request;
494
+ request = request.clone();
495
+ const signatureInputHeader = request.headers.get("Signature-Input");
496
+ if (!signatureInputHeader) {
497
+ logger.debug("Failed to verify; no Signature-Input header found.", { headers: Object.fromEntries(request.headers.entries()) });
498
+ return null;
499
+ }
500
+ const signatureHeader = request.headers.get("Signature");
501
+ if (!signatureHeader) {
502
+ logger.debug("Failed to verify; no Signature header found.", { headers: Object.fromEntries(request.headers.entries()) });
503
+ return null;
504
+ }
505
+ const signatureInputs = parseRfc9421SignatureInput(signatureInputHeader);
506
+ logger.debug("Parsed Signature-Input header: {signatureInputs}", { signatureInputs });
507
+ const signatures = parseRfc9421Signature(signatureHeader);
508
+ const signatureNames = Object.keys(signatureInputs);
509
+ if (signatureNames.length === 0) {
510
+ logger.debug("Failed to verify; no valid signatures found in Signature-Input header.", { header: signatureInputHeader });
511
+ return null;
512
+ }
513
+ let validKey = null;
514
+ for (const sigName of signatureNames) {
515
+ if (!signatures[sigName]) continue;
516
+ const sigInput = signatureInputs[sigName];
517
+ const sigBytes = signatures[sigName];
518
+ if (!sigInput.keyId) {
519
+ logger.debug("Failed to verify; missing keyId in signature {signatureName}.", {
520
+ signatureName: sigName,
521
+ signatureInput: signatureInputHeader
522
+ });
523
+ continue;
524
+ }
525
+ if (!sigInput.created) {
526
+ logger.debug("Failed to verify; missing created timestamp in signature {signatureName}.", {
527
+ signatureName: sigName,
528
+ signatureInput: signatureInputHeader
529
+ });
530
+ continue;
531
+ }
532
+ const signatureCreated = Temporal.Instant.fromEpochMilliseconds(sigInput.created * 1e3);
533
+ const now = currentTime ?? Temporal.Now.instant();
534
+ if (timeWindow !== false) {
535
+ const tw = timeWindow ?? { hours: 1 };
536
+ if (Temporal.Instant.compare(signatureCreated, now.add(tw)) > 0) {
537
+ logger.debug("Failed to verify; signature created time is too far in the future.", {
538
+ created: signatureCreated.toString(),
539
+ now: now.toString()
540
+ });
541
+ continue;
542
+ } else if (Temporal.Instant.compare(signatureCreated, now.subtract(tw)) < 0) {
543
+ logger.debug("Failed to verify; signature created time is too far in the past.", {
544
+ created: signatureCreated.toString(),
545
+ now: now.toString()
546
+ });
547
+ continue;
548
+ }
549
+ }
550
+ if (request.method !== "GET" && request.method !== "HEAD" && sigInput.components.includes("content-digest")) {
551
+ const contentDigestHeader = request.headers.get("Content-Digest");
552
+ if (!contentDigestHeader) {
553
+ logger.debug("Failed to verify; Content-Digest header required but not found.", { components: sigInput.components });
554
+ continue;
555
+ }
556
+ const body = await request.arrayBuffer();
557
+ const digestValid = await verifyRfc9421ContentDigest(contentDigestHeader, body);
558
+ if (!digestValid) {
559
+ logger.debug("Failed to verify; Content-Digest verification failed.", { contentDigest: contentDigestHeader });
560
+ continue;
561
+ }
562
+ }
563
+ span?.setAttribute("http_signatures.key_id", sigInput.keyId);
564
+ span?.setAttribute("http_signatures.created", sigInput.created.toString());
565
+ const { key, cached } = await fetchKey(new URL(sigInput.keyId), CryptographicKey, {
566
+ documentLoader,
567
+ contextLoader,
568
+ keyCache,
569
+ tracerProvider
570
+ });
571
+ if (!key) {
572
+ logger.debug("Failed to fetch key: {keyId}", { keyId: sigInput.keyId });
573
+ continue;
574
+ }
575
+ let alg = sigInput.alg?.toLowerCase();
576
+ if (alg == null) {
577
+ if (key.publicKey.algorithm.name === "RSASSA-PKCS1-v1_5") alg = "hash" in key.publicKey.algorithm ? key.publicKey.algorithm.hash === "SHA-512" ? "rsa-v1_5-sha512" : "rsa-v1_5-sha256" : "rsa-v1_5-sha256";
578
+ else if (key.publicKey.algorithm.name === "RSA-PSS") alg = "rsa-pss-sha512";
579
+ else if (key.publicKey.algorithm.name === "ECDSA") alg = "namedCurve" in key.publicKey.algorithm && key.publicKey.algorithm.namedCurve === "P-256" ? "ecdsa-p256-sha256" : "ecdsa-p384-sha384";
580
+ else if (key.publicKey.algorithm.name === "Ed25519") alg = "ed25519";
581
+ }
582
+ if (alg) span?.setAttribute("http_signatures.algorithm", alg);
583
+ const algorithm = alg && rfc9421AlgorithmMap[alg];
584
+ if (!algorithm) {
585
+ logger.debug("Failed to verify; unsupported algorithm: {algorithm}", {
586
+ algorithm: sigInput.alg,
587
+ supported: Object.keys(rfc9421AlgorithmMap)
588
+ });
589
+ continue;
590
+ }
591
+ const signatureBase = createRfc9421SignatureBase(request, sigInput.components, sigInput.parameters);
592
+ const signatureBaseBytes = new TextEncoder().encode(signatureBase);
593
+ span?.setAttribute("http_signatures.signature", encodeHex(sigBytes));
594
+ try {
595
+ const verified = await crypto.subtle.verify(algorithm, key.publicKey, sigBytes, signatureBaseBytes);
596
+ if (verified) {
597
+ validKey = key;
598
+ break;
599
+ } else if (cached) {
600
+ logger.debug("Failed to verify with cached key {keyId}; retrying with fresh key...", { keyId: sigInput.keyId });
601
+ return await verifyRequest(originalRequest, {
602
+ documentLoader,
603
+ contextLoader,
604
+ timeWindow,
605
+ currentTime,
606
+ keyCache: {
607
+ get: () => Promise.resolve(void 0),
608
+ set: async (keyId, key$1) => await keyCache?.set(keyId, key$1)
609
+ },
610
+ spec: "rfc9421"
611
+ });
612
+ } else logger.debug("Failed to verify signature with fetched key {keyId}; signature invalid.", {
613
+ keyId: sigInput.keyId,
614
+ signatureBase
615
+ });
616
+ } catch (error) {
617
+ logger.debug("Error during signature verification: {error}", {
618
+ error,
619
+ keyId: sigInput.keyId,
620
+ algorithm: sigInput.alg
621
+ });
622
+ }
623
+ }
624
+ return validKey;
625
+ }
626
+ /**
627
+ * Performs a double-knock request to the given URL. For the details of
628
+ * double-knocking, see
629
+ * <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>.
630
+ * @param request The request to send.
631
+ * @param identity The identity to use for signing the request.
632
+ * @param options The options for double-knock requests.
633
+ * @returns The response to the request.
634
+ * @since 1.6.0
635
+ */
636
+ async function doubleKnock(request, identity, options = {}) {
637
+ const { specDeterminer, log, tracerProvider } = options;
638
+ const origin = new URL(request.url).origin;
639
+ const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
640
+ let signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
641
+ spec: firstTrySpec,
642
+ tracerProvider
643
+ });
644
+ log?.(signedRequest);
645
+ let response = await fetch(signedRequest, { redirect: "manual" });
646
+ if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
647
+ const location = response.headers.get("Location");
648
+ const body = request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : void 0;
649
+ return doubleKnock(new Request(location, {
650
+ method: request.method,
651
+ headers: request.headers,
652
+ body,
653
+ redirect: "manual",
654
+ signal: request.signal,
655
+ mode: request.mode,
656
+ credentials: request.credentials,
657
+ referrer: request.referrer,
658
+ referrerPolicy: request.referrerPolicy,
659
+ integrity: request.integrity,
660
+ keepalive: request.keepalive
661
+ }), identity, options);
662
+ } else if (response.status === 400 || response.status === 401) {
663
+ const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
664
+ getLogger([
665
+ "fedify",
666
+ "sig",
667
+ "http"
668
+ ]).debug("Failed to verify with the spec {spec} ({status} {statusText}); retrying with spec {secondSpec}... (double-knocking)", {
669
+ spec: firstTrySpec,
670
+ secondSpec: spec,
671
+ status: response.status,
672
+ statusText: response.statusText
673
+ });
674
+ signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
675
+ spec,
676
+ tracerProvider
677
+ });
678
+ log?.(signedRequest);
679
+ response = await fetch(signedRequest, { redirect: "manual" });
680
+ if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
681
+ const location = response.headers.get("Location");
682
+ const body = request.method !== "GET" && request.method !== "HEAD" ? request.clone().body : null;
683
+ return doubleKnock(new Request(location, {
684
+ ...request,
685
+ body
686
+ }), identity, options);
687
+ } else if (response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
688
+ } else await specDeterminer?.rememberSpec(origin, firstTrySpec);
689
+ return response;
690
+ }
691
+ /**
692
+ * Performs a timing-safe equality comparison between two `Uint8Array` values.
693
+ *
694
+ * This function is designed to take a constant amount of time to execute,
695
+ * dependent only on the length of the longer of the two arrays,
696
+ * regardless of where the first difference in bytes occurs. This helps
697
+ * prevent timing attacks.
698
+ *
699
+ * @param a The first bytes.
700
+ * @param b The second bytes.
701
+ * @returns `true` if the arrays are of the same length and contain the same
702
+ * bytes, `false` otherwise.
703
+ * @since 1.6.0
704
+ */
705
+ function timingSafeEqual(a, b) {
706
+ const lenA = a.length;
707
+ const lenB = b.length;
708
+ const commonLength = Math.max(lenA, lenB);
709
+ let result = 0;
710
+ for (let i = 0; i < commonLength; i++) {
711
+ const byteA = i < lenA ? a[i] : 0;
712
+ const byteB = i < lenB ? b[i] : 0;
713
+ result |= byteA ^ byteB;
714
+ }
715
+ result |= lenA ^ lenB;
716
+ return result === 0;
717
+ }
718
+
719
+ //#endregion
720
+ export { doubleKnock, signRequest, verifyRequest };