@fuzdev/fuz_app 0.180.0 → 0.181.0

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 (358) hide show
  1. package/dist/actions/CLAUDE.md +14 -14
  2. package/dist/actions/action_rpc.d.ts +14 -5
  3. package/dist/actions/action_rpc.d.ts.map +1 -1
  4. package/dist/actions/action_rpc.js +53 -46
  5. package/dist/actions/action_types.d.ts +15 -12
  6. package/dist/actions/action_types.d.ts.map +1 -1
  7. package/dist/actions/perform_action.d.ts +4 -4
  8. package/dist/actions/perform_action.d.ts.map +1 -1
  9. package/dist/actions/perform_action.js +6 -6
  10. package/dist/actions/register_action_ws.d.ts +6 -2
  11. package/dist/actions/register_action_ws.d.ts.map +1 -1
  12. package/dist/actions/register_action_ws.js +14 -3
  13. package/dist/actions/ws_socket_session.js +1 -1
  14. package/dist/auth/CLAUDE.md +36 -30
  15. package/dist/auth/account_actions.d.ts.map +1 -1
  16. package/dist/auth/account_actions.js +18 -1
  17. package/dist/auth/account_queries.d.ts +69 -0
  18. package/dist/auth/account_queries.d.ts.map +1 -1
  19. package/dist/auth/account_queries.js +82 -0
  20. package/dist/auth/account_route_schema.d.ts +26 -16
  21. package/dist/auth/account_route_schema.d.ts.map +1 -1
  22. package/dist/auth/account_route_schema.js +10 -24
  23. package/dist/auth/account_routes.d.ts +4 -6
  24. package/dist/auth/account_routes.d.ts.map +1 -1
  25. package/dist/auth/account_routes.js +86 -66
  26. package/dist/auth/admin_actions.d.ts.map +1 -1
  27. package/dist/auth/admin_actions.js +63 -14
  28. package/dist/auth/api_token_queries.d.ts +16 -7
  29. package/dist/auth/api_token_queries.d.ts.map +1 -1
  30. package/dist/auth/api_token_queries.js +18 -18
  31. package/dist/auth/audit_log_route_schema.d.ts +1 -1
  32. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  33. package/dist/auth/audit_log_routes.d.ts +1 -1
  34. package/dist/auth/audit_log_routes.d.ts.map +1 -1
  35. package/dist/auth/audit_log_routes.js +10 -12
  36. package/dist/auth/audit_log_schema.js +4 -4
  37. package/dist/auth/bearer_auth.d.ts +4 -3
  38. package/dist/auth/bearer_auth.d.ts.map +1 -1
  39. package/dist/auth/bearer_auth.js +35 -31
  40. package/dist/auth/bootstrap_account.d.ts +65 -37
  41. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  42. package/dist/auth/bootstrap_account.js +115 -66
  43. package/dist/auth/bootstrap_route_schema.d.ts +6 -2
  44. package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
  45. package/dist/auth/bootstrap_route_schema.js +7 -2
  46. package/dist/auth/bootstrap_routes.d.ts +50 -33
  47. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  48. package/dist/auth/bootstrap_routes.js +109 -87
  49. package/dist/auth/bootstrap_token_store.d.ts +60 -0
  50. package/dist/auth/bootstrap_token_store.d.ts.map +1 -0
  51. package/dist/auth/bootstrap_token_store.js +39 -0
  52. package/dist/auth/credential_headers.d.ts +71 -0
  53. package/dist/auth/credential_headers.d.ts.map +1 -0
  54. package/dist/auth/credential_headers.js +100 -0
  55. package/dist/auth/daemon_token.d.ts +13 -1
  56. package/dist/auth/daemon_token.d.ts.map +1 -1
  57. package/dist/auth/daemon_token.js +14 -2
  58. package/dist/auth/daemon_token_middleware.d.ts +10 -11
  59. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  60. package/dist/auth/daemon_token_middleware.js +27 -29
  61. package/dist/auth/deps.d.ts +0 -11
  62. package/dist/auth/deps.d.ts.map +1 -1
  63. package/dist/auth/invite_queries.d.ts +18 -0
  64. package/dist/auth/invite_queries.d.ts.map +1 -1
  65. package/dist/auth/invite_queries.js +24 -0
  66. package/dist/auth/request_context.d.ts +26 -5
  67. package/dist/auth/request_context.d.ts.map +1 -1
  68. package/dist/auth/request_context.js +17 -10
  69. package/dist/auth/role_grant_offer_action_specs.d.ts +1 -1
  70. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  71. package/dist/auth/role_grant_offer_action_specs.js +3 -2
  72. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  73. package/dist/auth/role_grant_offer_actions.js +37 -14
  74. package/dist/auth/role_grant_offer_ddl.d.ts +7 -1
  75. package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
  76. package/dist/auth/role_grant_offer_ddl.js +9 -2
  77. package/dist/auth/role_grant_offer_queries.d.ts +56 -3
  78. package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
  79. package/dist/auth/role_grant_offer_queries.js +93 -8
  80. package/dist/auth/role_grant_queries.d.ts +7 -0
  81. package/dist/auth/role_grant_queries.d.ts.map +1 -1
  82. package/dist/auth/role_grant_queries.js +8 -0
  83. package/dist/auth/session_cookie.d.ts +105 -25
  84. package/dist/auth/session_cookie.d.ts.map +1 -1
  85. package/dist/auth/session_cookie.js +124 -15
  86. package/dist/auth/session_middleware.d.ts +83 -54
  87. package/dist/auth/session_middleware.d.ts.map +1 -1
  88. package/dist/auth/session_middleware.js +92 -66
  89. package/dist/auth/session_queries.d.ts +64 -4
  90. package/dist/auth/session_queries.d.ts.map +1 -1
  91. package/dist/auth/session_queries.js +53 -4
  92. package/dist/auth/signup_route_schema.d.ts +5 -5
  93. package/dist/auth/signup_route_schema.d.ts.map +1 -1
  94. package/dist/auth/signup_route_schema.js +4 -4
  95. package/dist/auth/signup_routes.d.ts.map +1 -1
  96. package/dist/auth/signup_routes.js +17 -14
  97. package/dist/auth/token_scope.d.ts +5 -7
  98. package/dist/auth/token_scope.d.ts.map +1 -1
  99. package/dist/auth/token_scope.js +5 -8
  100. package/dist/dev/setup.d.ts +6 -1
  101. package/dist/dev/setup.d.ts.map +1 -1
  102. package/dist/dev/setup.js +42 -34
  103. package/dist/hono_context.d.ts +21 -0
  104. package/dist/hono_context.d.ts.map +1 -1
  105. package/dist/hono_context.js +17 -0
  106. package/dist/http/CLAUDE.md +150 -43
  107. package/dist/http/auth_shape.d.ts +3 -3
  108. package/dist/http/common_routes.js +1 -1
  109. package/dist/http/db_routes.d.ts +4 -3
  110. package/dist/http/db_routes.d.ts.map +1 -1
  111. package/dist/http/db_routes.js +14 -14
  112. package/dist/http/dev_route_error_check.d.ts +6 -3
  113. package/dist/http/dev_route_error_check.d.ts.map +1 -1
  114. package/dist/http/dev_route_error_check.js +6 -3
  115. package/dist/http/dev_set_cookie_check.d.ts +53 -0
  116. package/dist/http/dev_set_cookie_check.d.ts.map +1 -0
  117. package/dist/http/dev_set_cookie_check.js +80 -0
  118. package/dist/http/error_schemas.d.ts +36 -1
  119. package/dist/http/error_schemas.d.ts.map +1 -1
  120. package/dist/http/error_schemas.js +39 -2
  121. package/dist/http/header_lines.d.ts +42 -0
  122. package/dist/http/header_lines.d.ts.map +1 -0
  123. package/dist/http/header_lines.js +80 -0
  124. package/dist/http/host.d.ts +12 -9
  125. package/dist/http/host.d.ts.map +1 -1
  126. package/dist/http/host.js +25 -20
  127. package/dist/http/origin.d.ts +7 -22
  128. package/dist/http/origin.d.ts.map +1 -1
  129. package/dist/http/origin.js +11 -25
  130. package/dist/http/proxy.d.ts +1 -0
  131. package/dist/http/proxy.d.ts.map +1 -1
  132. package/dist/http/proxy.js +3 -0
  133. package/dist/http/request_headers.d.ts +95 -0
  134. package/dist/http/request_headers.d.ts.map +1 -0
  135. package/dist/http/request_headers.js +110 -0
  136. package/dist/http/request_target.d.ts +134 -0
  137. package/dist/http/request_target.d.ts.map +1 -0
  138. package/dist/http/request_target.js +193 -0
  139. package/dist/http/route_error_check.d.ts +4 -11
  140. package/dist/http/route_error_check.d.ts.map +1 -1
  141. package/dist/http/route_error_check.js +4 -21
  142. package/dist/http/route_result.d.ts +127 -23
  143. package/dist/http/route_result.d.ts.map +1 -1
  144. package/dist/http/route_result.js +97 -19
  145. package/dist/http/route_spec.d.ts +298 -82
  146. package/dist/http/route_spec.d.ts.map +1 -1
  147. package/dist/http/route_spec.js +548 -71
  148. package/dist/http/simple_request.d.ts +19 -14
  149. package/dist/http/simple_request.d.ts.map +1 -1
  150. package/dist/http/simple_request.js +17 -29
  151. package/dist/http/surface.d.ts +2 -0
  152. package/dist/http/surface.d.ts.map +1 -1
  153. package/dist/http/surface.js +4 -1
  154. package/dist/realtime/outbound_budget.d.ts +1 -2
  155. package/dist/realtime/outbound_budget.d.ts.map +1 -1
  156. package/dist/realtime/outbound_budget.js +1 -2
  157. package/dist/realtime/sse.d.ts +47 -17
  158. package/dist/realtime/sse.d.ts.map +1 -1
  159. package/dist/realtime/sse.js +115 -93
  160. package/dist/realtime/sse_constants.d.ts +7 -1
  161. package/dist/realtime/sse_constants.d.ts.map +1 -1
  162. package/dist/realtime/sse_constants.js +12 -1
  163. package/dist/realtime/sse_registry.d.ts +3 -3
  164. package/dist/realtime/sse_registry.js +3 -3
  165. package/dist/runtime/deps.d.ts +20 -4
  166. package/dist/runtime/deps.d.ts.map +1 -1
  167. package/dist/runtime/mock.d.ts +7 -1
  168. package/dist/runtime/mock.d.ts.map +1 -1
  169. package/dist/runtime/mock.js +33 -3
  170. package/dist/runtime/node.d.ts.map +1 -1
  171. package/dist/runtime/node.js +2 -1
  172. package/dist/runtime/secure_file.d.ts +71 -10
  173. package/dist/runtime/secure_file.d.ts.map +1 -1
  174. package/dist/runtime/secure_file.js +91 -11
  175. package/dist/server/app_backend.d.ts +0 -8
  176. package/dist/server/app_backend.d.ts.map +1 -1
  177. package/dist/server/app_backend.js +1 -3
  178. package/dist/server/app_server.d.ts +28 -17
  179. package/dist/server/app_server.d.ts.map +1 -1
  180. package/dist/server/app_server.js +52 -34
  181. package/dist/server/serve_fact_route.d.ts.map +1 -1
  182. package/dist/server/serve_fact_route.js +49 -45
  183. package/dist/server/static.d.ts +20 -0
  184. package/dist/server/static.d.ts.map +1 -1
  185. package/dist/server/static.js +56 -8
  186. package/dist/server/unmatched_route.d.ts +42 -0
  187. package/dist/server/unmatched_route.d.ts.map +1 -0
  188. package/dist/server/unmatched_route.js +64 -0
  189. package/dist/testing/CLAUDE.md +404 -1200
  190. package/dist/testing/app_server.d.ts +3 -1
  191. package/dist/testing/app_server.d.ts.map +1 -1
  192. package/dist/testing/app_server.js +4 -10
  193. package/dist/testing/auth_apps.d.ts.map +1 -1
  194. package/dist/testing/auth_apps.js +2 -1
  195. package/dist/testing/cross_backend/account_lifecycle.d.ts +11 -4
  196. package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
  197. package/dist/testing/cross_backend/account_lifecycle.js +277 -6
  198. package/dist/testing/cross_backend/build_test_backend_paths.d.ts +4 -1
  199. package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
  200. package/dist/testing/cross_backend/build_test_backend_paths.js +1 -1
  201. package/dist/testing/cross_backend/capabilities.d.ts +68 -5
  202. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  203. package/dist/testing/cross_backend/capabilities.js +20 -4
  204. package/dist/testing/cross_backend/cell_gated_create.js +1 -1
  205. package/dist/testing/cross_backend/conformance_case.d.ts +63 -21
  206. package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
  207. package/dist/testing/cross_backend/conformance_table.d.ts +54 -12
  208. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  209. package/dist/testing/cross_backend/conformance_table.js +179 -23
  210. package/dist/testing/cross_backend/cookie_attributes.js +1 -1
  211. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +7 -1
  212. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
  213. package/dist/testing/cross_backend/create_dual_spawn_global_setup.js +3 -3
  214. package/dist/testing/cross_backend/credential_conformance.d.ts +196 -0
  215. package/dist/testing/cross_backend/credential_conformance.d.ts.map +1 -0
  216. package/dist/testing/cross_backend/credential_conformance.js +296 -0
  217. package/dist/testing/cross_backend/credential_conformance.json +1284 -0
  218. package/dist/testing/cross_backend/credential_conformance_wire.d.ts +40 -0
  219. package/dist/testing/cross_backend/credential_conformance_wire.d.ts.map +1 -0
  220. package/dist/testing/cross_backend/credential_conformance_wire.js +293 -0
  221. package/dist/testing/cross_backend/credential_header_robustness.d.ts +1 -3
  222. package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
  223. package/dist/testing/cross_backend/credential_header_robustness.js +24 -55
  224. package/dist/testing/cross_backend/credential_wire.d.ts +112 -0
  225. package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -0
  226. package/dist/testing/cross_backend/credential_wire.js +188 -0
  227. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  228. package/dist/testing/cross_backend/default_backend_configs.js +22 -2
  229. package/dist/testing/cross_backend/default_spine_surface.js +1 -1
  230. package/dist/testing/cross_backend/differential.d.ts +1 -1
  231. package/dist/testing/cross_backend/differential.d.ts.map +1 -1
  232. package/dist/testing/cross_backend/differential.js +3 -2
  233. package/dist/testing/cross_backend/differential_normalize.d.ts +23 -6
  234. package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
  235. package/dist/testing/cross_backend/differential_normalize.js +11 -5
  236. package/dist/testing/cross_backend/full_spine_mount.d.ts +1 -0
  237. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  238. package/dist/testing/cross_backend/full_spine_mount.js +7 -0
  239. package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
  240. package/dist/testing/cross_backend/identity_parity.js +4 -0
  241. package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
  242. package/dist/testing/cross_backend/in_process_setup.js +78 -4
  243. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  244. package/dist/testing/cross_backend/login_security.js +13 -10
  245. package/dist/testing/cross_backend/peer_ping_ws.d.ts +1 -1
  246. package/dist/testing/cross_backend/peer_ping_ws.js +2 -2
  247. package/dist/testing/cross_backend/request_header_conformance.d.ts +174 -0
  248. package/dist/testing/cross_backend/request_header_conformance.d.ts.map +1 -0
  249. package/dist/testing/cross_backend/request_header_conformance.js +196 -0
  250. package/dist/testing/cross_backend/request_header_conformance.json +1158 -0
  251. package/dist/testing/cross_backend/request_header_conformance_wire.d.ts +39 -0
  252. package/dist/testing/cross_backend/request_header_conformance_wire.d.ts.map +1 -0
  253. package/dist/testing/cross_backend/request_header_conformance_wire.js +284 -0
  254. package/dist/testing/cross_backend/request_target_conformance.d.ts +298 -0
  255. package/dist/testing/cross_backend/request_target_conformance.d.ts.map +1 -0
  256. package/dist/testing/cross_backend/request_target_conformance.js +186 -0
  257. package/dist/testing/cross_backend/request_target_conformance.json +3765 -0
  258. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +32 -0
  259. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -0
  260. package/dist/testing/cross_backend/request_target_conformance_wire.js +278 -0
  261. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
  262. package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +173 -1
  263. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  264. package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +2 -1
  265. package/dist/testing/cross_backend/rpc_adversarial.d.ts +6 -4
  266. package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
  267. package/dist/testing/cross_backend/rpc_adversarial.js +5 -2
  268. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +6 -7
  269. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  270. package/dist/testing/cross_backend/rust_spine_consumer_surface.js +4 -5
  271. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  272. package/dist/testing/cross_backend/session_cap.js +56 -29
  273. package/dist/testing/cross_backend/session_cookie_effect.d.ts +43 -0
  274. package/dist/testing/cross_backend/session_cookie_effect.d.ts.map +1 -0
  275. package/dist/testing/cross_backend/session_cookie_effect.js +103 -0
  276. package/dist/testing/cross_backend/session_login.d.ts +24 -0
  277. package/dist/testing/cross_backend/session_login.d.ts.map +1 -0
  278. package/dist/testing/cross_backend/session_login.js +31 -0
  279. package/dist/testing/cross_backend/setup.d.ts +117 -0
  280. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  281. package/dist/testing/cross_backend/setup.js +193 -9
  282. package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
  283. package/dist/testing/cross_backend/simple_request.js +5 -0
  284. package/dist/testing/cross_backend/spine_suites.d.ts +9 -1
  285. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  286. package/dist/testing/cross_backend/spine_suites.js +88 -5
  287. package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
  288. package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
  289. package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
  290. package/dist/testing/cross_backend/sse_round_trip.d.ts +8 -5
  291. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  292. package/dist/testing/cross_backend/sse_round_trip.js +205 -64
  293. package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
  294. package/dist/testing/cross_backend/testing_backdoor.js +5 -2
  295. package/dist/testing/cross_backend/testing_credential_read.d.ts +165 -0
  296. package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -0
  297. package/dist/testing/cross_backend/testing_credential_read.js +175 -0
  298. package/dist/testing/cross_backend/testing_reset_actions.d.ts +19 -0
  299. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  300. package/dist/testing/cross_backend/testing_reset_actions.js +22 -6
  301. package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
  302. package/dist/testing/cross_backend/token_lifetime.js +58 -2
  303. package/dist/testing/cross_backend/transport_composition.d.ts +2 -4
  304. package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
  305. package/dist/testing/cross_backend/transport_composition.js +13 -10
  306. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  307. package/dist/testing/cross_backend/ts_spine_backend_config.js +5 -3
  308. package/dist/testing/cross_backend/ws_endpoint.d.ts +11 -1
  309. package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
  310. package/dist/testing/cross_backend/ws_endpoint.js +19 -2
  311. package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
  312. package/dist/testing/cross_backend/ws_role_gated.js +2 -3
  313. package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
  314. package/dist/testing/cross_backend/ws_round_trip.js +28 -12
  315. package/dist/testing/cross_backend/xfail.d.ts +44 -11
  316. package/dist/testing/cross_backend/xfail.d.ts.map +1 -1
  317. package/dist/testing/cross_backend/xfail.js +68 -23
  318. package/dist/testing/data_exposure.d.ts.map +1 -1
  319. package/dist/testing/data_exposure.js +4 -3
  320. package/dist/testing/integration.d.ts +1 -2
  321. package/dist/testing/integration.d.ts.map +1 -1
  322. package/dist/testing/integration.js +14 -8
  323. package/dist/testing/integration_helpers.d.ts +50 -3
  324. package/dist/testing/integration_helpers.d.ts.map +1 -1
  325. package/dist/testing/integration_helpers.js +87 -9
  326. package/dist/testing/middleware.d.ts +2 -0
  327. package/dist/testing/middleware.d.ts.map +1 -1
  328. package/dist/testing/middleware.js +9 -2
  329. package/dist/testing/round_trip.d.ts +6 -2
  330. package/dist/testing/round_trip.d.ts.map +1 -1
  331. package/dist/testing/round_trip.js +17 -6
  332. package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
  333. package/dist/testing/rpc_envelope_cases.js +7 -0
  334. package/dist/testing/rpc_helpers.d.ts +4 -2
  335. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  336. package/dist/testing/rpc_helpers.js +6 -1
  337. package/dist/testing/rpc_round_trip.d.ts +13 -2
  338. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  339. package/dist/testing/rpc_round_trip.js +25 -6
  340. package/dist/testing/schema_generators.d.ts +2 -2
  341. package/dist/testing/schema_generators.d.ts.map +1 -1
  342. package/dist/testing/schema_generators.js +4 -4
  343. package/dist/testing/stubs.d.ts +2 -2
  344. package/dist/testing/stubs.d.ts.map +1 -1
  345. package/dist/testing/stubs.js +8 -8
  346. package/dist/testing/transports/fetch_transport.d.ts +6 -3
  347. package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
  348. package/dist/testing/transports/fetch_transport.js +31 -19
  349. package/dist/testing/transports/raw_http.d.ts +61 -1
  350. package/dist/testing/transports/raw_http.d.ts.map +1 -1
  351. package/dist/testing/transports/raw_http.js +61 -1
  352. package/dist/testing/transports/ws_raw_client.d.ts +20 -0
  353. package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
  354. package/dist/testing/transports/ws_raw_client.js +10 -4
  355. package/dist/testing/transports/ws_transport.d.ts +21 -1
  356. package/dist/testing/transports/ws_transport.d.ts.map +1 -1
  357. package/dist/testing/transports/ws_transport.js +58 -20
  358. package/package.json +1 -1
