@fuzdev/fuz_app 0.163.0 → 0.165.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 (199) hide show
  1. package/README.md +2 -1
  2. package/dist/actions/action_event_data.d.ts +1 -1
  3. package/dist/actions/action_rpc.d.ts.map +1 -1
  4. package/dist/actions/action_rpc.js +4 -0
  5. package/dist/actions/action_spec.d.ts +3 -3
  6. package/dist/actions/action_spec.d.ts.map +1 -1
  7. package/dist/auth/CLAUDE.md +1 -1
  8. package/dist/auth/account_route_schema.d.ts +3 -27
  9. package/dist/auth/account_route_schema.d.ts.map +1 -1
  10. package/dist/auth/account_route_schema.js +6 -20
  11. package/dist/auth/admin_action_specs.d.ts +56 -56
  12. package/dist/auth/audit_log_route_schema.d.ts +1 -1
  13. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  14. package/dist/auth/audit_log_route_schema.js +4 -5
  15. package/dist/auth/audit_log_schema.d.ts +18 -18
  16. package/dist/auth/bootstrap_route_schema.d.ts +1 -30
  17. package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
  18. package/dist/auth/bootstrap_route_schema.js +3 -8
  19. package/dist/auth/daemon_token.d.ts +4 -4
  20. package/dist/auth/daemon_token.d.ts.map +1 -1
  21. package/dist/auth/daemon_token.js +3 -3
  22. package/dist/auth/daemon_token_middleware.d.ts +1 -1
  23. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  24. package/dist/auth/daemon_token_middleware.js +5 -5
  25. package/dist/auth/middleware.js +4 -4
  26. package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
  27. package/dist/auth/signup_route_schema.d.ts.map +1 -1
  28. package/dist/auth/signup_route_schema.js +3 -7
  29. package/dist/db/CLAUDE.md +2 -1
  30. package/dist/db/file_fact_url.d.ts +11 -6
  31. package/dist/db/file_fact_url.d.ts.map +1 -1
  32. package/dist/db/file_fact_url.js +5 -5
  33. package/dist/db/schema_ready.d.ts +0 -5
  34. package/dist/db/schema_ready.d.ts.map +1 -1
  35. package/dist/db/schema_ready.js +0 -5
  36. package/dist/http/CLAUDE.md +105 -71
  37. package/dist/http/auth_shape.d.ts +48 -29
  38. package/dist/http/auth_shape.d.ts.map +1 -1
  39. package/dist/http/auth_shape.js +12 -85
  40. package/dist/http/body_limit.d.ts +12 -0
  41. package/dist/http/body_limit.d.ts.map +1 -1
  42. package/dist/http/body_limit.js +15 -0
  43. package/dist/http/body_limit_schema.d.ts +20 -0
  44. package/dist/http/body_limit_schema.d.ts.map +1 -0
  45. package/dist/http/body_limit_schema.js +20 -0
  46. package/dist/http/common_routes.d.ts +1 -1
  47. package/dist/http/common_routes.d.ts.map +1 -1
  48. package/dist/http/common_routes.js +11 -14
  49. package/dist/http/db_routes.d.ts.map +1 -1
  50. package/dist/http/db_routes.js +59 -69
  51. package/dist/http/dev_route_error_check.d.ts +70 -0
  52. package/dist/http/dev_route_error_check.d.ts.map +1 -0
  53. package/dist/http/dev_route_error_check.js +119 -0
  54. package/dist/http/error_schemas.d.ts +365 -189
  55. package/dist/http/error_schemas.d.ts.map +1 -1
  56. package/dist/http/error_schemas.js +256 -149
  57. package/dist/http/health_schema.d.ts +10 -6
  58. package/dist/http/health_schema.d.ts.map +1 -1
  59. package/dist/http/health_schema.js +3 -3
  60. package/dist/http/middleware_spec.d.ts +8 -3
  61. package/dist/http/middleware_spec.d.ts.map +1 -1
  62. package/dist/http/origin.d.ts +12 -43
  63. package/dist/http/origin.d.ts.map +1 -1
  64. package/dist/http/origin.js +10 -6
  65. package/dist/http/route_error_check.d.ts +179 -0
  66. package/dist/http/route_error_check.d.ts.map +1 -0
  67. package/dist/http/route_error_check.js +283 -0
  68. package/dist/http/route_errors.d.ts +80 -0
  69. package/dist/http/route_errors.d.ts.map +1 -0
  70. package/dist/http/route_errors.js +83 -0
  71. package/dist/http/route_spec.d.ts +33 -17
  72. package/dist/http/route_spec.d.ts.map +1 -1
  73. package/dist/http/route_spec.js +48 -62
  74. package/dist/http/schema_helpers.d.ts +15 -34
  75. package/dist/http/schema_helpers.d.ts.map +1 -1
  76. package/dist/http/schema_helpers.js +11 -47
  77. package/dist/http/surface.d.ts +19 -12
  78. package/dist/http/surface.d.ts.map +1 -1
  79. package/dist/http/surface.js +25 -38
  80. package/dist/http/surface_query.d.ts +11 -2
  81. package/dist/http/surface_query.d.ts.map +1 -1
  82. package/dist/http/surface_query.js +7 -1
  83. package/dist/primitive_schemas_fuz.d.ts +17 -3
  84. package/dist/primitive_schemas_fuz.d.ts.map +1 -1
  85. package/dist/primitive_schemas_fuz.js +13 -3
  86. package/dist/rate_limiter.d.ts +13 -0
  87. package/dist/rate_limiter.d.ts.map +1 -1
  88. package/dist/rate_limiter.js +20 -2
  89. package/dist/schema_issues.d.ts +29 -11
  90. package/dist/schema_issues.d.ts.map +1 -1
  91. package/dist/schema_issues.js +11 -10
  92. package/dist/schema_meta.d.ts +8 -1
  93. package/dist/schema_meta.d.ts.map +1 -1
  94. package/dist/schema_meta.js +2 -1
  95. package/dist/server/app_server.d.ts +3 -1
  96. package/dist/server/app_server.d.ts.map +1 -1
  97. package/dist/server/app_server.js +24 -10
  98. package/dist/server/serve_fact_route.d.ts.map +1 -1
  99. package/dist/server/serve_fact_route.js +8 -31
  100. package/dist/server/surface_route.d.ts.map +1 -1
  101. package/dist/server/surface_route.js +5 -6
  102. package/dist/server/x_accel.d.ts +12 -7
  103. package/dist/server/x_accel.d.ts.map +1 -1
  104. package/dist/server/x_accel.js +7 -9
  105. package/dist/testing/CLAUDE.md +105 -61
  106. package/dist/testing/admin_integration.js +2 -2
  107. package/dist/testing/adversarial_404.d.ts +4 -18
  108. package/dist/testing/adversarial_404.d.ts.map +1 -1
  109. package/dist/testing/adversarial_404.js +20 -52
  110. package/dist/testing/adversarial_headers.d.ts +3 -4
  111. package/dist/testing/adversarial_headers.d.ts.map +1 -1
  112. package/dist/testing/adversarial_headers.js +8 -6
  113. package/dist/testing/adversarial_input.d.ts.map +1 -1
  114. package/dist/testing/adversarial_input.js +20 -19
  115. package/dist/testing/assertions.d.ts +46 -14
  116. package/dist/testing/assertions.d.ts.map +1 -1
  117. package/dist/testing/assertions.js +73 -16
  118. package/dist/testing/attack_surface.d.ts +17 -35
  119. package/dist/testing/attack_surface.d.ts.map +1 -1
  120. package/dist/testing/attack_surface.js +36 -95
  121. package/dist/testing/auth_apps.d.ts.map +1 -1
  122. package/dist/testing/auth_apps.js +2 -1
  123. package/dist/testing/cross_backend/action_manifest.d.ts +126 -56
  124. package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
  125. package/dist/testing/cross_backend/action_manifest.js +11 -11
  126. package/dist/testing/cross_backend/action_manifest_parity.d.ts +1 -1
  127. package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
  128. package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
  129. package/dist/testing/cross_backend/cell_crud.js +2 -1
  130. package/dist/testing/cross_backend/conformance_table.js +1 -1
  131. package/dist/testing/cross_backend/fact_serving.js +3 -3
  132. package/dist/testing/cross_backend/in_process_setup.d.ts +7 -3
  133. package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
  134. package/dist/testing/cross_backend/in_process_setup.js +11 -4
  135. package/dist/testing/cross_backend/origin_conformance.d.ts +278 -102
  136. package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
  137. package/dist/testing/cross_backend/origin_conformance.js +21 -21
  138. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  139. package/dist/testing/cross_backend/rust_spine_consumer_surface.js +7 -1
  140. package/dist/testing/cross_backend/setup.d.ts +13 -0
  141. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  142. package/dist/testing/cross_backend/setup.js +24 -7
  143. package/dist/testing/cross_backend/spine_suites.d.ts +3 -2
  144. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  145. package/dist/testing/cross_backend/spine_suites.js +5 -2
  146. package/dist/testing/cross_backend/standard.d.ts +31 -0
  147. package/dist/testing/cross_backend/standard.d.ts.map +1 -1
  148. package/dist/testing/cross_backend/standard.js +9 -3
  149. package/dist/testing/cross_backend/testing_origin_check.d.ts +147 -71
  150. package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
  151. package/dist/testing/cross_backend/testing_origin_check.js +16 -13
  152. package/dist/testing/cross_backend/testing_reset_actions.d.ts +70 -27
  153. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  154. package/dist/testing/data_exposure.d.ts +7 -0
  155. package/dist/testing/data_exposure.d.ts.map +1 -1
  156. package/dist/testing/data_exposure.js +8 -7
  157. package/dist/testing/error_coverage.d.ts +53 -61
  158. package/dist/testing/error_coverage.d.ts.map +1 -1
  159. package/dist/testing/error_coverage.js +86 -119
  160. package/dist/testing/integration.d.ts +28 -1
  161. package/dist/testing/integration.d.ts.map +1 -1
  162. package/dist/testing/integration.js +54 -29
  163. package/dist/testing/integration_helpers.d.ts +37 -9
  164. package/dist/testing/integration_helpers.d.ts.map +1 -1
  165. package/dist/testing/integration_helpers.js +75 -40
  166. package/dist/testing/middleware.d.ts +3 -5
  167. package/dist/testing/middleware.d.ts.map +1 -1
  168. package/dist/testing/middleware.js +5 -4
  169. package/dist/testing/middleware_gate_probes.d.ts +90 -0
  170. package/dist/testing/middleware_gate_probes.d.ts.map +1 -0
  171. package/dist/testing/middleware_gate_probes.js +179 -0
  172. package/dist/testing/rate_limiting.d.ts +1 -1
  173. package/dist/testing/rate_limiting.d.ts.map +1 -1
  174. package/dist/testing/rate_limiting.js +5 -4
  175. package/dist/testing/round_trip.d.ts +7 -0
  176. package/dist/testing/round_trip.d.ts.map +1 -1
  177. package/dist/testing/round_trip.js +8 -5
  178. package/dist/testing/schema_generators.d.ts +40 -11
  179. package/dist/testing/schema_generators.d.ts.map +1 -1
  180. package/dist/testing/schema_generators.js +71 -17
  181. package/dist/testing/stubs.d.ts +10 -1
  182. package/dist/testing/stubs.d.ts.map +1 -1
  183. package/dist/testing/stubs.js +15 -5
  184. package/dist/testing/surface_invariants.d.ts +36 -115
  185. package/dist/testing/surface_invariants.d.ts.map +1 -1
  186. package/dist/testing/surface_invariants.js +106 -269
  187. package/dist/testing/transports/raw_http.d.ts +10 -2
  188. package/dist/testing/transports/raw_http.d.ts.map +1 -1
  189. package/dist/testing/transports/raw_http.js +10 -4
  190. package/dist/ui/CLAUDE.md +4 -2
  191. package/dist/ui/auth_state.svelte.d.ts.map +1 -1
  192. package/dist/ui/auth_state.svelte.js +2 -8
  193. package/dist/ui/backend_probe.svelte.js +3 -3
  194. package/dist/ui/table_state.svelte.d.ts.map +1 -1
  195. package/dist/ui/table_state.svelte.js +1 -8
  196. package/dist/ui/ui_fetch.d.ts +12 -2
  197. package/dist/ui/ui_fetch.d.ts.map +1 -1
  198. package/dist/ui/ui_fetch.js +22 -4
  199. package/package.json +1 -1
