@fuzdev/fuz_app 0.180.0 → 0.182.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 (389) hide show
  1. package/dist/actions/CLAUDE.md +38 -20
  2. package/dist/actions/action_rpc.d.ts +25 -6
  3. package/dist/actions/action_rpc.d.ts.map +1 -1
  4. package/dist/actions/action_rpc.js +56 -48
  5. package/dist/actions/action_types.d.ts +31 -13
  6. package/dist/actions/action_types.d.ts.map +1 -1
  7. package/dist/actions/action_types.js +1 -1
  8. package/dist/actions/notification_sender.d.ts +83 -0
  9. package/dist/actions/notification_sender.d.ts.map +1 -0
  10. package/dist/actions/notification_sender.js +85 -0
  11. package/dist/actions/perform_action.d.ts +13 -4
  12. package/dist/actions/perform_action.d.ts.map +1 -1
  13. package/dist/actions/perform_action.js +27 -18
  14. package/dist/actions/register_action_ws.d.ts +20 -2
  15. package/dist/actions/register_action_ws.d.ts.map +1 -1
  16. package/dist/actions/register_action_ws.js +17 -5
  17. package/dist/actions/ws_socket_session.d.ts +3 -0
  18. package/dist/actions/ws_socket_session.d.ts.map +1 -1
  19. package/dist/actions/ws_socket_session.js +3 -2
  20. package/dist/auth/CLAUDE.md +84 -59
  21. package/dist/auth/account_actions.d.ts.map +1 -1
  22. package/dist/auth/account_actions.js +30 -3
  23. package/dist/auth/account_queries.d.ts +213 -2
  24. package/dist/auth/account_queries.d.ts.map +1 -1
  25. package/dist/auth/account_queries.js +255 -2
  26. package/dist/auth/account_route_schema.d.ts +26 -16
  27. package/dist/auth/account_route_schema.d.ts.map +1 -1
  28. package/dist/auth/account_route_schema.js +10 -24
  29. package/dist/auth/account_routes.d.ts +5 -7
  30. package/dist/auth/account_routes.d.ts.map +1 -1
  31. package/dist/auth/account_routes.js +110 -89
  32. package/dist/auth/admin_actions.d.ts.map +1 -1
  33. package/dist/auth/admin_actions.js +117 -25
  34. package/dist/auth/api_token_queries.d.ts +29 -12
  35. package/dist/auth/api_token_queries.d.ts.map +1 -1
  36. package/dist/auth/api_token_queries.js +42 -27
  37. package/dist/auth/audit_log_route_schema.d.ts +1 -1
  38. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  39. package/dist/auth/audit_log_routes.d.ts +1 -1
  40. package/dist/auth/audit_log_routes.d.ts.map +1 -1
  41. package/dist/auth/audit_log_routes.js +10 -12
  42. package/dist/auth/audit_log_schema.js +4 -4
  43. package/dist/auth/bearer_auth.d.ts +4 -3
  44. package/dist/auth/bearer_auth.d.ts.map +1 -1
  45. package/dist/auth/bearer_auth.js +37 -32
  46. package/dist/auth/bootstrap_account.d.ts +65 -37
  47. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  48. package/dist/auth/bootstrap_account.js +115 -66
  49. package/dist/auth/bootstrap_route_schema.d.ts +6 -2
  50. package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
  51. package/dist/auth/bootstrap_route_schema.js +7 -2
  52. package/dist/auth/bootstrap_routes.d.ts +50 -33
  53. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  54. package/dist/auth/bootstrap_routes.js +109 -87
  55. package/dist/auth/bootstrap_token_store.d.ts +60 -0
  56. package/dist/auth/bootstrap_token_store.d.ts.map +1 -0
  57. package/dist/auth/bootstrap_token_store.js +39 -0
  58. package/dist/auth/credential_headers.d.ts +71 -0
  59. package/dist/auth/credential_headers.d.ts.map +1 -0
  60. package/dist/auth/credential_headers.js +100 -0
  61. package/dist/auth/daemon_token.d.ts +13 -1
  62. package/dist/auth/daemon_token.d.ts.map +1 -1
  63. package/dist/auth/daemon_token.js +14 -2
  64. package/dist/auth/daemon_token_middleware.d.ts +10 -11
  65. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  66. package/dist/auth/daemon_token_middleware.js +39 -30
  67. package/dist/auth/deps.d.ts +10 -11
  68. package/dist/auth/deps.d.ts.map +1 -1
  69. package/dist/auth/invite_queries.d.ts +18 -0
  70. package/dist/auth/invite_queries.d.ts.map +1 -1
  71. package/dist/auth/invite_queries.js +24 -0
  72. package/dist/auth/request_context.d.ts +97 -76
  73. package/dist/auth/request_context.d.ts.map +1 -1
  74. package/dist/auth/request_context.js +93 -104
  75. package/dist/auth/resolved_auth.d.ts +10 -5
  76. package/dist/auth/resolved_auth.d.ts.map +1 -1
  77. package/dist/auth/resolved_auth.js +2 -2
  78. package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
  79. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  80. package/dist/auth/role_grant_offer_action_specs.js +5 -3
  81. package/dist/auth/role_grant_offer_actions.d.ts +7 -11
  82. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  83. package/dist/auth/role_grant_offer_actions.js +97 -106
  84. package/dist/auth/role_grant_offer_ddl.d.ts +7 -1
  85. package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
  86. package/dist/auth/role_grant_offer_ddl.js +9 -2
  87. package/dist/auth/role_grant_offer_notifications.d.ts +87 -38
  88. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
  89. package/dist/auth/role_grant_offer_notifications.js +75 -22
  90. package/dist/auth/role_grant_offer_queries.d.ts +143 -9
  91. package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
  92. package/dist/auth/role_grant_offer_queries.js +266 -66
  93. package/dist/auth/role_grant_offer_schema.js +1 -1
  94. package/dist/auth/role_grant_queries.d.ts +57 -10
  95. package/dist/auth/role_grant_queries.d.ts.map +1 -1
  96. package/dist/auth/role_grant_queries.js +81 -22
  97. package/dist/auth/role_grant_sql.d.ts +21 -0
  98. package/dist/auth/role_grant_sql.d.ts.map +1 -1
  99. package/dist/auth/role_grant_sql.js +21 -0
  100. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  101. package/dist/auth/self_service_role_actions.js +9 -2
  102. package/dist/auth/session_cookie.d.ts +105 -25
  103. package/dist/auth/session_cookie.d.ts.map +1 -1
  104. package/dist/auth/session_cookie.js +124 -15
  105. package/dist/auth/session_middleware.d.ts +83 -54
  106. package/dist/auth/session_middleware.d.ts.map +1 -1
  107. package/dist/auth/session_middleware.js +92 -66
  108. package/dist/auth/session_queries.d.ts +95 -14
  109. package/dist/auth/session_queries.d.ts.map +1 -1
  110. package/dist/auth/session_queries.js +98 -19
  111. package/dist/auth/signup_route_schema.d.ts +5 -5
  112. package/dist/auth/signup_route_schema.d.ts.map +1 -1
  113. package/dist/auth/signup_route_schema.js +4 -4
  114. package/dist/auth/signup_routes.d.ts.map +1 -1
  115. package/dist/auth/signup_routes.js +17 -14
  116. package/dist/auth/standard_rpc_actions.d.ts +6 -19
  117. package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
  118. package/dist/auth/standard_rpc_actions.js +5 -6
  119. package/dist/auth/token_scope.d.ts +6 -8
  120. package/dist/auth/token_scope.d.ts.map +1 -1
  121. package/dist/auth/token_scope.js +6 -9
  122. package/dist/dev/setup.d.ts +6 -1
  123. package/dist/dev/setup.d.ts.map +1 -1
  124. package/dist/dev/setup.js +42 -34
  125. package/dist/hono_context.d.ts +21 -0
  126. package/dist/hono_context.d.ts.map +1 -1
  127. package/dist/hono_context.js +17 -0
  128. package/dist/http/CLAUDE.md +156 -48
  129. package/dist/http/auth_shape.d.ts +4 -4
  130. package/dist/http/common_routes.js +1 -1
  131. package/dist/http/db_routes.d.ts +4 -3
  132. package/dist/http/db_routes.d.ts.map +1 -1
  133. package/dist/http/db_routes.js +14 -14
  134. package/dist/http/dev_route_error_check.d.ts +6 -3
  135. package/dist/http/dev_route_error_check.d.ts.map +1 -1
  136. package/dist/http/dev_route_error_check.js +6 -3
  137. package/dist/http/dev_set_cookie_check.d.ts +53 -0
  138. package/dist/http/dev_set_cookie_check.d.ts.map +1 -0
  139. package/dist/http/dev_set_cookie_check.js +80 -0
  140. package/dist/http/error_schemas.d.ts +45 -22
  141. package/dist/http/error_schemas.d.ts.map +1 -1
  142. package/dist/http/error_schemas.js +53 -26
  143. package/dist/http/header_lines.d.ts +42 -0
  144. package/dist/http/header_lines.d.ts.map +1 -0
  145. package/dist/http/header_lines.js +80 -0
  146. package/dist/http/host.d.ts +12 -9
  147. package/dist/http/host.d.ts.map +1 -1
  148. package/dist/http/host.js +25 -20
  149. package/dist/http/origin.d.ts +7 -22
  150. package/dist/http/origin.d.ts.map +1 -1
  151. package/dist/http/origin.js +11 -25
  152. package/dist/http/proxy.d.ts +1 -0
  153. package/dist/http/proxy.d.ts.map +1 -1
  154. package/dist/http/proxy.js +3 -0
  155. package/dist/http/request_headers.d.ts +95 -0
  156. package/dist/http/request_headers.d.ts.map +1 -0
  157. package/dist/http/request_headers.js +110 -0
  158. package/dist/http/request_target.d.ts +134 -0
  159. package/dist/http/request_target.d.ts.map +1 -0
  160. package/dist/http/request_target.js +193 -0
  161. package/dist/http/route_error_check.d.ts +4 -11
  162. package/dist/http/route_error_check.d.ts.map +1 -1
  163. package/dist/http/route_error_check.js +4 -21
  164. package/dist/http/route_result.d.ts +127 -23
  165. package/dist/http/route_result.d.ts.map +1 -1
  166. package/dist/http/route_result.js +97 -19
  167. package/dist/http/route_spec.d.ts +299 -83
  168. package/dist/http/route_spec.d.ts.map +1 -1
  169. package/dist/http/route_spec.js +548 -71
  170. package/dist/http/simple_request.d.ts +19 -14
  171. package/dist/http/simple_request.d.ts.map +1 -1
  172. package/dist/http/simple_request.js +17 -29
  173. package/dist/http/surface.d.ts +2 -0
  174. package/dist/http/surface.d.ts.map +1 -1
  175. package/dist/http/surface.js +4 -1
  176. package/dist/realtime/outbound_budget.d.ts +1 -2
  177. package/dist/realtime/outbound_budget.d.ts.map +1 -1
  178. package/dist/realtime/outbound_budget.js +1 -2
  179. package/dist/realtime/sse.d.ts +47 -17
  180. package/dist/realtime/sse.d.ts.map +1 -1
  181. package/dist/realtime/sse.js +115 -93
  182. package/dist/realtime/sse_constants.d.ts +7 -1
  183. package/dist/realtime/sse_constants.d.ts.map +1 -1
  184. package/dist/realtime/sse_constants.js +12 -1
  185. package/dist/realtime/sse_registry.d.ts +3 -3
  186. package/dist/realtime/sse_registry.js +3 -3
  187. package/dist/runtime/deps.d.ts +20 -4
  188. package/dist/runtime/deps.d.ts.map +1 -1
  189. package/dist/runtime/mock.d.ts +7 -1
  190. package/dist/runtime/mock.d.ts.map +1 -1
  191. package/dist/runtime/mock.js +33 -3
  192. package/dist/runtime/node.d.ts.map +1 -1
  193. package/dist/runtime/node.js +2 -1
  194. package/dist/runtime/secure_file.d.ts +71 -10
  195. package/dist/runtime/secure_file.d.ts.map +1 -1
  196. package/dist/runtime/secure_file.js +91 -11
  197. package/dist/server/app_backend.d.ts +0 -8
  198. package/dist/server/app_backend.d.ts.map +1 -1
  199. package/dist/server/app_backend.js +4 -4
  200. package/dist/server/app_server.d.ts +54 -33
  201. package/dist/server/app_server.d.ts.map +1 -1
  202. package/dist/server/app_server.js +69 -41
  203. package/dist/server/serve_fact_route.d.ts +3 -3
  204. package/dist/server/serve_fact_route.d.ts.map +1 -1
  205. package/dist/server/serve_fact_route.js +59 -55
  206. package/dist/server/static.d.ts +20 -0
  207. package/dist/server/static.d.ts.map +1 -1
  208. package/dist/server/static.js +56 -8
  209. package/dist/server/unmatched_route.d.ts +42 -0
  210. package/dist/server/unmatched_route.d.ts.map +1 -0
  211. package/dist/server/unmatched_route.js +64 -0
  212. package/dist/testing/CLAUDE.md +406 -1202
  213. package/dist/testing/app_server.d.ts +3 -1
  214. package/dist/testing/app_server.d.ts.map +1 -1
  215. package/dist/testing/app_server.js +5 -9
  216. package/dist/testing/auth_apps.d.ts.map +1 -1
  217. package/dist/testing/auth_apps.js +3 -2
  218. package/dist/testing/cross_backend/account_lifecycle.d.ts +11 -4
  219. package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
  220. package/dist/testing/cross_backend/account_lifecycle.js +320 -6
  221. package/dist/testing/cross_backend/build_test_backend_paths.d.ts +4 -1
  222. package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
  223. package/dist/testing/cross_backend/build_test_backend_paths.js +1 -1
  224. package/dist/testing/cross_backend/capabilities.d.ts +68 -5
  225. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  226. package/dist/testing/cross_backend/capabilities.js +20 -4
  227. package/dist/testing/cross_backend/cell_gated_create.js +1 -1
  228. package/dist/testing/cross_backend/conformance_case.d.ts +63 -21
  229. package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
  230. package/dist/testing/cross_backend/conformance_table.d.ts +54 -12
  231. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  232. package/dist/testing/cross_backend/conformance_table.js +179 -23
  233. package/dist/testing/cross_backend/cookie_attributes.js +1 -1
  234. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +7 -1
  235. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
  236. package/dist/testing/cross_backend/create_dual_spawn_global_setup.js +3 -3
  237. package/dist/testing/cross_backend/credential_conformance.d.ts +196 -0
  238. package/dist/testing/cross_backend/credential_conformance.d.ts.map +1 -0
  239. package/dist/testing/cross_backend/credential_conformance.js +296 -0
  240. package/dist/testing/cross_backend/credential_conformance.json +1284 -0
  241. package/dist/testing/cross_backend/credential_conformance_wire.d.ts +40 -0
  242. package/dist/testing/cross_backend/credential_conformance_wire.d.ts.map +1 -0
  243. package/dist/testing/cross_backend/credential_conformance_wire.js +293 -0
  244. package/dist/testing/cross_backend/credential_header_robustness.d.ts +1 -3
  245. package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
  246. package/dist/testing/cross_backend/credential_header_robustness.js +24 -55
  247. package/dist/testing/cross_backend/credential_wire.d.ts +112 -0
  248. package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -0
  249. package/dist/testing/cross_backend/credential_wire.js +188 -0
  250. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  251. package/dist/testing/cross_backend/default_backend_configs.js +22 -2
  252. package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -26
  253. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  254. package/dist/testing/cross_backend/default_spine_surface.js +3 -7
  255. package/dist/testing/cross_backend/differential.d.ts +1 -1
  256. package/dist/testing/cross_backend/differential.d.ts.map +1 -1
  257. package/dist/testing/cross_backend/differential.js +3 -2
  258. package/dist/testing/cross_backend/differential_normalize.d.ts +23 -6
  259. package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
  260. package/dist/testing/cross_backend/differential_normalize.js +11 -5
  261. package/dist/testing/cross_backend/full_spine_mount.d.ts +4 -10
  262. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  263. package/dist/testing/cross_backend/full_spine_mount.js +11 -4
  264. package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
  265. package/dist/testing/cross_backend/identity_parity.js +4 -0
  266. package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
  267. package/dist/testing/cross_backend/in_process_setup.js +78 -4
  268. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  269. package/dist/testing/cross_backend/login_security.js +13 -10
  270. package/dist/testing/cross_backend/peer_ping_ws.d.ts +1 -1
  271. package/dist/testing/cross_backend/peer_ping_ws.js +2 -2
  272. package/dist/testing/cross_backend/request_header_conformance.d.ts +174 -0
  273. package/dist/testing/cross_backend/request_header_conformance.d.ts.map +1 -0
  274. package/dist/testing/cross_backend/request_header_conformance.js +196 -0
  275. package/dist/testing/cross_backend/request_header_conformance.json +1158 -0
  276. package/dist/testing/cross_backend/request_header_conformance_wire.d.ts +39 -0
  277. package/dist/testing/cross_backend/request_header_conformance_wire.d.ts.map +1 -0
  278. package/dist/testing/cross_backend/request_header_conformance_wire.js +284 -0
  279. package/dist/testing/cross_backend/request_target_conformance.d.ts +298 -0
  280. package/dist/testing/cross_backend/request_target_conformance.d.ts.map +1 -0
  281. package/dist/testing/cross_backend/request_target_conformance.js +186 -0
  282. package/dist/testing/cross_backend/request_target_conformance.json +3765 -0
  283. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +32 -0
  284. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -0
  285. package/dist/testing/cross_backend/request_target_conformance_wire.js +278 -0
  286. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
  287. package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +173 -1
  288. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +5 -4
  289. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  290. package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +185 -31
  291. package/dist/testing/cross_backend/rpc_adversarial.d.ts +6 -4
  292. package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
  293. package/dist/testing/cross_backend/rpc_adversarial.js +5 -2
  294. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +6 -7
  295. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  296. package/dist/testing/cross_backend/rust_spine_consumer_surface.js +4 -5
  297. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  298. package/dist/testing/cross_backend/session_cap.js +82 -34
  299. package/dist/testing/cross_backend/session_cookie_effect.d.ts +43 -0
  300. package/dist/testing/cross_backend/session_cookie_effect.d.ts.map +1 -0
  301. package/dist/testing/cross_backend/session_cookie_effect.js +103 -0
  302. package/dist/testing/cross_backend/session_login.d.ts +24 -0
  303. package/dist/testing/cross_backend/session_login.d.ts.map +1 -0
  304. package/dist/testing/cross_backend/session_login.js +31 -0
  305. package/dist/testing/cross_backend/setup.d.ts +117 -0
  306. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  307. package/dist/testing/cross_backend/setup.js +193 -9
  308. package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
  309. package/dist/testing/cross_backend/simple_request.js +5 -0
  310. package/dist/testing/cross_backend/spine_suites.d.ts +9 -1
  311. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  312. package/dist/testing/cross_backend/spine_suites.js +88 -5
  313. package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
  314. package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
  315. package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
  316. package/dist/testing/cross_backend/sse_round_trip.d.ts +8 -5
  317. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  318. package/dist/testing/cross_backend/sse_round_trip.js +205 -64
  319. package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
  320. package/dist/testing/cross_backend/testing_backdoor.js +5 -2
  321. package/dist/testing/cross_backend/testing_credential_read.d.ts +165 -0
  322. package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -0
  323. package/dist/testing/cross_backend/testing_credential_read.js +175 -0
  324. package/dist/testing/cross_backend/testing_reset_actions.d.ts +19 -0
  325. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  326. package/dist/testing/cross_backend/testing_reset_actions.js +22 -6
  327. package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
  328. package/dist/testing/cross_backend/token_lifetime.js +58 -2
  329. package/dist/testing/cross_backend/transport_composition.d.ts +2 -4
  330. package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
  331. package/dist/testing/cross_backend/transport_composition.js +13 -10
  332. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  333. package/dist/testing/cross_backend/ts_spine_backend_config.js +5 -3
  334. package/dist/testing/cross_backend/ws_endpoint.d.ts +11 -1
  335. package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
  336. package/dist/testing/cross_backend/ws_endpoint.js +19 -2
  337. package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
  338. package/dist/testing/cross_backend/ws_role_gated.js +2 -3
  339. package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
  340. package/dist/testing/cross_backend/ws_round_trip.js +28 -12
  341. package/dist/testing/cross_backend/xfail.d.ts +44 -11
  342. package/dist/testing/cross_backend/xfail.d.ts.map +1 -1
  343. package/dist/testing/cross_backend/xfail.js +68 -23
  344. package/dist/testing/data_exposure.d.ts.map +1 -1
  345. package/dist/testing/data_exposure.js +4 -3
  346. package/dist/testing/integration.d.ts +1 -2
  347. package/dist/testing/integration.d.ts.map +1 -1
  348. package/dist/testing/integration.js +14 -8
  349. package/dist/testing/integration_helpers.d.ts +50 -3
  350. package/dist/testing/integration_helpers.d.ts.map +1 -1
  351. package/dist/testing/integration_helpers.js +87 -9
  352. package/dist/testing/middleware.d.ts +3 -1
  353. package/dist/testing/middleware.d.ts.map +1 -1
  354. package/dist/testing/middleware.js +14 -7
  355. package/dist/testing/resolved_auth.d.ts +3 -1
  356. package/dist/testing/resolved_auth.d.ts.map +1 -1
  357. package/dist/testing/resolved_auth.js +4 -4
  358. package/dist/testing/round_trip.d.ts +6 -2
  359. package/dist/testing/round_trip.d.ts.map +1 -1
  360. package/dist/testing/round_trip.js +17 -6
  361. package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
  362. package/dist/testing/rpc_envelope_cases.js +7 -0
  363. package/dist/testing/rpc_helpers.d.ts +4 -2
  364. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  365. package/dist/testing/rpc_helpers.js +6 -1
  366. package/dist/testing/rpc_round_trip.d.ts +13 -2
  367. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  368. package/dist/testing/rpc_round_trip.js +25 -6
  369. package/dist/testing/schema_generators.d.ts +2 -2
  370. package/dist/testing/schema_generators.d.ts.map +1 -1
  371. package/dist/testing/schema_generators.js +4 -4
  372. package/dist/testing/stubs.d.ts +2 -2
  373. package/dist/testing/stubs.d.ts.map +1 -1
  374. package/dist/testing/stubs.js +13 -10
  375. package/dist/testing/transports/fetch_transport.d.ts +6 -3
  376. package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
  377. package/dist/testing/transports/fetch_transport.js +31 -19
  378. package/dist/testing/transports/raw_http.d.ts +61 -1
  379. package/dist/testing/transports/raw_http.d.ts.map +1 -1
  380. package/dist/testing/transports/raw_http.js +61 -1
  381. package/dist/testing/transports/ws_raw_client.d.ts +20 -0
  382. package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
  383. package/dist/testing/transports/ws_raw_client.js +10 -4
  384. package/dist/testing/transports/ws_transport.d.ts +21 -1
  385. package/dist/testing/transports/ws_transport.d.ts.map +1 -1
  386. package/dist/testing/transports/ws_transport.js +58 -20
  387. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  388. package/dist/testing/ws_round_trip.js +8 -4
  389. package/package.json +1 -1
