@fuzdev/fuz_app 0.181.0 → 0.183.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 (267) hide show
  1. package/README.md +2 -0
  2. package/dist/actions/CLAUDE.md +28 -10
  3. package/dist/actions/action_rpc.d.ts +11 -1
  4. package/dist/actions/action_rpc.d.ts.map +1 -1
  5. package/dist/actions/action_rpc.js +3 -2
  6. package/dist/actions/action_types.d.ts +16 -1
  7. package/dist/actions/action_types.d.ts.map +1 -1
  8. package/dist/actions/action_types.js +1 -1
  9. package/dist/actions/notification_sender.d.ts +83 -0
  10. package/dist/actions/notification_sender.d.ts.map +1 -0
  11. package/dist/actions/notification_sender.js +85 -0
  12. package/dist/actions/perform_action.d.ts +9 -0
  13. package/dist/actions/perform_action.d.ts.map +1 -1
  14. package/dist/actions/perform_action.js +22 -13
  15. package/dist/actions/register_action_ws.d.ts +14 -0
  16. package/dist/actions/register_action_ws.d.ts.map +1 -1
  17. package/dist/actions/register_action_ws.js +3 -2
  18. package/dist/actions/ws_socket_session.d.ts +3 -0
  19. package/dist/actions/ws_socket_session.d.ts.map +1 -1
  20. package/dist/actions/ws_socket_session.js +2 -1
  21. package/dist/auth/CLAUDE.md +113 -70
  22. package/dist/auth/account_actions.d.ts.map +1 -1
  23. package/dist/auth/account_actions.js +13 -3
  24. package/dist/auth/account_queries.d.ts +158 -16
  25. package/dist/auth/account_queries.d.ts.map +1 -1
  26. package/dist/auth/account_queries.js +189 -18
  27. package/dist/auth/account_routes.d.ts +6 -4
  28. package/dist/auth/account_routes.d.ts.map +1 -1
  29. package/dist/auth/account_routes.js +98 -92
  30. package/dist/auth/admin_actions.d.ts.map +1 -1
  31. package/dist/auth/admin_actions.js +93 -45
  32. package/dist/auth/api_token_queries.d.ts +13 -5
  33. package/dist/auth/api_token_queries.d.ts.map +1 -1
  34. package/dist/auth/api_token_queries.js +24 -9
  35. package/dist/auth/audit_emitter.d.ts +75 -84
  36. package/dist/auth/audit_emitter.d.ts.map +1 -1
  37. package/dist/auth/audit_emitter.js +83 -71
  38. package/dist/auth/audit_log_schema.d.ts +10 -5
  39. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  40. package/dist/auth/audit_log_schema.js +22 -6
  41. package/dist/auth/bearer_auth.d.ts.map +1 -1
  42. package/dist/auth/bearer_auth.js +3 -2
  43. package/dist/auth/bootstrap_account.d.ts +31 -13
  44. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  45. package/dist/auth/bootstrap_account.js +34 -15
  46. package/dist/auth/bootstrap_routes.d.ts +1 -1
  47. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  48. package/dist/auth/bootstrap_routes.js +7 -14
  49. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  50. package/dist/auth/daemon_token_middleware.js +12 -1
  51. package/dist/auth/deps.d.ts +18 -5
  52. package/dist/auth/deps.d.ts.map +1 -1
  53. package/dist/auth/deps.js +3 -2
  54. package/dist/auth/request_context.d.ts +73 -73
  55. package/dist/auth/request_context.d.ts.map +1 -1
  56. package/dist/auth/request_context.js +78 -96
  57. package/dist/auth/resolved_auth.d.ts +16 -11
  58. package/dist/auth/resolved_auth.d.ts.map +1 -1
  59. package/dist/auth/resolved_auth.js +6 -6
  60. package/dist/auth/role_grant_offer_action_specs.d.ts +1 -1
  61. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  62. package/dist/auth/role_grant_offer_action_specs.js +2 -1
  63. package/dist/auth/role_grant_offer_actions.d.ts +32 -12
  64. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  65. package/dist/auth/role_grant_offer_actions.js +91 -116
  66. package/dist/auth/role_grant_offer_notifications.d.ts +87 -38
  67. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
  68. package/dist/auth/role_grant_offer_notifications.js +75 -22
  69. package/dist/auth/role_grant_offer_queries.d.ts +155 -18
  70. package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
  71. package/dist/auth/role_grant_offer_queries.js +262 -73
  72. package/dist/auth/role_grant_offer_schema.js +1 -1
  73. package/dist/auth/role_grant_queries.d.ts +43 -52
  74. package/dist/auth/role_grant_queries.d.ts.map +1 -1
  75. package/dist/auth/role_grant_queries.js +50 -74
  76. package/dist/auth/role_grant_sql.d.ts +21 -0
  77. package/dist/auth/role_grant_sql.d.ts.map +1 -1
  78. package/dist/auth/role_grant_sql.js +21 -0
  79. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  80. package/dist/auth/self_service_role_actions.js +17 -21
  81. package/dist/auth/session_queries.d.ts +40 -16
  82. package/dist/auth/session_queries.d.ts.map +1 -1
  83. package/dist/auth/session_queries.js +68 -29
  84. package/dist/auth/signup_routes.d.ts.map +1 -1
  85. package/dist/auth/signup_routes.js +90 -38
  86. package/dist/auth/standard_rpc_actions.d.ts +6 -19
  87. package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
  88. package/dist/auth/standard_rpc_actions.js +5 -6
  89. package/dist/auth/token_scope.d.ts +1 -1
  90. package/dist/auth/token_scope.js +1 -1
  91. package/dist/db/sql_columns.d.ts +1 -1
  92. package/dist/db/sql_columns.js +1 -1
  93. package/dist/http/CLAUDE.md +22 -16
  94. package/dist/http/auth_shape.d.ts +1 -1
  95. package/dist/http/db_routes.d.ts +7 -22
  96. package/dist/http/db_routes.d.ts.map +1 -1
  97. package/dist/http/db_routes.js +72 -72
  98. package/dist/http/error_schemas.d.ts +9 -21
  99. package/dist/http/error_schemas.d.ts.map +1 -1
  100. package/dist/http/error_schemas.js +14 -24
  101. package/dist/http/pending_effects.d.ts +42 -4
  102. package/dist/http/pending_effects.d.ts.map +1 -1
  103. package/dist/http/pending_effects.js +34 -4
  104. package/dist/http/route_spec.d.ts +2 -2
  105. package/dist/server/app_backend.d.ts.map +1 -1
  106. package/dist/server/app_backend.js +3 -1
  107. package/dist/server/app_server.d.ts +69 -18
  108. package/dist/server/app_server.d.ts.map +1 -1
  109. package/dist/server/app_server.js +74 -10
  110. package/dist/server/serve_fact_route.d.ts +3 -3
  111. package/dist/server/serve_fact_route.js +12 -12
  112. package/dist/testing/CLAUDE.md +259 -790
  113. package/dist/testing/adversarial_404.d.ts +6 -1
  114. package/dist/testing/adversarial_404.d.ts.map +1 -1
  115. package/dist/testing/adversarial_404.js +38 -17
  116. package/dist/testing/app_server.d.ts +20 -140
  117. package/dist/testing/app_server.d.ts.map +1 -1
  118. package/dist/testing/app_server.js +48 -125
  119. package/dist/testing/audit_drift_guard.d.ts +11 -6
  120. package/dist/testing/audit_drift_guard.d.ts.map +1 -1
  121. package/dist/testing/audit_drift_guard.js +15 -8
  122. package/dist/testing/auth_apps.js +1 -1
  123. package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
  124. package/dist/testing/cross_backend/account_lifecycle.js +43 -0
  125. package/dist/testing/cross_backend/audit_cross_helpers.d.ts +12 -9
  126. package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -1
  127. package/dist/testing/cross_backend/audit_cross_helpers.js +13 -14
  128. package/dist/testing/cross_backend/capabilities.d.ts +9 -6
  129. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  130. package/dist/testing/cross_backend/capabilities.js +11 -7
  131. package/dist/testing/cross_backend/capability_mounts.d.ts +103 -0
  132. package/dist/testing/cross_backend/capability_mounts.d.ts.map +1 -0
  133. package/dist/testing/cross_backend/capability_mounts.js +423 -0
  134. package/dist/testing/cross_backend/cell_moderate.js +2 -2
  135. package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
  136. package/dist/testing/cross_backend/cell_relations.js +12 -11
  137. package/dist/testing/cross_backend/conformance_principal.d.ts +54 -0
  138. package/dist/testing/cross_backend/conformance_principal.d.ts.map +1 -0
  139. package/dist/testing/cross_backend/conformance_principal.js +283 -0
  140. package/dist/testing/cross_backend/conformance_table.d.ts +2 -50
  141. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  142. package/dist/testing/cross_backend/conformance_table.js +2 -270
  143. package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
  144. package/dist/testing/cross_backend/credential_deadline.js +2 -0
  145. package/dist/testing/cross_backend/credential_wire.d.ts +1 -1
  146. package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -1
  147. package/dist/testing/cross_backend/db_state_diff.d.ts +72 -0
  148. package/dist/testing/cross_backend/db_state_diff.d.ts.map +1 -0
  149. package/dist/testing/cross_backend/db_state_diff.js +444 -0
  150. package/dist/testing/cross_backend/declared_skips.d.ts +68 -0
  151. package/dist/testing/cross_backend/declared_skips.d.ts.map +1 -0
  152. package/dist/testing/cross_backend/declared_skips.js +132 -0
  153. package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -26
  154. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  155. package/dist/testing/cross_backend/default_spine_surface.js +2 -6
  156. package/dist/testing/cross_backend/differential.d.ts +11 -2
  157. package/dist/testing/cross_backend/differential.d.ts.map +1 -1
  158. package/dist/testing/cross_backend/differential.js +35 -11
  159. package/dist/testing/cross_backend/differential_normalize.d.ts +12 -0
  160. package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
  161. package/dist/testing/cross_backend/differential_normalize.js +16 -0
  162. package/dist/testing/cross_backend/full_spine_mount.d.ts +3 -10
  163. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  164. package/dist/testing/cross_backend/full_spine_mount.js +4 -4
  165. package/dist/testing/cross_backend/in_process_setup.d.ts +22 -12
  166. package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
  167. package/dist/testing/cross_backend/in_process_setup.js +151 -134
  168. package/dist/testing/cross_backend/login_security.d.ts +12 -0
  169. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  170. package/dist/testing/cross_backend/login_security.js +21 -4
  171. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +0 -2
  172. package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -1
  173. package/dist/testing/cross_backend/request_target_conformance_wire.js +3 -1
  174. package/dist/testing/cross_backend/revocation_drivers.d.ts +18 -5
  175. package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
  176. package/dist/testing/cross_backend/revocation_drivers.js +18 -10
  177. package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts +1 -1
  178. package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts.map +1 -1
  179. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
  180. package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +33 -1
  181. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +5 -4
  182. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  183. package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +183 -30
  184. package/dist/testing/cross_backend/role_grant_participation.js +4 -4
  185. package/dist/testing/cross_backend/rpc_adversarial.js +1 -1
  186. package/dist/testing/cross_backend/session_cap.d.ts +2 -2
  187. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  188. package/dist/testing/cross_backend/session_cap.js +48 -16
  189. package/dist/testing/cross_backend/setup.d.ts +31 -1
  190. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  191. package/dist/testing/cross_backend/setup.js +32 -1
  192. package/dist/testing/cross_backend/spine_suites.d.ts +123 -12
  193. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  194. package/dist/testing/cross_backend/spine_suites.js +454 -57
  195. package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
  196. package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
  197. package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
  198. package/dist/testing/cross_backend/sse_round_trip.d.ts +9 -1
  199. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  200. package/dist/testing/cross_backend/sse_round_trip.js +123 -27
  201. package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
  202. package/dist/testing/cross_backend/testing_backdoor.js +4 -2
  203. package/dist/testing/cross_backend/testing_reset_actions.d.ts +59 -27
  204. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  205. package/dist/testing/cross_backend/testing_reset_actions.js +66 -42
  206. package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
  207. package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
  208. package/dist/testing/cross_backend/transport_composition.js +7 -3
  209. package/dist/testing/cross_backend/ws_round_trip.d.ts +5 -0
  210. package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
  211. package/dist/testing/cross_backend/ws_round_trip.js +54 -8
  212. package/dist/testing/data_exposure.d.ts.map +1 -1
  213. package/dist/testing/data_exposure.js +3 -0
  214. package/dist/testing/db.d.ts +0 -32
  215. package/dist/testing/db.d.ts.map +1 -1
  216. package/dist/testing/db.js +0 -86
  217. package/dist/testing/db_entities.d.ts +14 -0
  218. package/dist/testing/db_entities.d.ts.map +1 -1
  219. package/dist/testing/db_entities.js +17 -0
  220. package/dist/testing/db_invariant_queries.d.ts +259 -0
  221. package/dist/testing/db_invariant_queries.d.ts.map +1 -0
  222. package/dist/testing/db_invariant_queries.js +400 -0
  223. package/dist/testing/db_invariants.d.ts +106 -0
  224. package/dist/testing/db_invariants.d.ts.map +1 -0
  225. package/dist/testing/db_invariants.gen.sql.d.ts +11 -0
  226. package/dist/testing/db_invariants.gen.sql.d.ts.map +1 -0
  227. package/dist/testing/db_invariants.gen.sql.js +13 -0
  228. package/dist/testing/db_invariants.js +141 -0
  229. package/dist/testing/db_invariants.sql +152 -0
  230. package/dist/testing/describe_db.d.ts +36 -0
  231. package/dist/testing/describe_db.d.ts.map +1 -0
  232. package/dist/testing/describe_db.js +71 -0
  233. package/dist/testing/integration.d.ts +6 -9
  234. package/dist/testing/integration.d.ts.map +1 -1
  235. package/dist/testing/integration.js +9 -13
  236. package/dist/testing/integration_helpers.d.ts +1 -1
  237. package/dist/testing/integration_helpers.d.ts.map +1 -1
  238. package/dist/testing/middleware.d.ts +1 -1
  239. package/dist/testing/middleware.js +5 -5
  240. package/dist/testing/rate_limiting.d.ts +1 -1
  241. package/dist/testing/rate_limiting.d.ts.map +1 -1
  242. package/dist/testing/rate_limiting.js +3 -2
  243. package/dist/testing/resolved_auth.d.ts +3 -1
  244. package/dist/testing/resolved_auth.d.ts.map +1 -1
  245. package/dist/testing/resolved_auth.js +4 -4
  246. package/dist/testing/role_grant_helpers.d.ts +1 -1
  247. package/dist/testing/role_grant_helpers.d.ts.map +1 -1
  248. package/dist/testing/round_trip.d.ts.map +1 -1
  249. package/dist/testing/round_trip.js +3 -0
  250. package/dist/testing/rpc_attack_surface.d.ts +8 -6
  251. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  252. package/dist/testing/rpc_attack_surface.js +69 -6
  253. package/dist/testing/rpc_round_trip.d.ts +1 -1
  254. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  255. package/dist/testing/rpc_round_trip.js +3 -0
  256. package/dist/testing/sse_round_trip.d.ts +1 -1
  257. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  258. package/dist/testing/sse_round_trip.js +13 -4
  259. package/dist/testing/stubs.d.ts +4 -2
  260. package/dist/testing/stubs.d.ts.map +1 -1
  261. package/dist/testing/stubs.js +15 -7
  262. package/dist/testing/test_app.d.ts +166 -0
  263. package/dist/testing/test_app.d.ts.map +1 -0
  264. package/dist/testing/test_app.js +124 -0
  265. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  266. package/dist/testing/ws_round_trip.js +8 -4
  267. package/package.json +1 -1