@@ -3,14 +3,17 @@ import './assert_dev_env.js';
3
3
  * Adversarial input validation testing for route specs.
4
4
  *
5
5
  * Fires the payloads `adversarial_input_cases.ts` generates against a test
6
- * app and asserts 400 responses before handlers are reached.
6
+ * app and asserts 400 responses before handlers are reached, each with a
7
+ * code the route's own error map declares at 400 and a body its schema there
8
+ * accepts.
7
9
  *
8
10
  * @module
9
11
  */
10
12
  import { test, assert, describe } from 'vitest';
11
- import { filter_routes_with_input, filter_routes_with_params, filter_routes_with_query } from '../http/surface_query.js';
12
- import { ValidationError, ERROR_INVALID_REQUEST_BODY, ERROR_INVALID_JSON_BODY, ERROR_INVALID_ROUTE_PARAMS, ERROR_INVALID_QUERY_PARAMS } from '../http/error_schemas.js';
13
+ import { filter_routes_with_input, filter_routes_with_params, filter_routes_with_query, format_route_key } from '../http/surface_query.js';
14
+ import { ERROR_INVALID_REQUEST_BODY, ERROR_INVALID_JSON_BODY, ERROR_INVALID_ROUTE_PARAMS, ERROR_INVALID_QUERY_PARAMS } from '../http/error_schemas.js';
13
15
  import { create_auth_test_apps, create_route_skip_filter, select_auth_app } from './auth_apps.js';