@@ -101,7 +101,8 @@ export interface MintTestSessionOptions {
101
101
  }
102
102
  /**
103
103
  * Mint a real `auth_session` row for an existing account and return a
104
- * validly-signed session cookie value referencing it. Test-only — the
104
+ * validly-signed session cookie value referencing it, with the row's id (the
105
+ * token's hash) for a caller that revokes it. Test-only — the
105
106
  * forge behind the cross-backend expiry conformance cases (the
106
107
  * `expired_session` principal): pass a negative `expires_in_seconds` to
107
108
  * produce an *expired server-side session* whose signed cookie envelope is
@@ -113,6 +114,7 @@ export interface MintTestSessionOptions {
113
114
  */
114
115
  export declare const mint_test_session: (options: MintTestSessionOptions) => Promise<{
115
116
  session_cookie: string;
117
+ session_hash: string;
116
118
  }>;
117
119
  /**
118
120
  * Bootstrap the test-DB keeper. Direct-query shortcut for the default
@@ -1 +1 @@
1
- {"version":3,"file":"app_server.d.ts","sourceRoot":"","sources":["../../src/lib/testing/app_server.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGjC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;A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,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClF,iEAAiE;IACjE,2BAA2B,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxF,qDAAqD;IACrD,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7E,2PAA2P;IAC3P,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,QAAO,IAAI,CACzD,gBAAgB,EAChB,iBAAiB,GAAG,OAAO,GAAG,YAAY,CAa1C,CAAC;AAgCF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,oBAAoB,KAAG,OAAO,CAAC,OAAO,CAqFpF,CAAC"}
@@ -13,6 +13,7 @@ import { create_session_cookie_value } from '../auth/session_cookie.js';
13
13
  import { run_migrations } from '../db/migrate.js';
14
14
  import { AUTH_MIGRATION_NS } from '../auth/migrations.js';
15
15
  import { create_realtime_closer } from '../actions/connection_closer.js';
16
+ import { create_realtime_notification_sender } from '../actions/notification_sender.js';
16
17
  import { default_audit_factory } from '../server/app_backend.js';
17
18
  import { create_app_server } from '../server/app_server.js';
18
19
  import { generate_daemon_token, DAEMON_TOKEN_HEADER } from '../auth/daemon_token.js';
@@ -121,7 +122,8 @@ export const create_test_account_with_credentials = async (options) => {
121
122
  };
122
123
  /**
123
124
  * Mint a real `auth_session` row for an existing account and return a
124
- * validly-signed session cookie value referencing it. Test-only — the
125
+ * validly-signed session cookie value referencing it, with the row's id (the
126
+ * token's hash) for a caller that revokes it. Test-only — the
125
127
  * forge behind the cross-backend expiry conformance cases (the
126
128
  * `expired_session` principal): pass a negative `expires_in_seconds` to
127
129
  * produce an *expired server-side session* whose signed cookie envelope is
@@ -138,7 +140,7 @@ export const mint_test_session = async (options) => {
138
140
  const expires_at = new Date(Date.now() + expires_in_seconds * 1000);
139
141
  await query_create_session({ db }, session_hash, account_id, expires_at);
140
142
  const session_cookie = await create_session_cookie_value(keyring, session_token, session_options);
141
- return { session_cookie };
143
+ return { session_cookie, session_hash };
142
144
  };
143
145
  /**
144
146
  * Bootstrap the test-DB keeper. Direct-query shortcut for the default
@@ -164,12 +166,6 @@ export const bootstrap_test_keeper = async (options) => {
164
166
  };
165
167
  /** Silent logger for tests — suppresses all output. */
