@fuzdev/fuz_app 0.162.0 → 0.164.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/README.md +2 -1
- package/dist/actions/action_event_data.d.ts +1 -1
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +4 -0
- package/dist/actions/action_spec.d.ts +3 -3
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/auth/CLAUDE.md +39 -36
- package/dist/auth/account_action_specs.d.ts +441 -115
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +47 -46
- package/dist/auth/account_route_schema.d.ts +98 -62
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +45 -45
- package/dist/auth/account_routes.js +1 -1
- package/dist/auth/account_schema.d.ts +54 -27
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +16 -18
- package/dist/auth/admin_action_specs.d.ts +76 -76
- package/dist/auth/admin_action_specs.js +2 -4
- package/dist/auth/admin_actions.d.ts +4 -4
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +3 -3
- package/dist/auth/all_cell_actions.d.ts +3 -3
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.js +1 -1
- package/dist/auth/api_token.d.ts +4 -4
- package/dist/auth/api_token.d.ts.map +1 -1
- package/dist/auth/api_token.js +3 -3
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +4 -5
- package/dist/auth/audit_log_schema.d.ts +46 -66
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +34 -30
- package/dist/auth/bootstrap_route_schema.d.ts +146 -52
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +33 -19
- package/dist/auth/cell_grant_action_specs.d.ts +1 -1
- package/dist/auth/cell_grant_action_specs.js +1 -1
- package/dist/auth/cell_grant_actions.d.ts +4 -4
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +1 -1
- package/dist/auth/credential_type_schema.d.ts +16 -29
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +14 -18
- package/dist/auth/daemon_token.d.ts +4 -4
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token.js +3 -3
- package/dist/auth/daemon_token_middleware.d.ts +1 -1
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +5 -5
- package/dist/auth/grant_path_schema.d.ts +15 -29
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.js +13 -17
- package/dist/auth/middleware.js +4 -4
- package/dist/auth/migrations.js +1 -1
- package/dist/auth/name_schema.d.ts +7 -6
- package/dist/auth/name_schema.d.ts.map +1 -1
- package/dist/auth/name_schema.js +8 -9
- package/dist/auth/password.d.ts +15 -7
- package/dist/auth/password.d.ts.map +1 -1
- package/dist/auth/password.js +16 -9
- package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
- package/dist/auth/role_grant_offer_action_specs.js +2 -2
- package/dist/auth/role_grant_offer_actions.d.ts +4 -4
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +3 -3
- package/dist/auth/role_grant_offer_notifications.js +2 -2
- package/dist/auth/role_grant_offer_schema.d.ts +2 -2
- package/dist/auth/role_grant_offer_schema.js +2 -2
- package/dist/auth/role_schema.d.ts +47 -55
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +29 -35
- package/dist/auth/scope_kind_schema.d.ts +22 -26
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema.js +19 -19
- package/dist/auth/self_service_role_action_specs.js +1 -1
- package/dist/auth/self_service_role_actions.d.ts +6 -6
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +7 -6
- package/dist/auth/signup_route_schema.d.ts +71 -21
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +17 -19
- package/dist/auth/standard_rpc_actions.d.ts +1 -1
- package/dist/auth/standard_rpc_actions.js +1 -1
- package/dist/auth/token_lifetime.d.ts +33 -9
- package/dist/auth/token_lifetime.d.ts.map +1 -1
- package/dist/auth/token_lifetime.js +8 -7
- package/dist/auth/token_scope.d.ts +99 -25
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +57 -35
- package/dist/db/CLAUDE.md +2 -1
- package/dist/db/file_fact_url.d.ts +11 -6
- package/dist/db/file_fact_url.d.ts.map +1 -1
- package/dist/db/file_fact_url.js +5 -5
- package/dist/db/schema_ready.d.ts +0 -5
- package/dist/db/schema_ready.d.ts.map +1 -1
- package/dist/db/schema_ready.js +0 -5
- package/dist/http/CLAUDE.md +104 -71
- package/dist/http/auth_shape.d.ts +48 -29
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +12 -85
- package/dist/http/body_limit.d.ts +12 -0
- package/dist/http/body_limit.d.ts.map +1 -1
- package/dist/http/body_limit.js +15 -0
- package/dist/http/body_limit_schema.d.ts +20 -0
- package/dist/http/body_limit_schema.d.ts.map +1 -0
- package/dist/http/body_limit_schema.js +20 -0
- package/dist/http/common_routes.d.ts +1 -1
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +11 -14
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +59 -69
- package/dist/http/dev_route_error_check.d.ts +70 -0
- package/dist/http/dev_route_error_check.d.ts.map +1 -0
- package/dist/http/dev_route_error_check.js +119 -0
- package/dist/http/error_schemas.d.ts +365 -189
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +256 -149
- package/dist/http/health_schema.d.ts +10 -6
- package/dist/http/health_schema.d.ts.map +1 -1
- package/dist/http/health_schema.js +3 -3
- package/dist/http/middleware_spec.d.ts +8 -3
- package/dist/http/middleware_spec.d.ts.map +1 -1
- package/dist/http/origin.d.ts +12 -43
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +10 -6
- package/dist/http/route_error_check.d.ts +158 -0
- package/dist/http/route_error_check.d.ts.map +1 -0
- package/dist/http/route_error_check.js +247 -0
- package/dist/http/route_errors.d.ts +80 -0
- package/dist/http/route_errors.d.ts.map +1 -0
- package/dist/http/route_errors.js +83 -0
- package/dist/http/route_spec.d.ts +33 -17
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +48 -62
- package/dist/http/schema_helpers.d.ts +0 -33
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +0 -45
- package/dist/http/surface.d.ts +19 -12
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +25 -38
- package/dist/http/surface_query.d.ts +11 -2
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +7 -1
- package/dist/primitive_schemas.d.ts +2 -19
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +2 -20
- package/dist/primitive_schemas_fuz.d.ts +39 -5
- package/dist/primitive_schemas_fuz.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.js +36 -7
- package/dist/rate_limiter.d.ts +13 -0
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +20 -2
- package/dist/schema_issues.d.ts +29 -11
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +11 -10
- package/dist/schema_meta.d.ts +8 -1
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +2 -1
- package/dist/server/app_server.d.ts +3 -1
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +24 -10
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +8 -31
- package/dist/server/surface_route.d.ts.map +1 -1
- package/dist/server/surface_route.js +5 -6
- package/dist/server/x_accel.d.ts +12 -7
- package/dist/server/x_accel.d.ts.map +1 -1
- package/dist/server/x_accel.js +7 -9
- package/dist/testing/CLAUDE.md +55 -44
- package/dist/testing/admin_integration.d.ts +3 -3
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +2 -2
- package/dist/testing/adversarial_404.d.ts +4 -18
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +19 -51
- package/dist/testing/adversarial_headers.d.ts +3 -4
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +8 -6
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +18 -17
- package/dist/testing/assertions.d.ts +33 -11
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +52 -12
- package/dist/testing/attack_surface.d.ts +5 -35
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +29 -91
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +2 -1
- package/dist/testing/cross_backend/action_manifest.d.ts +126 -56
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +11 -11
- package/dist/testing/cross_backend/action_manifest_parity.d.ts +1 -1
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +2 -1
- package/dist/testing/cross_backend/conformance_table.js +1 -1
- package/dist/testing/cross_backend/default_spine_surface.d.ts +2 -2
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +2 -2
- package/dist/testing/cross_backend/fact_serving.js +3 -3
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +39 -6
- package/dist/testing/cross_backend/origin_conformance.d.ts +278 -102
- package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_conformance.js +21 -21
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +3 -3
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +7 -1
- package/dist/testing/cross_backend/setup.d.ts +14 -1
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +68 -48
- package/dist/testing/cross_backend/spine_suites.d.ts +3 -3
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.d.ts +4 -4
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.d.ts +147 -71
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.js +16 -13
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +70 -27
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +34 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +5 -4
- package/dist/testing/error_coverage.d.ts +24 -34
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +46 -89
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +6 -14
- package/dist/testing/integration_helpers.d.ts +37 -9
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +86 -40
- package/dist/testing/middleware.d.ts +3 -5
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +5 -4
- package/dist/testing/rate_limiting.d.ts +1 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +5 -4
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +5 -3
- package/dist/testing/schema_generators.d.ts +10 -3
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +23 -11
- package/dist/testing/stubs.d.ts +10 -1
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +15 -5
- package/dist/testing/surface_invariants.d.ts +36 -115
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +106 -269
- package/dist/testing/token_scope_fixtures.d.ts +24 -0
- package/dist/testing/token_scope_fixtures.d.ts.map +1 -0
- package/dist/testing/token_scope_fixtures.js +49 -0
- package/dist/testing/transports/bootstrap.d.ts +1 -1
- package/dist/testing/transports/bootstrap.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.js +13 -12
- package/dist/ui/BootstrapForm.svelte +4 -2
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +4 -2
- package/dist/ui/SignupForm.svelte +4 -2
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.js +2 -8
- package/dist/ui/backend_probe.svelte.js +3 -3
- package/dist/ui/table_state.svelte.d.ts.map +1 -1
- package/dist/ui/table_state.svelte.js +1 -8
- package/dist/ui/ui_fetch.d.ts +12 -2
- package/dist/ui/ui_fetch.d.ts.map +1 -1
- package/dist/ui/ui_fetch.js +22 -4
- package/package.json +1 -1
- package/dist/auth/audit_log_schema_fuz.d.ts +0 -53
- package/dist/auth/audit_log_schema_fuz.d.ts.map +0 -1
- package/dist/auth/audit_log_schema_fuz.js +0 -50
- package/dist/auth/role_schema_fuz.d.ts +0 -30
- package/dist/auth/role_schema_fuz.d.ts.map +0 -1
- package/dist/auth/role_schema_fuz.js +0 -30
- package/dist/auth/scope_kind_schema_fuz.d.ts +0 -31
- package/dist/auth/scope_kind_schema_fuz.d.ts.map +0 -1
- package/dist/auth/scope_kind_schema_fuz.js +0 -31
|
@@ -15,15 +15,16 @@ export declare const assert_protected_routes_declare_401: (surface: AppSurface)
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const assert_role_routes_declare_403: (surface: AppSurface) => void;
|
|
17
17
|
/**
|
|
18
|
-
* Every route with non-null `input_schema`
|
|
18
|
+
* Every route with a body — a non-null `input_schema` on a method other than
|
|
19
|
+
* `GET`, which reads no body — declares a 400 naming `invalid_request_body`.
|
|
19
20
|
*/
|
|
20
21
|
export declare const assert_input_routes_declare_400: (surface: AppSurface) => void;
|
|
21
22
|
/**
|
|
22
|
-
* Every route with non-null `params_schema`
|
|
23
|
+
* Every route with non-null `params_schema` declares a 400 naming `invalid_route_params`.
|
|
23
24
|
*/
|
|
24
25
|
export declare const assert_params_routes_declare_400: (surface: AppSurface) => void;
|
|
25
26
|
/**
|
|
26
|
-
* Every route with non-null `query_schema`
|
|
27
|
+
* Every route with non-null `query_schema` declares a 400 naming `invalid_query_params`.
|
|
27
28
|
*/
|
|
28
29
|
export declare const assert_query_routes_declare_400: (surface: AppSurface) => void;
|
|
29
30
|
/**
|
|
@@ -37,71 +38,45 @@ export declare const assert_no_duplicate_routes: (surface: AppSurface) => void;
|
|
|
37
38
|
/**
|
|
38
39
|
* Every applicable middleware that declares errors must have those status codes
|
|
39
40
|
* present in the route's `error_schemas`.
|
|
41
|
+
*
|
|
42
|
+
* Holds by construction for a surface `generate_app_surface` builds: each
|
|
43
|
+
* route's error map (`resolve_route_error_map`) already unions every applying
|
|
44
|
+
* layer's definitions. It earns its place only on a surface built another
|
|
45
|
+
* way — a committed snapshot read back, or one written by hand.
|
|
40
46
|
*/
|
|
41
47
|
export declare const assert_middleware_errors_propagated: (surface: AppSurface) => void;
|
|
42
48
|
/**
|
|
43
|
-
* Every
|
|
44
|
-
* (
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* is checked, not just the top-level wrapper.
|
|
49
|
+
* Every error a route or middleware layer declares names its code exactly:
|
|
50
|
+
* each body at each status (each branch of an `anyOf` or `oneOf`) is an
|
|
51
|
+
* object whose `error` is a `const` or an `enum` — what a definition built by
|
|
52
|
+
* `rest_error` writes. A bare string `error`, or a body with no `error`, is a
|
|
53
|
+
* contract a client can't key on.
|
|
49
54
|
*
|
|
50
|
-
*
|
|
51
|
-
* read `.error` from error responses.
|
|
55
|
+
* @throws AssertionError naming the route or layer, the status, and the body
|
|
52
56
|
*/
|
|
53
|
-
export declare const
|
|
57
|
+
export declare const assert_error_codes_specific: (surface: AppSurface) => void;
|
|
54
58
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
59
|
+
* Every declared `error` code is a code — `REST_ERROR_CODE_PATTERN`, a
|
|
60
|
+
* lowercase letter then lowercase letters, digits, and `_` — never prose,
|
|
61
|
+
* which belongs in `message`. `rest_error` refuses one off the pattern; this
|
|
62
|
+
* holds a surface built another way (a snapshot, a hand-written layer) to the
|
|
63
|
+
* same rule.
|
|
57
64
|
*
|
|
58
|
-
*
|
|
59
|
-
* `z.literal()` in the Zod source). Walks union branches (`anyOf` from `z.union`,
|
|
60
|
-
* `oneOf` from `z.discriminatedUnion`) so literal codes nested inside merged unions
|
|
61
|
-
* (e.g. validation 400 + actor-resolution 400) are still tracked. Flags when the
|
|
62
|
-
* same literal appears at different status codes — e.g., `ERROR_INVALID_CREDENTIALS`
|
|
63
|
-
* at both 401 and 403 would be a bug.
|
|
64
|
-
*
|
|
65
|
-
* Only checks `const` values (literal schemas). Generic `z.string()` schemas
|
|
66
|
-
* (which produce `{type: 'string'}`) and `z.enum()` schemas are ignored — the
|
|
67
|
-
* literal-only narrow keeps the check unambiguous.
|
|
65
|
+
* @throws AssertionError naming the route or layer, the status, and the code
|
|
68
66
|
*/
|
|
69
|
-
export declare const
|
|
67
|
+
export declare const assert_error_codes_well_formed: (surface: AppSurface) => void;
|
|
70
68
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* declaring 404 for other reasons (e.g., bootstrap not configured) may legitimately
|
|
81
|
-
* use generic schemas.
|
|
69
|
+
* One error code at one HTTP status: the same code declared at two statuses
|
|
70
|
+
* across the surface's routes and middleware layers fails — e.g.
|
|
71
|
+
* `invalid_credentials` at both 401 and 403 would be a bug.
|
|
72
|
+
*
|
|
73
|
+
* Reads each body's `error` `const` (what `rest_error` writes), through every
|
|
74
|
+
* branch of an `anyOf` or `oneOf` — the surface writes a status with several
|
|
75
|
+
* definitions as an `anyOf` — and nested unions within them. An `error` with
|
|
76
|
+
* no `const` (an `enum`, a bare string) is not read; `assert_error_codes_specific`
|
|
77
|
+
* refuses the bare string.
|
|
82
78
|
*/
|
|
83
|
-
export declare const
|
|
84
|
-
/** Specificity level of an error schema's `error` field. */
|
|
85
|
-
export type ErrorSchemaSpecificity = 'literal' | 'enum' | 'generic';
|
|
86
|
-
/** A single entry in the error schema tightness audit report. */
|
|
87
|
-
export interface ErrorSchemaAuditEntry {
|
|
88
|
-
method: string;
|
|
89
|
-
route_path: string;
|
|
90
|
-
status: string;
|
|
91
|
-
specificity: ErrorSchemaSpecificity;
|
|
92
|
-
/** The literal value or enum values, if specific. */
|
|
93
|
-
error_codes: Array<string> | null;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Audit error schema tightness across all routes in a surface.
|
|
97
|
-
*
|
|
98
|
-
* Reports which route x status code combinations use generic `ApiError`
|
|
99
|
-
* (`z.string()`) vs specific `z.literal()` or `z.enum()` error codes.
|
|
100
|
-
* Use the output to prioritize progressive tightening of error schemas.
|
|
101
|
-
*
|
|
102
|
-
* @returns audit entries for every route x status combination
|
|
103
|
-
*/
|
|
104
|
-
export declare const audit_error_schema_tightness: (surface: AppSurface) => Array<ErrorSchemaAuditEntry>;
|
|
79
|
+
export declare const assert_error_code_status_consistency: (surface: AppSurface) => void;
|
|
105
80
|
/**
|
|
106
81
|
* Every RPC method on every endpoint has a non-empty `description`.
|
|
107
82
|
*
|
|
@@ -242,68 +217,14 @@ export declare const assert_mutation_routes_use_post: (surface: AppSurface) => v
|
|
|
242
217
|
* (e.g., a keeper route at `/health` or `/admin/` instead of `/api/...`).
|
|
243
218
|
*/
|
|
244
219
|
export declare const assert_keeper_routes_under_prefix: (surface: AppSurface, prefixes?: Array<string>) => void;
|
|
245
|
-
/** Options for `assert_error_schema_tightness`. */
|
|
246
|
-
export interface ErrorSchemaTightnessOptions {
|
|
247
|
-
/** Minimum specificity level. Error schemas below this threshold fail. Default: `'enum'`. */
|
|
248
|
-
min_specificity?: ErrorSchemaSpecificity;
|
|
249
|
-
/** HTTP status codes to skip (e.g., middleware-injected codes). */
|
|
250
|
-
ignore_statuses?: Array<number>;
|
|
251
|
-
/** Routes to skip, in `'METHOD /path'` format. */
|
|
252
|
-
allowlist?: Array<string>;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Routes shipped by fuz_app whose error schemas require a tightness exemption.
|
|
256
|
-
*
|
|
257
|
-
* Currently empty — every fuz_app-shipped route (account login/password/
|
|
258
|
-
* bootstrap/signup, db health/tables/:name/tables/:name/rows/:id) was tightened
|
|
259
|
-
* in place to `z.enum([...])` / `z.literal(...)` against every emit-site error
|
|
260
|
-
* code.
|
|
261
|
-
*
|
|
262
|
-
* Kept as a forward-compatibility hook: when new stock routes ship with
|
|
263
|
-
* heterogeneous error surfaces that need an interim generic schema, add
|
|
264
|
-
* them here instead of forcing every consumer to hand-maintain the entry.
|
|
265
|
-
*
|
|
266
|
-
* Paths assume the standard `/api/account` + `/api/db` prefixes used by every
|
|
267
|
-
* fuz_app consumer. Merged into `default_error_schema_tightness.allowlist` so
|
|
268
|
-
* consumers calling `assert_error_schema_tightness` directly inherit the
|
|
269
|
-
* exemptions; the standard attack-surface suite also prepends these entries
|
|
270
|
-
* underneath any consumer-supplied allowlist so project-specific entries are
|
|
271
|
-
* additive.
|
|
272
|
-
*/
|
|
273
|
-
export declare const fuz_app_stock_route_tightness_allowlist: ReadonlyArray<string>;
|
|
274
|
-
/**
|
|
275
|
-
* Baseline error schema tightness applied by
|
|
276
|
-
* `describe_standard_attack_surface_tests` when no config is passed.
|
|
277
|
-
*
|
|
278
|
-
* Uses `min_specificity: 'enum'` (the assertion default) with `ignore_statuses`
|
|
279
|
-
* for middleware-derived status codes that are commonly generic (auth middleware
|
|
280
|
-
* produces multiple error codes at 401/403, and 429 comes from rate limiters),
|
|
281
|
-
* and `allowlist` seeded with `fuz_app_stock_route_tightness_allowlist` so
|
|
282
|
-
* fuz_app-shipped routes with heterogeneous generic schemas don't force every
|
|
283
|
-
* consumer to hand-maintain an identical allowlist. Consumers can pass a
|
|
284
|
-
* narrower config with project-specific `allowlist` entries, or pass `null`
|
|
285
|
-
* to skip the assertion entirely.
|
|
286
|
-
*/
|
|
287
|
-
export declare const default_error_schema_tightness: ErrorSchemaTightnessOptions;
|
|
288
|
-
/**
|
|
289
|
-
* Assert that all error schemas meet a minimum specificity threshold.
|
|
290
|
-
*
|
|
291
|
-
* Calls `audit_error_schema_tightness` and fails on any entry below
|
|
292
|
-
* the configured threshold. Use `allowlist` and `ignore_statuses` to exclude
|
|
293
|
-
* known exceptions during progressive tightening.
|
|
294
|
-
*
|
|
295
|
-
* @throws AssertionError listing every route × status combination whose error
|
|
296
|
-
* schema specificity is below `min_specificity` (default `'enum'`) and is
|
|
297
|
-
* not in `allowlist` or `ignore_statuses`.
|
|
298
|
-
*/
|
|
299
|
-
export declare const assert_error_schema_tightness: (surface: AppSurface, options?: ErrorSchemaTightnessOptions) => void;
|
|
300
220
|
/**
|
|
301
221
|
* Run all structural invariants. Options-free — applies universally.
|
|
302
222
|
*
|
|
303
223
|
* Catches schema/surface generation bugs: missing 401/403/400 declarations,
|
|
304
224
|
* empty descriptions, duplicate routes, middleware-injected error codes
|
|
305
|
-
* unpropagated to routes
|
|
306
|
-
*
|
|
225
|
+
* unpropagated to routes (by construction on a generated surface, so a
|
|
226
|
+
* snapshot's check), an error that doesn't name its code or whose code is
|
|
227
|
+
* not one, and error codes appearing at multiple statuses.
|
|
307
228
|
*
|
|
308
229
|
* @throws AssertionError on the first invariant violation; the message names
|
|
309
230
|
* the offending route and the missing/inconsistent field.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface_invariants.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/surface_invariants.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAuB7B,OAAO,KAAK,EAAE,UAAU,EAAwB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"surface_invariants.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/surface_invariants.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAuB7B,OAAO,KAAK,EAAE,UAAU,EAAwB,MAAM,oBAAoB,CAAC;AAuB3E;;GAEG;AACH,eAAO,MAAM,mCAAmC,GAAI,SAAS,UAAU,KAAG,IAQzE,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,GAAI,SAAS,UAAU,KAAG,IASpE,CAAC;AAqBF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,GAAI,SAAS,UAAU,KAAG,IAMrE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAAI,SAAS,UAAU,KAAG,IAMtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAAI,SAAS,UAAU,KAAG,IAMrE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,SAAS,UAAU,KAAG,IAIjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0B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