@fuzdev/fuz_app 0.155.1 → 0.157.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/actions/CLAUDE.md +27 -14
- package/dist/actions/action_codegen.d.ts +10 -3
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +52 -13
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +13 -11
- package/dist/actions/action_rpc.d.ts +4 -3
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +4 -3
- package/dist/actions/action_spec.d.ts +102 -206
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +18 -96
- package/dist/actions/action_types.d.ts +4 -4
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +2 -2
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/broadcast_api.js +6 -5
- package/dist/actions/compile_action_registry.d.ts +11 -6
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/compile_action_registry.js +15 -9
- package/dist/actions/perform_action.d.ts +4 -4
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +11 -11
- package/dist/auth/CLAUDE.md +1 -1
- package/dist/auth/account_action_specs.d.ts +50 -23
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +18 -8
- package/dist/auth/account_route_schema.d.ts +10 -10
- package/dist/auth/account_schema.d.ts +21 -21
- package/dist/auth/actor_lookup_action_specs.d.ts +7 -7
- package/dist/auth/actor_search_action_specs.d.ts +6 -6
- package/dist/auth/admin_action_specs.d.ts +98 -98
- package/dist/auth/app_settings_schema.d.ts +2 -2
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_schema.d.ts +44 -44
- package/dist/auth/auth_guard_resolver.d.ts +2 -2
- package/dist/auth/auth_guard_resolver.js +2 -2
- package/dist/auth/bootstrap_route_schema.d.ts +4 -4
- package/dist/auth/cell_action_specs.d.ts +241 -241
- package/dist/auth/cell_actions.js +3 -3
- package/dist/auth/cell_audit_action_specs.d.ts +14 -14
- package/dist/auth/cell_audit_metadata.d.ts +6 -6
- package/dist/auth/cell_field_action_specs.d.ts +38 -38
- package/dist/auth/cell_field_audit_metadata.d.ts +4 -4
- package/dist/auth/cell_grant_action_specs.d.ts +61 -61
- package/dist/auth/cell_grant_audit_metadata.d.ts +10 -10
- package/dist/auth/cell_item_action_specs.d.ts +50 -50
- package/dist/auth/cell_item_audit_metadata.d.ts +5 -5
- package/dist/auth/invite_schema.d.ts +6 -6
- package/dist/auth/role_grant_offer_action_specs.d.ts +120 -120
- package/dist/auth/role_grant_offer_notifications.d.ts +66 -66
- package/dist/auth/role_grant_offer_schema.d.ts +6 -6
- package/dist/auth/self_service_role_action_specs.d.ts +2 -2
- package/dist/auth/signup_route_schema.d.ts +2 -2
- package/dist/http/CLAUDE.md +26 -17
- package/dist/http/auth_shape.d.ts +51 -17
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +101 -52
- package/dist/http/error_schemas.d.ts +15 -8
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +4 -9
- package/dist/http/jsonrpc_errors.d.ts +11 -4
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +11 -4
- package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
- package/dist/http/jsonrpc_helpers.js +2 -1
- package/dist/http/route_spec.d.ts +37 -19
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +54 -24
- package/dist/http/schema_helpers.d.ts +27 -24
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +24 -19
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +7 -3
- package/dist/primitive_schemas.d.ts +16 -5
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +26 -4
- package/dist/primitive_schemas_fuz.d.ts +67 -0
- package/dist/primitive_schemas_fuz.d.ts.map +1 -0
- package/dist/primitive_schemas_fuz.js +47 -0
- package/dist/realtime/sse.d.ts +3 -3
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +4 -4
- package/dist/schema_issues.d.ts +91 -4
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +262 -1
- package/dist/schema_meta.d.ts +24 -8
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +31 -10
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +2 -1
- package/dist/testing/CLAUDE.md +23 -17
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +3 -2
- package/dist/testing/adversarial_404.d.ts +2 -2
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +8 -5
- package/dist/testing/adversarial_input.js +1 -1
- package/dist/testing/adversarial_input_cases.d.ts +18 -23
- package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
- package/dist/testing/adversarial_input_cases.js +51 -46
- package/dist/testing/assertions.d.ts +6 -5
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +9 -4
- package/dist/testing/cross_backend/action_manifest.d.ts +2 -1
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +3 -3
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +3 -8
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +5 -4
- package/dist/testing/cross_backend/cross_rpc.d.ts +4 -2
- package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
- package/dist/testing/cross_backend/cross_rpc.js +6 -4
- package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +3 -2
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +8 -8
- package/dist/testing/error_coverage.d.ts +9 -17
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +20 -3
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +7 -6
- package/dist/testing/rpc_envelope_cases.d.ts +3 -3
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +1 -1
- package/dist/testing/rpc_helpers.d.ts +12 -8
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +18 -15
- package/dist/testing/schema_generators.d.ts +75 -40
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +273 -99
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +4 -3
- package/dist/ui/admin_accounts_state.svelte.d.ts +10 -10
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_invites_state.svelte.d.ts +1 -1
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_sessions_state.svelte.d.ts +2 -2
- package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.d.ts +6 -6
- package/dist/zod.d.ts +23 -5
- package/dist/zod.d.ts.map +1 -1
- package/dist/zod.js +2 -2
- package/package.json +6 -6
|
@@ -5,20 +5,23 @@
|
|
|
5
5
|
* then applied to Hono. The attack surface is generated from the specs —
|
|
6
6
|
* always accurate, always complete.
|
|
7
7
|
*
|
|
8
|
-
* Input/output schemas align with SAES `ActionSpec` conventions
|
|
9
|
-
*
|
|
10
|
-
* - `
|
|
11
|
-
* - `
|
|
8
|
+
* Input/output schemas align with SAES `ActionSpec` conventions, and each is
|
|
9
|
+
* a Zod or `@fuzdev/fuz_schema` schema (`ValidationSchema`):
|
|
10
|
+
* - `input`: the request body schema (`z.null()` or `literal(null)` for no body)
|
|
11
|
+
* - `output`: the success response body schema
|
|
12
|
+
* - a strict object for inputs (reject unknown keys): `z.strictObject()` or `object`
|
|
12
13
|
*
|
|
13
14
|
* @module
|
|
14
15
|
*/
|
|
15
16
|
import type { Context, Hono, MiddlewareHandler } from 'hono';
|
|
16
17
|
import type { z } from 'zod';
|
|
18
|
+
import { type AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
17
19
|
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
18
20
|
import type { Db } from '../db/db.js';
|
|
19
21
|
import { type RouteErrorSchemas, type RateLimitKey } from './error_schemas.js';
|
|
20
22
|
import type { MiddlewareSpec } from './middleware_spec.js';
|
|
21
23
|
import { type RouteAuth } from './auth_shape.js';
|
|
24
|
+
import { type ValidationOutput, type ValidationSchema } from '../schema_issues.js';
|
|
22
25
|
/**
|
|
23
26
|
* Two-phase auth guard set returned by `AuthGuardResolver`.
|
|
24
27
|
*
|
|
@@ -110,8 +113,10 @@ export type RouteHandler = (c: Context, route: RouteContext) => Response | Promi
|
|
|
110
113
|
/**
|
|
111
114
|
* A single route definition — the unit of the surface map.
|
|
112
115
|
*
|
|
113
|
-
* `input` and `output` schemas align with SAES `ActionSpec` naming.
|
|
114
|
-
*
|
|
116
|
+
* `input` and `output` schemas align with SAES `ActionSpec` naming. Every
|
|
117
|
+
* schema field takes a Zod or a `@fuzdev/fuz_schema` schema, validated through
|
|
118
|
+
* `parse_any`. Use `z.null()` (or fuz_schema's `literal(null)`) for routes with
|
|
119
|
+
* no request body (GET, DELETE without body).
|
|
115
120
|
*/
|
|
116
121
|
export interface RouteSpec {
|
|
117
122
|
method: RouteMethod;
|
|
@@ -120,18 +125,25 @@ export interface RouteSpec {
|
|
|
120
125
|
handler: RouteHandler;
|
|
121
126
|
description: string;
|
|
122
127
|
/**
|
|
123
|
-
* URL path parameter schema. Use `z.strictObject()`
|
|
128
|
+
* URL path parameter schema. Use `z.strictObject()` (or fuz_schema's
|
|
129
|
+
* `object`) with string fields matching `:param` segments. A fuz_schema
|
|
130
|
+
* schema must be an object schema under any wrappers (`get_schema_entries`);
|
|
131
|
+
* `apply_route_specs` throws on one that isn't.
|
|
124
132
|
*
|
|
125
133
|
* REST-only — actions dispatch through a single JSON-RPC endpoint and encode
|
|
126
134
|
* everything in `input`, so `params` doesn't appear on `ActionSpec`.
|
|
127
135
|
*/
|
|
128
|
-
params?: z.ZodObject;
|
|
129
|
-
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
136
|
+
params?: z.ZodObject | AnySchema;
|
|
137
|
+
/**
|
|
138
|
+
* URL query parameter schema. Use `z.strictObject()` (or fuz_schema's
|
|
139
|
+
* `object`) with string fields; a fuz_schema schema must be an object
|
|
140
|
+
* schema, as for `params`.
|
|
141
|
+
*/
|
|
142
|
+
query?: z.ZodObject | AnySchema;
|
|
143
|
+
/** Request body schema. Use `z.null()` (or `literal(null)`) for routes with no body. */
|
|
144
|
+
input: ValidationSchema;
|
|
133
145
|
/** Success response body schema. */
|
|
134
|
-
output:
|
|
146
|
+
output: ValidationSchema;
|
|
135
147
|
/**
|
|
136
148
|
* Marks a route whose request and/or response carries **raw bytes or a
|
|
137
149
|
* streaming protocol** rather than JSON — git smart-HTTP, file-store
|
|
@@ -213,7 +225,8 @@ export interface RouteSpec {
|
|
|
213
225
|
* Get validated input from the Hono context.
|
|
214
226
|
*
|
|
215
227
|
* Call after the input validation middleware has run. Pass the route's
|
|
216
|
-
* `input` Zod
|
|
228
|
+
* `input` schema, Zod or `@fuzdev/fuz_schema`, to infer the typed shape
|
|
229
|
+
* directly (`ValidationOutput`):
|
|
217
230
|
*
|
|
218
231
|
* ```ts
|
|
219
232
|
* const input = get_route_input(c, my_route_spec.input);
|
|
@@ -225,7 +238,7 @@ export interface RouteSpec {
|
|
|
225
238
|
* const input = get_route_input<MyInput>(c);
|
|
226
239
|
* ```
|
|
227
240
|
*/
|
|
228
|
-
export declare function get_route_input<S extends
|
|
241
|
+
export declare function get_route_input<S extends ValidationSchema>(c: Context, schema: S): ValidationOutput<S>;
|
|
229
242
|
export declare function get_route_input<T = unknown>(c: Context): T;
|
|
230
243
|
/**
|
|
231
244
|
* Get validated URL path params from the Hono context.
|
|
@@ -234,7 +247,7 @@ export declare function get_route_input<T = unknown>(c: Context): T;
|
|
|
234
247
|
* `params` schema to infer the typed shape, or supply an explicit type
|
|
235
248
|
* argument. See `get_route_input` for the two call shapes.
|
|
236
249
|
*/
|
|
237
|
-
export declare function get_route_params<S extends
|
|
250
|
+
export declare function get_route_params<S extends ValidationSchema>(c: Context, schema: S): ValidationOutput<S>;
|
|
238
251
|
export declare function get_route_params<T = unknown>(c: Context): T;
|
|
239
252
|
/**
|
|
240
253
|
* Get validated URL query params from the Hono context.
|
|
@@ -243,7 +256,7 @@ export declare function get_route_params<T = unknown>(c: Context): T;
|
|
|
243
256
|
* `query` schema to infer the typed shape, or supply an explicit type
|
|
244
257
|
* argument. See `get_route_input` for the two call shapes.
|
|
245
258
|
*/
|
|
246
|
-
export declare function get_route_query<S extends
|
|
259
|
+
export declare function get_route_query<S extends ValidationSchema>(c: Context, schema: S): ValidationOutput<S>;
|
|
247
260
|
export declare function get_route_query<T = unknown>(c: Context): T;
|
|
248
261
|
/**
|
|
249
262
|
* Apply named middleware specs to a Hono app.
|
|
@@ -280,18 +293,23 @@ export declare const apply_middleware_specs: (app: Hono, specs: Array<Middleware
|
|
|
280
293
|
* - `pending_effects`: eager fire-and-forget pool-write queue
|
|
281
294
|
* - `post_commit_effects`: deferred-thunk queue (push via `emit_after_commit`)
|
|
282
295
|
*
|
|
283
|
-
* Also enforces registry-time
|
|
296
|
+
* Also enforces the auth shape's registry-time invariants: the cross-axis
|
|
297
|
+
* invariants 1, 3, and 4 (`assert_route_auth_invariants`), and invariant 2:
|
|
284
298
|
* `auth.actor !== 'none' ⟺ input or query declares acting?: ActingActor`.
|
|
285
299
|
* REST is bi-located (GETs declare `acting` on `query`, mutations on
|
|
286
300
|
* `input`), so the check passes both slots; the action-dispatcher
|
|
287
301
|
* registries (`compile_action_registry`) share the same helper with
|
|
288
302
|
* `input` only — `ActionSpec` has no `query` shape.
|
|
289
303
|
*
|
|
304
|
+
* A `@fuzdev/fuz_schema` `params` or `query` must be an object schema
|
|
305
|
+
* (`get_schema_entries`), as the path params and query string are an object:
|
|
306
|
+
* one that isn't throws naming the route.
|
|
307
|
+
*
|
|
290
308
|
* @param resolve_auth_guards - maps `RouteAuth` to middleware — use `fuz_auth_guard_resolver` from `auth/auth_guard_resolver.ts`
|
|
291
309
|
* @param authorize - optional authorization phase; runs after the pre-authorization guards and before the post-authorization guards
|
|
292
310
|
* @param db - used for transaction wrapping and `RouteContext`
|
|
293
311
|
* @mutates `app`
|
|
294
|
-
* @throws Error if two specs share the same `method` + `path` (each combination must be unique),
|
|
312
|
+
* @throws Error if two specs share the same `method` + `path` (each combination must be unique), if any spec violates a cross-axis auth invariant or the actor-acting biconditional, or if a fuz_schema `params` or `query` is not an object schema
|
|
295
313
|
*/
|
|
296
314
|
export declare const apply_route_specs: (app: Hono, specs: Array<RouteSpec>, resolve_auth_guards: AuthGuardResolver, log: Logger, db: Db, authorize?: AuthorizationHandler) => void;
|
|
297
315
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_spec.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_spec.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"route_spec.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAW,IAAI,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;A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;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,gBAAgB,EAC1D,CAAC,EAAE,OAAO,EACV,MAAM,EAAE,CAAC,GACP,gBAAgB,CAAC,CAAC,CAAC,CAAC;AACvB,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC;AAK7D;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,gBAAgB,EACzD,CAAC,EAAE,OAAO,EACV,MAAM,EAAE,CAAC,GACP,gBAAgB,CAAC,CAAC,CAAC,CAAC;AACvB,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC;AA4M5D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,IAAI,EAAE,OAAO,KAAK,CAAC,cAAc,CAAC,KAAG,IAIhF,CAAC;AAsGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,iBAAiB,GAC7B,KAAK,IAAI,EACT,OAAO,KAAK,CAAC,SAAS,CAAC,EACvB,qBAAqB,iBAAiB,EACtC,KAAK,MAAM,EACX,IAAI,EAAE,EACN,YAAY,oBAAoB,KAC9B,IAyEF,CAAC;AAeF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,EAAE,OAAO,KAAK,CAAC,SAAS,CAAC,KAAG,KAAK,CAAC,SAAS,CAK3F,CAAC"}
|
package/dist/http/route_spec.js
CHANGED
|
@@ -5,21 +5,25 @@
|
|
|
5
5
|
* then applied to Hono. The attack surface is generated from the specs —
|
|
6
6
|
* always accurate, always complete.
|
|
7
7
|
*
|
|
8
|
-
* Input/output schemas align with SAES `ActionSpec` conventions
|
|
9
|
-
*
|
|
10
|
-
* - `
|
|
11
|
-
* - `
|
|
8
|
+
* Input/output schemas align with SAES `ActionSpec` conventions, and each is
|
|
9
|
+
* a Zod or `@fuzdev/fuz_schema` schema (`ValidationSchema`):
|
|
10
|
+
* - `input`: the request body schema (`z.null()` or `literal(null)` for no body)
|
|
11
|
+
* - `output`: the success response body schema
|
|
12
|
+
* - a strict object for inputs (reject unknown keys): `z.strictObject()` or `object`
|
|
12
13
|
*
|
|
13
14
|
* @module
|
|
14
15
|
*/
|
|
15
16
|
import { DEV } from 'esm-env';
|
|
17
|
+
import { is_schema } from '@fuzdev/fuz_schema/schema.ts';
|
|
18
|
+
import { get_schema_entries } from '@fuzdev/fuz_schema/introspect.ts';
|
|
16
19
|
import { is_db_checkout_error } from '../db/db_checkout_error.js';
|
|
17
20
|
import { ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY, ERROR_INVALID_ROUTE_PARAMS, ERROR_INVALID_QUERY_PARAMS, ERROR_SERVICE_UNAVAILABLE, ERROR_UNSUPPORTED_CONTENT_TYPE } from './error_schemas.js';
|
|
18
21
|
import { is_post_content_type_refused } from './simple_request.js';
|
|
19
22
|
import { jsonrpc_error_code_to_http_status, jsonrpc_error_code_to_name, dev_only, to_thrown_jsonrpc_error } from './jsonrpc_errors.js';
|
|
20
23
|
import { is_null_schema, merge_error_schemas } from './schema_helpers.js';
|
|
21
24
|
import { dispatch_with_post_commit_rollback } from './pending_effects.js';
|
|
22
|
-
import { assert_route_auth_acting_biconditional } from './auth_shape.js';
|
|
25
|
+
import { assert_route_auth_acting_biconditional, assert_route_auth_invariants } from './auth_shape.js';
|
|
26
|
+
import { parse_any, to_wire_issues } from '../schema_issues.js';
|
|
23
27
|
export function get_route_input(c, _schema) {
|
|
24
28
|
return c.get('validated_input');
|
|
25
29
|
}
|
|
@@ -82,11 +86,14 @@ const create_input_validation = (input_schema, method) => {
|
|
|
82
86
|
if (typeof body !== 'object' || body === null || Array.isArray(body)) {
|
|
83
87
|
return c.json({ error: ERROR_INVALID_JSON_BODY }, 400);
|
|
84
88
|
}
|
|
85
|
-
const result = input_schema
|
|
86
|
-
if (!result.
|
|
87
|
-
return c.json({
|
|
89
|
+
const result = parse_any(input_schema, body);
|
|
90
|
+
if (!result.ok) {
|
|
91
|
+
return c.json({
|
|
92
|
+
error: ERROR_INVALID_REQUEST_BODY,
|
|
93
|
+
issues: dev_only(() => to_wire_issues(result.issues, body))
|
|
94
|
+
}, 400);
|
|
88
95
|
}
|
|
89
|
-
c.set('validated_input', result.
|
|
96
|
+
c.set('validated_input', result.value);
|
|
90
97
|
await next();
|
|
91
98
|
};
|
|
92
99
|
return [validate];
|
|
@@ -105,11 +112,14 @@ const create_params_validation = (params_schema) => {
|
|
|
105
112
|
return [];
|
|
106
113
|
const validate = async (c, next) => {
|
|
107
114
|
const raw_params = c.req.param();
|
|
108
|
-
const result = params_schema
|
|
109
|
-
if (!result.
|
|
110
|
-
return c.json({
|
|
115
|
+
const result = parse_any(params_schema, raw_params);
|
|
116
|
+
if (!result.ok) {
|
|
117
|
+
return c.json({
|
|
118
|
+
error: ERROR_INVALID_ROUTE_PARAMS,
|
|
119
|
+
issues: dev_only(() => to_wire_issues(result.issues, raw_params))
|
|
120
|
+
}, 400);
|
|
111
121
|
}
|
|
112
|
-
c.set('validated_params', result.
|
|
122
|
+
c.set('validated_params', result.value);
|
|
113
123
|
await next();
|
|
114
124
|
};
|
|
115
125
|
return [validate];
|
|
@@ -128,11 +138,14 @@ const create_query_validation = (query_schema) => {
|
|
|
128
138
|
return [];
|
|
129
139
|
const validate = async (c, next) => {
|
|
130
140
|
const raw_query = c.req.query();
|
|
131
|
-
const result = query_schema
|
|
132
|
-
if (!result.
|
|
133
|
-
return c.json({
|
|
141
|
+
const result = parse_any(query_schema, raw_query);
|
|
142
|
+
if (!result.ok) {
|
|
143
|
+
return c.json({
|
|
144
|
+
error: ERROR_INVALID_QUERY_PARAMS,
|
|
145
|
+
issues: dev_only(() => to_wire_issues(result.issues, raw_query))
|
|
146
|
+
}, 400);
|
|
134
147
|
}
|
|
135
|
-
c.set('validated_query', result.
|
|
148
|
+
c.set('validated_query', result.value);
|
|
136
149
|
await next();
|
|
137
150
|
};
|
|
138
151
|
return [validate];
|
|
@@ -153,6 +166,8 @@ const is_service_unavailable_body = (body) => body !== null &&
|
|
|
153
166
|
* catch layer, so the body built from a thrown error is validated too — except
|
|
154
167
|
* a 500 `internal_error` and a failed checkout's 503 `service_unavailable`,
|
|
155
168
|
* which the catch layer can answer on any route and so are always accepted.
|
|
169
|
+
* Each schema is Zod or `@fuzdev/fuz_schema`, parsed with `parse_any`; the
|
|
170
|
+
* log carries the library's own issues.
|
|
156
171
|
* Logs an error for mismatches and returns the response unchanged —
|
|
157
172
|
* does not throw. Non-JSON responses (SSE, binary) are skipped. In
|
|
158
173
|
* production, returns the handler unchanged.
|
|
@@ -187,12 +202,12 @@ const wrap_output_validation = (handler, output_schema, error_schemas, log) => {
|
|
|
187
202
|
// the same for a failed pool checkout's 503, which any route can answer
|
|
188
203
|
if (response.status === 503 && is_service_unavailable_body(body))
|
|
189
204
|
return response;
|
|
190
|
-
const result = schema
|
|
191
|
-
if (!result.
|
|
205
|
+
const result = parse_any(schema, body);
|
|
206
|
+
if (!result.ok) {
|
|
192
207
|
const label = response.ok
|
|
193
208
|
? 'Output schema mismatch'
|
|
194
209
|
: `Error schema mismatch (${response.status})`;
|
|
195
|
-
log.error(`${label}: ${c.req.method} ${c.req.path}`, result.
|
|
210
|
+
log.error(`${label}: ${c.req.method} ${c.req.path}`, result.issues);
|
|
196
211
|
}
|
|
197
212
|
return response;
|
|
198
213
|
};
|
|
@@ -260,11 +275,11 @@ const wrap_error_catch = (handler, log) => {
|
|
|
260
275
|
}
|
|
261
276
|
// generic error — internal_error. Raw exception messages can leak
|
|
262
277
|
// internals; surface them only in development (same gate as the
|
|
263
|
-
//
|
|
278
|
+
// validation-issue redaction), production gets the bare error code.
|
|
264
279
|
log.error('Unhandled handler error', err);
|
|
265
280
|
const body = {
|
|
266
281
|
error: 'internal_error',
|
|
267
|
-
message: dev_only(err instanceof Error ? err.message : undefined)
|
|
282
|
+
message: dev_only(() => (err instanceof Error ? err.message : undefined))
|
|
268
283
|
};
|
|
269
284
|
return c.json(body, 500);
|
|
270
285
|
}
|
|
@@ -333,18 +348,23 @@ const build_rest_error_body = (err) => {
|
|
|
333
348
|
* - `pending_effects`: eager fire-and-forget pool-write queue
|
|
334
349
|
* - `post_commit_effects`: deferred-thunk queue (push via `emit_after_commit`)
|
|
335
350
|
*
|
|
336
|
-
* Also enforces registry-time
|
|
351
|
+
* Also enforces the auth shape's registry-time invariants: the cross-axis
|
|
352
|
+
* invariants 1, 3, and 4 (`assert_route_auth_invariants`), and invariant 2:
|
|
337
353
|
* `auth.actor !== 'none' ⟺ input or query declares acting?: ActingActor`.
|
|
338
354
|
* REST is bi-located (GETs declare `acting` on `query`, mutations on
|
|
339
355
|
* `input`), so the check passes both slots; the action-dispatcher
|
|
340
356
|
* registries (`compile_action_registry`) share the same helper with
|
|
341
357
|
* `input` only — `ActionSpec` has no `query` shape.
|
|
342
358
|
*
|
|
359
|
+
* A `@fuzdev/fuz_schema` `params` or `query` must be an object schema
|
|
360
|
+
* (`get_schema_entries`), as the path params and query string are an object:
|
|
361
|
+
* one that isn't throws naming the route.
|
|
362
|
+
*
|
|
343
363
|
* @param resolve_auth_guards - maps `RouteAuth` to middleware — use `fuz_auth_guard_resolver` from `auth/auth_guard_resolver.ts`
|
|
344
364
|
* @param authorize - optional authorization phase; runs after the pre-authorization guards and before the post-authorization guards
|
|
345
365
|
* @param db - used for transaction wrapping and `RouteContext`
|
|
346
366
|
* @mutates `app`
|
|
347
|
-
* @throws Error if two specs share the same `method` + `path` (each combination must be unique),
|
|
367
|
+
* @throws Error if two specs share the same `method` + `path` (each combination must be unique), if any spec violates a cross-axis auth invariant or the actor-acting biconditional, or if a fuz_schema `params` or `query` is not an object schema
|
|
348
368
|
*/
|
|
349
369
|
export const apply_route_specs = (app, specs, resolve_auth_guards, log, db, authorize) => {
|
|
350
370
|
const registered = new Set();
|
|
@@ -354,6 +374,9 @@ export const apply_route_specs = (app, specs, resolve_auth_guards, log, db, auth
|
|
|
354
374
|
throw new Error(`Duplicate route: ${route_key} — each method+path combination must be unique`);
|
|
355
375
|
}
|
|
356
376
|
registered.add(route_key);
|
|
377
|
+
assert_object_slot(spec.params, 'params', route_key);
|
|
378
|
+
assert_object_slot(spec.query, 'query', route_key);
|
|
379
|
+
assert_route_auth_invariants(spec.auth, `Route "${route_key}"`);
|
|
357
380
|
assert_route_auth_acting_biconditional(spec.auth, { input: spec.input, query: spec.query }, `Route "${route_key}"`);
|
|
358
381
|
const { pre_authorization: pre_authorization_guards, post_authorization: post_authorization_guards } = resolve_auth_guards(spec.auth);
|
|
359
382
|
const content_type_check = create_content_type_check(spec);
|
|
@@ -396,6 +419,13 @@ export const apply_route_specs = (app, specs, resolve_auth_guards, log, db, auth
|
|
|
396
419
|
app.on(spec.method, [spec.path], ...content_type_check, ...params_validation, ...query_validation, ...pre_authorization_guards, ...authorization, ...post_authorization_guards, ...input_validation, handler);
|
|
397
420
|
}
|
|
398
421
|
};
|
|
422
|
+
// throws unless a fuz_schema `params` / `query` is an object schema under any
|
|
423
|
+
// wrappers; a Zod one is a `z.ZodObject` by its type
|
|
424
|
+
const assert_object_slot = (schema, slot, route_key) => {
|
|
425
|
+
if (schema === undefined || !is_schema(schema) || get_schema_entries(schema))
|
|
426
|
+
return;
|
|
427
|
+
throw new Error(`Route "${route_key}": ${slot} is a @fuzdev/fuz_schema '${schema.kind}' schema, not an object schema`);
|
|
428
|
+
};
|
|
399
429
|
/**
|
|
400
430
|
* Prepend a prefix to all route spec paths.
|
|
401
431
|
*
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
|
-
import { z } from 'zod';
|
|
11
10
|
import type { RouteAuth } from './auth_shape.js';
|
|
12
11
|
import type { RouteMethod } from './route_spec.js';
|
|
13
12
|
import { type RateLimitKey, type RouteErrorSchemas } from './error_schemas.js';
|
|
@@ -22,19 +21,23 @@ import { type ParseAnyResult, type ValidationOutput, type ValidationSchema } fro
|
|
|
22
21
|
*/
|
|
23
22
|
export declare const is_null_schema: (schema: ValidationSchema) => boolean;
|
|
24
23
|
/**
|
|
25
|
-
* Check if a schema is exactly `z.void()
|
|
24
|
+
* Check if a schema is exactly `z.void()`, or a `@fuzdev/fuz_schema`
|
|
25
|
+
* `literal(undefined)` (what its `s.void` is, `meta` copies included).
|
|
26
26
|
*
|
|
27
|
-
* RPC action specs use
|
|
27
|
+
* RPC action specs use a void schema to declare a parameterless method —
|
|
28
28
|
* JSON-RPC 2.0 forbids `params: null` (params must be omitted or be a
|
|
29
|
-
* Structured value), so
|
|
30
|
-
*
|
|
29
|
+
* Structured value), so void is the correct schema for "no params" and the
|
|
30
|
+
* dispatcher maps absent params to `undefined` for these specs. Like
|
|
31
|
+
* `is_null_schema`, it reads the schema's kind rather than parsing
|
|
32
|
+
* `undefined`, so an optional schema is not void. `z.undefined()` is not
|
|
33
|
+
* void either.
|
|
31
34
|
*/
|
|
32
35
|
export declare const is_void_schema: (schema: ValidationSchema) => boolean;
|
|
33
36
|
/**
|
|
34
|
-
* Normalize the raw `params` of a
|
|
35
|
-
* empty object, and the `null` a GET `?params=null` parses to
|
|
36
|
-
* no-arg call (`undefined`); anything else passes through for
|
|
37
|
-
* refuse.
|
|
37
|
+
* Normalize the raw `params` of a void input (`is_void_schema`): an absent
|
|
38
|
+
* `params`, an empty object, and the `null` a GET `?params=null` parses to
|
|
39
|
+
* are all the no-arg call (`undefined`); anything else passes through for the
|
|
40
|
+
* void schema to refuse.
|
|
38
41
|
*
|
|
39
42
|
* JSON-RPC 2.0 lets a parameterless call omit `params`, and an empty by-name
|
|
40
43
|
* structure carries no parameters, so refusing `{}` would only break clients
|
|
@@ -49,18 +52,18 @@ export declare const is_void_schema: (schema: ValidationSchema) => boolean;
|
|
|
49
52
|
export declare const to_void_params: (raw_params: unknown) => unknown;
|
|
50
53
|
/**
|
|
51
54
|
* Normalize the raw `params` of an RPC call for `input` to validate: for a
|
|
52
|
-
*
|
|
53
|
-
* `null` `params` reads as `{}`, so an
|
|
54
|
-
* call that omits them. Every receiving
|
|
55
|
-
* (`perform_action`) and a peer receiving a
|
|
56
|
-
* (`ActionDispatcher`) — reads params through this,
|
|
57
|
-
* stricter than the server.
|
|
58
|
-
*
|
|
59
|
-
* @param input - the action's input schema
|
|
55
|
+
* void input (`is_void_schema`, Zod or fuz_schema), `to_void_params`; for
|
|
56
|
+
* any other input, an absent or `null` `params` reads as `{}`, so an
|
|
57
|
+
* all-optional object input accepts a call that omits them. Every receiving
|
|
58
|
+
* end — the server dispatch (`perform_action`) and a peer receiving a
|
|
59
|
+
* request or notification (`ActionDispatcher`) — reads params through this,
|
|
60
|
+
* so a peer is never stricter than the server.
|
|
61
|
+
*
|
|
62
|
+
* @param input - the action's input schema, Zod or fuz_schema
|
|
60
63
|
* @param raw_params - the call's `params` as parsed off the wire
|
|
61
64
|
* @returns the value the input parse (`parse_any`) reads
|
|
62
65
|
*/
|
|
63
|
-
export declare const to_input_params: (input:
|
|
66
|
+
export declare const to_input_params: (input: ValidationSchema, raw_params: unknown) => unknown;
|
|
64
67
|
/**
|
|
65
68
|
* Check whether a parsed JSON value holds an own `__proto__` key in any
|
|
66
69
|
* object, at any depth — what the dispatcher refuses in a request's `params`
|
|
@@ -170,9 +173,9 @@ export interface SchemaToSurfaceOptions {
|
|
|
170
173
|
* Convert a Zod or `@fuzdev/fuz_schema` schema to its JSON Schema for the
|
|
171
174
|
* surface, with `$schema` and `default` stripped at every depth.
|
|
172
175
|
*
|
|
173
|
-
* Returns `null` for a null schema (`is_null_schema`) and a
|
|
174
|
-
* (`is_void_schema`): no body, no params. Any other
|
|
175
|
-
* its library's emitter (`to_json_schema` for fuz_schema, `z.toJSONSchema`
|
|
176
|
+
* Returns `null` for a null schema (`is_null_schema`) and a void schema
|
|
177
|
+
* (`is_void_schema`), in either library: no body, no params. Any other
|
|
178
|
+
* schema is written with its library's emitter (`to_json_schema` for fuz_schema, `z.toJSONSchema`
|
|
176
179
|
* for Zod) on the side `options.io` names. A part JSON Schema can't say (a
|
|
177
180
|
* transform on the output side, a `z.custom()`, a fuz_schema `check`) is left
|
|
178
181
|
* out or written as `{}` (a `pipe(string, check(…))` writes as
|
|
@@ -241,9 +244,9 @@ export declare const middleware_spec_applies: (spec: {
|
|
|
241
244
|
export declare const merge_error_schemas: (spec: {
|
|
242
245
|
method: RouteMethod;
|
|
243
246
|
auth: RouteAuth;
|
|
244
|
-
input:
|
|
245
|
-
params?:
|
|
246
|
-
query?:
|
|
247
|
+
input: ValidationSchema;
|
|
248
|
+
params?: ValidationSchema;
|
|
249
|
+
query?: ValidationSchema;
|
|
247
250
|
rate_limit?: RateLimitKey;
|
|
248
251
|
errors?: RouteErrorSchemas;
|
|
249
252
|
}, middleware_errors?: RouteErrorSchemas | null) => RouteErrorSchemas | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/schema_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"schema_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/schema_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAEN,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGN,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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MAAM,EAAE,GAAG,MAAM,KAAG,OAM/D,CAAC;AAEF;;;;;;GAMG;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,OAE0F,CAAC;AAE9F;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM;IACL,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC3B,EACD,oBAAoB,iBAAiB,GAAG,IAAI,KAC1C,iBAAiB,GAAG,IAWtB,CAAC"}
|
|
@@ -25,19 +25,24 @@ import { parse_any, unknown_key_targets } from '../schema_issues.js';
|
|
|
25
25
|
export const is_null_schema = (schema) => schema instanceof z.ZodNull ||
|
|
26
26
|
(is_schema(schema) && schema.kind === 'literal' && schema.def === null);
|
|
27
27
|
/**
|
|
28
|
-
* Check if a schema is exactly `z.void()
|
|
28
|
+
* Check if a schema is exactly `z.void()`, or a `@fuzdev/fuz_schema`
|
|
29
|
+
* `literal(undefined)` (what its `s.void` is, `meta` copies included).
|
|
29
30
|
*
|
|
30
|
-
* RPC action specs use
|
|
31
|
+
* RPC action specs use a void schema to declare a parameterless method —
|
|
31
32
|
* JSON-RPC 2.0 forbids `params: null` (params must be omitted or be a
|
|
32
|
-
* Structured value), so
|
|
33
|
-
*
|
|
33
|
+
* Structured value), so void is the correct schema for "no params" and the
|
|
34
|
+
* dispatcher maps absent params to `undefined` for these specs. Like
|
|
35
|
+
* `is_null_schema`, it reads the schema's kind rather than parsing
|
|
36
|
+
* `undefined`, so an optional schema is not void. `z.undefined()` is not
|
|
37
|
+
* void either.
|
|
34
38
|
*/
|
|
35
|
-
export const is_void_schema = (schema) => schema instanceof z.ZodVoid
|
|
39
|
+
export const is_void_schema = (schema) => schema instanceof z.ZodVoid ||
|
|
40
|
+
(is_schema(schema) && schema.kind === 'literal' && schema.def === undefined);
|
|
36
41
|
/**
|
|
37
|
-
* Normalize the raw `params` of a
|
|
38
|
-
* empty object, and the `null` a GET `?params=null` parses to
|
|
39
|
-
* no-arg call (`undefined`); anything else passes through for
|
|
40
|
-
* refuse.
|
|
42
|
+
* Normalize the raw `params` of a void input (`is_void_schema`): an absent
|
|
43
|
+
* `params`, an empty object, and the `null` a GET `?params=null` parses to
|
|
44
|
+
* are all the no-arg call (`undefined`); anything else passes through for the
|
|
45
|
+
* void schema to refuse.
|
|
41
46
|
*
|
|
42
47
|
* JSON-RPC 2.0 lets a parameterless call omit `params`, and an empty by-name
|
|
43
48
|
* structure carries no parameters, so refusing `{}` would only break clients
|
|
@@ -61,14 +66,14 @@ export const to_void_params = (raw_params) => {
|
|
|
61
66
|
};
|
|
62
67
|
/**
|
|
63
68
|
* Normalize the raw `params` of an RPC call for `input` to validate: for a
|
|
64
|
-
*
|
|
65
|
-
* `null` `params` reads as `{}`, so an
|
|
66
|
-
* call that omits them. Every receiving
|
|
67
|
-
* (`perform_action`) and a peer receiving a
|
|
68
|
-
* (`ActionDispatcher`) — reads params through this,
|
|
69
|
-
* stricter than the server.
|
|
69
|
+
* void input (`is_void_schema`, Zod or fuz_schema), `to_void_params`; for
|
|
70
|
+
* any other input, an absent or `null` `params` reads as `{}`, so an
|
|
71
|
+
* all-optional object input accepts a call that omits them. Every receiving
|
|
72
|
+
* end — the server dispatch (`perform_action`) and a peer receiving a
|
|
73
|
+
* request or notification (`ActionDispatcher`) — reads params through this,
|
|
74
|
+
* so a peer is never stricter than the server.
|
|
70
75
|
*
|
|
71
|
-
* @param input - the action's input schema
|
|
76
|
+
* @param input - the action's input schema, Zod or fuz_schema
|
|
72
77
|
* @param raw_params - the call's `params` as parsed off the wire
|
|
73
78
|
* @returns the value the input parse (`parse_any`) reads
|
|
74
79
|
*/
|
|
@@ -325,9 +330,9 @@ const fuz_schema_untransformed_head = (schema) => {
|
|
|
325
330
|
* Convert a Zod or `@fuzdev/fuz_schema` schema to its JSON Schema for the
|
|
326
331
|
* surface, with `$schema` and `default` stripped at every depth.
|
|
327
332
|
*
|
|
328
|
-
* Returns `null` for a null schema (`is_null_schema`) and a
|
|
329
|
-
* (`is_void_schema`): no body, no params. Any other
|
|
330
|
-
* its library's emitter (`to_json_schema` for fuz_schema, `z.toJSONSchema`
|
|
333
|
+
* Returns `null` for a null schema (`is_null_schema`) and a void schema
|
|
334
|
+
* (`is_void_schema`), in either library: no body, no params. Any other
|
|
335
|
+
* schema is written with its library's emitter (`to_json_schema` for fuz_schema, `z.toJSONSchema`
|
|
331
336
|
* for Zod) on the side `options.io` names. A part JSON Schema can't say (a
|
|
332
337
|
* transform on the output side, a `z.custom()`, a fuz_schema `check`) is left
|
|
333
338
|
* out or written as `{}` (a `pipe(string, check(…))` writes as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBA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AC;CAC5C;AAED,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC1B;AAED,0CAA0C;AAC1C,MAAM,WAAW,yBAAyB;IACzC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC9B,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACxC,2FAA2F;IAC3F,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B,aAAa,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IACvC;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CACrD;AAID;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACrC,YAAY,KAAK,CAAC,cAAc,CAAC,EACjC,YAAY,MAAM,KAChB,iBAAiB,GAAG,IAQtB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,SAAS,KAAG,KAAK,CAAC,aAAa,CAc5E,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC7B,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,cAAc,KAAK,CAAC,oBAAoB,CAAC,KACvC,KAAK,CAAC,eAAe,CAQvB,CAAC;AA2BF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,yBAAyB,KAAG,UA6IzE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,yBAAyB,KAAG,cAS5E,CAAC"}
|
package/dist/http/surface.js
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
import { get_schema_entries, get_schema_fields } from '@fuzdev/fuz_schema/introspect.ts';
|
|
10
|
-
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
11
|
-
import { z } from 'zod';
|
|
10
|
+
import { is_schema, parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
12
11
|
import { schema_to_surface, middleware_spec_applies, merge_error_schemas, is_null_schema, is_strict_object_schema } from './schema_helpers.js';
|
|
13
12
|
import { find_schema_sensitivity } from '../sensitivity.js';
|
|
14
13
|
// --- Surface generation ---
|
|
@@ -83,6 +82,9 @@ const create_to_surface = (diagnostics) => (schema, io, source) => schema_to_sur
|
|
|
83
82
|
})
|
|
84
83
|
: undefined
|
|
85
84
|
});
|
|
85
|
+
// a fuz_schema input that is not a strict `object`: a `strip_object` drops
|
|
86
|
+
// unknown keys and a `loose_object` keeps them, so the text names neither
|
|
87
|
+
const FUZ_SCHEMA_NOT_STRICT_INPUT_MESSAGE = 'Input schema is not a strict object (@fuzdev/fuz_schema `object`) — unknown keys may not be refused';
|
|
86
88
|
/**
|
|
87
89
|
* Generate a JSON-serializable attack surface from middleware, route specs,
|
|
88
90
|
* and optional env/event metadata.
|
|
@@ -97,7 +99,9 @@ export const generate_app_surface = (options) => {
|
|
|
97
99
|
diagnostics.push({
|
|
98
100
|
level: 'warning',
|
|
99
101
|
category: 'schema',
|
|
100
|
-
message:
|
|
102
|
+
message: is_schema(r.input)
|
|
103
|
+
? FUZ_SCHEMA_NOT_STRICT_INPUT_MESSAGE
|
|
104
|
+
: 'Input schema is not z.strictObject() — unknown keys will be silently stripped',
|
|
101
105
|
source: `${r.method} ${r.path} input`
|
|
102
106
|
});
|
|
103
107
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* @module
|
|
20
20
|
*/
|
|
21
21
|
import { z } from 'zod';
|
|
22
|
+
import type { Branded } from '@fuzdev/fuz_schema/schema.ts';
|
|
22
23
|
import { type FactHash } from '@fuzdev/fuz_util/hash_schemas.ts';
|
|
23
24
|
/** Length bounds for `bounded_string`, in UTF-16 code units. */
|
|
24
25
|
export interface BoundedStringOptions {
|
|
@@ -121,18 +122,28 @@ export declare const create_uuid: () => Uuid;
|
|
|
121
122
|
* Branded UUID schema. Accepts either case and outputs lowercase — the form
|
|
122
123
|
* Postgres renders a `uuid` in and every id the server mints — so a parsed id
|
|
123
124
|
* compares equal to the same id read back from the database. The Rust spine
|
|
124
|
-
* canonicalizes the same way
|
|
125
|
-
*
|
|
126
|
-
*
|
|
125
|
+
* canonicalizes the same way, and its grammar is this one, the fuz_schema
|
|
126
|
+
* twin's in `primitive_schemas_fuz.ts`: `z.uuid()` with the max UUID taken in
|
|
127
|
+
* any case. Issues and JSON Schema keep `format: 'uuid'`; only the `pattern`
|
|
128
|
+
* differs from a bare `z.uuid()`'s, rendered or on a Zod issue (the wire
|
|
129
|
+
* issue drops it).
|
|
130
|
+
*
|
|
131
|
+
* `pattern` is a `$ZodUUIDDef` field that `z.uuid()` honors (its default
|
|
132
|
+
* applies only when none is given) but whose public params type omits it,
|
|
133
|
+
* hence the cast on the params.
|
|
127
134
|
*
|
|
128
135
|
* `.toLowerCase()` rather than `.transform()`: an overwrite keeps the output
|
|
129
136
|
* type and stays invisible to `z.toJSONSchema`, where a transform would leave
|
|
130
137
|
* no input schema to render.
|
|
138
|
+
*
|
|
139
|
+
* The output type is fuz_schema's `Branded<string, 'Uuid'>`, the twin's, by a
|
|
140
|
+
* cast as on `FactHashSchema`: Zod's `.brand('Uuid')` would output Zod's own
|
|
141
|
+
* brand, which a fuz_schema `Uuid` isn't assignable to.
|
|
131
142
|
*/
|
|
132
|
-
export declare const Uuid: z.
|
|
143
|
+
export declare const Uuid: z.ZodUUID & z.ZodType<Branded<string, 'Uuid'>, string>;
|
|
133
144
|
export type Uuid = z.infer<typeof Uuid>;
|
|
134
145
|
/** `Uuid` that defaults to a fresh `create_uuid()` when the input is `undefined`. */
|
|
135
|
-
export declare const UuidWithDefault: z.ZodDefault<z.
|
|
146
|
+
export declare const UuidWithDefault: z.ZodDefault<z.ZodUUID & z.ZodType<Branded<string, "Uuid">, string, z.core.$ZodTypeInternals<Branded<string, "Uuid">, string>>>;
|
|
136
147
|
export type UuidWithDefault = z.infer<typeof UuidWithDefault>;
|
|
137
148
|
/**
|
|
138
149
|
* Branded datetime schema, zod's default `z.iso.datetime()`: an RFC 3339 date
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitive_schemas.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/primitive_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAIlF,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACpC,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,oBAAoB,KAAG,CAAC,CAAC,SA+ChE,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,6GAA6G;AAC7G,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,gNAAgN;AAChN,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,wDAEc,CAAC;AACpC,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,wDAEqE,CAAC;AACnG,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAqBpC;;;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