@fuzdev/fuz_app 0.168.1 → 0.170.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 (239) hide show
  1. package/dist/actions/CLAUDE.md +17 -19
  2. package/dist/actions/action_codegen.d.ts +32 -23
  3. package/dist/actions/action_codegen.d.ts.map +1 -1
  4. package/dist/actions/action_codegen.js +101 -80
  5. package/dist/actions/action_event.d.ts +0 -8
  6. package/dist/actions/action_event.d.ts.map +1 -1
  7. package/dist/actions/action_event.js +7 -6
  8. package/dist/actions/action_event_data.d.ts +18 -18
  9. package/dist/actions/action_rpc.d.ts +1 -1
  10. package/dist/actions/action_rpc.js +1 -1
  11. package/dist/actions/action_spec.d.ts +8 -10
  12. package/dist/actions/action_spec.d.ts.map +1 -1
  13. package/dist/actions/action_spec.js +1 -1
  14. package/dist/actions/action_types.d.ts +4 -4
  15. package/dist/actions/action_types.d.ts.map +1 -1
  16. package/dist/actions/action_types.js +2 -2
  17. package/dist/actions/broadcast_api.d.ts +2 -2
  18. package/dist/actions/broadcast_api.js +4 -4
  19. package/dist/actions/compile_action_registry.d.ts +6 -7
  20. package/dist/actions/compile_action_registry.d.ts.map +1 -1
  21. package/dist/actions/compile_action_registry.js +8 -9
  22. package/dist/actions/perform_action.d.ts +6 -6
  23. package/dist/actions/perform_action.d.ts.map +1 -1
  24. package/dist/actions/perform_action.js +11 -10
  25. package/dist/actions/socket.svelte.d.ts +1 -1
  26. package/dist/actions/socket.svelte.js +2 -2
  27. package/dist/auth/CLAUDE.md +11 -11
  28. package/dist/auth/account_action_specs.d.ts +11 -11
  29. package/dist/auth/account_action_specs.js +1 -1
  30. package/dist/auth/account_route_schema.d.ts +18 -18
  31. package/dist/auth/account_route_schema.js +1 -1
  32. package/dist/auth/account_routes.js +1 -1
  33. package/dist/auth/account_schema.d.ts +38 -40
  34. package/dist/auth/account_schema.d.ts.map +1 -1
  35. package/dist/auth/account_schema.js +7 -8
  36. package/dist/auth/actor_lookup_action_specs.d.ts +7 -7
  37. package/dist/auth/actor_lookup_action_specs.js +1 -1
  38. package/dist/auth/actor_search_action_specs.d.ts +6 -6
  39. package/dist/auth/actor_search_action_specs.js +1 -1
  40. package/dist/auth/admin_action_specs.d.ts +166 -166
  41. package/dist/auth/admin_action_specs.js +1 -1
  42. package/dist/auth/app_settings_schema.d.ts +3 -3
  43. package/dist/auth/app_settings_schema.d.ts.map +1 -1
  44. package/dist/auth/app_settings_schema.js +1 -1
  45. package/dist/auth/audit_emitter.d.ts +6 -7
  46. package/dist/auth/audit_emitter.d.ts.map +1 -1
  47. package/dist/auth/audit_emitter.js +11 -22
  48. package/dist/auth/audit_log_ddl.d.ts +1 -1
  49. package/dist/auth/audit_log_ddl.js +1 -1
  50. package/dist/auth/audit_log_queries.d.ts +0 -13
  51. package/dist/auth/audit_log_queries.d.ts.map +1 -1
  52. package/dist/auth/audit_log_queries.js +3 -3
  53. package/dist/auth/audit_log_route_schema.d.ts +1 -1
  54. package/dist/auth/audit_log_route_schema.js +1 -1
  55. package/dist/auth/audit_log_schema.d.ts +69 -70
  56. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  57. package/dist/auth/audit_log_schema.js +2 -2
  58. package/dist/auth/auth_ddl.d.ts +1 -1
  59. package/dist/auth/auth_ddl.js +1 -1
  60. package/dist/auth/bootstrap_route_schema.d.ts +4 -4
  61. package/dist/auth/bootstrap_route_schema.js +1 -1
  62. package/dist/auth/cell_action_specs.d.ts +466 -466
  63. package/dist/auth/cell_action_specs.js +1 -1
  64. package/dist/auth/cell_actions.d.ts +2 -2
  65. package/dist/auth/cell_actions.js +5 -5
  66. package/dist/auth/cell_audit_action_specs.d.ts +14 -14
  67. package/dist/auth/cell_audit_action_specs.js +1 -1
  68. package/dist/auth/cell_audit_metadata.d.ts +8 -8
  69. package/dist/auth/cell_audit_metadata.js +1 -1
  70. package/dist/auth/cell_field_action_specs.d.ts +55 -55
  71. package/dist/auth/cell_field_action_specs.js +1 -1
  72. package/dist/auth/cell_field_audit_metadata.d.ts +4 -4
  73. package/dist/auth/cell_field_audit_metadata.js +1 -1
  74. package/dist/auth/cell_grant_action_specs.d.ts +61 -61
  75. package/dist/auth/cell_grant_action_specs.js +1 -1
  76. package/dist/auth/cell_grant_audit_metadata.d.ts +10 -10
  77. package/dist/auth/cell_grant_audit_metadata.js +1 -1
  78. package/dist/auth/cell_item_action_specs.d.ts +76 -76
  79. package/dist/auth/cell_item_action_specs.js +1 -1
  80. package/dist/auth/cell_item_audit_metadata.d.ts +5 -5
  81. package/dist/auth/cell_item_audit_metadata.js +1 -1
  82. package/dist/auth/invite_schema.d.ts +11 -11
  83. package/dist/auth/invite_schema.d.ts.map +1 -1
  84. package/dist/auth/invite_schema.js +1 -1
  85. package/dist/auth/name_schema.js +1 -1
  86. package/dist/auth/password.js +1 -1
  87. package/dist/auth/request_context.js +2 -2
  88. package/dist/auth/role_grant_offer_action_specs.d.ts +182 -182
  89. package/dist/auth/role_grant_offer_action_specs.js +1 -1
  90. package/dist/auth/role_grant_offer_ddl.d.ts +1 -1
  91. package/dist/auth/role_grant_offer_ddl.js +1 -1
  92. package/dist/auth/role_grant_offer_notifications.d.ts +107 -107
  93. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
  94. package/dist/auth/role_grant_offer_notifications.js +3 -4
  95. package/dist/auth/role_grant_offer_schema.d.ts +9 -9
  96. package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
  97. package/dist/auth/role_grant_offer_schema.js +1 -1
  98. package/dist/auth/self_service_role_action_specs.d.ts +2 -2
  99. package/dist/auth/self_service_role_action_specs.js +1 -1
  100. package/dist/auth/self_service_role_actions.d.ts +1 -1
  101. package/dist/auth/self_service_role_actions.js +1 -1
  102. package/dist/auth/signup_route_schema.d.ts +2 -2
  103. package/dist/auth/signup_route_schema.js +1 -1
  104. package/dist/auth/token_scope.d.ts +8 -8
  105. package/dist/db/file_fact_url.d.ts +1 -1
  106. package/dist/env/env_schemas.d.ts +1 -2
  107. package/dist/env/env_schemas.d.ts.map +1 -1
  108. package/dist/env/env_schemas.js +3 -4
  109. package/dist/http/CLAUDE.md +30 -32
  110. package/dist/http/auth_shape.d.ts +17 -52
  111. package/dist/http/auth_shape.d.ts.map +1 -1
  112. package/dist/http/auth_shape.js +19 -61
  113. package/dist/http/db_routes.d.ts +1 -1
  114. package/dist/http/db_routes.d.ts.map +1 -1
  115. package/dist/http/db_routes.js +1 -1
  116. package/dist/http/error_schemas.d.ts +36 -36
  117. package/dist/http/jsonrpc.d.ts +11 -11
  118. package/dist/http/jsonrpc_helpers.js +1 -1
  119. package/dist/http/route_error_check.d.ts +2 -2
  120. package/dist/http/route_error_check.d.ts.map +1 -1
  121. package/dist/http/route_error_check.js +2 -3
  122. package/dist/http/route_errors.d.ts +4 -4
  123. package/dist/http/route_errors.d.ts.map +1 -1
  124. package/dist/http/route_errors.js +0 -13
  125. package/dist/http/route_spec.d.ts +33 -36
  126. package/dist/http/route_spec.d.ts.map +1 -1
  127. package/dist/http/route_spec.js +21 -22
  128. package/dist/http/schema_helpers.d.ts +75 -67
  129. package/dist/http/schema_helpers.d.ts.map +1 -1
  130. package/dist/http/schema_helpers.js +54 -76
  131. package/dist/http/surface.d.ts.map +1 -1
  132. package/dist/http/surface.js +6 -8
  133. package/dist/primitive_schemas.d.ts +162 -112
  134. package/dist/primitive_schemas.d.ts.map +1 -1
  135. package/dist/primitive_schemas.js +129 -161
  136. package/dist/realtime/sse.d.ts +3 -3
  137. package/dist/realtime/sse.d.ts.map +1 -1
  138. package/dist/realtime/sse.js +2 -2
  139. package/dist/schema_issues.d.ts +41 -146
  140. package/dist/schema_issues.d.ts.map +1 -1
  141. package/dist/schema_issues.js +39 -322
  142. package/dist/schema_meta.d.ts +63 -136
  143. package/dist/schema_meta.d.ts.map +1 -1
  144. package/dist/schema_meta.js +37 -184
  145. package/dist/sensitivity.d.ts +3 -5
  146. package/dist/sensitivity.d.ts.map +1 -1
  147. package/dist/sensitivity.js +3 -5
  148. package/dist/server/serve_fact_route.js +1 -1
  149. package/dist/server/surface_route.js +1 -1
  150. package/dist/testing/CLAUDE.md +23 -25
  151. package/dist/testing/adversarial_headers.js +2 -2
  152. package/dist/testing/adversarial_input_cases.d.ts +19 -18
  153. package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
  154. package/dist/testing/adversarial_input_cases.js +29 -42
  155. package/dist/testing/assertions.d.ts +2 -2
  156. package/dist/testing/assertions.d.ts.map +1 -1
  157. package/dist/testing/assertions.js +3 -3
  158. package/dist/testing/cross_backend/account_lifecycle.js +2 -2
  159. package/dist/testing/cross_backend/action_manifest.d.ts +10 -9
  160. package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
  161. package/dist/testing/cross_backend/action_manifest.js +4 -3
  162. package/dist/testing/cross_backend/cell_crud.js +1 -1
  163. package/dist/testing/cross_backend/conformance_case.d.ts +96 -114
  164. package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
  165. package/dist/testing/cross_backend/conformance_case.js +0 -256
  166. package/dist/testing/cross_backend/conformance_rpc_auth.d.ts +0 -62
  167. package/dist/testing/cross_backend/conformance_rpc_auth.d.ts.map +1 -1
  168. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  169. package/dist/testing/cross_backend/conformance_table.js +3 -3
  170. package/dist/testing/cross_backend/cross_rpc.d.ts +3 -4
  171. package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
  172. package/dist/testing/cross_backend/cross_rpc.js +4 -4
  173. package/dist/testing/cross_backend/differential.js +2 -2
  174. package/dist/testing/cross_backend/fact_serving.js +1 -1
  175. package/dist/testing/cross_backend/identity_parity.js +9 -9
  176. package/dist/testing/cross_backend/origin_conformance.d.ts +9 -9
  177. package/dist/testing/cross_backend/query_shape.js +1 -1
  178. package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -1
  179. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
  180. package/dist/testing/cross_backend/setup.d.ts +26 -4
  181. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  182. package/dist/testing/cross_backend/setup.js +7 -8
  183. package/dist/testing/cross_backend/sse_round_trip.js +2 -2
  184. package/dist/testing/cross_backend/testing_origin_check.d.ts +12 -12
  185. package/dist/testing/cross_backend/testing_reset_actions.d.ts +608 -201
  186. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  187. package/dist/testing/cross_backend/testing_reset_actions.js +46 -55
  188. package/dist/testing/cross_backend/token_lifetime.js +3 -3
  189. package/dist/testing/cross_backend/wire_shapes.js +1 -1
  190. package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
  191. package/dist/testing/cross_backend/ws_outbound_overflow.js +35 -0
  192. package/dist/testing/cross_backend/ws_round_trip.js +1 -1
  193. package/dist/testing/data_exposure.d.ts.map +1 -1
  194. package/dist/testing/data_exposure.js +1 -1
  195. package/dist/testing/integration.js +2 -2
  196. package/dist/testing/integration_helpers.d.ts.map +1 -1
  197. package/dist/testing/integration_helpers.js +2 -2
  198. package/dist/testing/middleware.d.ts.map +1 -1
  199. package/dist/testing/middleware.js +2 -2
  200. package/dist/testing/rpc_attack_surface.js +1 -1
  201. package/dist/testing/rpc_envelope_cases.d.ts +3 -3
  202. package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
  203. package/dist/testing/rpc_envelope_cases.js +1 -1
  204. package/dist/testing/rpc_helpers.d.ts +12 -14
  205. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  206. package/dist/testing/rpc_helpers.js +9 -11
  207. package/dist/testing/schema_generators.d.ts +67 -60
  208. package/dist/testing/schema_generators.d.ts.map +1 -1
  209. package/dist/testing/schema_generators.js +144 -151
  210. package/dist/testing/schema_introspect.d.ts +438 -78
  211. package/dist/testing/schema_introspect.d.ts.map +1 -1
  212. package/dist/testing/schema_introspect.js +26 -26
  213. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  214. package/dist/testing/sse_round_trip.js +2 -2
  215. package/dist/testing/surface_invariants.d.ts +1 -1
  216. package/dist/testing/surface_invariants.js +1 -1
  217. package/dist/testing/transports/bootstrap.d.ts +1 -1
  218. package/dist/testing/transports/bootstrap.d.ts.map +1 -1
  219. package/dist/testing/transports/bootstrap.js +1 -1
  220. package/dist/ui/BootstrapForm.svelte +1 -2
  221. package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
  222. package/dist/ui/SignupForm.svelte +1 -2
  223. package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
  224. package/dist/ui/admin_accounts_state.svelte.d.ts +5 -5
  225. package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
  226. package/dist/ui/admin_invites_state.svelte.d.ts +1 -1
  227. package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
  228. package/dist/ui/admin_sessions_state.svelte.d.ts +2 -2
  229. package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
  230. package/dist/ui/form_state.svelte.d.ts +1 -1
  231. package/dist/ui/form_state.svelte.js +1 -1
  232. package/dist/ui/role_grant_offers_state.svelte.d.ts +1 -1
  233. package/package.json +7 -9
  234. package/dist/primitive_schemas_fuz.d.ts +0 -178
  235. package/dist/primitive_schemas_fuz.d.ts.map +0 -1
  236. package/dist/primitive_schemas_fuz.js +0 -149
  237. package/dist/zod.d.ts +0 -101
  238. package/dist/zod.d.ts.map +0 -1
  239. package/dist/zod.js +0 -195