@@ -15,12 +15,13 @@
15
15
  * schema declared `acting?: ActingActor` (reference equality with the
16
16
  * canonical `ActingActor` schema) or the auth requires role_grants
17
17
  * (`role` / `keeper`), `apply_authorization_phase` resolves the actor
18
- * against the resolved account id plus the validated `acting` value via
18
+ * against the resolved account plus the validated `acting` value via
19
19
  * `resolve_acting_actor`, builds the `{account, actor, role_grants}`
20
20
  * context via `build_request_context`, and sets it on
21
21
  * `REQUEST_CONTEXT_KEY` before auth guards fire. Authenticated routes
22
- * that don't need an actor still get an account-only context via
23
- * `build_account_context` so handler signatures stay uniform.
22
+ * that don't need an actor still get an account-only context, so handler
23
+ * signatures stay uniform. The account is the row the credential leg
24
+ * read (`ResolvedAuth.account`) — the phase does not read it again.
24
25
  *
25
26
  * Account-grain operations (logout, password_change, account_verify,
26
27
  * etc.) declare neither `acting` nor role_grant-requiring auth, so no actor
@@ -29,9 +30,9 @@
29
30
  * which is what makes multi-actor logout work without first picking a
30
31
  * persona.
31
32
  *
32
- * `build_request_context` loads `account → actor → role_grants` and verifies
33
- * the `actor.account_id === account.id` binding. `refresh_role_grants`
34
- * reloads role_grants on an existing context.
33
+ * `build_request_context` loads the acting actor's role_grants onto the
34
+ * account and the actor `resolve_acting_actor` read off that account.
35
+ * `refresh_role_grants` reloads role_grants on an existing context.
35
36
  *