166
168
  const test_log = new Logger('test', { level: 'off' });
167
- const test_fs_stubs = {
168
- read_secure_file: async (path) => {
169
- throw new Error(`ENOENT: no such file or directory: ${path}`);
170
- },
171
- delete_file: async () => { }
172
- };
173
169
  /**
174
170
  * Backend-assembly path for `create_test_app_server`. Returns the raw
175
171
  * `AppBackend` + the keyring used to sign session cookies.
@@ -224,7 +220,7 @@ const _build_test_backend = async (options) => {
224
220
  log: test_log,
225
221
  audit: audit_factory({ db, log: test_log }),
226
222
  connection_closer: create_realtime_closer(),
227
- ...test_fs_stubs
223
+ notification_sender: create_realtime_notification_sender()
228
224
  }
229
225
  };
230
226
  return { backend, keyring: keyring_result.keyring };
@@ -1 +1 @@
1
- {"version":3,"file":"auth_apps.d.ts","sourceRoot":"","sources":["../../src/lib/testing/auth_apps.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAIN,KAAK,qBAAqB,EAC1B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,4BAA4B,CAAC;AAUpC;;GAEG;AACH,eAA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AACvE,OAAO,EAIN,KAAK,qBAAqB,EAC1B,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,4BAA4B,CAAC;AAWpC;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,OAAO,MAAM,KAAG,cAI1D,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACtC,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,WAAW,cAAc,EACzB,kBAAkB,qBAAqB,KACrC,IA4BF,CAAC;AAEF,sFAAsF;AACtF,MAAM,WAAW,YAAY;IAC5B,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;IACb;;;;;;;;OAQG;IACH,kBAAkB,EAAE,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;IACrD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GACjC,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,OAAO,KAAK,CAAC,MAAM,CAAC,KAClB,YAsBF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,YAAY,EAAE,MAAM,SAAS,KAAG,IAwBrE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACpC,aAAa,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,KACpC,CAAC,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAGvD,CAAC"}
@@ -19,6 +19,7 @@ import { REQUEST_CONTEXT_KEY, create_fuz_authorization_handler } from '../auth/r
19
19
  import { RESOLVED_AUTH_KEY, TEST_CONTEXT_PRESET, TEST_CONTEXT_PRESET_KEY } from '../hono_context.js';
20
20
  import { create_test_resolved_auth } from './resolved_auth.js';
21
21
  import { create_stub_db } from './stubs.js';
22
+ import { create_sse_stream } from '../realtime/sse.js';
22
23
  import { create_test_account, create_test_actor, create_test_role_grant } from './entities.js';
23
24
  /**
24
25
  * Create a mock `RequestContext` with optional role role_grant.
@@ -44,14 +45,14 @@ export const create_test_app_from_specs = (route_specs, auth_ctx, credential_typ
44
45
  if (auth_ctx) {
45
46
  c.set(RESOLVED_AUTH_KEY, create_test_resolved_auth({
46
47
  credential_type: credential_type ?? CREDENTIAL_TYPE_SESSION,
47
- account_id: auth_ctx.account.id
48
+ account: auth_ctx.account
48
49
  }));
49
50
  c.set(REQUEST_CONTEXT_KEY, auth_ctx);
50
51
  c.set(TEST_CONTEXT_PRESET_KEY, TEST_CONTEXT_PRESET);
51
52
  }
52
53
  await next();
53
54
  });
54
- apply_route_specs(app, route_specs, fuz_auth_guard_resolver, new Logger('test', { level: 'off' }), db, create_fuz_authorization_handler({ db }));
55
+ apply_route_specs(app, route_specs, fuz_auth_guard_resolver, new Logger('test', { level: 'off' }), db, { authorize: create_fuz_authorization_handler({ db }), open_sse: create_sse_stream });
55
56
  return app;
56
57
  };
57
58
  /**
@@ -1,11 +1,18 @@
1
1
  import '../assert_dev_env.js';
2
2
  import type { RpcPathCapabilityGatedCrossSuiteOptions } from './setup.js';
3
3
  /**
4
- * Options for the account-lifecycle parity suite. The standard
4
+ * Options for the account-lifecycle parity suite: the standard
5
5
  * capability-gating RPC-dispatched cross-suite shape (`setup_test` /
6
- * `capabilities` / `rpc_path`); aliases
7
- * `RpcPathCapabilityGatedCrossSuiteOptions` rather than duplicating.
6
+ * `capabilities` / `rpc_path`) plus the two REST account routes the
7
+ * credential cases call.
8
8
  */
