@fuzdev/fuz_app 0.164.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.
- package/dist/http/CLAUDE.md +2 -1
- package/dist/http/route_error_check.d.ts +21 -0
- package/dist/http/route_error_check.d.ts.map +1 -1
- package/dist/http/route_error_check.js +37 -1
- package/dist/http/schema_helpers.d.ts +15 -1
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +12 -3
- package/dist/testing/CLAUDE.md +75 -25
- package/dist/testing/admin_integration.js +1 -1
- package/dist/testing/adversarial_404.js +1 -1
- package/dist/testing/adversarial_input.js +2 -2
- package/dist/testing/assertions.d.ts +13 -3
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +21 -4
- package/dist/testing/attack_surface.d.ts +12 -0
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +8 -5
- package/dist/testing/cross_backend/in_process_setup.d.ts +7 -3
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +11 -4
- package/dist/testing/cross_backend/spine_suites.d.ts +3 -2
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +5 -2
- package/dist/testing/cross_backend/standard.d.ts +31 -0
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +9 -3
- package/dist/testing/data_exposure.d.ts +7 -0
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +3 -3
- package/dist/testing/error_coverage.d.ts +35 -33
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +53 -43
- package/dist/testing/integration.d.ts +28 -1
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +51 -18
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +4 -15
- package/dist/testing/middleware_gate_probes.d.ts +90 -0
- package/dist/testing/middleware_gate_probes.d.ts.map +1 -0
- package/dist/testing/middleware_gate_probes.js +179 -0
- package/dist/testing/round_trip.d.ts +7 -0
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +3 -2
- package/dist/testing/schema_generators.d.ts +31 -9
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +53 -11
- package/dist/testing/transports/raw_http.d.ts +10 -2
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +10 -4
- package/package.json +1 -1
package/dist/http/CLAUDE.md
CHANGED
|
@@ -18,7 +18,7 @@ effects, see ../../../docs/architecture.md.
|
|
|
18
18
|
- `http/auth_shape.ts` — canonical `RouteAuth` type + `AuthAxisState` + predicates + the registration-time checks: `assert_route_auth_invariants` (the cross-axis invariants 1, 3, 4) and `assert_route_auth_acting_biconditional` (invariant 2), both run by `apply_route_specs` and `compile_action_registry` on every spec.
|
|
19
19
|
- `http/error_schemas.ts` — `ERROR_*` constants, the per-code REST error definitions (`rest_error`, `REST_*`), `derive_route_errors`, `to_error_schemas`.
|
|
20
20
|
- `http/route_errors.ts` — the route error map: `RouteErrorMap`, `resolve_route_error_map`, `resolve_app_route_error_maps`, `get_route_error_map`.
|
|
21
|
-
- `http/route_error_check.ts` — `check_route_error` (whether an error response is one its route's map declares, the rule the DEV error check and `assert_response_matches_spec` share; `ALWAYS_ACCEPTED_ERRORS`, `is_error_status`, `format_route_error_check`) `is_json_response`, and the test helpers' hono-free route lookup (`split_route_template` and `parse_route_param`, a template read segment by segment as Hono's `getPattern` reads it; `compile_route_path`; `to_mounted_routes`; `find_mounted_route`), whose reading `resolve_valid_path` also fills params by. Hono-free and `esm-env`-free.
|
|
21
|
+
- `http/route_error_check.ts` — `check_route_error` (whether an error response is one its route's map declares, the rule the DEV error check and `assert_response_matches_spec` share; `ALWAYS_ACCEPTED_ERRORS`, `is_error_status`, `format_route_error_check`) `is_json_response`, and the test helpers' hono-free route lookup (`split_route_template` and `parse_route_param`, a template read segment by segment as Hono's `getPattern` reads it; `compile_route_path`; `compile_route_param_pattern`, a `{re}` grouped and anchored as `compile_route_path` reads it — Hono's RegExpRouter reading, stricter than TrieRouter's ungrouped `^re$`; `decode_route_path`, a path as Hono's router decodes it; `to_mounted_routes`; `find_mounted_route`), whose reading `resolve_valid_path` also fills params by. Hono-free and `esm-env`-free.
|
|
22
22
|
- `http/dev_route_error_check.ts` — `create_dev_route_error_check({route_specs, route_error_maps, log})`: the DEV-only outer error check, `null` outside DEV; `create_route_lookup`, its lookup by Hono's own router.
|
|
23
23
|
- `http/schema_helpers.ts` — shared schema introspection (null/void/strict/surface/middleware-applies), and `to_void_params` / `to_input_params` / `json_has_own_proto_key` / `safe_parse_dropping_unknown_keys`.
|
|
24
24
|
- `http/middleware_spec.ts` — `MiddlewareSpec` interface.
|
|
@@ -286,6 +286,7 @@ Key helpers:
|
|
|
286
286
|
- `is_strict_object_schema(schema)` — detects `z.strictObject()` by checking `schema.def.catchall instanceof z.ZodNever`, or a fuz_schema `object` (not `strip_object` / `loose_object`); a fuz_schema `pipe` is read through to its first schema when no stage is a `transform` (so a refined `object` reads strict), while any Zod `ZodPipe` — even `O.pipe(O)` with no transform — reads not strict
|
|
287
287
|
- `schema_to_surface(schema, {io?, source?, on_unrepresentable?}?)` — throws first on a value of neither library (`assert_validation_schema`, naming `source`, so an assembled app's slot of neither library fails boot as registration would refuse it, not as an unwritable JSON Schema); Zod or fuz_schema → JSON Schema (`z.toJSONSchema` or fuz_schema's `to_json_schema`, by `is_schema`), on the side `io` names (`'output'` by default), with `$schema` and `default` keys stripped recursively (defaults may be non-deterministic; `$schema` is snapshot noise). `null` for a null or void schema. A part JSON Schema can't say (an output-side transform, a `z.custom()`, a fuz_schema `check`) is left out or written as `{}` (`unrepresentable: 'any'`) and reported to `on_unrepresentable`; a schema with nothing describable (`{}` from a schema other than `z.unknown()` / `z.any()`) or one an emitter refuses outright throws, prefixed with `source` — so a root-level transform output (`z.unknown().transform(f)` included), `z.custom()` or `z.date()` fails server assembly. It never answers `null` for a failure, which would read as "no input" and drop the schema from every suite that reads the surface
|
|
288
288
|
- `middleware_applies(mw_path, route_path)` — Hono pattern matching: `'*'`, exact, `'/api/*'` prefix (handles `prefix.slice(0, -1)` so `/api/*` also matches the bare `/api`)
|
|
289
|
+
- `middleware_carves_out(spec, route_path)` — one of the layer's `carve_outs` applies to the route; the carve-out half of `middleware_spec_applies`, which `assert_full_middleware_stack` reads to relax a carved-out route's expected stack
|
|
289
290
|
- `middleware_spec_applies(spec, route_path)` — the layer runs on the route: its `path` applies and none of its `carve_outs` does; what the route error map takes middleware definitions by
|
|
290
291
|
|
|
291
292
|
## Surface Generation
|
|
@@ -108,6 +108,27 @@ export declare const parse_route_param: (segment: string) => RouteParam | null;
|
|
|
108
108
|
* @param template - a route's path template
|
|
109
109
|
*/
|
|
110
110
|
export declare const split_route_template: (template: string) => Array<string>;
|
|
111
|
+
/**
|
|
112
|
+
* Compile the `re` of a `:name{re}` param to the `RegExp` a value of the param
|
|
113
|
+
* must match, grouped and anchored at both ends, `^(?:re)$`, as
|
|
114
|
+
* `compile_route_path` reads it inside a template. That is Hono's RegExpRouter
|
|
115
|
+
* reading; its TrieRouter, which SmartRouter falls back to for some route
|
|
116
|
+
* sets, anchors `^re$` and leaves a top-level alternation ungrouped, so
|
|
117
|
+
* `^a|b$` takes `ab` where the grouped form refuses it. The grouped form is
|
|
118
|
+
* the stricter of the two: a value it accepts both routers accept. Test it
|
|
119
|
+
* against the value as Hono reads it (`decode_route_path`).
|
|
120
|
+
*
|
|
121
|
+
* @param pattern - the param's `re` (`RouteParam.pattern`)
|
|
122
|
+
*/
|
|
123
|
+
export declare const compile_route_param_pattern: (pattern: string) => RegExp;
|
|
124
|
+
/**
|
|
125
|
+
* A request path, or a part of one, as Hono's router reads it: percent-decoded
|
|
126
|
+
* by `decodeURI` with `%25` kept, so an encoded `/`, `#`, `?` or `%` stays
|
|
127
|
+
* encoded, or the raw text when decoding fails.
|
|
128
|
+
*
|
|
129
|
+
* @param path - the request pathname, or a percent-encoded segment of one
|
|
130
|
+
*/
|
|
131
|
+
export declare const decode_route_path: (path: string) => string;
|
|
111
132
|
/**
|
|
112
133
|
* Compile a Hono path template to a `RegExp` over request paths, reading it
|
|
113
134
|
* as Hono 4's routers do: the template is split on `/` with each `{…}` group
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_error_check.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_error_check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAGN,KAAK,YAAY,EACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,YAAY,CAG9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,OAAwB,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,QAAQ,KAAG,OACsB,CAAC;AAE7E,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GACxB;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GACZ;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,mBAAmB,CAAA;CAAE,GACxC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;CAAE,CAAC;AAEnE;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC7B,QAAQ,aAAa,EACrB,QAAQ,MAAM,EACd,MAA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AkB,GAAI,UAAU,MAAM,KAAG,MASrD,CAAC;AAEF,+GAA+G;AAC/G,MAAM,WAAW,YAAY,CAAC,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;CAClB;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC7B,MAAM,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACjE,CAAC,EAED,QAAQ,aAAa,CAAC,MAAM,CAAC,EAC7B,UAAU,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,KAC5B,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAKpB,CAAC;AAEL;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EACnC,QAAQ,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EACtC,QAAQ,MAAM,EACd,MAAM,MAAM,KACV,CAAC,GAAG,SAMN,CAAC"}
|
|
@@ -161,6 +161,42 @@ const expand_optional_params = (template) => {
|
|
|
161
161
|
}
|
|
162
162
|
return results.filter((v, i, a) => a.indexOf(v) === i);
|
|
163
163
|
};
|
|
164
|
+
/**
|
|
165
|
+
* The regexp source of a `{re}` param's pattern, grouped so an alternation
|
|
166
|
+
* stays inside it, as Hono's RegExpRouter reads it.
|
|
167
|
+
*/
|
|
168
|
+
const to_route_param_source = (pattern) => `(?:${pattern})`;
|
|
169
|
+
/**
|
|
170
|
+
* Compile the `re` of a `:name{re}` param to the `RegExp` a value of the param
|
|
171
|
+
* must match, grouped and anchored at both ends, `^(?:re)$`, as
|
|
172
|
+
* `compile_route_path` reads it inside a template. That is Hono's RegExpRouter
|
|
173
|
+
* reading; its TrieRouter, which SmartRouter falls back to for some route
|
|
174
|
+
* sets, anchors `^re$` and leaves a top-level alternation ungrouped, so
|
|
175
|
+
* `^a|b$` takes `ab` where the grouped form refuses it. The grouped form is
|
|
176
|
+
* the stricter of the two: a value it accepts both routers accept. Test it
|
|
177
|
+
* against the value as Hono reads it (`decode_route_path`).
|
|
178
|
+
*
|
|
179
|
+
* @param pattern - the param's `re` (`RouteParam.pattern`)
|
|
180
|
+
*/
|
|
181
|
+
export const compile_route_param_pattern = (pattern) => new RegExp(`^${to_route_param_source(pattern)}$`);
|
|
182
|
+
/**
|
|
183
|
+
* A request path, or a part of one, as Hono's router reads it: percent-decoded
|
|
184
|
+
* by `decodeURI` with `%25` kept, so an encoded `/`, `#`, `?` or `%` stays
|
|
185
|
+
* encoded, or the raw text when decoding fails.
|
|
186
|
+
*
|
|
187
|
+
* @param path - the request pathname, or a percent-encoded segment of one
|
|
188
|
+
*/
|
|
189
|
+
export const decode_route_path = (path) => {
|
|
190
|
+
if (!path.includes('%'))
|
|
191
|
+
return path;
|
|
192
|
+
try {
|
|
193
|
+
return decodeURI(path.replaceAll('%25', '%2525'));
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
// a malformed escape: Hono matches the raw path
|
|
197
|
+
return path;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
164
200
|
/** The regexp source of a template with no optional param. */
|
|
165
201
|
const to_route_path_source = (template) => {
|
|
166
202
|
const segments = split_route_template(template);
|
|
@@ -174,7 +210,7 @@ const to_route_path_source = (template) => {
|
|
|
174
210
|
}
|
|
175
211
|
const param = PARAM_SEGMENT.exec(segment);
|
|
176
212
|
if (param) {
|
|
177
|
-
source += param[2] ?
|
|
213
|
+
source += param[2] ? `/${to_route_param_source(param[2])}` : '/[^/]+';
|
|
178
214
|
continue;
|
|
179
215
|
}
|
|
180
216
|
if (segment.includes('*')) {
|
|
@@ -222,9 +222,23 @@ export declare const middleware_applies: (mw_path: string, route_path: string) =
|
|
|
222
222
|
* @param b - the other
|
|
223
223
|
*/
|
|
224
224
|
export declare const middleware_paths_overlap: (a: string, b: string) => boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Check if a middleware layer carves a route path out: one of its
|
|
227
|
+
* `carve_outs` applies to it (`middleware_applies`), whether or not its own
|
|
228
|
+
* `path` does.
|
|
229
|
+
*
|
|
230
|
+
* @param spec - the layer's optional `carve_outs`
|
|
231
|
+
* @param route_path - the route path to check
|
|
232
|
+
*/
|
|
233
|
+
export declare const middleware_carves_out: (spec: {
|
|
234
|
+
readonly carve_outs?: ReadonlyArray<{
|
|
235
|
+
readonly path: string;
|
|
236
|
+
}> | null;
|
|
237
|
+
}, route_path: string) => boolean;
|
|
225
238
|
/**
|
|
226
239
|
* Check if a middleware layer runs on a route path: its `path` pattern
|
|
227
|
-
* applies (`middleware_applies`) and none of its `carve_outs` does
|
|
240
|
+
* applies (`middleware_applies`) and none of its `carve_outs` does
|
|
241
|
+
* (`middleware_carves_out`).
|
|
228
242
|
*
|
|
229
243
|
* @param spec - the layer's `path` and optional `carve_outs`
|
|
230
244
|
* @param route_path - the route path to check
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/schema_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,EAIN,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,gBAAgB,KAAG,OAEc,CAAC;AAEzE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,gBAAgB,KAAG,OAEmB,CAAC;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,OAAO,KAAG,OAUpD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,gBAAgB,EAAE,YAAY,OAAO,KAAG,OACP,CAAC;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AC9B,OA+BF,CAAC;AAoBF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,EAAE,YAAY,MAAM,KAAG,OAQxE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,OAM/D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GACjC,MAAM;IAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI,CAAA;CAAE,EAC/E,YAAY,MAAM,KAChB,OACyF,CAAC;AAE7F;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GACnC,MAAM;IACL,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;CACtE,EACD,YAAY,MAAM,KAChB,OAAgG,CAAC"}
|
|
@@ -447,12 +447,21 @@ export const middleware_paths_overlap = (a, b) => {
|
|
|
447
447
|
const base = (pattern) => pattern.endsWith('/*') ? pattern.slice(0, -2) : pattern;
|
|
448
448
|
return middleware_applies(a, base(b)) || middleware_applies(b, base(a));
|
|
449
449
|
};
|
|
450
|
+
/**
|
|
451
|
+
* Check if a middleware layer carves a route path out: one of its
|
|
452
|
+
* `carve_outs` applies to it (`middleware_applies`), whether or not its own
|
|
453
|
+
* `path` does.
|
|
454
|
+
*
|
|
455
|
+
* @param spec - the layer's optional `carve_outs`
|
|
456
|
+
* @param route_path - the route path to check
|
|
457
|
+
*/
|
|
458
|
+
export const middleware_carves_out = (spec, route_path) => (spec.carve_outs ?? []).some((carve_out) => middleware_applies(carve_out.path, route_path));
|
|
450
459
|
/**
|
|
451
460
|
* Check if a middleware layer runs on a route path: its `path` pattern
|
|
452
|
-
* applies (`middleware_applies`) and none of its `carve_outs` does
|
|
461
|
+
* applies (`middleware_applies`) and none of its `carve_outs` does
|
|
462
|
+
* (`middleware_carves_out`).
|
|
453
463
|
*
|
|
454
464
|
* @param spec - the layer's `path` and optional `carve_outs`
|
|
455
465
|
* @param route_path - the route path to check
|
|
456
466
|
*/
|
|
457
|
-
export const middleware_spec_applies = (spec, route_path) => middleware_applies(spec.path, route_path) &&
|
|
458
|
-
!(spec.carve_outs ?? []).some((carve_out) => middleware_applies(carve_out.path, route_path));
|
|
467
|
+
export const middleware_spec_applies = (spec, route_path) => middleware_applies(spec.path, route_path) && !middleware_carves_out(spec, route_path);
|
package/dist/testing/CLAUDE.md
CHANGED
|
@@ -416,7 +416,7 @@ or Postgres and runs in the `cross-ts` CI job.
|
|
|
416
416
|
- `assert_surface_matches_snapshot(surface, path)` — compares live `AppSurface` against a committed JSON snapshot; failure message instructs `gro gen`.
|
|
417
417
|
- `assert_surface_deterministic(build_surface)` — build twice, `deepStrictEqual` results; catches nondeterminism in surface generation.
|
|
418
418
|
- `assert_only_expected_public_routes(surface, list)` — bidirectional: no unexpected public routes, no missing expected ones. Format: `['GET /health', 'POST /api/account/login']`.
|
|
419
|
-
- `assert_full_middleware_stack(surface, prefix, mws)` — every route under `prefix` has exactly `mws` as its middleware chain.
|
|
419
|
+
- `assert_full_middleware_stack(surface, prefix, mws)` — every route under `prefix` has exactly `mws` as its middleware chain, less each layer that carves it out (a layer whose `path` and one of whose `carve_outs` apply to the route, `middleware_carves_out`, with no other layer of its name running there) — the rule `applicable_middleware` and the route error map read. A route missing a layer no carve-out explains fails, and so does a carved-out route still listing it.
|
|
420
420
|
- `get_route_error_schema(lookup, route, status)` — reads the route's error map (`lookup` is `AppSurfaceSpec.route_error_maps`) at a status, a fuz_schema schema.
|
|
421
421
|
- `assert_error_schema_valid(lookup, route, status, body)` — assert the route declares the status, and the body parses against the status's schema (`parse_any`), a union of its definitions' `literal(code)` bodies, so a code the route doesn't declare at the status fails the parse; a mismatch throws an `Error` carrying the issues. Every adversarial refusal runs through it.
|
|
422
422
|
- `assert_error_response_declared(errors, jsonrpc, response, label)` — a JSON error response (400 and up) is one the route's map declares, by `check_route_error` (the DEV error check's rule: 500 `internal_error` / 503 `service_unavailable` always accepted, a JSON-RPC envelope on a `jsonrpc` route skipped, a success or non-JSON response passing); what the attack-surface suite's `correct auth passes guard` holds each answer to.
|
|
@@ -473,15 +473,22 @@ each code of each route's error map (`resolve_route_error_map`), one path per
|
|
|
473
473
|
takes the maps (`AppSurfaceSpec.route_error_maps`, middleware included); without
|
|
474
474
|
them a route's own map is read. The standard suites pass
|
|
475
475
|
`surface_source.route_error_maps`.
|
|
476
|
-
Observations live in a `Set<string>` keyed by `"METHOD /spec-path:STATUS"`
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
476
|
+
Observations live in a `Set<string>` keyed by `"METHOD /spec-path:STATUS:CODE"`
|
|
477
|
+
for an observation with a code, which covers that path alone (a
|
|
478
|
+
`forbidden_origin` 403 leaves `credential_type_required` uncovered), or
|
|
479
|
+
`"METHOD /spec-path:STATUS"` for one recorded with a `null` code (a response
|
|
480
|
+
that carries none), which satisfies the "any-code" rule for every code declared
|
|
481
|
+
at that status — asked for explicitly, never had by omission.
|
|
480
482
|
|
|
481
483
|
Methods:
|
|
482
484
|
|
|
483
|
-
- `record(specs, method, path, status, code
|
|
484
|
-
|
|
485
|
+
- `record(specs, method, path, status, code: string | null)` — resolves concrete
|
|
486
|
+
paths back to spec templates (e.g. `/api/accounts/abc` → `/api/accounts/:id`);
|
|
487
|
+
`code` is the body's `error`, `null` only for a response that has none.
|
|
488
|
+
- `assert_and_record(specs, method, path, response, code?)` — wraps
|
|
489
|
+
`assert_response_matches_spec` and reads `body.error` from the JSON body via
|
|
490
|
+
`response.clone()` (`null` when there is none). Pass `code` when the body was
|
|
491
|
+
already consumed; without it a consumed body throws.
|
|
485
492
|
- `uncovered(specs, options?)` — one `{method, path, status, code}` row per declared code never observed.
|
|
486
493
|
|
|
487
494
|
Support functions:
|
|
@@ -502,7 +509,7 @@ naming it.
|
|
|
502
509
|
- `detect_format(field_schema)` — `detect_json_schema_format` over `to_field_json_schema`: the `format`, `'pattern'` for a regex, or `null`.
|
|
503
510
|
- `generate_valid_value(field, field_schema)` — base-type switch producing a valid sample (UUIDs → nil UUID, strings → `'xxxxxxxxxx'`, numbers → `1`, objects → `generate_valid_object` against the field schema, so a nested refinement is satisfied too, enums → first entry, records → `{}`, a void field → `undefined`, etc.). For branded-string refinements, walks a fallback chain synthesized from the `pattern` string the JSON Schema representation exposes: fixed-length hex (`^[0-9a-f]{N}$` — blake3 / sha256 / md5 digests; `0`.repeat(N)), prefix-lengthed slug (`^<prefix>_[A-Za-z0-9_-]{N}$` — `ApiTokenId`-style ids; `<prefix>_` + `x`.repeat(N)), absolute path prefix, URL prefix, two `/`-joined segments (an `owner/name` slug). First candidate the field accepts is used.
|
|
504
511
|
- `generate_valid_string_param(field, field_schema)` — a string a URL-sourced field (route param, query value) accepts: the nil UUID for a UUID field, else the first of `test_value`, the generated valid value as a string, `1`, `0`, `true`, `false`, the field's JSON Schema `default` or lower bound as a string (a preprocessed integer whose minimum is above one) and a synthesized string the field accepts; `null` when none does. The params and query case generators build their base from it.
|
|
505
|
-
- `resolve_valid_path(path, params_schema?)` — swaps each whole param segment (`:name`, `:name{re}`, optional or not, read as Hono reads a template: `split_route_template` / `parse_route_param`) for a value the params schema accepts; a `:` inside a literal segment (`files:upload`) stays. Prefers `test_<name>` wherever the field schema admits it (the param name keeps failure messages readable); otherwise a UUID param takes the nil UUID and anything else is synthesized from the schema, percent-encoded. A synthesized value containing `/` is refused (it would route elsewhere) and falls back to `test_<name>`.
|
|
512
|
+
- `resolve_valid_path(path, params_schema?, param_values?)` — swaps each whole param segment (`:name`, `:name{re}`, optional or not, read as Hono reads a template: `split_route_template` / `parse_route_param`) for a value the params schema accepts; a `:` inside a literal segment (`files:upload`) stays. Prefers `test_<name>` wherever the field schema admits it (the param name keeps failure messages readable); otherwise a UUID param takes the nil UUID and anything else is synthesized from the schema, percent-encoded. A synthesized value containing `/` is refused (it would route elsewhere) and falls back to `test_<name>`. A value in `param_values` (the route's entry of `RouteParamValues`, `'METHOD /path'` → param name → value, the option the path-resolving suites take) comes first, percent-encoded like the rest. A `:name{re}` param's value, supplied or generated, must match its pattern grouped and anchored, `^(?:re)$` (`compile_route_param_pattern`, over the value as Hono decodes it, `decode_route_path`) — Hono's RegExpRouter reading, the stricter of its routers', as TrieRouter leaves a top-level alternation ungrouped — else it throws naming the route and the param and pointing at `param_values`: no value is guessed from the pattern, and no route is skipped silently. A `param_values` entry naming no param of the path throws too, and so does a supplied `''`, `.` or `..` (the URL normalizes it away) or a lone surrogate. Supplied values are always encoded, so a `{re}` needing a literal `/` can't be met by one.
|
|
506
513
|
- `to_route_content_type(route)` — the `Content-Type` a well-formed request to the route sends: `application/json`, or `application/octet-stream` for a `raw_body` route. Every `POST` route refuses anything else with 415 before its other gates, so every probe in the harnesses (auth, params and query fuzz, 404, data exposure, round trip) sends it, body or not.
|
|
507
514
|
- `generate_valid_object(object_schema, schema) => {value, result}` — required and defaulted fields; when `schema` (refinements included) refuses those, each optional field alone in declaration order, the first that parses; failing that, the optional fields added cumulatively until it parses. Covers a `.refine()` over optional fields (at least one of, exactly one of, both of) at any depth, and, where one optional field suffices, keeps the others (an `acting` declared first) out. Returns the last `parse_any` result (`GeneratedObject`) and leaves the throw to the caller, which renders its issues with `format_issues` (`schema_issues.ts`).
|
|
508
515
|
- `generate_valid_object_with_field(object_schema, schema, base, field)` — a valid object carrying `field`, built from the valid `base`: `base` itself when it carries the field; else the field joins `base`, with the optional fields `base` omits filled as `generate_valid_object` fills them (a pair rule: `scope_kind` needs `scope_id`); failing that, the field replaces `base`'s optional fields, refilled around it (exactly one of: adding `slug` drops `id`). `null` when no object the generator builds carries the field. The body a single-fault case on a field the base omits changes.
|
|
@@ -534,7 +541,7 @@ case per route):
|
|
|
534
541
|
4. **adversarial input validation** — delegated to `describe_adversarial_input`.
|
|
535
542
|
5. **adversarial 404 response validation** — delegated to `describe_adversarial_404`.
|
|
536
543
|
|
|
537
|
-
Options: `{build: () => AppSurfaceSpec, snapshot_path, expected_public_routes, expected_api_middleware, roles, api_path_prefix?, security_policy?, skip_routes?}`.
|
|
544
|
+
Options: `{build: () => AppSurfaceSpec, snapshot_path, expected_public_routes, expected_api_middleware, roles, api_path_prefix?, security_policy?, skip_routes?, param_values?}`.
|
|
538
545
|
|
|
539
546
|
`skip_routes` is a list of `'METHOD /path'` surface keys the three
|
|
540
547
|
adversarial sub-suites drop, forwarded to each of them (it also sits on
|
|
@@ -543,7 +550,9 @@ adversarial sub-suites drop, forwarded to each of them (it also sits on
|
|
|
543
550
|
escape hatch for a route that cannot be driven generically at all — a
|
|
544
551
|
handler needing real seeded state, a path segment no schema describes. A
|
|
545
552
|
route whose params merely carry a format needs no entry: `resolve_valid_path`
|
|
546
|
-
synthesizes a segment the route accepts.
|
|
553
|
+
synthesizes a segment the route accepts. A `{re}` param whose pattern refuses
|
|
554
|
+
every generated value takes a `param_values` entry instead, forwarded the same
|
|
555
|
+
way (`RouteParamValues`).
|
|
547
556
|
|
|
548
557
|
Also exported: `describe_adversarial_auth(options)` (group 3 on its own).
|
|
549
558
|
|
|
@@ -636,7 +645,7 @@ For every route spec, fires a valid request with matching auth and validates
|
|
|
636
645
|
the response against declared schemas. DB-backed via `create_test_app`.
|
|
637
646
|
Per-route test (`test.each`) — one line per route in the vitest output.
|
|
638
647
|
|
|
639
|
-
Options: `{setup_test, surface_source, skip_routes?, input_overrides?, success_fixtures?}`.
|
|
648
|
+
Options: `{setup_test, surface_source, skip_routes?, input_overrides?, success_fixtures?, param_values?}`.
|
|
640
649
|
Principals and the 401 check are the RPC round-trip's (`pick_auth_principal`;
|
|
641
650
|
`assert_route_authenticated` over `is_unauthenticated_refusal`, reading the
|
|
642
651
|
flat `error`), and a non-`GET` route called as the authed
|
|
@@ -793,7 +802,7 @@ has no JSON Schema form and a field inside a transformed subtree shows only
|
|
|
793
802
|
there. The input side is a superset, so a transform that deliberately drops a
|
|
794
803
|
blocklisted field is flagged too — skip that output by its key.
|
|
795
804
|
|
|
796
|
-
Options: `{setup_test, surface_source, sensitive_fields?, admin_only_fields?, skip_routes?}`.
|
|
805
|
+
Options: `{setup_test, surface_source, sensitive_fields?, admin_only_fields?, skip_routes?, param_values?}`.
|
|
797
806
|
`skip_routes` keys a route as `'METHOD /path'`, an RPC or WS method output
|
|
798
807
|
as `'/path method_name'`, and pushed WS params as `'/path method_name params'`
|
|
799
808
|
(the schema-level checks only).
|
|
@@ -839,20 +848,54 @@ these thematic areas:
|
|
|
839
848
|
9. Token revocation + cross-account isolation
|
|
840
849
|
10. Response body schema validation + error-response information leakage
|
|
841
850
|
11. Signup invite edge cases + expired credential rejection + error-coverage breadth
|
|
851
|
+
12. Middleware gates — one test per gate each counted route's error map declares (`middleware_gate_probes.ts`, below)
|
|
842
852
|
|
|
843
853
|
An `ErrorCoverageCollector` runs across groups; `afterAll` filters to
|
|
844
|
-
|
|
845
|
-
and asserts `DEFAULT_INTEGRATION_ERROR_COVERAGE` (20%). Bootstrap is
|
|
854
|
+
the routes it counts — login, logout, password, signup (when wired) and the
|
|
855
|
+
RPC path — and asserts `DEFAULT_INTEGRATION_ERROR_COVERAGE` (20%). Bootstrap is
|
|
846
856
|
excluded because no describe block in this suite drives it — its declared
|
|
847
857
|
codes would always be uncovered. Consumer-specific routes aren't exercised
|
|
848
858
|
here either — they don't count against the baseline. The declared paths are
|
|
849
859
|
the route error maps of `surface_source`, middleware included (the origin
|
|
850
|
-
check's 403, the body limit's 413 and 400
|
|
860
|
+
check's 403, the body limit's 413 and 400, and the Rust spine's host gate's
|
|
861
|
+
403 where the surface declares it), counted per (route, status, code), so
|
|
862
|
+
every error response a test asserts is recorded, and the middleware-gate group
|
|
863
|
+
probes each gate on each counted route. Override with
|
|
851
864
|
`error_coverage_min?: number` (set to `0` to skip the assertion — useful for
|
|
852
865
|
minimal route sets whose declared error codes outpace the suite's
|
|
853
866
|
denial-path drivers).
|
|
854
867
|
|
|
855
|
-
Options: `{setup_test, surface_source, session_options, rpc_endpoints,
|
|
868
|
+
Options: `{setup_test, surface_source, session_options, rpc_endpoints, base_url,
|
|
869
|
+
max_body_bytes?, rpc_max_body_bytes?, error_coverage_min?,
|
|
870
|
+
check_uncovered_errors?}`; the last is called with the declared paths left
|
|
871
|
+
uncovered before the floor is asserted, which fuz_app's own wirings hold to an
|
|
872
|
+
exact set. `base_url` is the
|
|
873
|
+
backend's socket, `null` in-process (`default_in_process_suite_options` gives
|
|
874
|
+
`null`, and `max_body_bytes` from `app_options.max_body_size`); the caps
|
|
875
|
+
default to `SPINE_BODY_LIMIT_DEFAULT_BYTES`, the RPC endpoint's to
|
|
876
|
+
`max_body_bytes`.
|
|
877
|
+
|
|
878
|
+
### `middleware_gate_probes.ts` — the integration suite's gate probes
|
|
879
|
+
|
|
880
|
+
`plan_middleware_gate_probes({route_specs, route_error_maps, base_url,
|
|
881
|
+
max_body_bytes?, rpc_path, rpc_max_body_bytes?})` plans one
|
|
882
|
+
`MiddlewareGateProbe` per gate a route's error map declares, so a carved-out
|
|
883
|
+
route or a backend without the layer gets none: a foreign `Origin`
|
|
884
|
+
(`GATE_PROBE_FOREIGN_ORIGIN`) → 403 `forbidden_origin`; a foreign `Host`
|
|
885
|
+
(`GATE_PROBE_FOREIGN_HOST`) → 403 `forbidden_host`; a declared
|
|
886
|
+
`Content-Length` one over the route's cap → 413 `payload_too_large`; and,
|
|
887
|
+
in-process only, an unreadable `Content-Length` → 400 `invalid_content_length`
|
|
888
|
+
(over a socket Node's parser and hyper answer that one themselves with a
|
|
889
|
+
bodiless 400, and `fetch` can't send it). Each probe is a request head with no
|
|
890
|
+
body and no credential, refused before auth, rate limiting and body parsing;
|
|
891
|
+
in-process the probes share one fixture. A route whose path has a param or
|
|
892
|
+
wildcard segment throws rather than be probed at its literal template.
|
|
893
|
+
`send_middleware_gate_probe(probe, base_url, transport)` writes it to the socket
|
|
894
|
+
with `raw_http_send_head` (`fetch` replaces a caller's `Host` and
|
|
895
|
+
`Content-Length`), or in-process through the transport, whose `Request` keeps
|
|
896
|
+
both. `assert_middleware_gate_refusal(probe, response, collector, route_specs)`
|
|
897
|
+
asserts the declared status and code, then `assert_and_record`s it.
|
|
898
|
+
`format_middleware_gate_probe` names a probe's test.
|
|
856
899
|
|
|
857
900
|
### `admin_integration.ts` — `describe_standard_admin_integration_tests`
|
|
858
901
|
|
|
@@ -1208,12 +1251,16 @@ the in-process backend exposes; wire-level audit observability lives in the
|
|
|
1208
1251
|
consumer's own audit `.cross.test.ts`). The omission rationale lives in the
|
|
1209
1252
|
module doc once instead of repeating in each consumer's `*.cross.test.ts`.
|
|
1210
1253
|
|
|
1254
|
+
`base_url` (required — the integration suite's middleware-gate probes write
|
|
1255
|
+
to the socket), `max_body_bytes` and `rpc_max_body_bytes` forward to the
|
|
1256
|
+
integration suite;
|
|
1211
1257
|
`rpc_success_fixtures`, `rpc_skip_methods` and `rpc_input_overrides`
|
|
1212
1258
|
forward to the RPC round-trip's `success_fixtures`, `skip_methods` and
|
|
1213
1259
|
`input_overrides` (`describe_spine_cross_suites` also forwards
|
|
1214
1260
|
`rpc_input_overrides` to `rpc_adversarial`) — `rpc_skip_methods` is the
|
|
1215
1261
|
consumer escape hatch for a method the generic round-trip can't drive in its
|
|
1216
|
-
test wiring.
|
|
1262
|
+
test wiring. `param_values` (`RouteParamValues`) forwards to both the
|
|
1263
|
+
round-trip and data exposure, the two that resolve route paths.
|
|
1217
1264
|
|
|
1218
1265
|
Hard-codes the cross-process-safe set with no `skip` knob; if a future
|
|
1219
1266
|
consumer needs partial opt-out, add the knob then.
|
|
@@ -1272,7 +1319,8 @@ here never reaches it.
|
|
|
1272
1319
|
request-body cap on `rpc_path` and its inbound WS message cap, when they
|
|
1273
1320
|
aren't the spine defaults (`SPINE_BODY_LIMIT_DEFAULT_BYTES`,
|
|
1274
1321
|
`DEFAULT_WS_MAX_MESSAGE_BYTES`). The first reaches `body_size`,
|
|
1275
|
-
`body_size_smuggling
|
|
1322
|
+
`body_size_smuggling`, `transport_composition`'s RPC over-cap row and the
|
|
1323
|
+
standard bundle's middleware-gate probes of the RPC endpoint (each
|
|
1276
1324
|
takes it as `rpc_max_body_bytes`), the second `ws_round_trip`'s
|
|
1277
1325
|
`max_message_bytes` — one value per limit for every suite probing it.
|
|
1278
1326
|
- **`exclude`** — `{[suite]: reason}`; the reason is required and shows in the
|
|
@@ -2163,13 +2211,15 @@ are `src/test/auth/cell_crud_parity.db.test.ts`
|
|
|
2163
2211
|
`raw_http_parse_json` (a body's JSON, `undefined` when it isn't), and
|
|
2164
2212
|
`RAW_HTTP_READ_TIMEOUT_MS`, the suites' default read window.
|
|
2165
2213
|
`raw_http_send_head(base_url, {method?, path, headers, content_length,
|
|
2166
|
-
read_timeout_ms?})` (`RawHttpHeadRequest`) is the over-cap probe
|
|
2167
|
-
them: the request head alone, declaring `content_length` body
|
|
2168
|
-
sending none, read until one whole response — so a server that
|
|
2169
|
-
the declared length answers and one that reads the body first
|
|
2170
|
-
read timeout. It writes `Host`
|
|
2171
|
-
`
|
|
2172
|
-
|
|
2214
|
+
host?, read_timeout_ms?})` (`RawHttpHeadRequest`) is the over-cap probe
|
|
2215
|
+
built on them: the request head alone, declaring `content_length` body
|
|
2216
|
+
bytes and sending none, read until one whole response — so a server that
|
|
2217
|
+
refuses on the declared length answers and one that reads the body first
|
|
2218
|
+
fails on the read timeout. It writes `Host` (`host`, default the base URL's)
|
|
2219
|
+
and `Content-Length` itself (naming either in `headers` throws), defaults
|
|
2220
|
+
nothing else, and throws on a CR or LF in the host or a header name or value,
|
|
2221
|
+
and when no whole response arrives. The middleware-gate probes and the
|
|
2222
|
+
body-size, body-size smuggling, credential-header,
|
|
2173
2223
|
origin-scope and transport-composition suites share this module; they take
|
|
2174
2224
|
the 1 MiB cap they probe from `SPINE_BODY_LIMIT_DEFAULT_BYTES`
|
|
2175
2225
|
(`spine_surface_constants.ts`).
|
|
@@ -869,7 +869,7 @@ export const describe_standard_admin_integration_tests = (options) => {
|
|
|
869
869
|
headers: { host: 'localhost', 'content-type': to_route_content_type(route) }
|
|
870
870
|
});
|
|
871
871
|
if (res.status === 401 || res.status === 403) {
|
|
872
|
-
error_collector.
|
|
872
|
+
await error_collector.assert_and_record(route_specs, route.method, route.path, res);
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
});
|
|
@@ -75,7 +75,7 @@ export const describe_adversarial_404 = (options) => {
|
|
|
75
75
|
test(key, async () => {
|
|
76
76
|
const route = surface.routes.find((r) => format_route_key(r) === key);
|
|
77
77
|
const app = select_auth_app(apps, route.auth);
|
|
78
|
-
const url = resolve_valid_path(route.path, spec.params);
|
|
78
|
+
const url = resolve_valid_path(route.path, spec.params, options.param_values?.[key]);
|
|
79
79
|
const request_init = {
|
|
80
80
|
method: route.method,
|
|
81
81
|
headers: { 'content-type': to_route_content_type(spec) }
|
|
@@ -75,7 +75,7 @@ export const describe_adversarial_input = (options) => {
|
|
|
75
75
|
continue;
|
|
76
76
|
input_test_count += test_cases.length;
|
|
77
77
|
const app = select_auth_app(apps, route.auth);
|
|
78
|
-
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]);
|
|
79
79
|
const is_get = route.method === 'GET';
|
|
80
80
|
describe(key, () => {
|
|
81
81
|
for (const tc of test_cases) {
|
|
@@ -167,7 +167,7 @@ export const describe_adversarial_input = (options) => {
|
|
|
167
167
|
continue;
|
|
168
168
|
query_test_count += test_cases.length;
|
|
169
169
|
const app = select_auth_app(apps, route.auth);
|
|
170
|
-
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]);
|
|
171
171
|
describe(key, () => {
|
|
172
172
|
for (const tc of test_cases) {
|
|
173
173
|
test(tc.label, async () => {
|
|
@@ -84,13 +84,23 @@ export declare const assert_error_schema_valid: (lookup: ReadonlyMap<string, Rou
|
|
|
84
84
|
*/
|
|
85
85
|
export declare const assert_error_response_declared: (errors: RouteErrorMap, jsonrpc: boolean, response: Response, label: string) => Promise<void>;
|
|
86
86
|
/**
|
|
87
|
-
* Verify every route under a path prefix has the exact expected middleware
|
|
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.
|
|
88
98
|
*
|
|
89
99
|
* @param surface - the app surface to check
|
|
90
100
|
* @param path_prefix - prefix to filter routes (e.g. `'/api/'`)
|
|
91
|
-
* @param expected_middleware - the
|
|
101
|
+
* @param expected_middleware - the full middleware names in order
|
|
92
102
|
* @throws AssertionError if no routes match `path_prefix`, or if any matching
|
|
93
|
-
* route's `applicable_middleware` does not deep-equal
|
|
103
|
+
* route's `applicable_middleware` does not deep-equal its expected stack
|
|
94
104
|
*/
|
|
95
105
|
export declare const assert_full_middleware_stack: (surface: AppSurface, path_prefix: string, expected_middleware: Array<string>) => void;
|
|
96
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;AAe7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OA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AC1C,QAAQ,aAAa,EACrB,SAAS,OAAO,EAChB,UAAU,QAAQ,EAClB,OAAO,MAAM,KACX,OAAO,CAAC,IAAI,CAiBd,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,UAAU,EACnB,aAAa,MAAM,EACnB,qBAAqB,KAAK,CAAC,MAAM,CAAC,KAChC,IAsBF,CAAC"}
|
|
@@ -15,6 +15,7 @@ import { format_route_key } from '../http/surface_query.js';
|
|
|
15
15
|
import { is_public_auth } from '../http/auth_shape.js';
|
|
16
16
|
import { parse_any } from '../schema_issues.js';
|
|
17
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';
|
|
18
19
|
/**
|
|
19
20
|
* Resolve an absolute path relative to the caller's module.
|
|
20
21
|
*
|
|
@@ -137,18 +138,34 @@ export const assert_error_response_declared = async (errors, jsonrpc, response,
|
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
140
|
/**
|
|
140
|
-
* Verify every route under a path prefix has the exact expected middleware
|
|
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.
|
|
141
152
|
*
|
|
142
153
|
* @param surface - the app surface to check
|
|
143
154
|
* @param path_prefix - prefix to filter routes (e.g. `'/api/'`)
|
|
144
|
-
* @param expected_middleware - the
|
|
155
|
+
* @param expected_middleware - the full middleware names in order
|
|
145
156
|
* @throws AssertionError if no routes match `path_prefix`, or if any matching
|
|
146
|
-
* route's `applicable_middleware` does not deep-equal
|
|
157
|
+
* route's `applicable_middleware` does not deep-equal its expected stack
|
|
147
158
|
*/
|
|
148
159
|
export const assert_full_middleware_stack = (surface, path_prefix, expected_middleware) => {
|
|
149
160
|
const routes = surface.routes.filter((r) => r.path.startsWith(path_prefix));
|
|
150
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
|
+
};
|
|
151
166
|
for (const route of routes) {
|
|
152
|
-
|
|
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(', ')})` : ''}`);
|
|
153
170
|
}
|
|
154
171
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
2
|
import { type SurfaceSecurityPolicyOptions } from './surface_invariants.js';
|
|
3
|
+
import { type RouteParamValues } from './schema_generators.js';
|
|
3
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 {
|
|
@@ -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.
|
|
@@ -53,6 +60,11 @@ export interface StandardAttackSurfaceOptions {
|
|
|
53
60
|
* handled by the params-schema-aware synthesizer.
|
|
54
61
|
*/
|
|
55
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;
|
|
56
68
|
}
|
|
57
69
|
/**
|
|
58
70
|
* Run the standard attack surface test suite.
|
|
@@ -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,EAIN,KAAK,4BAA4B,EACjC,MAAM,yBAAyB,CAAC;
|
|
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,EAIN,KAAK,4BAA4B,EACjC,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAGN,KAAK,gBAAgB,EACrB,MAAM,wBAAwB,CAAC;AAWhC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAgCzD,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,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,sBAAsB,KAAG,IA6K3E,CAAC;AAIF,0DAA0D;AAC1D,MAAM,WAAW,4BAA4B;IAC5C,+EAA+E;IAC/E,KAAK,EAAE,MAAM,cAAc,CAAC;IAC5B,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,sBAAsB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtC,iIAAiI;IACjI,uBAAuB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvC,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,eAAe,CAAC,EAAE,4BAA4B,CAAC;IAC/C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sCAAsC,GAClD,SAAS,4BAA4B,KACnC,IAqDF,CAAC"}
|
|
@@ -67,7 +67,10 @@ export const describe_adversarial_auth = (options) => {
|
|
|
67
67
|
// validation accepts. Otherwise the generated request 400s on the path
|
|
68
68
|
// before ever reaching the 401 / 403 gate the case is asserting.
|
|
69
69
|
const spec_lookup = build_route_spec_lookup(route_specs);
|
|
70
|
-
const test_path = (route) =>
|
|
70
|
+
const test_path = (route) => {
|
|
71
|
+
const key = format_route_key(route);
|
|
72
|
+
return resolve_valid_path(route.path, spec_lookup.get(key)?.params, options.param_values?.[key]);
|
|
73
|
+
};
|
|
71
74
|
const apps = create_auth_test_apps(route_specs, roles);
|
|
72
75
|
// every probe carries the content type a real client sends, so the
|
|
73
76
|
// per-route content-type check (415) never answers ahead of the auth gate
|
|
@@ -213,7 +216,7 @@ export const describe_adversarial_auth = (options) => {
|
|
|
213
216
|
* any project-specific assertions in additional `describe` blocks.
|
|
214
217
|
*/
|
|
215
218
|
export const describe_standard_attack_surface_tests = (options) => {
|
|
216
|
-
const { build, snapshot_path, expected_public_routes, expected_api_middleware, roles, api_path_prefix = '/api/', security_policy, skip_routes } = options;
|
|
219
|
+
const { build, snapshot_path, expected_public_routes, expected_api_middleware, roles, api_path_prefix = '/api/', security_policy, skip_routes, param_values } = options;
|
|
217
220
|
const built = build();
|
|
218
221
|
const { surface } = built;
|
|
219
222
|
describe('attack surface snapshot', () => {
|
|
@@ -241,7 +244,7 @@ export const describe_standard_attack_surface_tests = (options) => {
|
|
|
241
244
|
assert_surface_security_policy(surface, security_policy);
|
|
242
245
|
});
|
|
243
246
|
});
|
|
244
|
-
describe_adversarial_auth({ build: () => built, roles, skip_routes });
|
|
245
|
-
describe_adversarial_input({ build: () => built, roles, skip_routes });
|
|
246
|
-
describe_adversarial_404({ build: () => built, roles, skip_routes });
|
|
247
|
+
describe_adversarial_auth({ build: () => built, roles, skip_routes, param_values });
|
|
248
|
+
describe_adversarial_input({ build: () => built, roles, skip_routes, param_values });
|
|
249
|
+
describe_adversarial_404({ build: () => built, roles, skip_routes, param_values });
|
|
247
250
|
};
|
|
@@ -115,9 +115,11 @@ export interface DefaultInProcessSuiteOptions {
|
|
|
115
115
|
* Build the full in-process suite bundle in a single helper invocation.
|
|
116
116
|
* Output covers `{setup_test, surface_source, capabilities}` plus every
|
|
117
117
|
* factory input the Tier 1 suites read at their top level
|
|
118
|
-
* (`session_options`, `create_route_specs`, `rpc_endpoints`)
|
|
119
|
-
*
|
|
120
|
-
* (`
|
|
118
|
+
* (`session_options`, `create_route_specs`, `rpc_endpoints`), and the
|
|
119
|
+
* integration suite's `base_url` (`null`, no socket) and `max_body_bytes`
|
|
120
|
+
* (`app_options.max_body_size`) — so the call site spreads once and adds
|
|
121
|
+
* only suite-specific extras (`roles`, `skip_routes`, `input_overrides`,
|
|
122
|
+
* `db_factories`, ...).
|
|
121
123
|
*
|
|
122
124
|
* ```ts
|
|
123
125
|
* // Suite-extras-free call: helper output is the entire options bag.
|
|
@@ -149,5 +151,7 @@ export declare const default_in_process_suite_options: <const O extends DefaultI
|
|
|
149
151
|
session_options: O["session_options"];
|
|
150
152
|
create_route_specs: O["create_route_specs"];
|
|
151
153
|
rpc_endpoints: O["rpc_endpoints"];
|
|
154
|
+
base_url: null;
|
|
155
|
+
max_body_bytes: number | undefined;
|
|
152
156
|
};
|
|
153
157
|
//# sourceMappingURL=in_process_setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in_process_setup.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/in_process_setup.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqB9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,EAIN,KAAK,oBAAoB,EACzB,KAAK,eAAe,EAEpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAGN,KAAK,uBAAuB,EAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEtF,OAAO,EAGN,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,MAAM,YAAY,CAAC;AAepB;;;;;GAKG;AACH,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IAClE;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC1D;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C;;;OAGG;IACH,QAAQ,CAAC,kCAAkC,CAAC,EAAE,OAAO,CAAC;CACtD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,qBAAqB,KAAG,SAuEjC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACjD;;;OAGG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC;;;OAGG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CAChC;AAWD
|
|
1
|
+
{"version":3,"file":"in_process_setup.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/in_process_setup.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqB9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OA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