16
+ import { assert_error_schema_valid } from './assertions.js';
14
17
  import { resolve_valid_path, to_route_content_type } from './schema_generators.js';
15
18
  import { generate_input_test_cases, generate_params_test_cases, generate_query_test_cases } from './adversarial_input_cases.js';
16
19
  // --- URL helpers ---
@@ -37,7 +40,7 @@ const build_query_url = (path, query) => {
37
40
  */
38
41
  export const describe_adversarial_input = (options) => {
39
42
  const { build, roles } = options;
40
- const { surface, route_specs } = build();
43
+ const { surface, route_specs, route_error_maps } = build();
41
44
  const is_skipped = create_route_skip_filter(options.skip_routes);
42
45
  const routes_with_input = filter_routes_with_input(surface).filter((r) => !is_skipped(r));
43
46
  const routes_with_params = filter_routes_with_params(surface).filter((r) => !is_skipped(r));
@@ -49,7 +52,7 @@ export const describe_adversarial_input = (options) => {
49
52
  // lookup RouteSpec by method+path for schema access
50
53
  const spec_lookup = new Map();
51
54
  for (const spec of route_specs) {
52
- spec_lookup.set(`${spec.method} ${spec.path}`, spec);
55
+ spec_lookup.set(format_route_key(spec), spec);
53
56
  }
54
57
  const apps = create_auth_test_apps(route_specs, roles);
55
58
  describe('adversarial input validation', () => {
@@ -57,7 +60,7 @@ export const describe_adversarial_input = (options) => {
57
60
  if (routes_with_input.length > 0) {
58
61
  // every surface route with input must have a matching RouteSpec
59
62
  const missing_specs = routes_with_input
60
- .map((r) => `${r.method} ${r.path}`)
63
+ .map((r) => format_route_key(r))
61
64
  .filter((key) => !spec_lookup.has(key));
62
65
  if (missing_specs.length > 0) {
63
66
  throw new Error(`adversarial_input: surface routes with input have no matching RouteSpec: ${missing_specs.join(', ')}`);
@@ -65,14 +68,14 @@ export const describe_adversarial_input = (options) => {
65
68
  let input_test_count = 0;
66
69
  describe('input body', () => {
67
70
  for (const route of routes_with_input) {
68
- const key = `${route.method} ${route.path}`;
71
+ const key = format_route_key(route);
69
72
  const spec = spec_lookup.get(key);
70
73
  const test_cases = generate_input_test_cases(spec.input);
71
74
  if (test_cases.length === 0)
72
75
  continue;
73
76
  input_test_count += test_cases.length;
74
77
  const app = select_auth_app(apps, route.auth);
75
- const base_url = resolve_valid_path(route.path, spec.params);
78
+ const base_url = resolve_valid_path(route.path, spec.params, options.param_values?.[key]);
76
79
  const is_get = route.method === 'GET';
77
80
  describe(key, () => {
78
81
  for (const tc of test_cases) {
@@ -99,10 +102,8 @@ export const describe_adversarial_input = (options) => {
99
102
  ? ERROR_INVALID_REQUEST_BODY
100
103
  : tc.expected_error;
101
104
  assert.strictEqual(body.error, expected_error, `Expected ${expected_error} for ${key} [${tc.label}], got: ${body.error}`);
102
- // validate response body structure matches error schema
103
- if (tc.expected_error === 'invalid_request_body') {
104
- ValidationError.parse(body);
105
- }
105
+ // the status and code are the route's own, and the body its schema there
106
+ assert_error_schema_valid(route_error_maps, route, 400, body);
106
107
  });
107
108
  }
108
109
  });
@@ -117,7 +118,7 @@ export const describe_adversarial_input = (options) => {
117
118
  let params_test_count = 0;
118
119
  describe('params', () => {
119
120
  for (const route of routes_with_params) {
120
- const key = `${route.method} ${route.path}`;
121
+ const key = format_route_key(route);
121
122
  const spec = spec_lookup.get(key);
122
123
  if (!spec?.params)
123
124
  continue;
@@ -137,8 +138,8 @@ export const describe_adversarial_input = (options) => {
137
138
  assert.strictEqual(res.status, 400, `Expected 400 for ${key} [${tc.label}], got ${res.status}`);
138
139
  const body = await res.json();
139
140
  assert.strictEqual(body.error, ERROR_INVALID_ROUTE_PARAMS, `Expected ${ERROR_INVALID_ROUTE_PARAMS} for ${key} [${tc.label}], got: ${body.error}`);
140
- // validate response body structure matches error schema
141
- ValidationError.parse(body);
141
+ // the status and code are the route's own, and the body its schema there
142
+ assert_error_schema_valid(route_error_maps, route, 400, body);
142
143
  });
143
144
  }
144
145
  });
@@ -157,7 +158,7 @@ export const describe_adversarial_input = (options) => {
157
158
  let query_test_count = 0;
158
159
  describe('query params', () => {
159
160
  for (const route of routes_with_query) {
160
- const key = `${route.method} ${route.path}`;
161
+ const key = format_route_key(route);
161
162
  const spec = spec_lookup.get(key);
162
163
  if (!spec?.query)
163
164
  continue;
@@ -166,7 +167,7 @@ export const describe_adversarial_input = (options) => {
166
167
  continue;
167
168
  query_test_count += test_cases.length;
168
169
  const app = select_auth_app(apps, route.auth);
169
- const base_url = resolve_valid_path(route.path, spec.params);
170
+ const base_url = resolve_valid_path(route.path, spec.params, options.param_values?.[key]);
170
171
  describe(key, () => {
171
172
  for (const tc of test_cases) {
172
173
  test(tc.label, async () => {
@@ -178,8 +179,8 @@ export const describe_adversarial_input = (options) => {
178
179
  assert.strictEqual(res.status, 400, `Expected 400 for ${key} [${tc.label}], got ${res.status}`);
179
180
  const body = await res.json();
180
181
  assert.strictEqual(body.error, ERROR_INVALID_QUERY_PARAMS, `Expected ${ERROR_INVALID_QUERY_PARAMS} for ${key} [${tc.label}], got: ${body.error}`);
181
- // validate response body structure matches error schema
182
- ValidationError.parse(body);
182
+ // the status and code are the route's own, and the body its schema there
183
+ assert_error_schema_valid(route_error_maps, route, 400, body);
183
184
  });
184
185
  }
185
186
  });
@@ -1,7 +1,7 @@
1
1
  import './assert_dev_env.js';
2
+ import type { AnySchema } from '@fuzdev/fuz_schema/schema.ts';
2
3
  import type { AppSurface, AppSurfaceRoute } from '../http/surface.js';
3
- import type { RouteErrorSchemas } from '../http/error_schemas.js';
4
- import { type ValidationSchema } from '../schema_issues.js';
4
+ import type { RouteErrorMap } from '../http/route_errors.js';
5
5
  /**
6
6
  * Resolve an absolute path relative to the caller's module.
7
7
  *
@@ -37,38 +37,70 @@ export declare const assert_surface_deterministic: (build_surface: () => AppSurf
37
37
  */
38
38
  export declare const assert_only_expected_public_routes: (surface: AppSurface, expected_public: Array<string>) => void;
39
39
  /**
40
- * Look up the merged error schema for a route+status from a pre-built schema lookup.
40
+ * Look up the error schema for a route+status in its error map.
41
41
  *
42
- * @param lookup - map from `"METHOD /path"` to merged error schemas
42
+ * @param lookup - map from `"METHOD /path"` to each route's error map (`AppSurfaceSpec.route_error_maps`)
43
43
  * @param route - the surface route to look up
44
44
  * @param status - HTTP status code
45
- * @returns the Zod or `@fuzdev/fuz_schema` schema for that route+status, or
45
+ * @returns the `@fuzdev/fuz_schema` schema for that route+status, or
46
46
  * `undefined` when no error schema is declared for the status code
47
47
  */
48
- export declare const get_route_error_schema: (lookup: Map<string, RouteErrorSchemas>, route: AppSurfaceRoute, status: number) => ValidationSchema | undefined;
48
+ export declare const get_route_error_schema: (lookup: ReadonlyMap<string, RouteErrorMap>, route: AppSurfaceRoute, status: number) => AnySchema | undefined;
49
49
  /**
50
- * Assert that an error schema exists for a route+status and validate the body against it.
50
+ * Assert that a route declares an error — its status, and its `error` code
51
+ * at that status — and that the body parses against the route's schema there.
52
+ * The schema at a status is a union of its definitions' bodies, each
53
+ * `error` a `literal` of its code for a definition made by `rest_error`
54
+ * (`to_error_schemas`), so a code the route
55
+ * doesn't declare at the status fails the parse.
51
56
  *
52
57
  * Protected routes should always have auto-derived error schemas (401 for authenticated,
53
58
  * 403 for role-restricted). A missing schema indicates a gap in error schema derivation.
54
59
  *
55
- * @param lookup - map from `"METHOD /path"` to merged error schemas
60
+ * @param lookup - map from `"METHOD /path"` to each route's error map (`AppSurfaceSpec.route_error_maps`)
56
61
  * @param route - the surface route to validate against
57
62
  * @param status - expected HTTP status code
58
63
  * @param body - the parsed response body to validate
59
64
  * @throws AssertionError if no schema is declared for the route+status pair.
60
- * @throws Error if the body does not satisfy the declared schema, its message
61
- * carrying the failed parse's issues (`parse_any`).
65
+ * @throws Error if the body does not satisfy the declared schema, a code the
66
+ * route doesn't declare at the status included, its message carrying the
67
+ * failed parse's issues (`parse_any`).
62
68
  */
63
- export declare const assert_error_schema_valid: (lookup: Map<string, RouteErrorSchemas>, route: AppSurfaceRoute, status: number, body: unknown) => void;
69
+ export declare const assert_error_schema_valid: (lookup: ReadonlyMap<string, RouteErrorMap>, route: AppSurfaceRoute, status: number, body: unknown) => void;
64
70
  /**
65
- * Verify every route under a path prefix has the exact expected middleware stack.
71
+ * Assert that a response is not an error its route leaves undeclared: a JSON
72
+ * body at an error status must be at a status the route's error map declares
73
+ * and parse against it, by the rule the DEV error check runs
74
+ * (`check_route_error` — a 500 `internal_error` and a 503
75
+ * `service_unavailable` always accepted, a JSON-RPC error envelope on a
76
+ * `jsonrpc` route not a REST error body). A success status or a non-JSON
77
+ * response passes.
78
+ *
79
+ * @param errors - the route's error map
80
+ * @param jsonrpc - whether the route answers JSON-RPC envelopes (`RouteSpec.jsonrpc`)
81
+ * @param response - the response, read through a clone
82
+ * @param label - what names the request in a failure
83
+ * @throws Error on a JSON error the route's map doesn't declare
84
+ */
85
+ export declare const assert_error_response_declared: (errors: RouteErrorMap, jsonrpc: boolean, response: Response, label: string) => Promise<void>;
86
+ /**
87
+ * Verify every route under a path prefix has the exact expected middleware
88
+ * stack, less the layers that carve it out.
89
+ *
90
+ * A route's expected stack is `expected_middleware` in order, without each
91
+ * name whose surface layers carve the route out: a layer of that name whose
92
+ * `path` applies to the route and one of whose `carve_outs` does too
93
+ * (`middleware_carves_out`), with no other layer of the name running on it
94
+ * (`middleware_spec_applies`) — the rule the surface's `applicable_middleware`
95
+ * and the route error map read. Anything else is held exactly: a route
96
+ * missing a name no carve-out explains fails, and so does a carved-out route
97
+ * still listing the name.
66
98
  *
67
99
  * @param surface - the app surface to check
68
100
  * @param path_prefix - prefix to filter routes (e.g. `'/api/'`)
69
- * @param expected_middleware - the exact middleware names in order
101
+ * @param expected_middleware - the full middleware names in order
70
102
  * @throws AssertionError if no routes match `path_prefix`, or if any matching
71
- * route's `applicable_middleware` does not deep-equal `expected_middleware`.
103
+ * route's `applicable_middleware` does not deep-equal its expected stack
72
104
  */
73
105
  export declare const assert_full_middleware_stack: (surface: AppSurface, path_prefix: string, expected_middleware: Array<string>) => void;
74
106
  //# sourceMappingURL=assertions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/assertions.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAgB7B,OAAO,KAAK,EAAE,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fs';
11
11
  import { resolve, dirname } from 'node:path';
12
12
  import { fileURLToPath } from 'node:url';
13
13
  import { assert } from 'vitest';
14
+ import { format_route_key } from '../http/surface_query.js';
14
15
  import { is_public_auth } from '../http/auth_shape.js';
15
16
  import { parse_any } from '../schema_issues.js';
17
+ import { check_route_error, format_route_error_check, is_error_status, is_json_response } from '../http/route_error_check.js';
18
+ import { middleware_applies, middleware_carves_out, middleware_spec_applies } from '../http/schema_helpers.js';
16
19
  /**
17
20
  * Resolve an absolute path relative to the caller's module.
18
21
  *
@@ -55,60 +58,114 @@ export const assert_only_expected_public_routes = (surface, expected_public) =>
55
58
  const expected = new Set(expected_public);
56
59
  const actual_public = surface.routes
57
60
  .filter((r) => is_public_auth(r.auth))
58
- .map((r) => `${r.method} ${r.path}`);
61
+ .map((r) => format_route_key(r));
59
62
  const unexpected = actual_public.filter((r) => !expected.has(r));
60
63
  const missing = expected_public.filter((r) => !actual_public.includes(r));
61
64
  assert.strictEqual(unexpected.length, 0, `Unexpected public routes: ${unexpected.join(', ')}`);
62
65
  assert.strictEqual(missing.length, 0, `Expected public routes missing: ${missing.join(', ')}`);
63
66
  };
64
67
  /**
65
- * Look up the merged error schema for a route+status from a pre-built schema lookup.
68
+ * Look up the error schema for a route+status in its error map.
66
69
  *
67
- * @param lookup - map from `"METHOD /path"` to merged error schemas
70
+ * @param lookup - map from `"METHOD /path"` to each route's error map (`AppSurfaceSpec.route_error_maps`)
68
71
  * @param route - the surface route to look up
69
72
  * @param status - HTTP status code
70
- * @returns the Zod or `@fuzdev/fuz_schema` schema for that route+status, or
73
+ * @returns the `@fuzdev/fuz_schema` schema for that route+status, or
71
74
  * `undefined` when no error schema is declared for the status code
72
75
  */
73
76
  export const get_route_error_schema = (lookup, route, status) => {
74
- const key = `${route.method} ${route.path}`;
75
- return lookup.get(key)?.[status];
77
+ return lookup.get(format_route_key(route))?.schemas[status];
76
78
  };
77
79
  /**
78
- * Assert that an error schema exists for a route+status and validate the body against it.
80
+ * Assert that a route declares an error — its status, and its `error` code
81
+ * at that status — and that the body parses against the route's schema there.
82
+ * The schema at a status is a union of its definitions' bodies, each
83
+ * `error` a `literal` of its code for a definition made by `rest_error`
84
+ * (`to_error_schemas`), so a code the route
85
+ * doesn't declare at the status fails the parse.
79
86
  *
80
87
  * Protected routes should always have auto-derived error schemas (401 for authenticated,
81
88
  * 403 for role-restricted). A missing schema indicates a gap in error schema derivation.
82
89
  *
83
- * @param lookup - map from `"METHOD /path"` to merged error schemas
90
+ * @param lookup - map from `"METHOD /path"` to each route's error map (`AppSurfaceSpec.route_error_maps`)
84
91
  * @param route - the surface route to validate against
85
92
  * @param status - expected HTTP status code
86
93
  * @param body - the parsed response body to validate
87
94
  * @throws AssertionError if no schema is declared for the route+status pair.
88
- * @throws Error if the body does not satisfy the declared schema, its message
89
- * carrying the failed parse's issues (`parse_any`).
95
+ * @throws Error if the body does not satisfy the declared schema, a code the
96
+ * route doesn't declare at the status included, its message carrying the
97
+ * failed parse's issues (`parse_any`).
90
98
  */
91
99
  export const assert_error_schema_valid = (lookup, route, status, body) => {
100
+ const key = format_route_key(route);
92
101
  const schema = get_route_error_schema(lookup, route, status);
93
- assert.ok(schema, `missing error schema for ${status} on ${route.method} ${route.path}`);
102
+ assert.ok(schema, `missing error schema for ${status} on ${key}`);
94
103
  const result = parse_any(schema, body);
95
104
  if (!result.ok) {
96
- throw new Error(`error schema mismatch for ${status} on ${route.method} ${route.path}: ${JSON.stringify(result.issues)}`);
105
+ throw new Error(`error schema mismatch for ${status} on ${key} (error ${JSON.stringify(body?.error)}): ${JSON.stringify(result.issues)}`);
97
106
  }
98
107
  };
99
108
  /**
100
- * Verify every route under a path prefix has the exact expected middleware stack.
109
+ * Assert that a response is not an error its route leaves undeclared: a JSON
110
+ * body at an error status must be at a status the route's error map declares
111
+ * and parse against it, by the rule the DEV error check runs
112
+ * (`check_route_error` — a 500 `internal_error` and a 503
113
+ * `service_unavailable` always accepted, a JSON-RPC error envelope on a
114
+ * `jsonrpc` route not a REST error body). A success status or a non-JSON
115
+ * response passes.
116
+ *
117
+ * @param errors - the route's error map
118
+ * @param jsonrpc - whether the route answers JSON-RPC envelopes (`RouteSpec.jsonrpc`)
119
+ * @param response - the response, read through a clone
120
+ * @param label - what names the request in a failure
121
+ * @throws Error on a JSON error the route's map doesn't declare
122
+ */
123
+ export const assert_error_response_declared = async (errors, jsonrpc, response, label) => {
124
+ if (!is_error_status(response.status))
125
+ return;
126
+ if (!is_json_response(response))
127
+ return;
128
+ let body;
129
+ try {
130
+ body = await response.clone().json();
131
+ }
132
+ catch {
133
+ return;
134
+ }
135
+ const check = check_route_error(errors, response.status, body, jsonrpc);
136
+ if (!check.ok) {
137
+ throw new Error(`${format_route_error_check(check, response.status, label)}: ${JSON.stringify(check.kind === 'schema_mismatch' ? check.issues : body)}`);
138
+ }
139
+ };
140
+ /**
141
+ * Verify every route under a path prefix has the exact expected middleware
142
+ * stack, less the layers that carve it out.
143
+ *
144
+ * A route's expected stack is `expected_middleware` in order, without each
145
+ * name whose surface layers carve the route out: a layer of that name whose
146
+ * `path` applies to the route and one of whose `carve_outs` does too
147
+ * (`middleware_carves_out`), with no other layer of the name running on it
148
+ * (`middleware_spec_applies`) — the rule the surface's `applicable_middleware`
149
+ * and the route error map read. Anything else is held exactly: a route
150
+ * missing a name no carve-out explains fails, and so does a carved-out route
151
+ * still listing the name.
101
152
  *
102
153
  * @param surface - the app surface to check
103
154
  * @param path_prefix - prefix to filter routes (e.g. `'/api/'`)
104
- * @param expected_middleware - the exact middleware names in order
155
+ * @param expected_middleware - the full middleware names in order
105
156
  * @throws AssertionError if no routes match `path_prefix`, or if any matching
106
- * route's `applicable_middleware` does not deep-equal `expected_middleware`.
157
+ * route's `applicable_middleware` does not deep-equal its expected stack
107
158
  */
108
159
  export const assert_full_middleware_stack = (surface, path_prefix, expected_middleware) => {
109
160
  const routes = surface.routes.filter((r) => r.path.startsWith(path_prefix));
110
161
  assert.ok(routes.length > 0, `No routes found under ${path_prefix}`);
162
+ const is_carved_out = (name, route_path) => {
163
+ const layers = surface.middleware.filter((m) => m.name === name);
164
+ return (layers.some((m) => middleware_applies(m.path, route_path) && middleware_carves_out(m, route_path)) && !layers.some((m) => middleware_spec_applies(m, route_path)));
165
+ };
111
166
  for (const route of routes) {
112
- assert.deepStrictEqual(route.applicable_middleware, expected_middleware, `${route.method} ${route.path} has wrong middleware stack`);
167
+ const carved = expected_middleware.filter((name) => is_carved_out(name, route.path));
168
+ const expected = expected_middleware.filter((name) => !carved.includes(name));
169
+ assert.deepStrictEqual(route.applicable_middleware, expected, `${route.method} ${route.path} has wrong middleware stack${carved.length > 0 ? ` (carved out of ${carved.join(', ')})` : ''}`);
113
170
  }
114
171
  };
@@ -1,6 +1,7 @@
1
1
  import './assert_dev_env.js';
2
- import { type SurfaceSecurityPolicyOptions, type ErrorSchemaTightnessOptions } from './surface_invariants.js';
3
- import { type AppSurfaceSpec } from '../http/surface.js';
2
+ import { type SurfaceSecurityPolicyOptions } from './surface_invariants.js';
3
+ import { type RouteParamValues } from './schema_generators.js';
4
+ import type { AppSurfaceSpec } from '../http/surface.js';
4
5
  /** Options for adversarial test runners (auth enforcement and input validation). */
5
6
  export interface AdversarialTestOptions {
6
7
  /** Build the app surface bundle (surface + route specs + middleware specs). */
@@ -15,6 +16,12 @@ export interface AdversarialTestOptions {
15
16
  * merely have a format is handled by the synthesizer.
16
17
  */
17
18
  skip_routes?: Array<string>;
19
+ /**
20
+ * Path param values for specific routes (`'METHOD /path'` → param name →
21
+ * value), used before the generated ones — needed for a `{re}` param whose
22
+ * pattern refuses the generated value. See `RouteParamValues`.
23
+ */
24
+ param_values?: RouteParamValues;
18
25
  }
19
26
  /**
20
27
  * Generate adversarial HTTP auth enforcement test suites.
@@ -29,22 +36,6 @@ export interface AdversarialTestOptions {
29
36
  * - correct auth passes guard — every protected route, assert not 401/403
30
37
  */
31
38
  export declare const describe_adversarial_auth: (options: AdversarialTestOptions) => void;
32
- /**
33
- * Merge a consumer's `error_schema_tightness` option with
34
- * `default_error_schema_tightness` so `allowlist` and `ignore_statuses` are
35
- * additive rather than replacing.
36
- *
37
- * - `undefined` → return the default as-is.
38
- * - `null` → return `null` (opt out of the assertion).
39
- * - object → spread the default, then consumer overrides for scalar fields
40
- * (`min_specificity`), then concat stock-then-consumer for the list fields
41
- * (`allowlist`, `ignore_statuses`) so consumer entries extend rather than
42
- * replace.
43
- *
44
- * Exported for direct use when a consumer calls `assert_error_schema_tightness`
45
- * outside the standard suite but still wants the additive merge.
46
- */
47
- export declare const resolve_standard_error_schema_tightness: (consumer: ErrorSchemaTightnessOptions | null | undefined) => ErrorSchemaTightnessOptions | null;
48
39
  /** Options for the standard attack surface test suite. */
49
40
  export interface StandardAttackSurfaceOptions {
50
41
  /** Build the app surface bundle (surface + route specs + middleware specs). */
@@ -61,19 +52,6 @@ export interface StandardAttackSurfaceOptions {
61
52
  api_path_prefix?: string;
62
53
  /** Security policy configuration. Omit for sensible defaults. */
63
54
  security_policy?: SurfaceSecurityPolicyOptions;
64
- /**
65
- * Error schema tightness assertion config. Defaults to
66
- * `default_error_schema_tightness` (ignores 401/403/429,
67
- * `min_specificity: 'enum'`, allowlist seeded with
68
- * `fuz_app_stock_route_tightness_allowlist`).
69
- *
70
- * Consumer-supplied `allowlist` and `ignore_statuses` are **additive** —
71
- * the suite merges them underneath the stock defaults, so project-specific
72
- * entries don't need to re-list fuz_app's own stock routes. Pass a narrower
73
- * config to extend either list or tighten `min_specificity`; pass `null`
74
- * to skip the assertion and keep the audit log informational-only.
75
- */
76
- error_schema_tightness?: ErrorSchemaTightnessOptions | null;
77
55
  /**
78
56
  * Routes the three adversarial sub-suites skip, in `'METHOD /path'` form
79
57
  * — the escape hatch every sibling suite carries (`round_trip`,
@@ -82,6 +60,11 @@ export interface StandardAttackSurfaceOptions {
82
60
  * handled by the params-schema-aware synthesizer.
83
61
  */
84
62
  skip_routes?: Array<string>;
63
+ /**
64
+ * Path param values for the three adversarial sub-suites, by route key and
65
+ * then param name. See `AdversarialTestOptions.param_values`.
66
+ */
67
+ param_values?: RouteParamValues;
85
68
  }
86
69
  /**
87
70
  * Run the standard attack surface test suite.
@@ -94,10 +77,9 @@ export interface StandardAttackSurfaceOptions {
94
77
  * 5. Surface invariants — structural assertions over `surface.routes` (error schemas, descriptions, duplicates, consistency)
95
78
  * 6. RPC/WS surface invariants — structural assertions over `surface.rpc_endpoints` + `surface.ws_endpoints` (descriptions, protocol-action spread, kind ⇔ auth)
96
79
  * 7. Security policy — rate limiting on sensitive routes, no unexpected public mutations, method conventions
97
- * 8. Error schema tightness — informational log of generic vs specific error schemas, plus assertion against `default_error_schema_tightness` by default (opt out with `error_schema_tightness: null`)
98
- * 9. Adversarial auth — unauthenticated/wrong-role/correct-auth enforcement
99
- * 10. Adversarial input — input body and params validation
100
- * 11. Adversarial 404 — stub 404 handlers, validate response bodies against declared schemas
80
+ * 8. Adversarial auth — unauthenticated/wrong-role/correct-auth enforcement, every refusal a status and code of the route's own error map
81
+ * 9. Adversarial input — input body and params validation, each 400 a code of the route's own map
82
+ * 10. Adversarial 404 — stub 404 handlers, validate response bodies against the route's declared 404
101
83
  *
102
84
  * Consumer test files call this with project-specific options, then add
103
85
  * any project-specific assertions in additional `describe` blocks.
@@ -1 +1 @@
1
- {"version":3,"file":"attack_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/attack_surface.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAoB7B,OAAO,EAQN,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,MAAM,yBAAyB,CAAC;AAejC,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAwDpF,oFAAoF;AACpF,MAAM,WAAW,sBAAsB;IACtC,+EAA+E;IAC/E,KAAK,EAAE,MAAM,cAAc,CAAC;IAC5B,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB;;;;;;OAMG;IACH,WAAW,CAA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