9
- export type AccountLifecycleCrossTestOptions = RpcPathCapabilityGatedCrossSuiteOptions;
9
+ export interface AccountLifecycleCrossTestOptions extends RpcPathCapabilityGatedCrossSuiteOptions {
10
+ /** REST login route path. Default `/api/account/login`. */
11
+ readonly login_path?: string;
12
+ /** REST password-change route path. Default `/api/account/password`. */
13
+ readonly password_path?: string;
14
+ /** REST signup route path. Default `/api/account/signup`. */
15
+ readonly signup_path?: string;
16
+ }
10
17
  export declare const describe_account_lifecycle_cross_tests: (options: AccountLifecycleCrossTestOptions) => void;
11
18
  //# sourceMappingURL=account_lifecycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"account_lifecycle.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/account_lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAuC9B,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,YAAY,CAAC;AAG1E;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG,uCAAuC,CAAC;AAEvF,eAAO,MAAM,sCAAsC,GAClD,SAAS,gCAAgC,KACvC,IAwaF,CAAC"}
1
+ {"version":3,"file":"account_lifecycle.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/account_lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgF9B,OAAO,KAAK,EAAE,uCAAuC,EAAe,MAAM,YAAY,CAAC;AAQvF;;;;;GAKG;AACH,MAAM,WAAW,gCAAiC,SAAQ,uCAAuC;IAChG,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AAQD,eAAO,MAAM,sCAAsC,GAClD,SAAS,gCAAgC,KACvC,IAg7BF,CAAC"}
@@ -8,26 +8,138 @@ import '../assert_dev_env.js';
8
8
  *