@@ -1 +1 @@
1
- {"version":3,"file":"action_manifest.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/action_manifest.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAON,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,KAAK,E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C/B,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC;CACnC,KAAG,mBASF,CAAC;AAMH;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GACjC,OAAO,aAAa,CACnB,IAAI,CAAC,yBAAyB,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,YAAY,CAAC,CAC5F,KACC,cAED,CAAC"}
@@ -47,9 +47,10 @@ export const ActionManifestEntry = object({
47
47
  /** RPC method name (`spec.method`). */
48
48
  method: string,
49
49
  /**
50
- * `'void'` when the input is a void schema (`is_void_schema`: `z.void()`
51
- * or fuz_schema `s.void`, a parameterless method), else `'object'` — the
52
- * Rust spine's declared `InputShape`, which its dispatcher enforces. A `z.strictObject({})` input is `'object'`.
50
+ * `'void'` when the input is a void schema (`is_void_schema`: `s.void`, a
51
+ * parameterless method), else `'object'` — the Rust spine's declared
52
+ * `InputShape`, which its dispatcher enforces. An `object({})` input is
53
+ * `'object'`.
53
54
  */
54
55
  input: one_of(['void', 'object']),
55
56
  /** `true` when the action declares `side_effects` (mutation; POST-only on the RPC transport). */
@@ -4,7 +4,7 @@ import '../assert_dev_env.js';
4
4
  *
5
5
  * The generic `describe_rpc_round_trip_tests` can't cover cells: the verbs
6
6
  * are stateful (update / delete / get-by-id need a real cell id threaded
7
- * from a prior create) and `cell_get`'s input has a top-level `.refine()`.
7
+ * from a prior create) and `cell_get`'s input has a top-level `check`.
8
8
  * So cells stay off the standard declared surface (`create_spine_surface_spec`)
9
9
  * — exactly like ws / sse — and this suite plus its sibling
10
10
  * `describe_cell_relations_cross_tests` (grant / field / item / clone / audit)
@@ -7,7 +7,7 @@ import '../assert_dev_env.js';
7
7
  * carried as **data**. The case references a `method` (an RPC method name
8
8
  * or a REST auth-route suffix); the runner
9
9
  * (`describe_conformance_table_tests`) resolves the `input` / `output`
10
- * Zod schemas from the live action-spec registry / `RouteSpec` — the case
10
+ * schemas from the live action-spec registry / `RouteSpec` — the case
11
11
  * never carries a schema. This is the opinionated behavioral/security
12
12
  * layer on top of the spec-derived auto-enumeration
13
13
  * (`describe_rpc_round_trip_tests` / `describe_rpc_attack_surface_tests`):
@@ -23,7 +23,6 @@ import '../assert_dev_env.js';
23
23
  *
24
24
  * @module
25
25
  */
26
- import { z } from 'zod';
27
26
  /**
28
27
  * Closed enum of fixture-provisioned principals a case runs `as`. Each
29
28
  * value maps to a `TestFixture` accessor (or a seeded `extra_accounts`
@@ -94,22 +93,7 @@ import { z } from 'zod';
94
93
  * a backdated `auth_session` row behind a still-valid signed cookie
95
94
  * payload, so the authoritative DB-row expiry gate is what refuses it).
96
95
  */
97
- export declare const ConformancePrincipal: z.ZodEnum<{
98
- keeper: "keeper";
99
- token: "token";
100
- anonymous: "anonymous";
101
- daemon: "daemon";
102
- invalid_daemon: "invalid_daemon";
103
- daemon_browser: "daemon_browser";
104
- bearer_browser: "bearer_browser";
105
- malformed_bearer: "malformed_bearer";
106
- scoped_token: "scoped_token";
107
- fresh_non_admin: "fresh_non_admin";
108
- role_holder: "role_holder";
109
- wrong_role: "wrong_role";
110
- expired_session: "expired_session";
111
- }>;
112
- export type ConformancePrincipal = z.infer<typeof ConformancePrincipal>;
96
+ export type ConformancePrincipal = 'keeper' | 'daemon' | 'invalid_daemon' | 'daemon_browser' | 'token' | 'bearer_browser' | 'malformed_bearer' | 'scoped_token' | 'anonymous' | 'fresh_non_admin' | 'role_holder' | 'wrong_role' | 'expired_session';
113
97
  /**
114
98
  * The single RPC method the `scoped_token` principal's narrowed token admits.
115
99
  *
@@ -144,53 +128,87 @@ export declare const SCOPED_TOKEN_ADMITTED_METHOD = "account_verify";
144
128
  * Unavailable for principals that present no account (`anonymous`,
145
129
  * `bearer_browser`, `malformed_bearer`) — the runner throws.
146
130
  */
147
- export declare const ConformanceActingBinding: z.ZodEnum<{
148
- principal: "principal";
149
- keeper_actor: "keeper_actor";
150
- extra_actor: "extra_actor";
151
- }>;
152
- export type ConformanceActingBinding = z.infer<typeof ConformanceActingBinding>;
131
+ export type ConformanceActingBinding = 'principal' | 'extra_actor' | 'keeper_actor';
153
132
  /** The request a conformance case issues. */
154
- export declare const ConformanceCaseRequest: z.ZodObject<{
155
- method: z.ZodString;
156
- params: z.ZodOptional<z.ZodUnknown>;
157
- params_json: z.ZodOptional<z.ZodString>;
158
- as: z.ZodEnum<{
159
- keeper: "keeper";
160
- token: "token";
161
- anonymous: "anonymous";
162
- daemon: "daemon";
163
- invalid_daemon: "invalid_daemon";
164
- daemon_browser: "daemon_browser";
165
- bearer_browser: "bearer_browser";
166
- malformed_bearer: "malformed_bearer";
167
- scoped_token: "scoped_token";
168
- fresh_non_admin: "fresh_non_admin";
169
- role_holder: "role_holder";
170
- wrong_role: "wrong_role";
171
- expired_session: "expired_session";
172
- }>;
173
- acting: z.ZodOptional<z.ZodEnum<{
174
- principal: "principal";
175
- keeper_actor: "keeper_actor";
176
- extra_actor: "extra_actor";
177
- }>>;
178
- verb: z.ZodOptional<z.ZodEnum<{
179
- GET: "GET";
180
- POST: "POST";
181
- }>>;
182
- }, z.core.$strict>;
183
- export type ConformanceCaseRequest = z.infer<typeof ConformanceCaseRequest>;
133
+ export interface ConformanceCaseRequest {
134
+ /**
135
+ * RPC method name (e.g. `admin_account_list`) or a REST auth-route suffix
136
+ * (e.g. `/login`). A leading `/` selects the REST branch; otherwise the
137
+ * runner resolves the RPC action from the spec registry.
138
+ */
139
+ method: string;
140
+ /** Request params / body. Omit for nullary methods. */
141
+ params?: unknown;
142
+ /**
143
+ * RPC params as raw JSON text, sent verbatim in place of `params` — for a
144
+ * spelling `JSON.stringify` loses (`5.0`, `1e1`, `-0`). Exclusive with
145
+ * `params` and `acting`; RPC methods only.
146
+ */
147
+ params_json?: string;
148
+ as: ConformancePrincipal;
149
+ /**
150
+ * Bind `params.acting` at run time to the named actor
151
+ * (`ConformanceActingBinding`). Params must be an object or omitted, and
152
+ * must not carry `acting` themselves.
153
+ */
154
+ acting?: ConformanceActingBinding;
155
+ /** HTTP verb. Defaults to POST; use GET for `side_effects: false` reads. */
156
+ verb?: 'POST' | 'GET';
157
+ }
184
158
  /** The expected response shape a conformance case asserts. */
185
- export declare const ConformanceCaseExpectation: z.ZodObject<{
186
- status: z.ZodNumber;
187
- error_reason: z.ZodOptional<z.ZodString>;
188
- fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
189
- absent_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
190
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
191
- equivalence_group: z.ZodOptional<z.ZodString>;
192
- }, z.core.$strict>;
193
- export type ConformanceCaseExpectation = z.infer<typeof ConformanceCaseExpectation>;
159
+ export interface ConformanceCaseExpectation {
160
+ /** Expected HTTP status code. */
161
+ status: number;
162
+ /**
163
+ * Expected error reason — pass the IMPORTED `ERROR_*` constant from
164
+ * `http/error_schemas.ts`, never a string literal. Asserted against the RPC
165
+ * `error.data.reason` (when the denial carries one) or the REST flat-body
166
+ * `error` field. The pre-authorization 401 carries `data.reason` too; a
167
+ * denial that genuinely omits it falls back to the `status` assertion to pin
168
+ * the class.
169
+ */
170
+ error_reason?: string;
171
+ /**
172
+ * Specific field-value assertions on the success `result` (2xx) or the
173
+ * error `error.data` (non-2xx). Each key must deep-equal the corresponding
174
+ * response field.
175
+ */
176
+ fields?: Record<string, unknown>;
177
+ /**
178
+ * Sensitive field names that must NOT appear ANYWHERE (at any depth) in the
179
+ * normalized response body — the negative-space twin of `fields`. Each name
180
+ * is searched recursively through the success `result` / error envelope, so
181
+ * a secret column (`password_hash`, `token_hash`) that leaks at any nesting
182
+ * level (top-level, inside a list element) fails the case. Pins "this secret
183
+ * never serializes" on BOTH spines — a serialization regression would
184
+ * otherwise leak identically and silently on each. Non-vacuous only when the
185
+ * body is known non-empty (e.g. a list that always contains the caller);
186
+ * note that in the case.
187
+ */
188
+ absent_fields?: Array<string>;
189
+ /**
190
+ * Per-header expectations on the response. Each key is a header name
191
+ * (case-insensitive); a string value asserts the header is present and
192
+ * equals it exactly, `null` asserts the header is ABSENT. Independent of
193
+ * this, the runner enforces an unconditional no-fingerprint invariant on
194
+ * EVERY response (`Server` / `X-Powered-By` / `WWW-Authenticate` must stay
195
+ * absent on both spines), so a case only needs `headers` to pin a header
196
+ * beyond that always-on floor.
197
+ */
198
+ headers?: Record<string, string | null>;
199
+ /**
200
+ * Tags this case as a member of an indistinguishability group. After all
201
+ * cases run, the runner asserts every member of a group produced a
202
+ * BYTE-IDENTICAL normalized response (`{status, body}`) — checked per impl.
203
+ * This promotes a masked pair (found-but-unauthorized ≡ not-found,
204
+ * wrong-password ≡ account-not-found) from "same status + reason" to
205
+ * "wire-indistinguishable", and holds BOTH impls to it: a prober hitting
206
+ * either spine cannot tell the members apart. A group needs >= 2 members; a
207
+ * member may still set `fields`. The negative-space twin of the positive
208
+ * `output`-schema parity the runner already asserts.
209
+ */
210
+ equivalence_group?: string;
211
+ }
194
212
  /**
195
213
  * Marks a case as a deferred-by-design gap. The runner routes it through
196
214
  * `xfail_until` instead of a normal `test` — visible (distinct from pass)
@@ -198,11 +216,12 @@ export type ConformanceCaseExpectation = z.infer<typeof ConformanceCaseExpectati
198
216
  * marker's removal). Use for declared gaps (e.g. facts), never for
199
217
  * in-scope gaps (those fail loud as a red `test`).
200
218
  */
201
- export declare const ConformanceCaseXfail: z.ZodObject<{
202
- tracking_id: z.ZodString;
203
- reason: z.ZodString;
204
- }, z.core.$strict>;
205
- export type ConformanceCaseXfail = z.infer<typeof ConformanceCaseXfail>;
219
+ export interface ConformanceCaseXfail {
220
+ /** Tracking id for the deferred gap (issue id or tracking slug). */
221
+ tracking_id: string;
222
+ /** Why this case is deferred-by-design. */
223
+ reason: string;
224
+ }
206
225
  /**
207
226
  * A single conformance case. `name` is the assertion; the optional
208
227
  * free-text `note` is printed in the test label / failure output. A
@@ -213,50 +232,13 @@ export type ConformanceCaseXfail = z.infer<typeof ConformanceCaseXfail>;
213
232
  * non-empty-string check never catches a *wrong* citation — the citation
214
233
  * is verified in review.
215
234
  */
216
- export declare const ConformanceCase: z.ZodObject<{
217
- name: z.ZodString;
218
- request: z.ZodObject<{
219
- method: z.ZodString;
220
- params: z.ZodOptional<z.ZodUnknown>;
221
- params_json: z.ZodOptional<z.ZodString>;
222
- as: z.ZodEnum<{
223
- keeper: "keeper";
224
- token: "token";
225
- anonymous: "anonymous";
226
- daemon: "daemon";
227
- invalid_daemon: "invalid_daemon";
228
- daemon_browser: "daemon_browser";
229
- bearer_browser: "bearer_browser";
230
- malformed_bearer: "malformed_bearer";
231
- scoped_token: "scoped_token";
232
- fresh_non_admin: "fresh_non_admin";
233
- role_holder: "role_holder";
234
- wrong_role: "wrong_role";
235
- expired_session: "expired_session";
236
- }>;
237
- acting: z.ZodOptional<z.ZodEnum<{
238
- principal: "principal";
239
- keeper_actor: "keeper_actor";
240
- extra_actor: "extra_actor";
241
- }>>;
242
- verb: z.ZodOptional<z.ZodEnum<{
243
- GET: "GET";
244
- POST: "POST";
245
- }>>;
246
- }, z.core.$strict>;
247
- expect: z.ZodObject<{
248
- status: z.ZodNumber;
249
- error_reason: z.ZodOptional<z.ZodString>;
250
- fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
251
- absent_fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
252
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
253
- equivalence_group: z.ZodOptional<z.ZodString>;
254
- }, z.core.$strict>;
255
- note: z.ZodOptional<z.ZodString>;
256
- xfail: z.ZodOptional<z.ZodObject<{
257
- tracking_id: z.ZodString;
258
- reason: z.ZodString;
259
- }, z.core.$strict>>;
260
- }, z.core.$strict>;
261
- export type ConformanceCase = z.infer<typeof ConformanceCase>;
235
+ export interface ConformanceCase {
236
+ /** The assertion, used as the test label. */
237
+ name: string;
238
+ request: ConformanceCaseRequest;
239
+ expect: ConformanceCaseExpectation;
240
+ /** Free-text note printed in the label / failure output. */
241
+ note?: string;
242
+ xfail?: ConformanceCaseXfail;
243
+ }
262
244
  //# sourceMappingURL=conformance_case.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conformance_case.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/conformance_case.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;EAc/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,wBAAwB;;;;EAAuD,CAAC;AAC7F,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8BjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B;;;;;;;kBA+DrC,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEpF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;kBAK/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAS1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"conformance_case.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/conformance_case.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,MAAM,MAAM,oBAAoB,GAC7B,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,OAAO,GACP,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,iBAAiB,GACjB,aAAa,GACb,YAAY,GACZ,iBAAiB,CAAC;AAErB;;;;;;;;;GASG;AACH,eAAO,MAAM,4BAA4B,mBAAmB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;AAEpF,6CAA6C;AAC7C,MAAM,WAAW,sBAAsB;IACtC;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,oBAAoB,CAAC;IACzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB;AAED,8DAA8D;AAC9D,MAAM,WAAW,0BAA0B;IAC1C,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACxC;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACpC,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC/B,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,sBAAsB,CAAC;IAChC,MAAM,EAAE,0BAA0B,CAAC;IACnC,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC7B"}
@@ -1,114 +1,4 @@
1
1
  import '../assert_dev_env.js';
2
- /**
3
- * Declarative conformance-case schema for the cross-backend behavioral +
4
- * security suite.
5
- *
6
- * A conformance case is a single request → expected-response assertion,
7
- * carried as **data**. The case references a `method` (an RPC method name
8
- * or a REST auth-route suffix); the runner
9
- * (`describe_conformance_table_tests`) resolves the `input` / `output`
10
- * Zod schemas from the live action-spec registry / `RouteSpec` — the case
11
- * never carries a schema. This is the opinionated behavioral/security
12
- * layer on top of the spec-derived auto-enumeration
13
- * (`describe_rpc_round_trip_tests` / `describe_rpc_attack_surface_tests`):
14
- * the same case definition runs in-process (fast, every `gro test`) and
15
- * cross-process (the conformance gate) against each impl's real auth
16
- * resolution.
17
- *
18
- * The table is for single-request matrices (credential-type ceiling,
19
- * privilege gates, IDOR masks, enumeration-equivalence, validation).
20
- * Multi-step flows stay imperative in their own `describe_*` suites,
21
- * sharing assertion primitives — there is deliberately no declarative
22
- * setup DSL.
23
- *
24
- * @module
25
- */
26
- import { z } from 'zod';
27
- /**
28
- * Closed enum of fixture-provisioned principals a case runs `as`. Each
29
- * value maps to a `TestFixture` accessor (or a seeded `extra_accounts`
30
- * entry) in the runner's `resolve_conformance_principal` — there is **no** inline
31
- * credential minting in a case (that would be the setup-DSL trap).
32
- *
33
- * - `keeper` — the per-test bootstrapped keeper (holds `ROLE_KEEPER` +
34
- * `ROLE_ADMIN`), session credential.
35
- * - `daemon` — the keeper authenticated via the daemon-token header.
36
- * - `invalid_daemon` — a *malformed/invalid* `X-Daemon-Token` carried
37
- * alongside the keeper's session cookie, over a non-browser (no-Origin)
38
- * transport. The middleware soft-fail-discards the invalid daemon token
39
- * (matching the Rust spine's `None`), so auth falls through to the session
40
- * leg: the request authenticates as the keeper-via-session and a
41
- * daemon-gated action then refuses the session credential with
42
- * `credential_type_required` — not a hard `invalid_daemon_token` 401. The
43
- * no-Origin transport keeps the daemon token on the invalid-token path
44
- * rather than the browser-context discard; the session base credential is
45
- * what makes the credential-type gate (not the auth gate) the refusing
46
- * layer (without it the discard would 401 anonymous).
47
- * - `daemon_browser` — a *valid* `X-Daemon-Token` carried in a browser
48
- * context (default `Origin` present) alongside the keeper's session cookie.
49
- * Browsers attach `Origin` automatically; the daemon-token middleware
50
- * discards a header-bearing daemon token as browser context (mirroring the
51
- * bearer guard and the Rust spine's `is_browser_context`), so the *valid*
52
- * token is dropped and auth falls through to the session leg → a daemon-gated
53
- * action then refuses the session credential with `credential_type_required`.
54
- * Distinct from `invalid_daemon`: here the token is well-formed and current,
55
- * so a 403 (not a 400 confirm-guard hit like `daemon`) proves the
56
- * browser-context discard fired — a valid daemon token does NOT authenticate
57
- * when an `Origin` is present. `Origin` is deliberately NOT suppressed; its
58
- * presence is the signal under test.
59
- * - `token` — the keeper authenticated via a bearer api-token (non-browser
60
- * context; the runner suppresses `Origin` so the token isn't discarded).
61
- * - `bearer_browser` — a *valid* bearer api-token carried in a browser context
62
- * (default `Origin` present), fresh jar so NO session rides alongside. The
63
- * bearer middleware discards the token as browser context (mirroring the
64
- * daemon guard + the Rust spine's `is_browser_context`), so the request
65
- * arrives anonymous and an authed action 401s. Proves a stolen bearer cannot
66
- * be replayed from a browser — wire-indistinguishable from sending no
67
- * credential (the `token` principal is the honored counterpart: it suppresses
68
- * `Origin`, so the same token authenticates).
69
- * - `malformed_bearer` — the keeper's bearer api-token with its last character
70
- * dropped, non-browser context, fresh jar. A value that cannot be a token
71
- * fails each spine's shape precheck and soft-fails before any database work,
72
- * so the request arrives anonymous — wire-indistinguishable from sending no
73
- * credential.
74
- * - `scoped_token` — the keeper authenticated via a bearer api-token minted
75
- * with a **narrowed** `TokenScope` (`{kind: 'methods', methods:
76
- * [SCOPED_TOKEN_ADMITTED_METHOD]}`), non-browser context. Minted through the
77
- * production `account_token_create` path over the keeper's session, not
78
- * seeded — `_testing_reset` deliberately seeds a `full` token, and a harness
79
- * that narrowed the seed would silently re-scope every other bearer case.
80
- * The scope gate sits between the credential gate and the role gate, so this
81
- * principal is what distinguishes `token_scope_required` from the
82
- * credential-type and role denials on either side of it.
83
- * - `anonymous` — no credential, fresh cookie jar.
84
- * - `fresh_non_admin` — a freshly minted account with no roles, session
85
- * credential (via the production invite → signup → login flow).
86
- * - `role_holder` — a seeded `extra_accounts` principal holding a specific
87
- * role; the runner reads it by the username named in
88
- * `ConformanceTableOptions.principals.role_holder`.
89
- * - `wrong_role` — a seeded `extra_accounts` principal holding a role
90
- * other than the one a route requires; named via
91
- * `ConformanceTableOptions.principals.wrong_role`.
92
- * - `expired_session` — the keeper account presented via an *expired
93
- * server-side session* cookie (minted by `fixture.mint_expired_session()`:
94
- * a backdated `auth_session` row behind a still-valid signed cookie
95
- * payload, so the authoritative DB-row expiry gate is what refuses it).
96
- */
97
- export const ConformancePrincipal = z.enum([
98
- 'keeper',
99
- 'daemon',
100
- 'invalid_daemon',
101
- 'daemon_browser',
102
- 'token',
103
- 'bearer_browser',
104
- 'malformed_bearer',
105
- 'scoped_token',
106
- 'anonymous',
107
- 'fresh_non_admin',
108
- 'role_holder',
109
- 'wrong_role',
110
- 'expired_session'
111
- ]);
112
2
  /**
113
3
  * The single RPC method the `scoped_token` principal's narrowed token admits.
114
4
  *
@@ -120,149 +10,3 @@ export const ConformancePrincipal = z.enum([
120
10
  * scope gate and nothing else.
121
11
  */
122
12
  export const SCOPED_TOKEN_ADMITTED_METHOD = 'account_verify';
123
- /**
124
- * Which actor the runner writes into a case's `params.acting` at run time.
125
- *
126
- * An actor id exists only once a fixture has seeded it, so a case names the
127
- * actor by its relation to the fixture and the runner fills in the id:
128
- *
129
- * - `principal` — the actor of the account the principal's credential names:
130
- * the keeper's bootstrap actor for the keeper-credential principals
131
- * (`keeper`, `daemon`, `token`, `scoped_token`, …), the account's one actor
132
- * for `fresh_non_admin` / `role_holder` / `wrong_role`. Binding it makes a
133
- * row hold whether the account has one actor or several: a single-actor
134
- * account resolves the same actor with or without the selector, a
135
- * multi-actor one needs it.
136
- * - `extra_actor` — the keeper's first seeded extra actor
137
- * (`fixture.extra_actors[0]`); the fixture must declare `extra_actors`.
138
- * With a keeper-credential principal, the request acts as a sibling actor
139
- * on the keeper's own account that holds none of the keeper's roles.
140
- * - `keeper_actor` — the keeper's bootstrap actor whatever the principal, so
141
- * a principal on another account names a real actor that is not its own.
142
- *
143
- * Unavailable for principals that present no account (`anonymous`,
144
- * `bearer_browser`, `malformed_bearer`) — the runner throws.
145
- */
146
- export const ConformanceActingBinding = z.enum(['principal', 'extra_actor', 'keeper_actor']);
147
- /** The request a conformance case issues. */
148
- export const ConformanceCaseRequest = z.strictObject({
149
- method: z.string().meta({
150
- description: 'RPC method name (e.g. `admin_account_list`) or a REST auth-route suffix ' +
151
- '(e.g. `/login`). A leading `/` selects the REST branch; otherwise the ' +
152
- 'runner resolves the RPC action from the spec registry.'
153
- }),
154
- params: z
155
- .unknown()
156
- .optional()
157
- .meta({ description: 'Request params / body. Omit for nullary methods.' }),
158
- params_json: z
159
- .string()
160
- .optional()
161
- .meta({
162
- description: 'RPC params as raw JSON text, sent verbatim in place of `params` — for a ' +
163
- 'spelling `JSON.stringify` loses (`5.0`, `1e1`, `-0`). Exclusive with ' +
164
- '`params` and `acting`; RPC methods only.'
165
- }),
166
- as: ConformancePrincipal,
167
- acting: ConformanceActingBinding.optional().meta({
168
- description: 'Bind `params.acting` at run time to the named actor (`ConformanceActingBinding`). ' +
169
- 'Params must be an object or omitted, and must not carry `acting` themselves.'
170
- }),
171
- verb: z
172
- .enum(['POST', 'GET'])
173
- .optional()
174
- .meta({ description: 'HTTP verb. Defaults to POST; use GET for `side_effects: false` reads.' })
175
- });
176
- /** The expected response shape a conformance case asserts. */
177
- export const ConformanceCaseExpectation = z.strictObject({
178
- status: z.number().int().meta({ description: 'Expected HTTP status code.' }),
179
- error_reason: z
180
- .string()
181
- .optional()
182
- .meta({
183
- description: 'Expected error reason — pass the IMPORTED `ERROR_*` constant from ' +
184
- '`http/error_schemas.ts`, never a string literal. Asserted against the RPC ' +
185
- '`error.data.reason` (when the denial carries one) or the REST flat-body ' +
186
- '`error` field. The pre-authorization 401 carries `data.reason` too; a denial ' +
187
- 'that genuinely omits it falls back to the `status` assertion to pin the class.'
188
- }),
189
- fields: z
190
- .record(z.string(), z.unknown())
191
- .optional()
192
- .meta({
193
- description: 'Specific field-value assertions on the success `result` (2xx) or the error ' +
194
- '`error.data` (non-2xx). Each key must deep-equal the corresponding response field.'
195
- }),
196
- absent_fields: z
197
- .array(z.string())
198
- .optional()
199
- .meta({
200
- description: 'Sensitive field names that must NOT appear ANYWHERE (at any depth) in the ' +
201
- 'normalized response body — the negative-space twin of `fields`. Each name is ' +
202
- 'searched recursively through the success `result` / error envelope, so a ' +
203
- 'secret column (`password_hash`, `token_hash`) that leaks at any nesting level ' +
204
- '(top-level, inside a list element) fails the case. Pins "this secret never ' +
205
- 'serializes" on BOTH spines — a serialization regression would otherwise leak ' +
206
- 'identically and silently on each. Non-vacuous only when the body is known ' +
207
- 'non-empty (e.g. a list that always contains the caller); note that in the case.'
208
- }),
209
- headers: z
210
- .record(z.string(), z.string().nullable())
211
- .optional()
212
- .meta({
213
- description: 'Per-header expectations on the response. Each key is a header name ' +
214
- '(case-insensitive); a string value asserts the header is present and equals ' +
215
- 'it exactly, `null` asserts the header is ABSENT. Independent of this, the ' +
216
- 'runner enforces an unconditional no-fingerprint invariant on EVERY response ' +
217
- '(`Server` / `X-Powered-By` / `WWW-Authenticate` must stay absent on both ' +
218
- 'spines), so a case only needs `headers` to pin a header beyond that ' +
219
- 'always-on floor.'
220
- }),
221
- equivalence_group: z
222
- .string()
223
- .optional()
224
- .meta({
225
- description: 'Tags this case as a member of an indistinguishability group. After all cases ' +
226
- 'run, the runner asserts every member of a group produced a BYTE-IDENTICAL ' +
227
- 'normalized response (`{status, body}`) — checked per impl. This promotes a ' +
228
- 'masked pair (found-but-unauthorized ≡ not-found, wrong-password ≡ ' +
229
- 'account-not-found) from "same status + reason" to "wire-indistinguishable", ' +
230
- 'and holds BOTH impls to it: a prober hitting either spine cannot tell the ' +
231
- 'members apart. A group needs >= 2 members; a member may still set `fields`. ' +
232
- 'The negative-space twin of the positive `output`-schema parity the runner ' +
233
- 'already asserts.'
234
- })
235
- });
236
- /**
237
- * Marks a case as a deferred-by-design gap. The runner routes it through
238
- * `xfail_until` instead of a normal `test` — visible (distinct from pass)
239
- * and self-cleaning (flips red when the impl starts passing, forcing the
240
- * marker's removal). Use for declared gaps (e.g. facts), never for
241
- * in-scope gaps (those fail loud as a red `test`).
242
- */
243
- export const ConformanceCaseXfail = z.strictObject({
244
- tracking_id: z
245
- .string()
246
- .meta({ description: 'Tracking id for the deferred gap (issue id or tracking slug).' }),
247
- reason: z.string().meta({ description: 'Why this case is deferred-by-design.' })
248
- });
249
- /**
250
- * A single conformance case. `name` is the assertion; the optional
251
- * free-text `note` is printed in the test label / failure output. A
252
- * security case's `note` should reference a **public** fuz_app doc
253
- * property (`security.md` / `architecture.md` / module TSDoc), since the
254
- * table ships in a public package — not an internal planning doc. The note
255
- * is documentation, not a gate: it stays free-text by design because a
256
- * non-empty-string check never catches a *wrong* citation — the citation
257
- * is verified in review.
258
- */
259
- export const ConformanceCase = z.strictObject({
260
- name: z.string().meta({ description: 'The assertion, used as the test label.' }),
261
- request: ConformanceCaseRequest,
262
- expect: ConformanceCaseExpectation,
263
- note: z
264
- .string()
265
- .optional()
266
- .meta({ description: 'Free-text note printed in the label / failure output.' }),
267
- xfail: ConformanceCaseXfail.optional()
268
- });
@@ -1,66 +1,4 @@
1
1
  import '../assert_dev_env.js';
2
- /**
3
- * Per-method RPC auth rows for the conformance table, generated from the
4
- * declared surface and, when given, the methods a backend live-mounts off it.
5
- *
6
- * `describe_rpc_attack_surface_tests` walks every declared method's auth, but
7
- * only in-process against stub apps with no database, so it never reaches a
8
- * spawned backend. The hand-written conformance rows reach every backend but
9
- * cover a chosen few methods. A spine that hand-implements a method's gate can
10
- * drift on any method nobody wrote a row for, and the action-manifest parity
11
- * gate only compares what the spines *declare*. These rows close that: each
12
- * method's declared `RouteAuth` becomes `ConformanceCase` data that
13
- * `describe_conformance_table_tests` fires at the live gate, in-process and
14
- * cross-process alike.
15
- *
16
- * Rows per method, from its declared auth:
17
- *
18
- * - **account or actor required** — `anonymous` → 401
19
- * `authentication_required`. The 401 body is method-independent, so every
20
- * such row joins one equivalence group: a caller with no credential learns
21
- * nothing that tells one method from another.
22
- * - **credential-gated** (`credential_types`) — each builtin channel the gate
23
- * does not admit (`keeper` for `session`, `token` for `api_token`, `daemon`
24
- * for `daemon_token`) → 403 `credential_type_required`, echoing the declared
25
- * `required_credential_types`. Each of those principals is the keeper.
26
- * - **role-gated** (`roles`) and admitting a session — `fresh_non_admin` →
27
- * 403 `insufficient_permissions`, echoing `required_roles`. A role gate
28
- * behind a credential gate that refuses sessions is skipped: every
29
- * role-less principal would hit the credential gate first.
30
- * - **public** — no rows.
31
- *
32
- * **Acting.** On both spines the authorization phase resolves the acting
33
- * actor before the credential gate runs, so a keeper with a second actor
34
- * (`extra_actors`) would answer `actor_required` (400) to a request with no
35
- * `acting` on an actor-bound method. Every credential and role row on such a
36
- * method therefore binds `acting` to its principal's own actor at run time
37
- * (`request.acting: 'principal'`): a single-actor account resolves the same
38
- * actor with or without it, a multi-actor keeper resolves the one holding its
39
- * roles, and either way the gate under test is the first that can refuse. The
40
- * anonymous rows send none — the 401 precedes actor resolution.
41
- *
42
- * Every refusal row sends schema-valid params where they can be generated
43
- * (`generate_valid_body`, its generated `acting` dropped for the binding),
44
- * so the gate is the only thing that can refuse. A backend
45
- * whose gate is missing reaches its handler and answers something else. The
46
- * rows therefore pin each gate, not the gate order against validation — the
47
- * 401-before-400 rows of the security slate pin that.
48
- *
49
- * **Off the declared surface.** `live_rpc_endpoints` adds the methods a
50
- * backend mounts beyond the declared surface — cell verbs, opt-in resolvers,
51
- * the `_testing_*` backdoors — read from their action specs the same way, a
52
- * method the declared surface already has taken from there. The rows then
53
- * need the same endpoints to resolve: pass them to the table runner's
54
- * `live_rpc_endpoints` too.
55
- *
56
- * Skipped: the protocol actions (`PROTOCOL_ACTION_METHODS`): their auth is
57
- * fixed by fuz_app's shared specs rather than declared per consumer, they are
58
- * WebSocket-scoped (`cancel` is a notification with no reply to assert,
59
- * `peer/ping` is public, `heartbeat` rides an admitted socket), and the WS
60
- * suites cover them.
61
- *
62
- * @module
63
- */
64
2
  import type { AppSurfaceSpec, RpcEndpointSpec } from '../../http/surface.js';
65
3
  import type { ConformanceCase } from './conformance_case.js';
66
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"conformance_rpc_auth.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/conformance_rpc_auth.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;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