36
37
  * @module
37
38
  */
@@ -42,7 +43,7 @@ import type { QueryDeps } from '../db/query_deps.js';
42
43
  import { type ResolvedAuth } from './resolved_auth.js';
43
44
  import type { RouteSpec } from '../http/route_spec.js';
44
45
  import { type RouteAuth } from '../http/auth_shape.js';
45
- import { ERROR_ACTOR_REQUIRED, ERROR_ACTOR_NOT_ON_ACCOUNT, ERROR_NO_ACTORS_ON_ACCOUNT, ERROR_ACCOUNT_VANISHED } from '../http/error_schemas.js';
46
+ import { ERROR_AUTHENTICATION_REQUIRED, ERROR_ACTOR_REQUIRED, ERROR_ACTOR_NOT_ON_ACCOUNT, ERROR_NO_ACTORS_ON_ACCOUNT } from '../http/error_schemas.js';
46
47
  /**
47
48
  * The resolved identity context for an authenticated request.
48
49
  *
@@ -54,8 +55,9 @@ import { ERROR_ACTOR_REQUIRED, ERROR_ACTOR_NOT_ON_ACCOUNT, ERROR_NO_ACTORS_ON_AC
54
55
  * `actor: null` as "no role_grants" so callers don't have to narrow.
55
56
  *
56
57
  * Multi-actor invariant: when populated, `actor.account_id === account.id`.
57
- * `build_request_context` enforces this; the dispatcher's authorization
58
- * phase rejects with `actor_not_on_account` before reaching the handler.
58
+ * `resolve_acting_actor` picks the actor from the account's own active
59
+ * actors, and the dispatcher's authorization phase rejects with
60
+ * `actor_not_on_account` before reaching the handler.
59
61
  */