9
9
  * Like the cell suites, these verbs can't ride the generic
10
10
  * `describe_rpc_round_trip_tests`: they're stateful and destructive (a
11
- * generic round-trip would tombstone the bootstrapped keeper). They
12
- * live-mount on every spine's RPC path but stay off the declared surface,
13
- * so this dedicated suite is their cross-impl validator. Every success
11
+ * generic round-trip would tombstone the bootstrapped keeper). They are on
12
+ * the declared surface, so shape and auth are auto-enumerated; this suite is
13
+ * the behavioral parity the generic round-trip can't drive. Every success
14
14
  * `result` is parsed against the verb's declared **output** schema, so
15
15
  * a TS↔Rust envelope drift fails the assertion.
16
16
  *
17
+ * Also pinned: a soft-deleted account's session and bearer stop
18
+ * authenticating; a bearer self-delete is 403 `credential_type_required` with
19
+ * the session left live; the delete, undelete and purge success rows snapshot
20
+ * the victim's `username`; the keeper guard and a second undelete each write
21
+ * an `outcome: 'failure'` row; `admin_account_list` with `include_deleted`
22
+ * lists tombstoned rows with `deleted_at` set.
23
+ *
24
+ * A purge ends the pending offers made to the account before its cascade
25
+ * deletes them, as a delete does — one `role_grant_offer_supersede` row each,
26
+ * `account_deleted` with the account as cause — and the grantor's history no
27
+ * longer lists them: the audit row is what remains.
28
+ *
29
+ * Two credential end states, each proven live before it is killed: a session
30
+ * and an API token minted before a soft delete stay dead after the undelete
31
+ * (the delete removed their rows, and the undelete clears only the
32
+ * tombstones), each answering as an anonymous request does, while a fresh
33
+ * login authenticates; and a password change made over one session ends the
34
+ * account's other session and its API token as well as its own, leaves
35
+ * another account's session live, and only the new password logs in. The
36
+ * password case needs no lifecycle verb, so it runs on every backend.
37
+ *
38
+ * What an undelete brings back, and what it doesn't. The account's role
39
+ * grants are kept through the delete — listed, conferring nothing while no
40
+ * credential of the account authenticates — and confer again once a fresh
41
+ * login has a session. Nothing the delete ended comes back: the offers made to
42
+ * the account, account- and actor-addressed, stay superseded (gone from its
43
+ * inbox, an accept answers `role_grant_offer_terminal` and grants nothing),
44
+ * and the unclaimed invites it issued stay deleted, a signup with one
45
+ * answering what a signup with no invite answers, while the invite it issued
46
+ * that was already claimed is untouched.
47
+ *
17
48
  * @module
18
49
  */
19
- import { describe, assert } from 'vitest';
20
- import { AccountDeleteOutput, AccountUndeleteOutput, AccountPurgeOutput, AdminAccountListOutput, ERROR_CANNOT_DELETE_KEEPER } from '../../auth/admin_action_specs.js';
50
+ import { describe, assert, test } from 'vitest';
51
+ import { AccountDeleteOutput, AccountUndeleteOutput, AccountPurgeOutput, AdminAccountListOutput, ERROR_CANNOT_DELETE_KEEPER, InviteListOutput } from '../../auth/admin_action_specs.js';
52
+ import { ERROR_ROLE_GRANT_OFFER_TERMINAL, RoleGrantOfferHistoryOutput, RoleGrantOfferListOutput } from '../../auth/role_grant_offer_action_specs.js';
53
+ import { ROLE_ADMIN } from '../../auth/role_schema.js';
54
+ import { JSONRPC_INVALID_REQUEST } from '../../http/jsonrpc.js';
21
55
  import { ERROR_ACCOUNT_NOT_FOUND, ERROR_AUTHENTICATION_REQUIRED, ERROR_CREDENTIAL_TYPE_REQUIRED } from '../../http/error_schemas.js';
22
56
  import { JSONRPC_ERROR_CODES } from '../../http/jsonrpc_errors.js';
23
57
  import { assert_audit_metadata_fields, list_audit_events } from './audit_cross_helpers.js';
24
58
  import { test_if } from './capabilities.js';
25
59
  import { cross_rpc_call, error_reason, expect_output } from './cross_rpc.js';
26
60
  import { assert_iso8601_seconds } from './wire_shapes.js';