@@ -54,18 +54,27 @@ export declare const query_create_api_token: (deps: QueryDeps, id: string, accou
54
54
  * Hashes the token with blake3, looks up the hash, and checks
55
55
  * expiration, reading how long the token has left on the database clock in
56
56
  * the same statement. A row whose stored scope is unreadable is refused like an
57
- * unknown hash. Updates `last_used_at` and `last_used_ip` on success
58
- * (fire-and-forget — errors logged, never thrown).
57
+ * unknown hash. Records no use: the caller touches the token
58
+ * (`query_api_token_touch`) once it has also found the account live, so a
59
+ * token on a tombstoned account records none — the Rust twin's order.
59
60
  *
60
61
  * @param deps - query dependencies with logger
61
62
  * @param raw_token - the raw API token from the Authorization header
62
- * @param ip - the client IP address (for audit)
63
- * @param pending_effects - optional array to register the usage-tracking effect for later awaiting
64
63
  * @returns the token record with its parsed scope if valid, or `undefined`
65
- * @mutates `api_token` row - fire-and-forget UPDATE of `last_used_at` / `last_used_ip` on a valid token
66
- * @mutates `pending_effects` - pushes the in-flight tracking promise when provided
67
64
  */
68
- export declare const query_validate_api_token: (deps: ApiTokenQueryDeps, raw_token: string, ip: string | undefined, pending_effects: Array<Promise<void>> | undefined) => Promise<ValidatedApiToken | undefined>;
65
+ export declare const query_validate_api_token: (deps: ApiTokenQueryDeps, raw_token: string) => Promise<ValidatedApiToken | undefined>;
66
+ /**
67
+ * Record a use of an API token: `last_used_at` now, `last_used_ip` the
68
+ * client's address (`null` when none resolved). The bearer leg runs it
69
+ * fire-and-forget once the token has authenticated. Twin of the Rust
70
+ * `fuz_auth::query_api_token_touch`.
71
+ *
72
+ * @param deps - query dependencies
73
+ * @param id - the public token id
74
+ * @param ip - the client IP address
75
+ * @mutates `api_token` row - sets `last_used_at` and `last_used_ip`
76
+ */
77
+ export declare const query_api_token_touch: (deps: QueryDeps, id: string, ip: string | undefined) => Promise<void>;
69
78
  /**
70
79
  * Look up the owning account of a live API token — one that still exists and
71
80
  * has not expired — by its public id.
@@ -1 +1 @@
1
- {"version":3,"file":"api_token_queries.d.ts","sourceRoot":"","sources":["../../src/lib/auth/api_token_queries.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,KAAK,UAAU,EAAmD,MAAM,kBAAkB,CAAC;AAEpG;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG;IACzD,KAAK,EAAE,UAAU,CAAC;IAClB;;;;;OAKG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,yEAAyE;AACzE,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IACnD,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,0HAUoB,CAAC;AA6BnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,SAAS,EACf,IAAI,MAAM,EACV,YAAY,MAAM,EAClB,MAAM,MAAM,EACZ,YAAY,MAAM,EAClB,OAAO,UAAU,EACjB,aAAa,IAAI,GAAG,IAA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AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kCAAkC,GAC9C,MAAM,SAAS,EACf,IAAI,MAAM,EACV,YAAY,MAAM,KAChB,OAAO,CAAC,OAAO,CAMjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gCAAgC,GAC5C,MAAM,SAAS,EACf,YAAY,MAAM,KAChB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAM7C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,6BAA6B,GACzC,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,YAAY,MAAM,KAChB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAYvB,CAAC"}
@@ -81,18 +81,15 @@ export const query_create_api_token = async (deps, id, account_id, name, token_h
81
81
  * Hashes the token with blake3, looks up the hash, and checks
82
82
  * expiration, reading how long the token has left on the database clock in
83
83
  * the same statement. A row whose stored scope is unreadable is refused like an
84
- * unknown hash. Updates `last_used_at` and `last_used_ip` on success
85
- * (fire-and-forget — errors logged, never thrown).
84
+ * unknown hash. Records no use: the caller touches the token
85
+ * (`query_api_token_touch`) once it has also found the account live, so a
86
+ * token on a tombstoned account records none — the Rust twin's order.
86
87
  *
87
88
  * @param deps - query dependencies with logger
88
89
  * @param raw_token - the raw API token from the Authorization header
89
- * @param ip - the client IP address (for audit)
90
- * @param pending_effects - optional array to register the usage-tracking effect for later awaiting
91
90
  * @returns the token record with its parsed scope if valid, or `undefined`
92
- * @mutates `api_token` row - fire-and-forget UPDATE of `last_used_at` / `last_used_ip` on a valid token
93
- * @mutates `pending_effects` - pushes the in-flight tracking promise when provided
94
91
  */
95
- export const query_validate_api_token = async (deps, raw_token, ip, pending_effects) => {
92
+ export const query_validate_api_token = async (deps, raw_token) => {
96
93
  const token_hash = hash_api_token(raw_token);
97
94
  const row = await deps.db.query_one(`SELECT ${columns_sql(API_TOKEN_COLUMNS, api_token_expr)}, ${EXPIRES_IN_MS_SQL} AS expires_in_ms
98
95
  FROM api_token
@@ -109,19 +106,22 @@ export const query_validate_api_token = async (deps, raw_token, ip, pending_effe
109
106
  deps.log.warn(`api_token.scope is unreadable for ${row.id}; refusing the credential`);
110
107
  return undefined;
111
108
  }
112
- // Fire-and-forget usage tracking
113
- const p = deps.db
114
- .query(`UPDATE api_token SET last_used_at = NOW(), last_used_ip = $1 WHERE id = $2`, [
115
- ip ?? null,
116
- row.id
117
- ])
118
- .then(() => { })
119
- .catch((err) => {
120
- deps.log.error('Failed to update last_used_at:', err);
121
- });
122
- pending_effects?.push(p);
123
109
  return { ...row, scope };
124
110
  };
111
+ /**
112
+ * Record a use of an API token: `last_used_at` now, `last_used_ip` the
113
+ * client's address (`null` when none resolved). The bearer leg runs it
114
+ * fire-and-forget once the token has authenticated. Twin of the Rust
115
+ * `fuz_auth::query_api_token_touch`.
116
+ *
117
+ * @param deps - query dependencies
118
+ * @param id - the public token id
119
+ * @param ip - the client IP address
120
+ * @mutates `api_token` row - sets `last_used_at` and `last_used_ip`
121
+ */
122
+ export const query_api_token_touch = async (deps, id, ip) => {
123
+ await deps.db.query(`UPDATE api_token SET last_used_at = NOW(), last_used_ip = $1 WHERE id = $2`, [ip ?? null, id]);
124
+ };
125
125
  /**
126
126
  * Look up the owning account of a live API token — one that still exists and
127
127
  * has not expired — by its public id.
@@ -39,5 +39,5 @@ export interface AuditStreamAuth {
39
39
  * @param required_role - role gating the stream (default `DEFAULT_AUDIT_STREAM_ROLE`)
40
40
  * @returns the SSE route shape minus its handler
41
41
  */
42
- export declare const create_audit_log_route_shape: (required_role?: string) => RouteShape<[], Schema<null, null, "literal", null>, AuditStreamAuth, undefined>;
42
+ export declare const create_audit_log_route_shape: (required_role?: string) => RouteShape<[], Schema<null, null, "literal", null>, AuditStreamAuth, undefined, Schema<null, null, "literal", null>, undefined, typeof AuditStreamQuery>;
43
43
  //# sourceMappingURL=audit_log_route_schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit_log_route_schema.d.ts","sourceRoot":"","sources":["../../src/lib/auth/audit_log_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAmB,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAExF,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAG5E;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;EAAkC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE9D,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAEjD,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACxC,cAAc,EAAE,sBAAsB,CAAC;CACvC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACxC,gBAAe,MAAkC,KAC/C,UAAU,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,eAAe,EAAE,SAAS,CA+B9E,CAAC"}
1
+ {"version":3,"file":"audit_log_route_schema.d.ts","sourceRoot":"","sources":["../../src/lib/auth/audit_log_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAmB,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAExF,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAG5E;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;EAAkC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE9D,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAEjD,6EAA6E;AAC7E,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACxC,cAAc,EAAE,sBAAsB,CAAC;CACvC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACxC,gBAAe,MAAkC,KAC/C,UAAU,CACZ,EAAE,EACF,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EACnC,eAAe,EACf,SAAS,EACT,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,EACnC,SAAS,EACT,OAAO,gBAAgB,CAgCrB,CAAC"}
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import type { Logger } from '@fuzdev/fuz_util/log.ts';
15
15
  import { type RouteSpec } from '../http/route_spec.js';
16
- import { type SseNotification } from '../realtime/sse.js';
16
+ import type { SseNotification } from '../realtime/sse.js';
17
17
  import type { SseRegistry } from '../realtime/sse_registry.js';
18
18
  /** Options for audit log route specs. */
19
19
  export interface AuditLogRouteOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"audit_log_routes.d.ts","sourceRoot":"","sources":["../../src/lib/auth/audit_log_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAW7E,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAW/D,yCAAyC;A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14 +13,11 @@
13
13
  */
14
14
  import { UnreachableError } from '@fuzdev/fuz_util/error.ts';
15
15
  import { attach_route_handler } from '../http/route_spec.js';
16
- import { route_fail, route_raw } from '../http/route_result.js';
16
+ import { route_fail, route_sse } from '../http/route_result.js';
17
17
  import { REST_AUTHENTICATION_REQUIRED, REST_INSUFFICIENT_PERMISSIONS } from '../http/error_schemas.js';
18
- import { has_test_context_preset } from '../hono_context.js';
19
18
  import { create_audit_log_route_shape, DEFAULT_AUDIT_STREAM_ROLE } from './audit_log_route_schema.js';
20
- import { create_sse_response } from '../realtime/sse.js';
21
19
  import { validate_sse_keep_alive_ms } from '../realtime/sse_constants.js';
22
- import { require_request_context } from './request_context.js';
23
- import { get_resolved_auth, recheck_admission, resolved_auth_api_token_id, resolved_auth_session_hash } from './resolved_auth.js';
20
+ import { recheck_admission, resolved_auth_api_token_id, resolved_auth_session_hash } from './resolved_auth.js';
24
21
  import { schedule_credential_deadline } from './credential_deadline.js';
25
22
  import { AUDIT_LOG_CHANNEL } from '../realtime/audit_log_sse.js';
26
23
  /**
@@ -77,11 +74,11 @@ export const create_audit_log_route_specs = (options) => {
77
74
  validate_sse_keep_alive_ms(keep_alive_ms);
78
75
  const required_role = options.required_role ?? DEFAULT_AUDIT_STREAM_ROLE;
79
76
  return [
80
- attach_route_handler(create_audit_log_route_shape(required_role), async (c, route) => {
77
+ attach_route_handler(create_audit_log_route_shape(required_role), async (route) => {
81
78
  // Rule 3 is declared on the route shape's `auth.required_scope`,
82
79
  // so a narrowed token is refused ahead of the role gate rather
83
80
  // than here.
84
- const ctx = require_request_context(c);
81
+ const ctx = route.auth;
85
82
  // scope = session hash (capped → tabs-per-session limit and
86
83
  // session-specific `session_revoke` close). groups = [account_id]
87
84
  // (uncapped → coarse close on role_grant_revoke / session_revoke_all
@@ -91,7 +88,7 @@ export const create_audit_log_route_specs = (options) => {
91
88
  // still has a revoked token's stream closed by `token_revoke`.
92
89
  // Both come off the resolved credential, which carries each only
93
90
  // for its own credential type.
94
- const resolved = get_resolved_auth(c);
91
+ const resolved = route.credential;
95
92
  const session_hash = resolved_auth_session_hash(resolved);
96
93
  const api_token_id = resolved_auth_api_token_id(resolved);
97
94
  // Register pending first: from here every revocation finds the
@@ -113,7 +110,7 @@ export const create_audit_log_route_specs = (options) => {
113
110
  // pre-baked context has no rows behind it to re-read, and for a
114
111
  // registration born closed by the shutdown, which admission
115
112
  // refuses whatever they answer.
116
- if (!has_test_context_preset(c) && !registry.closing) {
113
+ if (!route.has_test_context_preset && !registry.closing) {
117
114
  const reread = async () => {
118
115
  // Global grants only, like the `require_role` gate that ran in
119
116
  // the pipeline — a scoped grant must not open the instance-wide
@@ -166,9 +163,10 @@ export const create_audit_log_route_specs = (options) => {
166
163
  // left during the re-reads gets a stream that is already closed,
167
164
  // whose listener runs at once and removes the registration, so
168
165
  // `admit` refuses it rather than evicting a live stream for it.
169
- const { response, stream } = create_sse_response(c, log, {
166
+ const stream = route.open_sse({
170
167
  account_id: ctx.account.id,
171
- keep_alive_ms
168
+ keep_alive_ms,
169
+ log
172
170
  });
173
171
  stream.on_close(pending.unsubscribe);
174
172
  admitted = registry.admit(pending, stream);
@@ -185,7 +183,7 @@ export const create_audit_log_route_specs = (options) => {
185
183
  stream.close();
186
184
  }));
187
185
  }
188
- return route_raw(response);
186
+ return route_sse(stream);
189
187
  }
190
188
  finally {
191
189
  if (!admitted)
@@ -353,8 +353,8 @@ export const audit_metadata_schemas = Object.freeze({
353
353
  // distinguishes the trigger; `cause_id` points to the accepted offer
354
354
  // (for `sibling_accepted`), the revoked role_grant (for `role_grant_revoked`
355
355
  // — the recipient's grant of the offered role, or a grant of the grantor's),
356
- // the destroyed parent scope row (for `scope_destroyed`), or the grantor's
357
- // removed account (for `account_deleted`).
356
+ // the destroyed parent scope row (for `scope_destroyed`), or the removed
357
+ // account of the grantor or the recipient (for `account_deleted`).
358
358
  role_grant_offer_supersede: loose_object({
359
359
  offer_id: meta(Uuid, { description: 'Id of the superseded offer.' }),
360
360
  role: meta(string, { description: 'Role that was offered.' }),
@@ -362,10 +362,10 @@ export const audit_metadata_schemas = Object.freeze({
362
362
  description: 'Scope of the offered role; null for global offers.'
363
363
  }),
364
364
  reason: meta(one_of(['sibling_accepted', 'role_grant_revoked', 'scope_destroyed', 'account_deleted']), {
365
- description: "Trigger that obsoleted the offer: a sibling offer was accepted, the resulting role_grant or one of the grantor's was revoked, the parent scope row was destroyed, or the grantor's account was deleted or purged."
365
+ description: "Trigger that obsoleted the offer: a sibling offer was accepted, the resulting role_grant or one of the grantor's was revoked, the parent scope row was destroyed, or the grantor's account was deleted or purged, or the recipient's deleted."
366
366
  }),
367
367
  cause_id: meta(Uuid, {
368
- description: "Row that caused the supersede: accepted offer (`sibling_accepted`), revoked role_grant (`role_grant_revoked`), destroyed parent scope row (`scope_destroyed`), or the grantor's account (`account_deleted`)."
368
+ description: "Row that caused the supersede: accepted offer (`sibling_accepted`), revoked role_grant (`role_grant_revoked`), destroyed parent scope row (`scope_destroyed`), or the removed account, the grantor's or the recipient's (`account_deleted`)."
369
369
  })
370
370
  }),
371
371
  invite_create: loose_object({
@@ -31,9 +31,10 @@ import type { QueryDeps } from '../db/query_deps.js';
31
31
  * Discards bearer tokens when an `Origin` or `Referer` header is present —
32
32
  * `next()` with no identity, as for a bad token — so browsers must use cookie
33
33
  * auth, reducing attack surface.
34
- * A token that fails the `is_api_token_shaped` precheck soft-fails before
35
- * the database is touched.
36
- * Auth scheme matching is case-insensitive per RFC 7235.
34
+ * The token is read by `read_bearer_token`: one `Authorization` line, the
35
+ * scheme in any case (RFC 7235), one space, an `is_api_token_shaped` value. A
36
+ * header that reads no token — sent twice included — soft-fails before the
37
+ * database is touched.
37
38
  * On success, sets the `api_token` arm of `ResolvedAuth` (`RESOLVED_AUTH_KEY`):
38
39
  * the account, the token id, its scope, and its deadline. The last leg of the
39
40
  * chain, it skips when an earlier one (the daemon token or a session cookie)
@@ -1 +1 @@
1
- {"version":3,"file":"bearer_auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth/bearer_auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAOtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,6BAA6B,GAAI,MAAM,SAAS,EAAE,KAAK,MAAM,KAAG,iBAkF5E,CAAC"}
1
+ {"version":3,"file":"bearer_auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth/bearer_auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAQtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAKrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,6BAA6B,GAAI,MAAM,SAAS,EAAE,KAAK,MAAM,KAAG,iBAyE5E,CAAC"}
@@ -18,10 +18,12 @@ import { DEV } from 'esm-env';
18
18
  import { RESOLVED_AUTH_KEY } from '../hono_context.js';
19
19
  import { credential_deadline_after } from './credential_deadline.js';
20
20
  import { get_resolved_auth } from './resolved_auth.js';
21
- import { is_api_token_shaped } from './api_token.js';
22
- import { query_validate_api_token } from './api_token_queries.js';
21
+ import { read_bearer_token } from './credential_headers.js';
22
+ import { query_api_token_touch, query_validate_api_token } from './api_token_queries.js';
23
+ import { query_account_by_id } from './account_queries.js';
23
24
  import { get_client_ip } from '../http/client_ip.js';
24
- import { is_browser_context } from '../http/origin.js';
25
+ import { get_header_lines } from '../http/header_lines.js';
26
+ import { is_browser_context } from '../http/request_headers.js';
25
27
  /**
26
28
  * Create middleware that authenticates via bearer token.
27
29
  *
@@ -36,9 +38,10 @@ import { is_browser_context } from '../http/origin.js';
36
38
  * Discards bearer tokens when an `Origin` or `Referer` header is present —
37
39
  * `next()` with no identity, as for a bad token — so browsers must use cookie
38
40
  * auth, reducing attack surface.
39
- * A token that fails the `is_api_token_shaped` precheck soft-fails before
40
- * the database is touched.
41
- * Auth scheme matching is case-insensitive per RFC 7235.
41
+ * The token is read by `read_bearer_token`: one `Authorization` line, the
42
+ * scheme in any case (RFC 7235), one space, an `is_api_token_shaped` value. A
43
+ * header that reads no token — sent twice included — soft-fails before the
44
+ * database is touched.
42
45
  * On success, sets the `api_token` arm of `ResolvedAuth` (`RESOLVED_AUTH_KEY`):
43
46
  * the account, the token id, its scope, and its deadline. The last leg of the
44
47
  * chain, it skips when an earlier one (the daemon token or a session cookie)
@@ -67,19 +70,23 @@ export const create_bearer_auth_middleware = (deps, log) => {
67
70
  await next();
68
71
  return;
69
72
  }
70
- const auth_header = c.req.header('Authorization');
71
- // Case-insensitive scheme matching per RFC 7235 §2.1 — defense-in-depth:
72
- // without this, a `bearer` (lowercase) header silently bypasses token
73
- // validation and browser-context rejection instead of being processed.
74
- if (!auth_header || auth_header.slice(0, 7).toLowerCase() !== 'bearer ') {
73
+ // The header's one shaped token, or nothing (`read_bearer_token`): absent,
74
+ // another scheme, an empty or malformed token, and a header sent as more
75
+ // than one line all read `null` and soft-fail before any database work —
76
+ // no pool checkout, no query — so junk bearers cost nothing to refuse.
77
+ const authorization_lines = get_header_lines(c, 'Authorization');
78
+ const raw_token = read_bearer_token(authorization_lines);
79
+ if (raw_token === null) {
80
+ if (authorization_lines.length > 0)
81
+ log.debug('bearer auth soft-fail: no token read');
75
82
  await next();
76
83
  return;
77
84
  }
78
85
  // Silently discard bearer tokens in browser context (`is_browser_context`
79
- // — Origin or Referer present). Discards rather than returning 403 so that
86
+ // — an Origin or Referer line present). Discards rather than returning 403 so that
80
87
  // the RPC dispatcher can still handle public actions or fall through to
81
88
  // cookie auth.
82
- if (is_browser_context(c)) {
89
+ if (is_browser_context(get_header_lines(c, 'origin'), get_header_lines(c, 'referer'))) {
83
90
  log.debug('bearer auth rejected: browser context (Origin/Referer present)');
84
91
  // The discard is silent on the wire by design (a stolen-token probe
85
92
  // gets an indistinguishable 401, not a "your token was dropped"
@@ -91,24 +98,7 @@ export const create_bearer_auth_middleware = (deps, log) => {
91
98
  await next();
92
99
  return;
93
100
  }
94
- const raw_token = auth_header.slice(7);
95
- // Empty token body — soft-fail (treat as "no credential").
96
- // (The Fetch API trims 'Bearer ' to 'Bearer' which skips this middleware entirely,
97
- // but raw HTTP clients may send 'Bearer ' with an empty token.)
98
- if (!raw_token) {
99
- await next();
100
- return;
101
- }
102
- // A value that cannot be a token soft-fails before any database work —
103
- // no pool checkout, no query — so junk bearers cost nothing to refuse.
104
- if (!is_api_token_shaped(raw_token)) {
105
- log.debug('bearer auth soft-fail: malformed token');
106
- await next();
107
- return;
108
- }
109
- // `ip` feeds the token's `last_used_ip` bookkeeping, not a limiter.
110
- const ip = get_client_ip(c);
111
- const api_token = await query_validate_api_token({ ...deps, log }, raw_token, ip, c.var.pending_effects);
101
+ const api_token = await query_validate_api_token({ ...deps, log }, raw_token);
112
102
  if (!api_token) {
113
103
  // Invalid or expired token — soft-fail, indistinguishable from
114
104
  // sending no credential at all.
@@ -116,6 +106,20 @@ export const create_bearer_auth_middleware = (deps, log) => {
116
106
  await next();
117
107
  return;
118
108
  }
109
+ // a tombstoned account authenticates nothing — its token resolves as no
110
+ // credential, the anonymous caller, as on the Rust spine
111
+ if (!(await query_account_by_id(deps, api_token.account_id))) {
112
+ log.debug('bearer auth soft-fail: account not found or deleted');
113
+ await next();
114
+ return;
115
+ }
116
+ // Fire-and-forget usage tracking, once the token has authenticated —
117
+ // after the account check, so a token on a tombstoned account records
118
+ // no use. `ip` feeds `last_used_ip`, not a limiter.
119
+ const touch = query_api_token_touch(deps, api_token.id, get_client_ip(c)).catch((err) => {
120
+ log.error('Failed to update last_used_at:', err);
121
+ });
122
+ c.var.pending_effects?.push(touch);
119
123
  c.set(RESOLVED_AUTH_KEY, {
120
124
  credential_type: 'api_token',
121
125
  account_id: api_token.account_id,
@@ -2,31 +2,44 @@
2
2
  * Bootstrap flow for creating the first account.
3
3
  *
4
4
  * Uses an atomic `bootstrap_lock` table to prevent TOCTOU race conditions.
5
- * Token verification and account creation happen in a single transaction.
5
+ * The lock flip, the account, its keeper and admin grants, its session, and
6
+ * the burn of the one-shot token file all happen in one transaction, the burn
7
+ * last — so a live token never outlives a successful bootstrap, and a
8
+ * bootstrap whose token can't be burned never happened.
6
9
  *
7
10
  * @module
8
11
  */
9
12
  import type { Logger } from '@fuzdev/fuz_util/log.ts';
10
13
  import type { PasswordHashDeps } from './password.js';
11
- import { ERROR_INVALID_TOKEN, ERROR_ALREADY_BOOTSTRAPPED, ERROR_TOKEN_FILE_MISSING } from '../http/error_schemas.js';
14
+ import { ERROR_INVALID_TOKEN, ERROR_ALREADY_BOOTSTRAPPED, ERROR_TOKEN_FILE_MISSING, ERROR_TOKEN_FILE_UNDELETABLE } from '../http/error_schemas.js';
12
15
  import type { Account, Actor, RoleGrant } from './account_schema.js';
13
16
  import type { Db } from '../db/db.js';
17
+ import type { BootstrapTokenStore } from './bootstrap_token_store.js';
18
+ import type { Keyring } from './keyring.js';
19
+ import type { SessionOptions } from './session_cookie.js';
14
20
  /** Input for the bootstrap account creation. */
15
21
  export interface BootstrapAccountInput {
16
22
  username: string;
17
23
  password: string;
18
24
  }
19
- /** Successful bootstrap result with the created entities. */
20
- export interface BootstrapAccountSuccess {
21
- ok: true;
25
+ /** What a successful bootstrap created. */
26
+ export interface BootstrapAccountCreated {
22
27
  account: Account;
23
28
  actor: Actor;
24
29
  role_grants: {
25
30
  keeper: RoleGrant;
26
31
  admin: RoleGrant;
27
32
  };
28
- /** Whether the bootstrap token file was successfully deleted after account creation. */
29
- token_file_deleted: boolean;
33
+ }
34
+ /** Successful bootstrap result with the created entities and the new session. */
35
+ export interface BootstrapAccountSuccess extends BootstrapAccountCreated {
36
+ ok: true;
37
+ /**
38
+ * The signed cookie value of the session minted in the bootstrap
39
+ * transaction, for the caller to set on its response — it exists only
40
+ * because the transaction committed.
41
+ */
42
+ session_cookie_value: string;
30
43
  }
31
44
  /** Bootstrap failure result. */
32
45
  export type BootstrapAccountFailure = {
@@ -41,6 +54,10 @@ export type BootstrapAccountFailure = {
41
54
  ok: false;
42
55
  error: typeof ERROR_INVALID_TOKEN;
43
56
  status: 401;
57
+ } | {
58
+ ok: false;
59
+ error: typeof ERROR_TOKEN_FILE_UNDELETABLE;
60
+ status: 500;
44
61
  };
45
62
  /** Bootstrap account result — either success or a bootstrap verification failure. */
46
63
  export type BootstrapAccountResult = BootstrapAccountSuccess | BootstrapAccountFailure;
@@ -49,23 +66,25 @@ export type BootstrapAccountResult = BootstrapAccountSuccess | BootstrapAccountF
49
66
  */
50
67
  export interface BootstrapAccountDeps {
51
68
  db: Db;
52
- /** Path to the bootstrap token file on disk. */
53
- token_path: string;
54
69
  /**
55
- * Hardened secret-file read (see `FsSecureReadDeps.read_secure_file`) —
56
- * the token mints the keeper account, so a symlinked, non-regular,
57
- * group/other-readable, or oversized file must refuse rather than be
58
- * honored. Throws on refusal;
59
- * every throw reads as `TOKEN_FILE_MISSING` upstream.
70
+ * The one-shot token: read through the hardened secret read (a symlinked,
71
+ * non-regular, group/other-readable, multiply-linked, or oversized file is
72
+ * refused — every refusal reads as `TOKEN_FILE_MISSING`), burned last inside the
73
+ * transaction.
60
74
  */
61
- read_secure_file: (path: string) => Promise<Uint8Array>;
62
- /** Delete a file. */
63
- delete_file: (path: string) => Promise<void>;
75
+ token_store: BootstrapTokenStore;
64
76
  /** Only hashing is needed — verification happens separately during login. */
65
77
  password: Pick<PasswordHashDeps, 'hash_password'>;
78
+ /** Signs the session cookie minted in the transaction. */
79
+ keyring: Keyring;
66
80
  /** Structured logger instance. */
67
81
  log: Logger;
68
82
  }
83
+ /** Static options for `bootstrap_account`. */
84
+ export interface BootstrapAccountOptions {
85
+ /** Session cookie configuration for the session the bootstrap mints. */
86
+ session_options: SessionOptions<string>;
87
+ }
69
88
  /**
70
89
  * The fewest bytes a bootstrap token holds, counted after its one optional
71
90
  * trailing LF. A shorter file is read as unreadable: an empty or `"\n"` file
@@ -78,40 +97,49 @@ export interface BootstrapAccountDeps {
78
97
  export declare const BOOTSTRAP_TOKEN_MIN_BYTES = 32;
79
98
  /**
80
99
  * Read the bootstrap token the way both the availability check and the
81
- * request-time compare need it: the hardened secure read, less one trailing
100
+ * request-time compare need it: the store's hardened read, less one trailing
82
101
  * LF, refused when shorter than `BOOTSTRAP_TOKEN_MIN_BYTES`. A short token
83
102
  * logs an error naming the file before the throw — it is a misconfiguration
84
103
  * the operator must fix, never a quiet "unavailable". Twin of the Rust
85
104
  * `bootstrap_token_from_file`.
86
105
  *
87
- * @param deps - the secure read and a logger for the short-token error
88
- * @param token_path - the bootstrap token file
106
+ * @param deps - the token store and a logger for the short-token error
89
107
  * @returns the token bytes the provided token is compared against
90
- * @throws Error when the secure read refuses the file or the token is too short
108
+ * @throws Error when the store refuses the file or the token is too short
91
109
  */
92
- export declare const read_bootstrap_token: (deps: Pick<BootstrapAccountDeps, "read_secure_file" | "log">, token_path: string) => Promise<Uint8Array>;
110
+ export declare const read_bootstrap_token: (deps: Pick<BootstrapAccountDeps, "token_store" | "log">) => Promise<Uint8Array>;
93
111
  /**
94
112
  * Bootstrap the first account with keeper and admin privileges.
95
113
  *
96
- * Uses an atomic `bootstrap_lock` UPDATE to prevent concurrent bootstrap
97
- * attempts (TOCTOU). The full flow runs in a single transaction:
98
- *
99
- * 1. Read and verify the bootstrap token (before transaction) — the file's
100
- * raw bytes less one optional trailing LF, at least
114
+ * 1. Read and verify the bootstrap token (before the transaction) — the
115
+ * file's raw bytes less one optional trailing LF, at least
101
116
  * `BOOTSTRAP_TOKEN_MIN_BYTES` long, compared in constant time
102
- * 2. Hash the password (CPU-intensive, before transaction)
103
- * 3. Acquire the bootstrap lock atomically (inside transaction)
104
- * 4. Create account + actor
105
- * 5. Grant keeper and admin role_grants (no expiry, `granted_by = null`)
106
- * 6. Delete the token file (after commit, reported via `token_file_deleted`)
117
+ * 2. Hash the password (CPU-intensive, before the transaction)
118
+ * 3. In one transaction: flip the `bootstrap_lock` atomically (zero rows is
119
+ * the race loser, `already_bootstrapped`, nothing burned); create the
120
+ * account + actor; grant keeper and admin (no expiry, `granted_by =
121
+ * null`); mint the session through the capped minter login uses (the cap
122
+ * evicts nothing on a new account); then burn the token file, last, just
123
+ * before the commit
124
+ *
125
+ * The burn comes after the lock, so only the lock winner burns (its row lock
126
+ * is held across the unlink, so a concurrent attempt waits on its UPDATE);
127
+ * after the inserts, so a failed insert spends nothing; last, so the window
128
+ * between a burn and a failed commit is one round trip. A burn that fails
129
+ * rolls everything back and answers `token_file_undeletable`: nothing was
130
+ * created and the token is still valid, so the operator fixes the directory
131
+ * and retries. A commit that fails after the burn is logged as an error — the
132
+ * token is gone and a new one must be written. Twin of the Rust
133
+ * `bootstrap_handler`.
107
134
  *
108
- * @param deps - database, token path, filesystem callbacks, and password hashing
135
+ * @param deps - database, token store, password hashing, keyring, and logger
109
136
  * @param provided_token - the bootstrap token from the user
110
137
  * @param input - username and password
111
- * @returns the created account, actor, and role_grants — or a bootstrap failure
138
+ * @param options - the session cookie configuration
139
+ * @returns the created account, actor, role_grants, and session cookie value — or a bootstrap failure
112
140
  * @mutates `bootstrap_lock` row - flips `bootstrapped` to `true` atomically
113
- * @mutates `account` / `actor` / `role_grant` tables - inserts the bootstrap account, actor, and the keeper + admin role_grants
114
- * @mutates filesystem - deletes the bootstrap token file after commit (reported via `token_file_deleted`)
141
+ * @mutates `account` / `actor` / `role_grant` / `auth_session` tables - inserts the bootstrap account, actor, keeper + admin role_grants, and session
142
+ * @mutates filesystem - burns the bootstrap token file inside the transaction
115
143
  */
116
- export declare const bootstrap_account: (deps: BootstrapAccountDeps, provided_token: string, input: BootstrapAccountInput) => Promise<BootstrapAccountResult>;
144
+ export declare const bootstrap_account: (deps: BootstrapAccountDeps, provided_token: string, input: BootstrapAccountInput, options: BootstrapAccountOptions) => Promise<BootstrapAccountResult>;
117
145
  //# sourceMappingURL=bootstrap_account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap_account.d.ts","sourceRoot":"","sources":["../../src/lib/auth/bootstrap_account.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,gDAAgD;AAChD,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,6DAA6D;AAC7D,MAAM,WAAW,uBAAuB;IACvC,EAAE,EAAE,IAAI,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,CAAC;IACrD,wFAAwF;IACxF,kBAAkB,EAAE,OAAO,CAAC;CAC5B;AAED,gCAAgC;AAChC,MAAM,MAAM,uBAAuB,GAChC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,OAAO,0BAA0B,CAAC;IAAC,MAAM,EAAE,GAAG,CAAA;CAAE,GACpE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK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