@fuzdev/fuz_app 0.168.1 → 0.169.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 +1 -1
- package/dist/actions/action_codegen.d.ts +9 -7
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +20 -15
- package/dist/actions/action_event_data.d.ts +16 -16
- package/dist/auth/account_action_specs.d.ts +11 -11
- package/dist/auth/account_action_specs.js +1 -1
- package/dist/auth/account_route_schema.d.ts +18 -18
- package/dist/auth/account_route_schema.js +1 -1
- package/dist/auth/account_routes.js +1 -1
- package/dist/auth/account_schema.d.ts +38 -40
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +7 -8
- package/dist/auth/actor_lookup_action_specs.d.ts +7 -7
- package/dist/auth/actor_lookup_action_specs.js +1 -1
- package/dist/auth/actor_search_action_specs.d.ts +6 -6
- package/dist/auth/actor_search_action_specs.js +1 -1
- package/dist/auth/admin_action_specs.d.ts +166 -166
- package/dist/auth/admin_action_specs.js +1 -1
- package/dist/auth/app_settings_schema.d.ts +3 -3
- package/dist/auth/app_settings_schema.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.js +1 -1
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.js +1 -1
- package/dist/auth/audit_log_schema.d.ts +61 -61
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +1 -1
- package/dist/auth/bootstrap_route_schema.d.ts +4 -4
- package/dist/auth/bootstrap_route_schema.js +1 -1
- package/dist/auth/cell_action_specs.d.ts +424 -424
- package/dist/auth/cell_action_specs.js +1 -1
- package/dist/auth/cell_audit_action_specs.d.ts +14 -14
- package/dist/auth/cell_audit_action_specs.js +1 -1
- package/dist/auth/cell_audit_metadata.d.ts +8 -8
- package/dist/auth/cell_audit_metadata.js +1 -1
- package/dist/auth/cell_field_action_specs.d.ts +55 -55
- package/dist/auth/cell_field_action_specs.js +1 -1
- package/dist/auth/cell_field_audit_metadata.d.ts +4 -4
- package/dist/auth/cell_field_audit_metadata.js +1 -1
- package/dist/auth/cell_grant_action_specs.d.ts +61 -61
- package/dist/auth/cell_grant_action_specs.js +1 -1
- package/dist/auth/cell_grant_audit_metadata.d.ts +10 -10
- package/dist/auth/cell_grant_audit_metadata.js +1 -1
- package/dist/auth/cell_item_action_specs.d.ts +76 -76
- package/dist/auth/cell_item_action_specs.js +1 -1
- package/dist/auth/cell_item_audit_metadata.d.ts +5 -5
- package/dist/auth/cell_item_audit_metadata.js +1 -1
- package/dist/auth/invite_schema.d.ts +11 -11
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/invite_schema.js +1 -1
- package/dist/auth/name_schema.js +1 -1
- package/dist/auth/password.js +1 -1
- package/dist/auth/role_grant_offer_action_specs.d.ts +182 -182
- package/dist/auth/role_grant_offer_action_specs.js +1 -1
- package/dist/auth/role_grant_offer_notifications.d.ts +107 -107
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +1 -1
- package/dist/auth/role_grant_offer_schema.d.ts +9 -9
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_schema.js +1 -1
- package/dist/auth/self_service_role_action_specs.d.ts +2 -2
- package/dist/auth/self_service_role_action_specs.js +1 -1
- package/dist/auth/signup_route_schema.d.ts +2 -2
- package/dist/auth/signup_route_schema.js +1 -1
- package/dist/auth/token_scope.d.ts +8 -8
- package/dist/db/file_fact_url.d.ts +1 -1
- package/dist/http/CLAUDE.md +7 -7
- package/dist/http/auth_shape.d.ts +15 -32
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +31 -38
- package/dist/http/db_routes.d.ts +1 -1
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +1 -1
- package/dist/http/error_schemas.d.ts +18 -18
- package/dist/http/jsonrpc.d.ts +11 -11
- package/dist/http/schema_helpers.d.ts +2 -2
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +8 -7
- package/dist/primitive_schemas.d.ts +173 -115
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +134 -158
- package/dist/schema_issues.d.ts +10 -7
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +38 -8
- package/dist/server/serve_fact_route.js +1 -1
- package/dist/server/surface_route.js +1 -1
- package/dist/testing/CLAUDE.md +3 -3
- package/dist/testing/cross_backend/conformance_case.d.ts +96 -114
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.js +0 -256
- package/dist/testing/cross_backend/fact_serving.js +1 -1
- package/dist/testing/cross_backend/setup.d.ts +1 -1
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +3 -4
- package/dist/testing/cross_backend/testing_origin_check.d.ts +8 -8
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +608 -201
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +46 -55
- package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.js +35 -0
- package/dist/testing/rpc_helpers.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +0 -1
- package/dist/testing/schema_generators.js +1 -13
- package/dist/testing/schema_introspect.d.ts +438 -78
- package/dist/testing/schema_introspect.d.ts.map +1 -1
- package/dist/testing/schema_introspect.js +26 -26
- 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 +1 -1
- package/dist/ui/BootstrapForm.svelte +1 -2
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
- package/dist/ui/SignupForm.svelte +1 -2
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +5 -5
- 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 +1 -1
- package/dist/zod.d.ts +18 -3
- package/dist/zod.d.ts.map +1 -1
- package/dist/zod.js +26 -3
- package/dist/zod_schemas.d.ts +100 -0
- package/dist/zod_schemas.d.ts.map +1 -0
- package/dist/zod_schemas.js +157 -0
- package/package.json +3 -3
- package/dist/primitive_schemas_fuz.d.ts +0 -178
- package/dist/primitive_schemas_fuz.d.ts.map +0 -1
- package/dist/primitive_schemas_fuz.js +0 -149
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing_reset_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"testing_reset_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAmG9B,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAO3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAA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,aAAa,CAAC,SAAS,CAAC,KAC/B,SAMF,CAAC;AAEF,4CAA4C;AAC5C,MAAM,WAAW,2BAA2B;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;IAC9C;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,OAAO,EACb,SAAS,2BAA2B,KAClC,KAAK,CAAC,SAAS,CAwJjB,CAAC"}
|
|
@@ -78,7 +78,8 @@ import '../assert_dev_env.js';
|
|
|
78
78
|
*
|
|
79
79
|
* @module
|
|
80
80
|
*/
|
|
81
|
-
import {
|
|
81
|
+
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
82
|
+
import { array, boolean, max_value, min_value, number, object, optional, pipe, safe_integer, string, void as fuz_void } from '@fuzdev/fuz_schema/schema.ts';
|
|
82
83
|
import { Uuid, FactHashSchema } from '../../primitive_schemas.js';
|
|
83
84
|
import { fact_hash_bytes } from '@fuzdev/fuz_util/fact_hash.ts';
|
|
84
85
|
import { rpc_action } from '../../actions/action_types.js';
|
|
@@ -95,11 +96,11 @@ import { create_test_account_with_credentials, mint_test_session } from '../app_
|
|
|
95
96
|
import { DEFAULT_TEST_PASSWORD } from '../test_credentials.js';
|
|
96
97
|
import { TESTING_ACTION_AUTH } from './spine_surface_constants.js';
|
|
97
98
|
/** Output shape for an individual seeded account (keeper or extra). */
|
|
98
|
-
const SeededAccountShape =
|
|
99
|
-
account:
|
|
100
|
-
actor:
|
|
101
|
-
api_token:
|
|
102
|
-
session_cookie:
|
|
99
|
+
const SeededAccountShape = object({
|
|
100
|
+
account: object({ id: Uuid, username: string }),
|
|
101
|
+
actor: object({ id: Uuid }),
|
|
102
|
+
api_token: string,
|
|
103
|
+
session_cookie: string
|
|
103
104
|
});
|
|
104
105
|
/**
|
|
105
106
|
* The `_testing_reset` action spec.
|
|
@@ -132,15 +133,13 @@ export const testing_reset_action_spec = {
|
|
|
132
133
|
initiator: 'frontend',
|
|
133
134
|
auth: TESTING_ACTION_AUTH,
|
|
134
135
|
side_effects: true,
|
|
135
|
-
input:
|
|
136
|
-
extra_keeper_roles:
|
|
137
|
-
extra_accounts:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}))
|
|
143
|
-
.optional(),
|
|
136
|
+
input: object({
|
|
137
|
+
extra_keeper_roles: optional(array(string)),
|
|
138
|
+
extra_accounts: optional(array(object({
|
|
139
|
+
username: string,
|
|
140
|
+
password_value: optional(string),
|
|
141
|
+
roles: array(string)
|
|
142
|
+
}))),
|
|
144
143
|
/**
|
|
145
144
|
* Additional actor names to seed on the **keeper** account, beyond
|
|
146
145
|
* its single bootstrap actor. Drives the multi-actor `acting`
|
|
@@ -150,12 +149,13 @@ export const testing_reset_action_spec = {
|
|
|
150
149
|
* production wire path adds a second. Bootstrap-cradle seeding, same
|
|
151
150
|
* rationale as `extra_accounts`.
|
|
152
151
|
*/
|
|
153
|
-
extra_actors:
|
|
152
|
+
extra_actors: optional(array(string))
|
|
154
153
|
}),
|
|
155
|
-
output:
|
|
156
|
-
|
|
154
|
+
output: object({
|
|
155
|
+
...SeededAccountShape.def,
|
|
156
|
+
extra_accounts: array(SeededAccountShape),
|
|
157
157
|
/** The keeper's additional actors (from input `extra_actors`), in order. */
|
|
158
|
-
extra_actors:
|
|
158
|
+
extra_actors: array(object({ id: Uuid, name: string }))
|
|
159
159
|
}),
|
|
160
160
|
async: true,
|
|
161
161
|
description: 'Test-binary only — wipe auth tables, re-bootstrap a fresh keeper (+ optional extras), fire the domain-state reset.'
|
|
@@ -195,10 +195,10 @@ export const testing_drain_effects_action_spec = {
|
|
|
195
195
|
initiator: 'frontend',
|
|
196
196
|
auth: TESTING_ACTION_AUTH,
|
|
197
197
|
side_effects: false,
|
|
198
|
-
input:
|
|
199
|
-
output:
|
|
200
|
-
ok:
|
|
201
|
-
tracked:
|
|
198
|
+
input: fuz_void,
|
|
199
|
+
output: object({
|
|
200
|
+
ok: boolean,
|
|
201
|
+
tracked: meta(boolean, {
|
|
202
202
|
description: "Whether the backend's audit emitter tracks in-flight writes — false means the drain " +
|
|
203
203
|
'waited on nothing and is no barrier.'
|
|
204
204
|
})
|
|
@@ -210,7 +210,7 @@ export const testing_drain_effects_action_spec = {
|
|
|
210
210
|
* `_testing_mint_session` — mint an expired-by-construction server-side
|
|
211
211
|
* session for an existing account and return its signed cookie value.
|
|
212
212
|
*
|
|
213
|
-
* `expires_in_seconds` is **constrained negative** (`
|
|
213
|
+
* `expires_in_seconds` is **constrained negative** (a safe integer at most `-1`)
|
|
214
214
|
* so the action is structurally incapable of minting a *usable* session: it
|
|
215
215
|
* can only produce an already-backdated, already-dead `auth_session` row. The
|
|
216
216
|
* daemon-token gate + loopback binding already fence the backdoor, but the
|
|
@@ -242,19 +242,15 @@ export const testing_mint_session_action_spec = {
|
|
|
242
242
|
initiator: 'frontend',
|
|
243
243
|
auth: TESTING_ACTION_AUTH,
|
|
244
244
|
side_effects: true,
|
|
245
|
-
input:
|
|
245
|
+
input: object({
|
|
246
246
|
account_id: Uuid,
|
|
247
|
-
expires_in_seconds:
|
|
248
|
-
.number()
|
|
249
|
-
.int()
|
|
250
|
-
.negative()
|
|
251
|
-
.meta({
|
|
247
|
+
expires_in_seconds: meta(pipe(number, safe_integer, max_value(-1)), {
|
|
252
248
|
description: 'Seconds to offset the session row from NOW(). Constrained negative so this ' +
|
|
253
249
|
'backdoor can ONLY mint an already-expired (backdated) row — never a usable ' +
|
|
254
250
|
'session for an arbitrary account. Its sole use is the expired-session gate.'
|
|
255
251
|
})
|
|
256
252
|
}),
|
|
257
|
-
output:
|
|
253
|
+
output: object({ session_cookie: string }),
|
|
258
254
|
async: true,
|
|
259
255
|
description: 'Test-binary only — mint a backdated-expiry auth_session row for an account and return its ' +
|
|
260
256
|
'signed cookie value (exercises the authoritative server-side DB-row expiry gate).'
|
|
@@ -299,13 +295,13 @@ export const testing_put_fact_action_spec = {
|
|
|
299
295
|
initiator: 'frontend',
|
|
300
296
|
auth: TESTING_ACTION_AUTH,
|
|
301
297
|
side_effects: true,
|
|
302
|
-
input:
|
|
303
|
-
content:
|
|
304
|
-
content_type:
|
|
305
|
-
holder:
|
|
306
|
-
external_url:
|
|
298
|
+
input: object({
|
|
299
|
+
content: string,
|
|
300
|
+
content_type: optional(string),
|
|
301
|
+
holder: optional(Uuid),
|
|
302
|
+
external_url: optional(string)
|
|
307
303
|
}),
|
|
308
|
-
output:
|
|
304
|
+
output: object({ hash: FactHashSchema }),
|
|
309
305
|
async: true,
|
|
310
306
|
description: 'Test-binary only — seed a fact row for the blake3 of the UTF-8 content (embedded, or with ' +
|
|
311
307
|
'external_url an external row naming that URL) and return its hash, so the cross-process ' +
|
|
@@ -367,16 +363,16 @@ export const testing_flood_notifications_action_spec = {
|
|
|
367
363
|
initiator: 'frontend',
|
|
368
364
|
auth: TESTING_ACTION_AUTH,
|
|
369
365
|
side_effects: false,
|
|
370
|
-
input:
|
|
371
|
-
count:
|
|
366
|
+
input: object({
|
|
367
|
+
count: meta(pipe(number, safe_integer, min_value(0), max_value(TESTING_FLOOD_MAX_COUNT)), {
|
|
372
368
|
description: 'How many notifications to queue.'
|
|
373
369
|
}),
|
|
374
|
-
size:
|
|
370
|
+
size: meta(pipe(number, safe_integer, min_value(0), max_value(TESTING_FLOOD_MAX_SIZE)), {
|
|
375
371
|
description: "The byte length of each notification's `payload` string."
|
|
376
372
|
})
|
|
377
373
|
}),
|
|
378
|
-
output:
|
|
379
|
-
queued:
|
|
374
|
+
output: object({
|
|
375
|
+
queued: meta(pipe(number, safe_integer), {
|
|
380
376
|
description: 'The number of notifications asked for — not the number that fit.'
|
|
381
377
|
})
|
|
382
378
|
}),
|
|
@@ -427,7 +423,7 @@ export const testing_schema_snapshot_action_spec = {
|
|
|
427
423
|
initiator: 'frontend',
|
|
428
424
|
auth: TESTING_ACTION_AUTH,
|
|
429
425
|
side_effects: false,
|
|
430
|
-
input:
|
|
426
|
+
input: object({ exclude_tables: optional(array(string)) }),
|
|
431
427
|
output: SchemaSnapshot,
|
|
432
428
|
async: true,
|
|
433
429
|
description: 'Test-binary only — introspect the live schema into a normalized snapshot for cross-impl parity diffing.'
|
|
@@ -458,7 +454,7 @@ export const testing_migration_tracker_action_spec = {
|
|
|
458
454
|
initiator: 'frontend',
|
|
459
455
|
auth: TESTING_ACTION_AUTH,
|
|
460
456
|
side_effects: false,
|
|
461
|
-
input:
|
|
457
|
+
input: fuz_void,
|
|
462
458
|
output: MigrationTracker,
|
|
463
459
|
async: true,
|
|
464
460
|
description: 'Test-binary only — dump the schema_version tracker rows as a normalized {namespace, name, ' +
|
|
@@ -515,21 +511,16 @@ export const testing_shorten_credential_expiry_action_spec = {
|
|
|
515
511
|
initiator: 'frontend',
|
|
516
512
|
auth: TESTING_ACTION_AUTH,
|
|
517
513
|
side_effects: true,
|
|
518
|
-
input:
|
|
514
|
+
input: object({
|
|
519
515
|
account_id: Uuid,
|
|
520
|
-
seconds:
|
|
521
|
-
.number()
|
|
522
|
-
.int()
|
|
523
|
-
.min(TESTING_SHORTEN_CREDENTIAL_EXPIRY_MIN_SECONDS)
|
|
524
|
-
.max(TESTING_SHORTEN_CREDENTIAL_EXPIRY_MAX_SECONDS)
|
|
525
|
-
.meta({
|
|
516
|
+
seconds: meta(pipe(number, safe_integer, min_value(TESTING_SHORTEN_CREDENTIAL_EXPIRY_MIN_SECONDS), max_value(TESTING_SHORTEN_CREDENTIAL_EXPIRY_MAX_SECONDS)), {
|
|
526
517
|
description: 'Seconds from now the credentials expire, unless already due sooner — this ' +
|
|
527
518
|
'backdoor can only shorten a credential, never extend it.'
|
|
528
519
|
})
|
|
529
520
|
}),
|
|
530
|
-
output:
|
|
531
|
-
sessions:
|
|
532
|
-
api_tokens:
|
|
521
|
+
output: object({
|
|
522
|
+
sessions: pipe(number, safe_integer, min_value(0)),
|
|
523
|
+
api_tokens: pipe(number, safe_integer, min_value(0))
|
|
533
524
|
}),
|
|
534
525
|
async: true,
|
|
535
526
|
description: "Test-binary only — pull an account's session and API token expiries in to seconds from " +
|
|
@@ -570,7 +561,7 @@ export const testing_action_manifest_action_spec = {
|
|
|
570
561
|
initiator: 'frontend',
|
|
571
562
|
auth: TESTING_ACTION_AUTH,
|
|
572
563
|
side_effects: false,
|
|
573
|
-
input:
|
|
564
|
+
input: fuz_void,
|
|
574
565
|
output: ActionManifest,
|
|
575
566
|
async: true,
|
|
576
567
|
description: 'Test-binary only — dump the live RPC registry as a normalized ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws_outbound_overflow.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/ws_outbound_overflow.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ws_outbound_overflow.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/ws_outbound_overflow.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgF9B,OAAO,EAAE,KAAK,mBAAmB,EAAW,MAAM,mBAAmB,CAAC;AAGtE,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AACzD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AA+F1E,sDAAsD;AACtD,MAAM,WAAW,kCAAmC,SAAQ,gBAAgB;IAC3E,yEAAyE;IACzE,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,iFAAiF;IACjF,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,yCAAyC,GACrD,SAAS,kCAAkC,KACzC,IAgPF,CAAC"}
|
|
@@ -39,6 +39,10 @@ import '../assert_dev_env.js';
|
|
|
39
39
|
* and before they build a payload, so the boundaries are read off the
|
|
40
40
|
* refusal and no burst is ever allocated — which pins the two spines'
|
|
41
41
|
* limits equal.
|
|
42
|
+
* - **integral spellings** — over HTTP RPC a `count` written `3.0`, `1e1` or
|
|
43
|
+
* `-0` is the integer it spells, refused for having no connection, and one
|
|
44
|
+
* written `1.5` is refused `invalid_params` with no reason, as the TS
|
|
45
|
+
* twin's safe-integer check reads them.
|
|
42
46
|
*
|
|
43
47
|
* What the suite does **not** assert, because it is each implementation's own:
|
|
44
48
|
* how many frames accepted before the overflow reach the client (the Rust
|
|
@@ -64,6 +68,7 @@ import { create_admitted_ws_transport } from '../transports/ws_transport.js';
|
|
|
64
68
|
import { is_notification, is_response_for } from '../transports/ws_client.js';
|
|
65
69
|
import { test_if } from './capabilities.js';
|
|
66
70
|
import { cross_rpc_call } from './cross_rpc.js';
|
|
71
|
+
import { create_rpc_request_text } from '../rpc_helpers.js';
|
|
67
72
|
import { open_session_ws } from './ws_endpoint.js';
|
|
68
73
|
const FLOOD_METHOD = '_testing_flood_notifications';
|
|
69
74
|
const FLOOD_NOTIFICATION_METHOD = '_testing_flood';
|
|
@@ -126,6 +131,18 @@ const FLOOD_LIMIT_CASES = [
|
|
|
126
131
|
within: false
|
|
127
132
|
}
|
|
128
133
|
];
|
|
134
|
+
/**
|
|
135
|
+
* Flood params as raw JSON text, for the spellings `JSON.stringify` loses,
|
|
136
|
+
* and whether each is within the limits (so refused for no connection).
|
|
137
|
+
*/
|
|
138
|
+
const FLOOD_SPELLING_CASES = [
|
|
139
|
+
{ params_json: '{"count":3.0,"size":8}', within: true },
|
|
140
|
+
{ params_json: '{"count":1e1,"size":0}', within: true },
|
|
141
|
+
{ params_json: '{"count":-0,"size":0}', within: true },
|
|
142
|
+
{ params_json: '{"count":0,"size":8.0}', within: true },
|
|
143
|
+
{ params_json: '{"count":1.5,"size":0}', within: false },
|
|
144
|
+
{ params_json: '{"count":-1.0,"size":0}', within: false }
|
|
145
|
+
];
|
|
129
146
|
/** How long the test waits for the megabyte burst and its response. */
|
|
130
147
|
const LARGE_BURST_TIMEOUT_MS = 15_000;
|
|
131
148
|
/** How long the test waits for the overflow close. */
|
|
@@ -265,5 +282,23 @@ export const describe_ws_outbound_overflow_cross_tests = (options) => {
|
|
|
265
282
|
assert.strictEqual(res.error?.data?.reason, within ? REASON_NO_CONNECTION : undefined, `${name}: ${JSON.stringify(params)}`);
|
|
266
283
|
}
|
|
267
284
|
});
|
|
285
|
+
test_if(rpc_path !== undefined, 'over HTTP a flood count spelled as a float is the integer it spells, a fraction refused', async () => {
|
|
286
|
+
const fixture = await setup_test();
|
|
287
|
+
const transport = fixture.fresh_transport({ origin: null });
|
|
288
|
+
for (const { params_json, within } of FLOOD_SPELLING_CASES) {
|
|
289
|
+
const res = await transport(rpc_path, {
|
|
290
|
+
method: 'POST',
|
|
291
|
+
headers: {
|
|
292
|
+
'Content-Type': 'application/json',
|
|
293
|
+
...fixture.create_daemon_token_headers()
|
|
294
|
+
},
|
|
295
|
+
body: create_rpc_request_text(FLOOD_METHOD, params_json)
|
|
296
|
+
});
|
|
297
|
+
const body = (await res.json());
|
|
298
|
+
assert.ok(body.error, `${params_json}: expected a refusal over HTTP`);
|
|
299
|
+
assert.strictEqual(body.error.code, INVALID_PARAMS, params_json);
|
|
300
|
+
assert.strictEqual(body.error.data?.reason, within ? REASON_NO_CONNECTION : undefined, params_json);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
268
303
|
});
|
|
269
304
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
import { type Schema } from '@fuzdev/fuz_schema/schema.ts';
|
|
4
4
|
import { type JsonrpcErrorCode } from '../http/jsonrpc.js';
|
|
5
5
|
import type { RequestResponseActionSpec } from '../actions/action_spec.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rpc_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/rpc_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAa,KAAK,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAIN,KAAK,gBAAgB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EACX,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAAa,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE9F;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAClC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,+BAA+B,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;IAC1C,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,GAAU,KAAK,SAAS,yBAAyB,EAC9E,MAAM,kBAAkB,CAAC,KAAK,CAAC,KAC7B,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAoBrC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAU,CAAC,EACrC,MAAM,WAAW,EACjB,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,KAC1C,OAAO,CAAC,CAAC,CAkBX,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC3B,eAAe,aAAa,CAAC,eAAe,CAAC,EAC7C,QAAQ,MAAM,KACZ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAAG,SAOxC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC3B,eAAe,aAAa,CAAC,qBAAqB,CAAC,EACnD,QAAQ,MAAM,KACZ;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,mBAAmB,CAAA;CAAE,GAAG,SAOvD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,GACrC,eAAe,aAAa,CAAC,eAAe,CAAC,KAC3C,MAcF,CAAC"}
|
|
@@ -9,7 +9,6 @@ import './assert_dev_env.js';
|
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
11
|
import { assert } from 'vitest';
|
|
12
|
-
import { z } from 'zod';
|
|
13
12
|
import { is, parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
13
|
import { JSONRPC_VERSION, JsonrpcErrorResponse, JsonrpcResponse } from '../http/jsonrpc.js';
|
|
15
14
|
import { create_stub_app_server_context } from './stubs.js';
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
-
/**
|
|
3
|
-
* Schema-driven value generation helpers for testing.
|
|
4
|
-
*
|
|
5
|
-
* Walks Zod and `@fuzdev/fuz_schema` schemas to generate valid values for
|
|
6
|
-
* route params, request bodies, and URL paths. Used by adversarial input,
|
|
7
|
-
* adversarial 404, and round-trip validation test suites. A schema of
|
|
8
|
-
* neither library throws, and so does an input no body can be generated
|
|
9
|
-
* for, rather than yielding no body.
|
|
10
|
-
*
|
|
11
|
-
* @module
|
|
12
|
-
*/
|
|
13
|
-
import { z } from 'zod';
|
|
14
2
|
import { is_schema } from '@fuzdev/fuz_schema/schema.ts';
|
|
15
3
|
import { get_schema_entries, get_schema_fields, unwrap_schema } from '@fuzdev/fuz_schema/introspect.ts';
|
|
16
4
|
import { to_json_schema } from '@fuzdev/fuz_schema/json_schema.ts';
|
|
@@ -54,7 +42,7 @@ import { assert_zod_schema, format_issues, parse_any } from '../schema_issues.js
|
|
|
54
42
|
export const to_field_json_schema = (field_schema) => {
|
|
55
43
|
const json = is_schema(field_schema)
|
|
56
44
|
? to_json_schema(field_schema, { io: 'input', unrepresentable: 'any' })
|
|
57
|
-
:
|
|
45
|
+
: field_schema.toJSONSchema({ io: 'input', unrepresentable: 'any' });
|
|
58
46
|
if (Array.isArray(json.anyOf)) {
|
|
59
47
|
const branches = json.anyOf.filter((branch) => branch.type !== 'null');
|
|
60
48
|
if (branches.length === 1)
|