@fuzdev/fuz_app 0.182.0 → 0.184.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 -0
- package/dist/actions/CLAUDE.md +535 -1223
- package/dist/actions/action_codegen.d.ts +1 -1
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +3 -2
- package/dist/actions/connection_closer.d.ts +11 -9
- package/dist/actions/connection_closer.d.ts.map +1 -1
- package/dist/actions/connection_closer.js +11 -9
- package/dist/actions/frontend_rpc_client.d.ts +1 -1
- package/dist/actions/register_action_ws.d.ts +14 -1
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +2 -1
- package/dist/actions/ws_socket_session.d.ts +9 -1
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +43 -19
- package/dist/auth/CLAUDE.md +430 -1024
- package/dist/auth/account_queries.d.ts +1 -1
- package/dist/auth/account_queries.js +1 -1
- package/dist/auth/account_routes.d.ts +9 -8
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +78 -75
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +32 -28
- package/dist/auth/api_token.d.ts +20 -3
- package/dist/auth/api_token.d.ts.map +1 -1
- package/dist/auth/api_token.js +28 -9
- package/dist/auth/api_token_queries.d.ts +2 -2
- package/dist/auth/api_token_queries.js +2 -2
- package/dist/auth/audit_emitter.d.ts +75 -84
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +83 -71
- package/dist/auth/audit_log_schema.d.ts +25 -14
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +23 -8
- package/dist/auth/auth_guard_resolver.d.ts +1 -1
- package/dist/auth/auth_guard_resolver.js +1 -1
- package/dist/auth/bearer_auth.d.ts +2 -5
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +4 -13
- package/dist/auth/bootstrap_account.d.ts +42 -26
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +36 -19
- package/dist/auth/bootstrap_routes.d.ts +20 -21
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +26 -31
- package/dist/auth/bootstrap_token_store.d.ts +3 -4
- package/dist/auth/bootstrap_token_store.d.ts.map +1 -1
- package/dist/auth/bootstrap_token_store.js +1 -1
- package/dist/auth/daemon_token.d.ts +5 -1
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.d.ts +12 -8
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +15 -21
- package/dist/auth/deps.d.ts +19 -5
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/deps.js +3 -2
- package/dist/auth/invite_queries.d.ts +51 -3
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +81 -6
- package/dist/auth/invite_schema.d.ts +2 -1
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/middleware.d.ts +2 -3
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +3 -3
- package/dist/auth/request_context.d.ts +3 -3
- package/dist/auth/request_context.js +3 -3
- package/dist/auth/resolved_auth.d.ts +7 -7
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +4 -4
- package/dist/auth/role_grant_offer_actions.d.ts +27 -3
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +42 -35
- package/dist/auth/role_grant_offer_queries.d.ts +60 -4
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +79 -5
- package/dist/auth/role_grant_queries.d.ts +3 -52
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +5 -80
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +11 -22
- package/dist/auth/session_cookie.d.ts +82 -174
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +80 -130
- package/dist/auth/session_middleware.d.ts +8 -17
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +14 -23
- package/dist/auth/session_queries.d.ts +15 -17
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +28 -20
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +93 -43
- package/dist/db/CLAUDE.md +5 -3
- package/dist/db/sql_columns.d.ts +1 -1
- package/dist/db/sql_columns.js +1 -1
- package/dist/dev/setup.d.ts +3 -1
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +3 -1
- package/dist/http/CLAUDE.md +315 -763
- package/dist/http/db_routes.d.ts +8 -23
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +73 -73
- package/dist/http/origin.d.ts +7 -8
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +7 -8
- package/dist/http/pending_effects.d.ts +118 -6
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +114 -6
- package/dist/http/route_result.d.ts +1 -1
- package/dist/http/route_spec.d.ts +14 -11
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/realtime/sse.d.ts +4 -23
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +4 -25
- package/dist/server/app_backend.d.ts +4 -5
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +3 -1
- package/dist/server/app_server.d.ts +80 -16
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +113 -31
- package/dist/server/app_server_context.d.ts +1 -2
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.js +2 -2
- package/dist/testing/CLAUDE.md +265 -796
- package/dist/testing/admin_integration.d.ts +2 -3
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +3 -3
- package/dist/testing/adversarial_404.d.ts +6 -1
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +38 -17
- package/dist/testing/app_server.d.ts +23 -148
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +53 -131
- package/dist/testing/attack_surface.d.ts +1 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/audit_completeness.d.ts +2 -3
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +1 -1
- package/dist/testing/audit_drift_guard.d.ts +11 -6
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.js +15 -8
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts +12 -9
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/audit_cross_helpers.js +13 -14
- package/dist/testing/cross_backend/capabilities.d.ts +9 -6
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +11 -7
- package/dist/testing/cross_backend/capability_mounts.d.ts +103 -0
- package/dist/testing/cross_backend/capability_mounts.d.ts.map +1 -0
- package/dist/testing/cross_backend/capability_mounts.js +428 -0
- package/dist/testing/cross_backend/cell_moderate.js +2 -2
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +12 -11
- package/dist/testing/cross_backend/conformance_principal.d.ts +54 -0
- package/dist/testing/cross_backend/conformance_principal.d.ts.map +1 -0
- package/dist/testing/cross_backend/conformance_principal.js +283 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +7 -56
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +6 -274
- package/dist/testing/cross_backend/cookie_attributes.js +1 -1
- package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_deadline.js +2 -0
- package/dist/testing/cross_backend/credential_wire.d.ts +1 -1
- package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -1
- package/dist/testing/cross_backend/db_state_diff.d.ts +72 -0
- package/dist/testing/cross_backend/db_state_diff.d.ts.map +1 -0
- package/dist/testing/cross_backend/db_state_diff.js +444 -0
- package/dist/testing/cross_backend/declared_skips.d.ts +68 -0
- package/dist/testing/cross_backend/declared_skips.d.ts.map +1 -0
- package/dist/testing/cross_backend/declared_skips.js +132 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts +3 -3
- package/dist/testing/cross_backend/default_spine_surface.d.ts +0 -6
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +4 -9
- package/dist/testing/cross_backend/differential.d.ts +13 -5
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +35 -11
- package/dist/testing/cross_backend/differential_normalize.d.ts +12 -0
- package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential_normalize.js +16 -0
- package/dist/testing/cross_backend/full_spine_mount.d.ts +1 -42
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +45 -4
- package/dist/testing/cross_backend/in_process_setup.d.ts +28 -19
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +156 -142
- package/dist/testing/cross_backend/login_security.d.ts +12 -0
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +21 -4
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +0 -2
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -1
- package/dist/testing/cross_backend/request_target_conformance_wire.js +3 -1
- package/dist/testing/cross_backend/revocation_drivers.d.ts +18 -5
- package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
- package/dist/testing/cross_backend/revocation_drivers.js +18 -10
- package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts +1 -1
- package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +33 -1
- package/dist/testing/cross_backend/role_grant_participation.js +4 -4
- package/dist/testing/cross_backend/rpc_adversarial.js +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +3 -4
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +2 -2
- package/dist/testing/cross_backend/session_cap.d.ts +2 -2
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +22 -11
- package/dist/testing/cross_backend/setup.d.ts +32 -2
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +32 -1
- package/dist/testing/cross_backend/spine_suites.d.ts +125 -15
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +459 -62
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
- package/dist/testing/cross_backend/sse_round_trip.d.ts +9 -1
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +123 -27
- package/dist/testing/cross_backend/standard.d.ts +2 -3
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +3 -3
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +4 -2
- package/dist/testing/cross_backend/testing_credential_read.d.ts +10 -11
- package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_credential_read.js +12 -12
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +84 -47
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +95 -63
- package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_core.js +2 -3
- package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +7 -3
- package/dist/testing/cross_backend/ws_round_trip.d.ts +5 -0
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +54 -8
- package/dist/testing/daemon_token_rotation.d.ts.map +1 -1
- package/dist/testing/daemon_token_rotation.js +2 -3
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +3 -0
- package/dist/testing/db.d.ts +0 -32
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +0 -86
- package/dist/testing/db_entities.d.ts +14 -0
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/db_entities.js +17 -0
- package/dist/testing/db_invariant_queries.d.ts +259 -0
- package/dist/testing/db_invariant_queries.d.ts.map +1 -0
- package/dist/testing/db_invariant_queries.js +400 -0
- package/dist/testing/db_invariants.d.ts +106 -0
- package/dist/testing/db_invariants.d.ts.map +1 -0
- package/dist/testing/db_invariants.gen.sql.d.ts +11 -0
- package/dist/testing/db_invariants.gen.sql.d.ts.map +1 -0
- package/dist/testing/db_invariants.gen.sql.js +13 -0
- package/dist/testing/db_invariants.js +141 -0
- package/dist/testing/db_invariants.sql +152 -0
- package/dist/testing/describe_db.d.ts +36 -0
- package/dist/testing/describe_db.d.ts.map +1 -0
- package/dist/testing/describe_db.js +71 -0
- package/dist/testing/integration.d.ts +8 -12
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +13 -17
- package/dist/testing/integration_helpers.d.ts +1 -1
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/rate_limiting.d.ts +3 -4
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +6 -5
- package/dist/testing/role_grant_helpers.d.ts +1 -1
- package/dist/testing/role_grant_helpers.d.ts.map +1 -1
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +3 -0
- package/dist/testing/rpc_attack_surface.d.ts +8 -6
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +69 -6
- package/dist/testing/rpc_helpers.d.ts +1 -2
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +3 -3
- package/dist/testing/rpc_round_trip.d.ts +3 -4
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +4 -1
- package/dist/testing/sse_round_trip.d.ts +3 -4
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +15 -6
- package/dist/testing/stubs.d.ts +9 -8
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +20 -13
- package/dist/testing/test_app.d.ts +168 -0
- package/dist/testing/test_app.d.ts.map +1 -0
- package/dist/testing/test_app.js +123 -0
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +3 -0
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +1 -2
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
2
|
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
3
3
|
import { type RpcAction } from '../../actions/action_types.js';
|
|
4
|
+
import { type RequestTracker } from '../../http/pending_effects.js';
|
|
4
5
|
import type { RoomRegistry } from '../../actions/room_registry.js';
|
|
5
6
|
import type { AppDeps } from '../../auth/deps.js';
|
|
6
7
|
import type { AuditEmitter } from '../../auth/audit_emitter.js';
|
|
7
|
-
import type { SessionOptions } from '../../auth/session_cookie.js';
|
|
8
8
|
import type { DaemonTokenState } from '../../auth/daemon_token.js';
|
|
9
9
|
import type { Db } from '../../db/db.js';
|
|
10
10
|
/**
|
|
@@ -91,31 +91,30 @@ export declare const testing_reset_action_spec: {
|
|
|
91
91
|
readonly description: "Test-binary only — wipe auth tables, re-bootstrap a fresh keeper (+ optional extras), fire the domain-state reset.";
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
|
-
* `_testing_drain_effects` — await in-flight fire-and-forget
|
|
95
|
-
*
|
|
96
|
-
* the cross-backend conformance suite uses in place of
|
|
97
|
-
* asserting on audit rows.
|
|
98
|
-
*
|
|
99
|
-
* The handler
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* drain
|
|
117
|
-
*
|
|
118
|
-
* read instead of racing it. The Rust twin answers the same shape.
|
|
94
|
+
* `_testing_drain_effects` — await in-flight fire-and-forget work so a
|
|
95
|
+
* following `audit_log_list` or database read is authoritative. The
|
|
96
|
+
* deterministic barrier the cross-backend conformance suite uses in place of
|
|
97
|
+
* a poll/sleep before asserting on audit rows.
|
|
98
|
+
*
|
|
99
|
+
* The handler waits, repeating until both are empty, for the effect flushes
|
|
100
|
+
* on `AppDeps.request_tracker` (`RequestTracker.drain_flushes`: each
|
|
101
|
+
* request's eager `pending_effects` — the bearer leg's token touch among
|
|
102
|
+
* them — and its post-commit thunks) and for the pool writes of
|
|
103
|
+
* `AppDeps.audit` (`AuditEmitter.drain_inflight`) — a thunk can start an
|
|
104
|
+
* audit write, and a write's listener fan-out runs in a thunk. It matters
|
|
105
|
+
* whatever the transport: both test binaries settle an **HTTP** answer's
|
|
106
|
+
* effects before it responds (the TS binary through
|
|
107
|
+
* `await_pending_effects: true`, the Rust stub through its
|
|
108
|
+
* `await_background_writes_layer`), but a **WS** mutation is answered
|
|
109
|
+
* before its effects flush (reply-then-close for a self-revocation), so its
|
|
110
|
+
* audit write or post-commit effect can still be running when the caller
|
|
111
|
+
* reads the reply. The Rust spine awaits the same work on its one tracker,
|
|
112
|
+
* `BackgroundWrites`.
|
|
113
|
+
*
|
|
114
|
+
* Covered: every flush and `emit` that started before the drain was
|
|
115
|
+
* dispatched, and any started while it waits. Not a handler still running —
|
|
116
|
+
* the drain's own request is one, and its flush starts only after it answers
|
|
117
|
+
* — nor work that starts after the drain resolves.
|
|
119
118
|
*
|
|
120
119
|
* `auth` gates on the daemon-token credential, matching `_testing_reset`.
|
|
121
120
|
*/
|
|
@@ -132,10 +131,9 @@ export declare const testing_drain_effects_action_spec: {
|
|
|
132
131
|
readonly input: import("@fuzdev/fuz_schema/schema.ts").VoidSchema;
|
|
133
132
|
readonly output: import("@fuzdev/fuz_schema/schema.ts").ObjectSchema<{
|
|
134
133
|
ok: import("@fuzdev/fuz_schema/schema.ts").BooleanSchema;
|
|
135
|
-
tracked: import("@fuzdev/fuz_schema/schema.ts").BooleanSchema;
|
|
136
134
|
}>;
|
|
137
135
|
readonly async: true;
|
|
138
|
-
readonly description: "Test-binary only — await in-flight fire-and-forget
|
|
136
|
+
readonly description: "Test-binary only — await in-flight fire-and-forget writes so a following audit_log_list or database read is authoritative.";
|
|
139
137
|
};
|
|
140
138
|
/**
|
|
141
139
|
* `_testing_mint_session` — mint an expired-by-construction server-side
|
|
@@ -153,7 +151,7 @@ export declare const testing_drain_effects_action_spec: {
|
|
|
153
151
|
* The minted `auth_session` row's `expires_at` is backdated while the
|
|
154
152
|
* returned cookie's own signed payload stays valid (future). Cross-process
|
|
155
153
|
* auth resolution therefore passes the
|
|
156
|
-
* cookie-payload gate (`
|
|
154
|
+
* cookie-payload gate (`parse_session_from_cookies`) and is refused by the authoritative
|
|
157
155
|
* DB-row gate (`query_session_get_valid` — `WHERE expires_at > NOW()`) —
|
|
158
156
|
* the gate the in-process payload-expiry tests never reach and the one that
|
|
159
157
|
* structurally needs a server-side mint (the cross-process driver has no
|
|
@@ -187,17 +185,23 @@ export declare const testing_mint_session_action_spec: {
|
|
|
187
185
|
readonly async: true;
|
|
188
186
|
readonly description: string;
|
|
189
187
|
};
|
|
188
|
+
/** What `_testing_drain_effects` waits on — `AppDeps` satisfies it. */
|
|
189
|
+
export interface TestingDrainEffectsDeps {
|
|
190
|
+
/** The backend's request tracker, whose effect flushes the action awaits. */
|
|
191
|
+
request_tracker: Pick<RequestTracker, 'drain_flushes' | 'flush_count'>;
|
|
192
|
+
/** The backend's emitter, whose in-flight pool writes the action awaits. */
|
|
193
|
+
audit: Pick<AuditEmitter, 'drain_inflight' | 'inflight_count'>;
|
|
194
|
+
}
|
|
190
195
|
/**
|
|
191
|
-
* Build the standalone `_testing_drain_effects` action over
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
* @param audit - the backend's emitter, whose in-flight writes the action awaits
|
|
196
|
+
* Build the standalone `_testing_drain_effects` action over the backend's
|
|
197
|
+
* deps — the tracker its requests are held on and the emitter its handlers
|
|
198
|
+
* emit through. Mount it on any test endpoint whose suite asserts on audit
|
|
199
|
+
* rows or effects (the spine binary bundles it via `create_testing_actions`;
|
|
200
|
+
* in-process suites mount it directly). Answers `{ok: true}`.
|
|
201
|
+
*
|
|
202
|
+
* @param deps - the backend's `request_tracker` and `audit`
|
|
199
203
|
*/
|
|
200
|
-
export declare const create_testing_drain_effects_action: (
|
|
204
|
+
export declare const create_testing_drain_effects_action: (deps: TestingDrainEffectsDeps) => RpcAction;
|
|
201
205
|
/**
|
|
202
206
|
* `_testing_put_fact` — seed an **embedded** fact (`fact.bytes`) for the
|
|
203
207
|
* cross-process fact-serving suite, which drives over real HTTP and has no
|
|
@@ -497,6 +501,46 @@ export declare const testing_migration_tracker_action_spec: {
|
|
|
497
501
|
* `create_testing_actions`; mount directly for in-process use.
|
|
498
502
|
*/
|
|
499
503
|
export declare const create_testing_migration_tracker_action: () => RpcAction;
|
|
504
|
+
/**
|
|
505
|
+
* `_testing_db_invariants` — run the database invariant statement
|
|
506
|
+
* (`DB_INVARIANTS_SQL`, the one `db_invariants.sql` holds) and answer every
|
|
507
|
+
* violating row, `{rows: [{invariant, row}]}`, unfiltered: the harness drops
|
|
508
|
+
* the invariants its setup excludes. The per-test check of a cross-process
|
|
509
|
+
* setup reads it, so a backend whose database the test process can't reach
|
|
510
|
+
* (`memory://`) is checked like one it can. Read-only, writing no audit row.
|
|
511
|
+
* A row's key order is not part of the contract (the spines' JSON maps order
|
|
512
|
+
* keys differently); compare rows as objects.
|
|
513
|
+
*
|
|
514
|
+
* `auth` gates on the daemon-token credential, matching `_testing_reset`. The
|
|
515
|
+
* Rust mirror is `fuz_testing::create_testing_db_invariants_action_spec`,
|
|
516
|
+
* running the same statement from its byte-identical copy of the file.
|
|
517
|
+
*/
|
|
518
|
+
export declare const testing_db_invariants_action_spec: {
|
|
519
|
+
readonly method: "_testing_db_invariants";
|
|
520
|
+
readonly kind: "request_response";
|
|
521
|
+
readonly initiator: "frontend";
|
|
522
|
+
readonly auth: {
|
|
523
|
+
readonly account: "required";
|
|
524
|
+
readonly actor: "none";
|
|
525
|
+
readonly credential_types: readonly ["daemon_token"];
|
|
526
|
+
};
|
|
527
|
+
readonly side_effects: false;
|
|
528
|
+
readonly input: import("@fuzdev/fuz_schema/schema.ts").VoidSchema;
|
|
529
|
+
readonly output: import("@fuzdev/fuz_schema/schema.ts").ObjectSchema<{
|
|
530
|
+
rows: import("@fuzdev/fuz_schema/schema.ts").ArraySchema<import("@fuzdev/fuz_schema/schema.ts").ObjectSchema<{
|
|
531
|
+
invariant: import("@fuzdev/fuz_schema/schema.ts").StringSchema;
|
|
532
|
+
row: import("@fuzdev/fuz_schema/schema.ts").RecordSchema<import("@fuzdev/fuz_schema/schema.ts").UnknownSchema>;
|
|
533
|
+
}>>;
|
|
534
|
+
}>;
|
|
535
|
+
readonly async: true;
|
|
536
|
+
readonly description: string;
|
|
537
|
+
};
|
|
538
|
+
/**
|
|
539
|
+
* Build the standalone `_testing_db_invariants` action. No deps — reads
|
|
540
|
+
* `ctx.db` via `query_db_invariant_rows`. Bundled by
|
|
541
|
+
* `create_testing_actions`; mount directly for in-process use.
|
|
542
|
+
*/
|
|
543
|
+
export declare const create_testing_db_invariants_action: () => RpcAction;
|
|
500
544
|
/** The shortest expiry `_testing_shorten_credential_expiry` sets, in seconds from now. */
|
|
501
545
|
export declare const TESTING_SHORTEN_CREDENTIAL_EXPIRY_MIN_SECONDS = 1;
|
|
502
546
|
/**
|
|
@@ -643,13 +687,6 @@ export declare const testing_action_manifest_action_spec: {
|
|
|
643
687
|
export declare const create_testing_action_manifest_action: (mounted: ReadonlyArray<RpcAction>, ws_only?: ReadonlyArray<RpcAction>) => RpcAction;
|
|
644
688
|
/** Options for `create_testing_actions`. */
|
|
645
689
|
export interface CreateTestingActionsOptions {
|
|
646
|
-
/**
|
|
647
|
-
* Session cookie options — the reset action uses these when signing
|
|
648
|
-
* the fresh keeper's (and any extra accounts') session cookies.
|
|
649
|
-
* Pass the same `SessionOptions` the live `create_app_server` call
|
|
650
|
-
* was wired with.
|
|
651
|
-
*/
|
|
652
|
-
readonly session_options: SessionOptions<string>;
|
|
653
690
|
/**
|
|
654
691
|
* Daemon-token runtime state — the reset action points
|
|
655
692
|
* `state.keeper_account_id` at the freshly seeded keeper once its
|
|
@@ -683,8 +720,8 @@ export interface CreateTestingActionsOptions {
|
|
|
683
720
|
*
|
|
684
721
|
* Returns the bundled `_testing_*` actions (module doc). The test binary
|
|
685
722
|
* calls this at server-assembly time and registers the result on its
|
|
686
|
-
* dispatcher. `_testing_drain_effects` drains `deps.
|
|
687
|
-
* `
|
|
723
|
+
* dispatcher. `_testing_drain_effects` drains `deps.request_tracker` and
|
|
724
|
+
* `deps.audit`.
|
|
688
725
|
*
|
|
689
726
|
* The reset action's table-wipe list mirrors
|
|
690
727
|
* `auth_integration_truncate_tables` from `testing/db.ts` — the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing_reset_actions.d.ts","sourceRoot":"","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":"","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqF9B,OAAO,EAcN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAGvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAInE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AA0BzC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;QAiBpC;;;;;;;;WAQG;;;;;;;;;;;;;;;QAMH,4EAA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;;;;;;;;;;;;;CAaF,CAAC;AAkB/C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,qCAAqC,GACjD,SAAS,aAAa,CAAC,SAAS,CAAC,EACjC,UAAS,aAAa,CAAC,SAAS,CAAM,KACpC,SASF,CAAC;AAEF,4CAA4C;AAC5C,MAAM,WAAW,2BAA2B;IAC3C;;;;;;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,CAsJjB,CAAC"}
|
|
@@ -4,14 +4,16 @@ import '../assert_dev_env.js';
|
|
|
4
4
|
*
|
|
5
5
|
* The daemon-token-authed actions bundled by `create_testing_actions`:
|
|
6
6
|
* **`_testing_reset`** (DB wipe + keeper re-seed), **`_testing_drain_effects`**
|
|
7
|
-
* (
|
|
7
|
+
* (effects barrier), **`_testing_mint_session`** (forge an
|
|
8
8
|
* expired-by-construction server-side session for the expiry conformance
|
|
9
9
|
* cases), **`_testing_put_fact`** (seed an embedded fact for the fact-serving
|
|
10
10
|
* suite), **`_testing_schema_snapshot`** (introspect the live schema for
|
|
11
11
|
* cross-impl parity diffing against a Rust backend's `fuz_db` snapshot),
|
|
12
12
|
* **`_testing_migration_tracker`** (dump the `schema_version` tracker rows for
|
|
13
13
|
* cross-impl migration-identity parity — the provenance half the snapshot gate
|
|
14
|
-
* excludes by design),
|
|
14
|
+
* excludes by design), **`_testing_db_invariants`** (run the database
|
|
15
|
+
* invariant statement for the per-test check), and
|
|
16
|
+
* **`_testing_flood_notifications`** (queue a burst
|
|
15
17
|
* of notifications onto the caller's own WebSocket connection, to push its
|
|
16
18
|
* outbound queue past its byte budget).
|
|
17
19
|
*
|
|
@@ -89,11 +91,11 @@ import { protocol_action_specs } from '../../actions/protocol.js';
|
|
|
89
91
|
import { RoomEvictReason, RoomId } from '../../actions/room_action_specs.js';
|
|
90
92
|
import { query_put_fact } from '../../db/fact_queries.js';
|
|
91
93
|
import { query_put_fact_holder } from '../../db/fact_holder_queries.js';
|
|
92
|
-
import { ROLE_ADMIN, ROLE_KEEPER } from '../../auth/role_schema.js';
|
|
93
94
|
import { query_schema_snapshot, SchemaSnapshot, query_migration_tracker, MigrationTracker } from '../schema_introspect.js';
|
|
94
95
|
import { ActionManifest, build_action_manifest } from './action_manifest.js';
|
|
96
|
+
import { DbInvariantRows, query_db_invariant_rows } from '../db_invariant_queries.js';
|
|
95
97
|
import { create_test_extra_actor } from '../db_entities.js';
|
|
96
|
-
import { create_test_account_with_credentials, mint_test_session } from '../app_server.js';
|
|
98
|
+
import { create_test_account_with_credentials, DEFAULT_TEST_KEEPER_ROLES, mint_test_session } from '../app_server.js';
|
|
97
99
|
import { DEFAULT_TEST_PASSWORD } from '../test_credentials.js';
|
|
98
100
|
import { TESTING_ACTION_AUTH } from './spine_surface_constants.js';
|
|
99
101
|
/** Output shape for an individual seeded account (keeper or extra). */
|
|
@@ -162,31 +164,30 @@ export const testing_reset_action_spec = {
|
|
|
162
164
|
description: 'Test-binary only — wipe auth tables, re-bootstrap a fresh keeper (+ optional extras), fire the domain-state reset.'
|
|
163
165
|
};
|
|
164
166
|
/**
|
|
165
|
-
* `_testing_drain_effects` — await in-flight fire-and-forget
|
|
166
|
-
*
|
|
167
|
-
* the cross-backend conformance suite uses in place of
|
|
168
|
-
* asserting on audit rows.
|
|
169
|
-
*
|
|
170
|
-
* The handler
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* drain
|
|
188
|
-
*
|
|
189
|
-
* read instead of racing it. The Rust twin answers the same shape.
|
|
167
|
+
* `_testing_drain_effects` — await in-flight fire-and-forget work so a
|
|
168
|
+
* following `audit_log_list` or database read is authoritative. The
|
|
169
|
+
* deterministic barrier the cross-backend conformance suite uses in place of
|
|
170
|
+
* a poll/sleep before asserting on audit rows.
|
|
171
|
+
*
|
|
172
|
+
* The handler waits, repeating until both are empty, for the effect flushes
|
|
173
|
+
* on `AppDeps.request_tracker` (`RequestTracker.drain_flushes`: each
|
|
174
|
+
* request's eager `pending_effects` — the bearer leg's token touch among
|
|
175
|
+
* them — and its post-commit thunks) and for the pool writes of
|
|
176
|
+
* `AppDeps.audit` (`AuditEmitter.drain_inflight`) — a thunk can start an
|
|
177
|
+
* audit write, and a write's listener fan-out runs in a thunk. It matters
|
|
178
|
+
* whatever the transport: both test binaries settle an **HTTP** answer's
|
|
179
|
+
* effects before it responds (the TS binary through
|
|
180
|
+
* `await_pending_effects: true`, the Rust stub through its
|
|
181
|
+
* `await_background_writes_layer`), but a **WS** mutation is answered
|
|
182
|
+
* before its effects flush (reply-then-close for a self-revocation), so its
|
|
183
|
+
* audit write or post-commit effect can still be running when the caller
|
|
184
|
+
* reads the reply. The Rust spine awaits the same work on its one tracker,
|
|
185
|
+
* `BackgroundWrites`.
|
|
186
|
+
*
|
|
187
|
+
* Covered: every flush and `emit` that started before the drain was
|
|
188
|
+
* dispatched, and any started while it waits. Not a handler still running —
|
|
189
|
+
* the drain's own request is one, and its flush starts only after it answers
|
|
190
|
+
* — nor work that starts after the drain resolves.
|
|
190
191
|
*
|
|
191
192
|
* `auth` gates on the daemon-token credential, matching `_testing_reset`.
|
|
192
193
|
*/
|
|
@@ -197,15 +198,9 @@ export const testing_drain_effects_action_spec = {
|
|
|
197
198
|
auth: TESTING_ACTION_AUTH,
|
|
198
199
|
side_effects: false,
|
|
199
200
|
input: fuz_void,
|
|
200
|
-
output: object({
|
|
201
|
-
ok: boolean,
|
|
202
|
-
tracked: meta(boolean, {
|
|
203
|
-
description: "Whether the backend's audit emitter tracks in-flight writes — false means the drain " +
|
|
204
|
-
'waited on nothing and is no barrier.'
|
|
205
|
-
})
|
|
206
|
-
}),
|
|
201
|
+
output: object({ ok: boolean }),
|
|
207
202
|
async: true,
|
|
208
|
-
description: 'Test-binary only — await in-flight fire-and-forget
|
|
203
|
+
description: 'Test-binary only — await in-flight fire-and-forget writes so a following audit_log_list or database read is authoritative.'
|
|
209
204
|
};
|
|
210
205
|
/**
|
|
211
206
|
* `_testing_mint_session` — mint an expired-by-construction server-side
|
|
@@ -223,7 +218,7 @@ export const testing_drain_effects_action_spec = {
|
|
|
223
218
|
* The minted `auth_session` row's `expires_at` is backdated while the
|
|
224
219
|
* returned cookie's own signed payload stays valid (future). Cross-process
|
|
225
220
|
* auth resolution therefore passes the
|
|
226
|
-
* cookie-payload gate (`
|
|
221
|
+
* cookie-payload gate (`parse_session_from_cookies`) and is refused by the authoritative
|
|
227
222
|
* DB-row gate (`query_session_get_valid` — `WHERE expires_at > NOW()`) —
|
|
228
223
|
* the gate the in-process payload-expiry tests never reach and the one that
|
|
229
224
|
* structurally needs a server-side mint (the cross-process driver has no
|
|
@@ -257,18 +252,23 @@ export const testing_mint_session_action_spec = {
|
|
|
257
252
|
'signed cookie value (exercises the authoritative server-side DB-row expiry gate).'
|
|
258
253
|
};
|
|
259
254
|
/**
|
|
260
|
-
* Build the standalone `_testing_drain_effects` action over
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* @param audit - the backend's emitter, whose in-flight writes the action awaits
|
|
255
|
+
* Build the standalone `_testing_drain_effects` action over the backend's
|
|
256
|
+
* deps — the tracker its requests are held on and the emitter its handlers
|
|
257
|
+
* emit through. Mount it on any test endpoint whose suite asserts on audit
|
|
258
|
+
* rows or effects (the spine binary bundles it via `create_testing_actions`;
|
|
259
|
+
* in-process suites mount it directly). Answers `{ok: true}`.
|
|
260
|
+
*
|
|
261
|
+
* @param deps - the backend's `request_tracker` and `audit`
|
|
268
262
|
*/
|
|
269
|
-
export const create_testing_drain_effects_action = (
|
|
270
|
-
|
|
271
|
-
|
|
263
|
+
export const create_testing_drain_effects_action = (deps) => rpc_action(testing_drain_effects_action_spec, async () => {
|
|
264
|
+
const { request_tracker, audit } = deps;
|
|
265
|
+
// until both are empty: a flush's post-commit thunk can start an audit
|
|
266
|
+
// write, and a flush that starts meanwhile is waited for too
|
|
267
|
+
do {
|
|
268
|
+
await request_tracker.drain_flushes();
|
|
269
|
+
await audit.drain_inflight();
|
|
270
|
+
} while (request_tracker.flush_count() > 0 || audit.inflight_count() > 0);
|
|
271
|
+
return { ok: true };
|
|
272
272
|
});
|
|
273
273
|
/**
|
|
274
274
|
* `_testing_put_fact` — seed an **embedded** fact (`fact.bytes`) for the
|
|
@@ -514,6 +514,40 @@ export const testing_migration_tracker_action_spec = {
|
|
|
514
514
|
* `create_testing_actions`; mount directly for in-process use.
|
|
515
515
|
*/
|
|
516
516
|
export const create_testing_migration_tracker_action = () => rpc_action(testing_migration_tracker_action_spec, async (_input, ctx) => query_migration_tracker(ctx.db));
|
|
517
|
+
/**
|
|
518
|
+
* `_testing_db_invariants` — run the database invariant statement
|
|
519
|
+
* (`DB_INVARIANTS_SQL`, the one `db_invariants.sql` holds) and answer every
|
|
520
|
+
* violating row, `{rows: [{invariant, row}]}`, unfiltered: the harness drops
|
|
521
|
+
* the invariants its setup excludes. The per-test check of a cross-process
|
|
522
|
+
* setup reads it, so a backend whose database the test process can't reach
|
|
523
|
+
* (`memory://`) is checked like one it can. Read-only, writing no audit row.
|
|
524
|
+
* A row's key order is not part of the contract (the spines' JSON maps order
|
|
525
|
+
* keys differently); compare rows as objects.
|
|
526
|
+
*
|
|
527
|
+
* `auth` gates on the daemon-token credential, matching `_testing_reset`. The
|
|
528
|
+
* Rust mirror is `fuz_testing::create_testing_db_invariants_action_spec`,
|
|
529
|
+
* running the same statement from its byte-identical copy of the file.
|
|
530
|
+
*/
|
|
531
|
+
export const testing_db_invariants_action_spec = {
|
|
532
|
+
method: '_testing_db_invariants',
|
|
533
|
+
kind: 'request_response',
|
|
534
|
+
initiator: 'frontend',
|
|
535
|
+
auth: TESTING_ACTION_AUTH,
|
|
536
|
+
side_effects: false,
|
|
537
|
+
input: fuz_void,
|
|
538
|
+
output: DbInvariantRows,
|
|
539
|
+
async: true,
|
|
540
|
+
description: 'Test-binary only — run the database invariant statement and answer every violating row ' +
|
|
541
|
+
'for the per-test invariant check.'
|
|
542
|
+
};
|
|
543
|
+
/**
|
|
544
|
+
* Build the standalone `_testing_db_invariants` action. No deps — reads
|
|
545
|
+
* `ctx.db` via `query_db_invariant_rows`. Bundled by
|
|
546
|
+
* `create_testing_actions`; mount directly for in-process use.
|
|
547
|
+
*/
|
|
548
|
+
export const create_testing_db_invariants_action = () => rpc_action(testing_db_invariants_action_spec, async (_input, ctx) => ({
|
|
549
|
+
rows: await query_db_invariant_rows({ db: ctx.db })
|
|
550
|
+
}));
|
|
517
551
|
/** The shortest expiry `_testing_shorten_credential_expiry` sets, in seconds from now. */
|
|
518
552
|
export const TESTING_SHORTEN_CREDENTIAL_EXPIRY_MIN_SECONDS = 1;
|
|
519
553
|
/**
|
|
@@ -675,8 +709,8 @@ export const create_testing_action_manifest_action = (mounted, ws_only = []) =>
|
|
|
675
709
|
*
|
|
676
710
|
* Returns the bundled `_testing_*` actions (module doc). The test binary
|
|
677
711
|
* calls this at server-assembly time and registers the result on its
|
|
678
|
-
* dispatcher. `_testing_drain_effects` drains `deps.
|
|
679
|
-
* `
|
|
712
|
+
* dispatcher. `_testing_drain_effects` drains `deps.request_tracker` and
|
|
713
|
+
* `deps.audit`.
|
|
680
714
|
*
|
|
681
715
|
* The reset action's table-wipe list mirrors
|
|
682
716
|
* `auth_integration_truncate_tables` from `testing/db.ts` — the
|
|
@@ -686,7 +720,7 @@ export const create_testing_action_manifest_action = (mounted, ws_only = []) =>
|
|
|
686
720
|
* without updating this handler fails CI.
|
|
687
721
|
*/
|
|
688
722
|
export const create_testing_actions = (deps, options) => {
|
|
689
|
-
const {
|
|
723
|
+
const { daemon_token_state, reset_state } = options;
|
|
690
724
|
const log = deps.log;
|
|
691
725
|
return [
|
|
692
726
|
rpc_action(testing_reset_action_spec, async (input, ctx) => {
|
|
@@ -738,21 +772,20 @@ export const create_testing_actions = (deps, options) => {
|
|
|
738
772
|
// parity — same hash, same account+actor+role_grants+
|
|
739
773
|
// api_token+session_cookie shape.
|
|
740
774
|
//
|
|
741
|
-
// Roles default to `
|
|
742
|
-
// production `bootstrap_account`.
|
|
743
|
-
// on top.
|
|
775
|
+
// Roles default to `DEFAULT_TEST_KEEPER_ROLES` (keeper and
|
|
776
|
+
// admin) to match production `bootstrap_account`.
|
|
777
|
+
// `extra_keeper_roles` adds on top.
|
|
744
778
|
const keeper = await create_test_account_with_credentials({
|
|
745
779
|
db: ctx.db,
|
|
746
780
|
keyring: deps.keyring,
|
|
747
|
-
session_options,
|
|
748
781
|
password: deps.password,
|
|
749
782
|
password_value: DEFAULT_TEST_PASSWORD,
|
|
750
|
-
roles: [
|
|
783
|
+
roles: [...new Set([...DEFAULT_TEST_KEEPER_ROLES, ...(input.extra_keeper_roles ?? [])])]
|
|
751
784
|
});
|
|
752
785
|
// 6. Refresh the daemon-token cache so subsequent daemon-token
|
|
753
786
|
// requests resolve to the freshly seeded keeper. The
|
|
754
|
-
// middleware
|
|
755
|
-
//
|
|
787
|
+
// middleware never re-reads the keeper, so the reset sets it —
|
|
788
|
+
// after the commit, queued as
|
|
756
789
|
// soon as the keeper exists, so a reset that rolls back after it
|
|
757
790
|
// (a failing extra seed, a failed COMMIT) leaves the cache on the
|
|
758
791
|
// keeper still in the database rather than one that never
|
|
@@ -769,7 +802,6 @@ export const create_testing_actions = (deps, options) => {
|
|
|
769
802
|
const seeded = await create_test_account_with_credentials({
|
|
770
803
|
db: ctx.db,
|
|
771
804
|
keyring: deps.keyring,
|
|
772
|
-
session_options,
|
|
773
805
|
password: deps.password,
|
|
774
806
|
username: spec.username,
|
|
775
807
|
password_value: spec.password_value ?? DEFAULT_TEST_PASSWORD,
|
|
@@ -796,7 +828,6 @@ export const create_testing_actions = (deps, options) => {
|
|
|
796
828
|
const { session_cookie } = await mint_test_session({
|
|
797
829
|
db: ctx.db,
|
|
798
830
|
keyring: deps.keyring,
|
|
799
|
-
session_options,
|
|
800
831
|
account_id: input.account_id,
|
|
801
832
|
expires_in_seconds: input.expires_in_seconds
|
|
802
833
|
});
|
|
@@ -819,9 +850,10 @@ export const create_testing_actions = (deps, options) => {
|
|
|
819
850
|
}
|
|
820
851
|
return { hash };
|
|
821
852
|
}),
|
|
822
|
-
create_testing_drain_effects_action(deps
|
|
853
|
+
create_testing_drain_effects_action(deps),
|
|
823
854
|
create_testing_flood_notifications_action(),
|
|
824
855
|
create_testing_schema_snapshot_action(),
|
|
825
|
-
create_testing_migration_tracker_action()
|
|
856
|
+
create_testing_migration_tracker_action(),
|
|
857
|
+
create_testing_db_invariants_action()
|
|
826
858
|
];
|
|
827
859
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing_server_core.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/testing_server_core.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAU,KAAK,MAAM,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;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C;CAC3B;AAED,0CAA0C;AAC1C,MAAM,WAAW,yBAAyB;IACzC,8CAA8C;IAC9C,OAAO,EAAE,oBAAoB,CAAC;IAC9B;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACzE,0EAA0E;IAC1E,GAAG,CAAC,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,OAGpD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAAU,SAAS,yBAAyB,KAAG,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"testing_server_core.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/testing_server_core.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAU,KAAK,MAAM,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,4DAA4D;AAC5D,MAAM,WAAW,uBAAuB;IACvC;;;;;;;;;;;;;;OAcG;IACH,iBAAiB,CAAC,EA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iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACzE,0EAA0E;IAC1E,GAAG,CAAC,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,OAGpD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAAU,SAAS,yBAAyB,KAAG,OAAO,CAAC,IAAI,CA2D3F,CAAC"}
|
|
@@ -65,9 +65,8 @@ export const start_testing_server = async (options) => {
|
|
|
65
65
|
// don't await the drain yet: live WebSockets hold it open until
|
|
66
66
|
// `built.close()` ends them (`AppServer.close`), so awaiting it
|
|
67
67
|
// first would wait on sockets nothing is closing. A request already
|
|
68
|
-
// in flight when the signal lands
|
|
69
|
-
//
|
|
70
|
-
// the suite.
|
|
68
|
+
// in flight when the signal lands is waited for by `AppServer.close`
|
|
69
|
+
// (behind `built.close()`), within its drain bound.
|
|
71
70
|
const drained = server.shutdown();
|
|
72
71
|
await built.close();
|
|
73
72
|
await drained;
|
|
@@ -60,7 +60,7 @@ export interface TransportCompositionCrossTestOptions extends RpcPathCapabilityG
|
|
|
60
60
|
readonly ws_path?: string;
|
|
61
61
|
/** Audit-log SSE path. Default `/api/admin/audit/stream`. */
|
|
62
62
|
readonly sse_path?: string;
|
|
63
|
-
/** Run the multi-actor rows (`transport_composition_multi_actor_cases`). */
|
|
63
|
+
/** Run the multi-actor rows (`transport_composition_multi_actor_cases`); omitted, they skip. */
|
|
64
64
|
readonly multi_actor?: TransportCompositionMultiActorOptions;
|
|
65
65
|
/**
|
|
66
66
|
* The backend's request-body cap on `rpc_path`, in bytes; the RPC row's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport_composition.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/transport_composition.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"transport_composition.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/transport_composition.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAwG9B,OAAO,EAAW,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,KAAK,EAAE,uCAAuC,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AASlG,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3D,6DAA6D;AAC7D,MAAM,MAAM,2BAA2B,GACtC,WAAW,GAAG,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,CAAC;AAE/E,0DAA0D;AAC1D,MAAM,MAAM,yBAAyB,GAClC,gBAAgB,GAChB,mBAAmB,GACnB,mBAAmB,GACnB,yBAAyB,GACzB,eAAe,GACf,gBAAgB,GAChB,uBAAuB,CAAC;AAE3B,kCAAkC;AAClC,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,8FAA8F;IAC9F,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wCAAwC;AACxC,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,yBAAyB,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAC5C,gFAAgF;IAChF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,mBAAmB,CAAC;CAC1C;AAsCD,2EAA2E;AAC3E,eAAO,MAAM,2BAA2B,EAAE,aAAa,CAAC,wBAAwB,CA4C/E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uCAAuC,EAAE,aAAa,CAAC,wBAAwB,CAO3F,CAAC;AAEF,mFAAmF;AACnF,MAAM,WAAW,qCAAqC;IACrD,sFAAsF;IACtF,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAC7B;AAED,gEAAgE;AAChE,MAAM,WAAW,oCAAqC,SAAQ,uCAAuC;IACpG;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,yFAAyF;IACzF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,yFAAyF;IACzF,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,kDAAkD;IAClD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,WAAW,CAAC,EAAE,qCAAqC,CAAC;IAC7D;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACrC;AAqED;;;;;;;GAOG;AACH,eAAO,MAAM,0CAA0C,GACtD,SAAS,oCAAoC,KAC3C,IAiQF,CAAC"}
|
|
@@ -64,7 +64,8 @@ import '../assert_dev_env.js';
|
|
|
64
64
|
* that ask for no upgrade gate on `capabilities.ws` alone.
|
|
65
65
|
*
|
|
66
66
|
* **Multi-actor upgrade.** One more WS row needs a keeper seeded with a
|
|
67
|
-
* second actor (`extra_actors`), so it runs only given `multi_actor
|
|
67
|
+
* second actor (`extra_actors`), so it runs only given `multi_actor` (without
|
|
68
|
+
* it the row registers as a gated skip): a
|
|
68
69
|
* multi-actor keeper's session upgrading with no `?acting=` → 400
|
|
69
70
|
* `actor_required`, the flat body both spines' upgrade-time actor resolution
|
|
70
71
|
* answers. The upgrade resolves an actor there, and a multi-actor account
|
|
@@ -420,10 +421,13 @@ export const describe_transport_composition_cross_tests = (options) => {
|
|
|
420
421
|
assert.strictEqual(raw_http_parse_json(res.text)?.error, 'route_not_found');
|
|
421
422
|
});
|
|
422
423
|
const { multi_actor } = options;
|
|
423
|
-
if (!multi_actor)
|
|
424
|
-
return;
|
|
425
424
|
for (const c of transport_composition_multi_actor_cases) {
|
|
426
425
|
const name = case_name(c);
|
|
426
|
+
// without the multi-actor setup the cases register as gated skips
|
|
427
|
+
if (!multi_actor) {
|
|
428
|
+
test_if(false, name, () => { });
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
427
431
|
const body = () => run_case(c, multi_actor.setup_test);
|
|
428
432
|
if (!is_runnable(c)) {
|
|
429
433
|
test_if(false, name, body);
|
|
@@ -28,6 +28,11 @@ export interface CrossProcessWsTestOptions extends WsEndpointTarget {
|
|
|
28
28
|
readonly max_message_bytes?: number;
|
|
29
29
|
/** REST logout route path, for the logout close case. Default `/api/account/logout`. */
|
|
30
30
|
readonly logout_path?: string;
|
|
31
|
+
/**
|
|
32
|
+
* REST login route path, for the logout case's second session of the
|
|
33
|
+
* account. Default `/api/account/login`.
|
|
34
|
+
*/
|
|
35
|
+
readonly login_path?: string;
|
|
31
36
|
/** REST password-change route path, for its close case. Default `/api/account/password`. */
|
|
32
37
|
readonly password_path?: string;
|
|
33
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws_round_trip.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/ws_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ws_round_trip.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/ws_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA2H9B,OAAO,EAAE,KAAK,mBAAmB,EAAW,MAAM,mBAAmB,CAAC;AAItE,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAOzD,OAAO,EAGN,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAK1B,2DAA2D;AAC3D,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IAClE;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,wFAAwF;IACxF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAClD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B,GAAI,SAAS,yBAAyB,KAAG,IAmiBpF,CAAC"}
|