27
- import { SPINE_RPC_PATH } from './spine_surface_constants.js';
61
+ import { create_test_request_headers } from '../test_origin.js';
62
+ import { SPINE_ACCOUNT_LOGIN_PATH, SPINE_ACCOUNT_PASSWORD_PATH, SPINE_ACCOUNT_SIGNUP_PATH, SPINE_RPC_PATH } from './spine_surface_constants.js';
63
+ /** The password the credential cases create their accounts with. */
64
+ const LIFECYCLE_PASSWORD = 'lifecycle-password-before';
65
+ /** The password the password-change case changes to. */
66
+ const LIFECYCLE_PASSWORD_CHANGED = 'lifecycle-password-after';
28
67
  export const describe_account_lifecycle_cross_tests = (options) => {
29
68
  const { setup_test, capabilities } = options;
30
69
  const rpc_path = options.rpc_path ?? SPINE_RPC_PATH;
70
+ const login_path = options.login_path ?? SPINE_ACCOUNT_LOGIN_PATH;
71
+ const password_path = options.password_path ?? SPINE_ACCOUNT_PASSWORD_PATH;
72
+ const signup_path = options.signup_path ?? SPINE_ACCOUNT_SIGNUP_PATH;
73
+ /** One RPC call on a fresh transport carrying `headers` alone. */
74
+ const rpc = (fixture, method, params, headers) => cross_rpc_call(fixture.fresh_transport(), rpc_path, method, params, headers);
75
+ /** `account_delete` of `account_id`, as the keeper. */
76
+ const delete_account = async (fixture, account_id) => {
77
+ const res = await rpc(fixture, 'account_delete', { account_id }, fixture.create_session_headers());
78
+ assert.ok(res.ok, `account_delete must succeed: ${JSON.stringify(res)}`);
79
+ };
80
+ /** `account_undelete` of `account_id`, as the keeper. */
81
+ const undelete_account = async (fixture, account_id) => {
82
+ const res = await rpc(fixture, 'account_undelete', { account_id }, fixture.create_session_headers());
83
+ assert.ok(res.ok, `account_undelete must succeed: ${JSON.stringify(res)}`);
84
+ };
85
+ /** `account`'s `admin_account_list` entry, tombstoned or not. */
86
+ const listed_account = async (fixture, account_id) => {
87
+ const { accounts } = expect_output(await rpc(fixture, 'admin_account_list', { include_deleted: true }, fixture.create_session_headers()), AdminAccountListOutput);
88
+ const entry = accounts.find((a) => a.account.id === account_id);
89
+ assert.ok(entry, 'admin_account_list lists the account');
90
+ return entry;
91
+ };
92
+ /** A signup with `username` on a fresh transport, its status and body. */
93
+ const signup = async (fixture, username) => {
94
+ const res = await fixture.fresh_transport()(signup_path, {
95
+ method: 'POST',
96
+ headers: create_test_request_headers({ 'content-type': 'application/json' }),
97
+ body: JSON.stringify({ username, password: LIFECYCLE_PASSWORD })
98
+ });
99
+ return { status: res.status, body: await res.json() };
100
+ };
101
+ /**
102
+ * `account_verify` carrying `headers` and no other credential — a
103
+ * cookie-free transport, no `Origin` added (a bearer beside one is
104
+ * discarded as browser context).
105
+ */
106
+ const verify = (fixture, headers) => cross_rpc_call(fixture.fresh_transport({ origin: null }), rpc_path, 'account_verify', undefined, headers);
107
+ /** Who `headers` authenticate as: the account id `account_verify` answers, or `null`. */
108
+ const verified_account_id = async (fixture, headers) => {
109
+ const res = await verify(fixture, headers);
110
+ return res.ok ? res.result.id : null;
111
+ };
112
+ /** A request carrying no credential, with `account`'s non-credential headers. */
113
+ const anonymous_headers = (account) => {
114
+ const { authorization: _, ...rest } = account.create_bearer_headers();
115
+ return rest;
116
+ };
117
+ /**
118
+ * Assert `headers` answer exactly as an anonymous request does — a dead
119
+ * credential must not be told apart from no credential.
120
+ */
121
+ const assert_answers_as_anonymous = async (fixture, account, headers, label) => {
122
+ const dead = await verify(fixture, headers);
123
+ const anonymous = await verify(fixture, anonymous_headers(account));
124
+ assert.strictEqual(anonymous.status, 401, 'the anonymous control is refused');
125
+ assert.strictEqual(dead.status, anonymous.status, label);
126
+ assert.strictEqual(error_reason(dead), ERROR_AUTHENTICATION_REQUIRED, label);
127
+ assert.deepStrictEqual(dead.error, anonymous.error, label);
128
+ };
129
+ /** Log in on a fresh transport; the session cookie the login sets, as a `Cookie` value. */
130
+ const login = async (fixture, username, password) => {
131
+ const res = await fixture.fresh_transport()(login_path, {
132
+ method: 'POST',
133
+ headers: create_test_request_headers({ 'content-type': 'application/json' }),
134
+ body: JSON.stringify({ username, password })
135
+ });
136
+ await res.body?.cancel();
137
+ const lines = res.headers.getSetCookie();
138
+ if (res.status !== 200)
139
+ return { status: res.status, cookie: null };
140
+ assert.strictEqual(lines.length, 1, 'a login sets exactly the session cookie');
141
+ return { status: res.status, cookie: lines[0].split(';')[0] };
142
+ };
31
143
  describe('account lifecycle parity', () => {
32
144
  test_if(capabilities.account_lifecycle, 'soft-delete → undelete round-trip (admin)', async () => {
33
145
  const fixture = await setup_test();
@@ -62,6 +174,44 @@ export const describe_account_lifecycle_cross_tests = (options) => {
62
174
  assert.ok(row, 'account_purge writes a success row targeting the victim');
63
175
  assert.strictEqual(row.metadata?.username, victim.account.username, 'account_purge snapshots the username');
64
176
  });
177
+ test_if(capabilities.account_lifecycle, 'a purge supersedes the offers made to the account, audited, before its cascade deletes them', async () => {
178
+ const fixture = await setup_test();
179
+ const victim = await fixture.create_account({ username: 'lifecycle_purge_offered' });
180
+ const grantor = await fixture.create_account({
181
+ username: 'lifecycle_purge_offerer',
182
+ roles: [ROLE_ADMIN]
183
+ });
184
+ const offer = async (headers, params) => {
185
+ const res = await rpc(fixture, 'role_grant_offer_create', { to_account_id: victim.account.id, role: ROLE_ADMIN, ...params }, headers);
186
+ if (!res.ok)
187
+ assert.fail(`role_grant_offer_create: ${JSON.stringify(res)}`);
188
+ return res.result.offer.id;
189
+ };
190
+ const by_account = await offer(fixture.create_session_headers(), {});
191
+ const by_actor = await offer(grantor.create_session_headers(), {
192
+ to_actor_id: victim.actor.id
193
+ });
194
+ expect_output(await cross_rpc_call(fixture.fresh_transport({ origin: null }), rpc_path, 'account_purge', { account_id: victim.account.id, confirm: true }, fixture.create_daemon_token_headers()), AccountPurgeOutput);
195
+ const supersedes = await list_audit_events(fixture, { event_type: 'role_grant_offer_supersede' }, rpc_path);
196
+ for (const [offer_id, grantor_headers, label] of [
197
+ [by_account, fixture.create_session_headers(), 'the account-addressed offer'],
198
+ [by_actor, grantor.create_session_headers(), 'the actor-addressed offer']
199
+ ]) {
200
+ const rows = supersedes.filter((e) => e.metadata?.offer_id === offer_id);
201
+ assert.strictEqual(rows.length, 1, `one role_grant_offer_supersede row for ${label}`);
202
+ assert.strictEqual(rows[0].target_account_id, victim.account.id, label);
203
+ assert_audit_metadata_fields(fixture, rows[0].metadata, {
204
+ offer_id,
205
+ role: ROLE_ADMIN,
206
+ scope_id: null,
207
+ reason: 'account_deleted',
208
+ cause_id: victim.account.id
209
+ });
210
+ // the cascade deleted the row: the audit row is all that remains
211
+ const { offers } = expect_output(await rpc(fixture, 'role_grant_offer_history', {}, grantor_headers), RoleGrantOfferHistoryOutput);
212
+ assert.notInclude(offers.map((o) => o.id), offer_id, `the grantor's history no longer lists ${label}`);
213
+ }
214
+ });
65
215
  test_if(capabilities.account_lifecycle, 'keeper guard: delete + purge refuse the keeper account', async () => {
66
216
  const fixture = await setup_test();
67
217
  const t = fixture.fresh_transport();
@@ -195,5 +345,169 @@ export const describe_account_lifecycle_cross_tests = (options) => {
195
345
  assert_iso8601_seconds(row.account.updated_at, 'admin_account_list.updated_at');
196
346
  assert_iso8601_seconds(row.account.deleted_at, 'admin_account_list.deleted_at');
197
347
  });
348
+ test_if(capabilities.account_lifecycle, 'credentials minted before a delete stay dead after the undelete; a fresh login authenticates', async () => {
349
+ const fixture = await setup_test();
350
+ const victim = await fixture.create_account({
351
+ username: 'lifecycle_revived',
352
+ password_value: LIFECYCLE_PASSWORD
353
+ });
354
+ const admin_headers = fixture.create_session_headers();
355
+ const victim_id = victim.account.id;
356
+ // each credential authenticates as the victim before the delete, so
357
+ // its refusal after the undelete is a transition
358
+ assert.strictEqual(await verified_account_id(fixture, victim.create_session_headers()), victim_id);
359
+ assert.strictEqual(await verified_account_id(fixture, victim.create_bearer_headers()), victim_id);
360
+ for (const method of ['account_delete', 'account_undelete']) {
361
+ const res = await cross_rpc_call(fixture.fresh_transport(), rpc_path, method, { account_id: victim_id }, admin_headers);
362
+ assert.ok(res.ok, `${method} must succeed: ${JSON.stringify(res)}`);
363
+ }
364
+ await assert_answers_as_anonymous(fixture, victim, victim.create_session_headers(), 'a session minted before the delete stays dead after the undelete');
365
+ await assert_answers_as_anonymous(fixture, victim, victim.create_bearer_headers(), 'an API token minted before the delete stays dead after the undelete');
366
+ const fresh = await login(fixture, victim.account.username, LIFECYCLE_PASSWORD);
367
+ assert.strictEqual(fresh.status, 200, 'the reactivated account logs in');
368
+ assert.ok(fresh.cookie);
369
+ assert.strictEqual(await verified_account_id(fixture, {
370
+ ...anonymous_headers(victim),
371
+ cookie: fresh.cookie
372
+ }), victim_id, 'the fresh session authenticates as the reactivated account');
373
+ });
374
+ test_if(capabilities.account_lifecycle, "an account's role grants are kept through a delete, inert, and confer again after the undelete", async () => {
375
+ const fixture = await setup_test();
376
+ const victim = await fixture.create_account({
377
+ username: 'lifecycle_granted',
378
+ password_value: LIFECYCLE_PASSWORD,
379
+ roles: [ROLE_ADMIN]
380
+ });
381
+ const victim_id = victim.account.id;
382
+ // an admin-gated read, so a 200 is the grant conferring
383
+ const admin_read = (headers) => rpc(fixture, 'admin_account_list', {}, headers);
384
+ assert.strictEqual((await admin_read(victim.create_session_headers())).status, 200, 'the grant confers before the delete');
385
+ const admin_grant_ids = (entry) => entry.role_grants.filter((g) => g.role === ROLE_ADMIN).map((g) => g.id);
386
+ const before = admin_grant_ids(await listed_account(fixture, victim_id));
387
+ assert.strictEqual(before.length, 1, 'one admin grant');
388
+ await delete_account(fixture, victim_id);
389
+ const during = await listed_account(fixture, victim_id);
390
+ assert.ok(during.account.deleted_at, 'tombstoned');
391
+ assert.deepStrictEqual(admin_grant_ids(during), before, 'the grant is kept, listed');
392
+ await assert_answers_as_anonymous(fixture, victim, victim.create_session_headers(), 'no credential of the deleted account authenticates');
393
+ assert.strictEqual((await login(fixture, victim.account.username, LIFECYCLE_PASSWORD)).status, 401, 'nor can one be minted');
394
+ await undelete_account(fixture, victim_id);
395
+ assert.deepStrictEqual(admin_grant_ids(await listed_account(fixture, victim_id)), before, 'the same grant after the undelete');
396
+ const fresh = await login(fixture, victim.account.username, LIFECYCLE_PASSWORD);
397
+ assert.ok(fresh.cookie, 'the reactivated account logs in');
398
+ assert.strictEqual((await admin_read({ ...anonymous_headers(victim), cookie: fresh.cookie })).status, 200, 'the grant confers again');
399
+ });
400
+ test_if(capabilities.account_lifecycle, 'offers made to an account before its delete stay superseded after the undelete and grant nothing', async () => {
401
+ const fixture = await setup_test();
402
+ const victim = await fixture.create_account({
403
+ username: 'lifecycle_offered',
404
+ password_value: LIFECYCLE_PASSWORD
405
+ });
406
+ const grantor = await fixture.create_account({
407
+ username: 'lifecycle_offerer',
408
+ roles: [ROLE_ADMIN]
409
+ });
410
+ const victim_id = victim.account.id;
411
+ const offer = async (headers, params) => {
412
+ const res = await rpc(fixture, 'role_grant_offer_create', { to_account_id: victim_id, role: ROLE_ADMIN, ...params }, headers);
413
+ if (!res.ok)
414
+ assert.fail(`role_grant_offer_create: ${JSON.stringify(res)}`);
415
+ return res.result.offer.id;
416
+ };
417
+ const by_account = await offer(fixture.create_session_headers(), {});
418
+ const by_actor = await offer(grantor.create_session_headers(), {
419
+ to_actor_id: victim.actor.id
420
+ });
421
+ const inbox = async (headers) => expect_output(await rpc(fixture, 'role_grant_offer_list', {}, headers), RoleGrantOfferListOutput).offers.map((o) => o.id);
422
+ assert.deepStrictEqual((await inbox(victim.create_session_headers())).sort(), [by_account, by_actor].sort(), 'both offers are pending before the delete');
423
+ await delete_account(fixture, victim_id);
424
+ await undelete_account(fixture, victim_id);
425
+ const fresh = await login(fixture, victim.account.username, LIFECYCLE_PASSWORD);
426
+ assert.ok(fresh.cookie, 'the reactivated account logs in');
427
+ const victim_headers = { ...anonymous_headers(victim), cookie: fresh.cookie };
428
+ assert.deepStrictEqual(await inbox(victim_headers), [], 'no offer is pending');
429
+ for (const offer_id of [by_account, by_actor]) {
430
+ const res = await rpc(fixture, 'role_grant_offer_accept', { offer_id }, victim_headers);
431
+ assert.ok(!res.ok, `an accept of a superseded offer is refused: ${JSON.stringify(res)}`);
432
+ assert.strictEqual(res.status, 400);
433
+ assert.strictEqual(res.error?.code, JSONRPC_INVALID_REQUEST);
434
+ assert.strictEqual(error_reason(res), ERROR_ROLE_GRANT_OFFER_TERMINAL);
435
+ }
436
+ assert.deepStrictEqual((await listed_account(fixture, victim_id)).role_grants.filter((g) => g.role === ROLE_ADMIN), [], 'no admin grant was minted');
437
+ const { offers } = expect_output(await rpc(fixture, 'role_grant_offer_history', {}, fixture.create_session_headers()), RoleGrantOfferHistoryOutput);
438
+ const sent = offers.find((o) => o.id === by_account);
439
+ assert.ok(sent?.superseded_at, "the grantor's history lists it superseded");
440
+ assert.strictEqual(sent.accepted_at, null);
441
+ });
442
+ test_if(capabilities.account_lifecycle, "a deleted account's unclaimed invites are void and stay void after the undelete; a claimed one is untouched", async () => {
443
+ const fixture = await setup_test();
444
+ const inviter = await fixture.create_account({
445
+ username: 'lifecycle_inviter',
446
+ roles: [ROLE_ADMIN]
447
+ });
448
+ const invite = async (username) => {
449
+ const res = await rpc(fixture, 'invite_create', { username }, inviter.create_session_headers());
450
+ if (!res.ok)
451
+ assert.fail(`invite_create: ${JSON.stringify(res)}`);
452
+ return res.result.invite.id;
453
+ };
454
+ const open_id = await invite('lifecycle_invitee_open');
455
+ const claimed_id = await invite('lifecycle_invitee_claimed');
456
+ assert.strictEqual((await signup(fixture, 'lifecycle_invitee_claimed')).status, 200, 'the claimed invite admits its signup');
457
+ // what a signup with no invite answers
458
+ const no_invite = await signup(fixture, 'lifecycle_invitee_none');
459
+ assert.strictEqual(no_invite.status, 403, 'signup is invite-gated');
460
+ const invites = async () => expect_output(await rpc(fixture, 'invite_list', {}, fixture.create_session_headers()), InviteListOutput).invites;
461
+ await delete_account(fixture, inviter.account.id);
462
+ assert.deepStrictEqual(await signup(fixture, 'lifecycle_invitee_open'), no_invite, "a signup with the deleted account's unclaimed invite answers as one with none");
463
+ const during = await invites();
464
+ assert.ok(!during.some((i) => i.id === open_id), 'the unclaimed invite is gone');
465
+ assert.ok(during.find((i) => i.id === claimed_id)?.claimed_at, 'the claimed invite is untouched');
466
+ const voided = (await list_audit_events(fixture, { event_type: 'invite_delete' }, rpc_path)).filter((e) => e.metadata?.invite_id === open_id);
467
+ assert.strictEqual(voided.length, 1, 'one invite_delete row for the voided invite');
468
+ await undelete_account(fixture, inviter.account.id);
469
+ assert.ok(!(await invites()).some((i) => i.id === open_id), 'the undelete does not bring the invite back');
470
+ assert.deepStrictEqual(await signup(fixture, 'lifecycle_invitee_open'), no_invite, 'and a signup with it is still refused');
471
+ });
472
+ test('a password change ends every session and API token of the account, and only the new password logs in', async () => {
473
+ const fixture = await setup_test();
474
+ const account = await fixture.create_account({
475
+ username: 'lifecycle_rotated',
476
+ password_value: LIFECYCLE_PASSWORD
477
+ });
478
+ const account_id = account.account.id;
479
+ const sibling = await login(fixture, account.account.username, LIFECYCLE_PASSWORD);
480
+ assert.strictEqual(sibling.status, 200, 'a second session for the account');
481
+ assert.ok(sibling.cookie);
482
+ const sibling_headers = { ...anonymous_headers(account), cookie: sibling.cookie };
483
+ // both sessions and the token authenticate as the account first
484
+ assert.strictEqual(await verified_account_id(fixture, account.create_session_headers()), account_id);
485
+ assert.strictEqual(await verified_account_id(fixture, sibling_headers), account_id);
486
+ assert.strictEqual(await verified_account_id(fixture, account.create_bearer_headers()), account_id);
487
+ // the change goes through the sibling session; the account's first
488
+ // session is the other one
489
+ const change = await fixture.fresh_transport()(password_path, {
490
+ method: 'POST',
491
+ headers: create_test_request_headers({
492
+ 'content-type': 'application/json',
493
+ cookie: sibling.cookie
494
+ }),
495
+ body: JSON.stringify({
496
+ current_password: LIFECYCLE_PASSWORD,
497
+ new_password: LIFECYCLE_PASSWORD_CHANGED
498
+ })
499
+ });
500
+ await change.body?.cancel();
501
+ assert.strictEqual(change.status, 200, 'the password change succeeds');
502
+ await assert_answers_as_anonymous(fixture, account, account.create_session_headers(), 'the session the change was not made on is ended');
503
+ await assert_answers_as_anonymous(fixture, account, sibling_headers, 'the session the change was made on is ended');
504
+ await assert_answers_as_anonymous(fixture, account, account.create_bearer_headers(), 'the account’s API token is ended');
505
+ // scoped to the account: the keeper's session is untouched
506
+ assert.strictEqual(await verified_account_id(fixture, fixture.create_session_headers()), fixture.account.id, 'another account’s session stays live');
507
+ const old_login = await login(fixture, account.account.username, LIFECYCLE_PASSWORD);
508
+ assert.strictEqual(old_login.status, 401, 'the old password no longer logs in');
509
+ const new_login = await login(fixture, account.account.username, LIFECYCLE_PASSWORD_CHANGED);
510
+ assert.strictEqual(new_login.status, 200, 'the new password logs in');
511
+ });
198
512
  });
199
513
  };
@@ -6,7 +6,10 @@ import '../assert_dev_env.js';
6
6
  * - `root` — the per-backend subtree under `os.tmpdir()`. Compose
7
7
  * consumer-specific paths under here.
8
8
  * - `bootstrap_token_path` — `FUZ_BOOTSTRAP_TOKEN_PATH`; harness writes
9
- * the bootstrap token here before spawn.
9
+ * the bootstrap token here before spawn. In a directory of its own
10
+ * (`{root}/bootstrap/`), holding nothing else, so a probe can take the
11
+ * directory's write permission away — what makes a backend's burn of the
12
+ * token fail — without touching the backend's other state.
10
13
  * - `daemon_token_path` — where `init_daemon_token` (Rust) and the TS
11
14
  * server's daemon-token writer land the token (under `{root}/run/`);
12
15
  * `spawn_backend` deletes it before each spawn, so a token a previous run
@@ -1 +1 @@
1
- {"version":3,"file":"build_test_backend_paths.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/build_test_backend_paths.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAyB9B;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,MAAM,KAAG,gBASzD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GAAI,MAAM,MAAM,KAAG,MACtB,CAAC;AAEtC;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,MAAM,MAAM,KAAG,gBACE,CAAC"}
1
+ {"version":3,"file":"build_test_backend_paths.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/build_test_backend_paths.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAyB9B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,MAAM,KAAG,gBASzD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GAAI,MAAM,MAAM,KAAG,MACtB,CAAC;AAEtC;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,MAAM,MAAM,KAAG,gBACE,CAAC"}
@@ -30,7 +30,7 @@ export const build_test_backend_paths = (prefix) => {
30
30
  const root = join(tmpdir(), prefix);
31
31
  return {
32
32
  root,
33
- bootstrap_token_path: join(root, 'bootstrap_token'),
33
+ bootstrap_token_path: join(root, 'bootstrap', 'bootstrap_token'),
34
34
  // `init_daemon_token` (Rust) and the TS server's daemon-token
35
35
  // writer both land the token at `{root}/run/daemon_token`.
36
36
  daemon_token_path: join(root, 'run', 'daemon_token')