60
62
  export interface RequestContext {
61
63
  account: Account;
@@ -164,15 +166,18 @@ export declare const has_scoped_role: (ctx: RequestContext | null, role: string,
164
166
  */
165
167
  export declare const has_any_scoped_role: (ctx: RequestContext | null, roles: ReadonlyArray<string>, scope_id: string | null, now?: Date) => boolean;
166
168
  /**
167
- * Result of `resolve_acting_actor` — either an actor id or a structured
168
- * error the caller maps to an HTTP response.
169
+ * Result of `resolve_acting_actor` — either the actor, as read, or a
170
+ * structured error the caller maps to an HTTP response.
169
171
  */
170
172
  export type ResolveActingActorResult = {
171
173
  ok: true;
172
- actor_id: string;
174
+ actor: Actor;
173
175
  } | {
174
176
  ok: false;
175
177
  reason: 'no_actors';
178
+ } | {
179
+ ok: false;
180
+ reason: 'account_removed';
176
181
  } | {
177
182
  ok: false;
178
183
  reason: 'actor_required';
@@ -192,9 +197,10 @@ export type ResolveActingActorResult = {
192
197
  * (from the request payload). Applies the uniform resolution rules:
193
198
  *
194
199
  * - `acting_actor_id` omitted + 1 actor → use it.
195
- * - `acting_actor_id` omitted + 0 actors → `no_actors` (defensive —
200
+ * - 0 actors → `no_actors` when the account is still live (defensive —
196
201
  * signup / bootstrap always create an actor in the same tx, so this
197
- * is a server error).
202
+ * is a server error), `account_removed` when it is tombstoned or gone:
203
+ * removed since its credential was read, its actors with it.
198
204
  * - `acting_actor_id` omitted + multiple actors → `actor_required` with
199
205
  * the available list so the client can prompt; never pick silently.
200
206
  * - `acting_actor_id` present + matches an actor on the account → use it.
@@ -202,6 +208,10 @@ export type ResolveActingActorResult = {
202
208
  * The available list is intentionally not echoed in this branch (treat
203
209
  * as opaque rejection).
204
210
  *
211
+ * The actor comes back as the row the account's actor list read, so the
212
+ * caller builds on it without reading it again — one read, as on the Rust
213
+ * spine, which leaves no window for the actor to vanish between two.
214
+ *
205
215
  * `acting_actor_id` is compared lowercased, the form actor ids are stored and
206
216
  * read back in, so a caller passing an id that skipped the `Uuid` schema
207
217
  * still matches its actor whatever its case.
@@ -284,10 +294,10 @@ export declare const create_request_context_middleware: (deps: QueryDeps, option
284
294
  */
285
295
  export declare const token_scope_surface_denial: (c: Context, capability: string) => Response | null;
286
296
  /**
287
- * The account id a public route — one that answers anonymous callers and reads
288
- * the credential (`reads_credential`) — may act on: `null` for the anonymous
289
- * caller **and for a scope-narrowed API token**. Rule 3 in its
290
- * anonymous-admitting disposition — the downgrade the Rust
297
+ * The account a public route — one that answers anonymous callers and reads
298
+ * the credential (`reads_credential`) — may act on, as the credential leg read
299
+ * it: `null` for the anonymous caller **and for a scope-narrowed API token**.
300
+ * Rule 3 in its anonymous-admitting disposition — the downgrade the Rust
291
301
  * `AuthGate::public_request_context` applies.
292
302
  *
293
303
  * A narrowed token reaches no non-RPC surface that reads account data
@@ -303,11 +313,11 @@ export declare const token_scope_surface_denial: (c: Context, capability: string
303
313
  * the scope, so it reads the full credential.
304
314
  *
305
315
  * @param route - the handler's `RouteContext`, or anything carrying its `credential`
306
- * @returns the account id, or `null` for an anonymous caller or a narrowed token
316
+ * @returns the account the credential resolved, or `null` for an anonymous caller or a narrowed token
307
317
  */
308
- export declare const get_public_account_id: (route: {
318
+ export declare const get_public_account: (route: {
309
319
  readonly credential: ResolvedAuth | null;
310
- }) => string | null;
320
+ }) => Account | null;
311
321
  /**
312
322
  * Create middleware refusing a route to a credential whose scope does not admit
313
323
  * `capability`.
@@ -399,44 +409,26 @@ export declare const require_credential_types: (credential_types: ReadonlyArray<
399
409
  */
400
410
  export declare const refresh_role_grants: (ctx: RequestContext, deps: QueryDeps) => Promise<RequestContext>;
401
411
  /**
402
- * Build a full `RequestContext` from an account id and an explicit
403
- * actor id (already resolved via `resolve_acting_actor`).
412
+ * Build an actor-bound `RequestContext` from the account the credential
413
+ * resolved and the actor `resolve_acting_actor` read off it, loading the
414
+ * actor's active role_grants.
404
415
  *
405
- * Loads `account` + the named `actor` + the actor's active role_grants.
406
- * Verifies the `actor.account_id === account.id` binding so downstream
407
- * handlers can trust `ctx.actor.account_id === ctx.account.id`. Returns
408
- * `null` when the account is missing, the actor is missing, or the
409
- * actor doesn't belong to the supplied account.
416
+ * Reads only the grants: the account is the credential leg's row
417
+ * (`ResolvedAuth.account`) and the actor the account's own actor list read,
418
+ * so neither is read twice in a request and there is no torn read between
419
+ * the reads — a delete landing after them is the handler's to meet, as on
420
+ * the Rust spine.
410
421
  *
411
- * Called by the route-spec / RPC dispatcher's authorization phase for
412
- * routes that need an acting actor; account-grain routes use
413
- * `build_account_context` instead.
422
+ * Called by the dispatcher's authorization phase for routes that need an
423
+ * acting actor; account-grain routes get `{account, actor: null,
424
+ * role_grants: []}` with no read at all.
414
425
  *
415
426
  * @param deps - query dependencies
416
- * @param account_id - the account to build context for
417
- * @param actor_id - the actor this request acts as
418
- * @returns a request context, or `null` if account/actor not found or mismatched
427
+ * @param account - the account the credential resolved
428
+ * @param actor - the acting actor, one of `account`'s active actors
429
+ * @returns the actor-bound request context
419
430
  */
420
- export declare const build_request_context: (deps: QueryDeps, account_id: string, actor_id: string) => Promise<RequestActorContext | null>;
421
- /**
422
- * Build an account-only `RequestContext` (no actor, no role_grants) from
423
- * an account id.
424
- *
425
- * Used by the dispatcher's authorization phase for authenticated routes
426
- * that don't need an acting actor — account-grain operations (logout,
427
- * password change, account self-service). Lets handlers read
428
- * `auth.account.id` / `auth.account.username` uniformly with role_grant-bound
429
- * routes; the cost is one extra `query_account_by_id` per request.
430
- *
431
- * Returns `null` when the account row is missing (e.g. deleted between
432
- * the auth middleware's session lookup and the dispatcher) — caller
433
- * surfaces that as a 500 since it represents a torn read.
434
- *
435
- * @param deps - query dependencies
436
- * @param account_id - the account to build context for
437
- * @returns an account-only request context, or `null` if the account is missing
438
- */
439
- export declare const build_account_context: (deps: QueryDeps, account_id: string) => Promise<RequestContext | null>;
431
+ export declare const build_request_context: (deps: QueryDeps, account: Account, actor: Actor) => Promise<RequestActorContext>;
440
432
  /**
441
433
  * Resolution-failure shape returned by `apply_authorization_phase`. Each
442
434
  * transport binds this to the appropriate wire shape — REST emits the body
@@ -457,9 +449,9 @@ export type AuthorizationFailureBody = {
457
449
  } | {
458
450
  error: typeof ERROR_ACTOR_NOT_ON_ACCOUNT;
459
451
  } | {
460
- error: typeof ERROR_NO_ACTORS_ON_ACCOUNT;
452
+ error: typeof ERROR_AUTHENTICATION_REQUIRED;
461
453
  } | {
462
- error: typeof ERROR_ACCOUNT_VANISHED;
454
+ error: typeof ERROR_NO_ACTORS_ON_ACCOUNT;
463
455
  };
464
456
  /**
465
457
  * Result of the authorization phase. Pure data — the auth domain stops
@@ -472,18 +464,19 @@ export type AuthorizationFailureBody = {
472
464
  * access on an `'optional'` axis. Public and unauthenticated collapse
473
465
  * to the same null `request_context`; every transport already treated
474
466
  * them identically.
475
- * - **`{ok: false, status, body}`** — 400/500 failure. `status` is
476
- * narrowed to the two values the auth phase emits, so Hono's `c.json`
477
- * status overload accepts the literals directly. The 500 reasons stay
478
- * distinct in `body`: `no_actors_on_account` (signup invariant
479
- * violation); `account_vanished` (torn read after resolve).
467
+ * - **`{ok: false, status, body}`** — 400/401/500 failure. `status` is
468
+ * narrowed to the values the auth phase emits, so Hono's `c.json` status
469
+ * overload accepts the literals directly. The 401 is the dead credential's
470
+ * `authentication_required`: the account was removed since the credential
471
+ * leg read it. The one 500 is `no_actors_on_account`: a live account listed
472
+ * no active actor.
480
473
  */
481
474
  export type AuthorizationResult = {
482
475
  ok: true;
483
476
  request_context: RequestContext | null;
484
477
  } | {
485
478
  ok: false;
486
- status: 400 | 500;
479
+ status: 400 | 401 | 500;
487
480
  body: AuthorizationFailureBody;
488
481
  };
489
482
  /**
@@ -494,33 +487,39 @@ export type AuthorizationResult = {
494
487
  * input validation 400.
495
488
  *
496
489
  * Pure data — the function does not touch a Hono context. Each transport
497
- * passes `account_id` (extracted from its own credential surface) and
490
+ * passes the account its credential resolved (`ResolvedAuth.account`) and
498
491
  * binds the returned `AuthorizationResult` to its wire shape. The REST
499
492
  * pipeline additionally writes `REQUEST_CONTEXT_KEY` on `c` for downstream
500
493
  * `require_role` / `require_credential_types` middleware that still reads
501
494
  * the resolved context off the Hono context.
502
495
  *
496
+ * The account is never read here: the context is built on the credential
497
+ * leg's row, so a request reads its account once, as on the Rust spine,
498
+ * whose `apply_authorization_phase` takes the resolved account the same way.
499
+ *
503
500
  * Branching by `auth.account` × `auth.actor`:
504
501
  *
505
502
  * - Both `'none'` → `{ok: true, request_context: null}`. Public actions
506
503
  * never see a `RequestContext`.
507
- * - `account_id == null` on any non-public route → same null
504
+ * - `account == null` on any non-public route → same null
508
505
  * `request_context`. The `'required'` callers were already rejected at
509
506
  * the pre-authorization gate in the dispatcher; only genuine anonymous
510
507
  * access on an `'optional'` axis lands here.
511
- * - `actor === 'none'` → builds account-only context via
512
- * `build_account_context`. Null lookup → `account_vanished` 500 failure.
508
+ * - `actor === 'none'` → an account-only context, `{account, actor: null,
509
+ * role_grants: []}`.
513
510
  * - `actor === 'required'` → resolves the actor from `acting_value` (or
514
- * single-actor account); failures map to 400 / 500.
511
+ * single-actor account); failures map to 400 / 401 / 500.
515
512
  * - `actor === 'optional'` → same as `'required'` except multi-actor
516
513
  * accounts without an `acting` value fall back to account-only context
517
514
  * (no `actor_required` 400). Bad `acting` ids still 400.
518
515
  *
519
- * 500 branches stay distinct: `ERROR_NO_ACTORS_ON_ACCOUNT` (signup
520
- * invariant violation), `ERROR_ACCOUNT_VANISHED` (torn read after
521
- * resolve).
516
+ * An account removed since the credential leg read it takes its actors with
517
+ * it: an actor-grain route then finds none, and answers the dead credential's
518
+ * 401 `ERROR_AUTHENTICATION_REQUIRED`, as a request that arrived after the
519
+ * removal does. The one 500 is `ERROR_NO_ACTORS_ON_ACCOUNT`: a live account
520
+ * with no active actor, a signup invariant violation.
522
521
  */
523
- export declare const apply_authorization_phase: (deps: QueryDeps, account_id: string | null, auth: RouteAuth, acting_value: string | undefined) => Promise<AuthorizationResult>;
522
+ export declare const apply_authorization_phase: (deps: QueryDeps, account: Account | null, auth: RouteAuth, acting_value: string | undefined) => Promise<AuthorizationResult>;
524
523
  /**
525
524
  * Run the authorization phase on a Hono request: resolve the acting actor from
526
525
  * `acting` against the authenticated account, and set the resulting
@@ -543,8 +542,9 @@ export declare const apply_authorization_phase: (deps: QueryDeps, account_id: st
543
542
  * @param deps - query deps for actor resolution
544
543
  * @param auth - the route's auth shape
545
544
  * @param acting - the `acting` selector, already through `parse_acting`; `undefined` when absent
546
- * @returns the refusal to answer (`400` actor selection, `500` a vanished
547
- * account), or nothing when the request may proceed
545
+ * @returns the refusal to answer (`400` actor selection, `401` an account
546
+ * removed since its credential was read, `500` a live account with no active
547
+ * actor), or nothing when the request may proceed
548
548
  */
549
549
  export declare const run_authorization_phase: (c: Context, deps: QueryDeps, auth: RouteAuth, acting: string | undefined) => Promise<Response | void>;
550
550
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"request_context.d.ts","sourceRoot":"","sources":["../../src/lib/auth/request_context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,SAAS,EACd,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AASrD,OAAO,EAA0C,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAM/F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElG,OAAO,EAIN,oBAAoB,EACp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