@fuzdev/fuz_app 0.148.0 → 0.150.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 +11 -9
- package/dist/actions/action_bridge.d.ts +7 -0
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +10 -0
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +14 -1
- package/dist/actions/action_event_types.d.ts +1 -1
- package/dist/actions/action_event_types.d.ts.map +1 -1
- package/dist/actions/perform_action.d.ts +17 -1
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +30 -7
- package/dist/actions/register_action_ws.d.ts +8 -2
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +24 -4
- package/dist/actions/transports_ws_auth_guard.d.ts +6 -4
- package/dist/actions/transports_ws_auth_guard.d.ts.map +1 -1
- package/dist/actions/transports_ws_auth_guard.js +9 -6
- package/dist/actions/ws_endpoint_spec.d.ts +1 -1
- package/dist/auth/CLAUDE.md +72 -33
- package/dist/auth/account_action_specs.d.ts +12 -0
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +16 -2
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +7 -4
- package/dist/auth/actor_lookup_queries.d.ts +3 -2
- package/dist/auth/actor_lookup_queries.d.ts.map +1 -1
- package/dist/auth/actor_lookup_queries.js +6 -3
- package/dist/auth/actor_search_queries.d.ts +5 -2
- package/dist/auth/actor_search_queries.d.ts.map +1 -1
- package/dist/auth/actor_search_queries.js +11 -4
- package/dist/auth/admin_action_specs.d.ts +4 -4
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +33 -12
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +35 -6
- package/dist/auth/all_cell_actions.d.ts +11 -2
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.js +2 -1
- package/dist/auth/audit_emitter.d.ts +23 -3
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +14 -4
- package/dist/auth/audit_log_schema.d.ts +1 -0
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +9 -5
- package/dist/auth/bootstrap_account.d.ts +25 -1
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +37 -4
- package/dist/auth/bootstrap_routes.d.ts +3 -2
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +5 -4
- package/dist/auth/cell_action_specs.d.ts +215 -15
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.js +103 -16
- package/dist/auth/cell_actions.d.ts +40 -18
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +126 -19
- package/dist/auth/cell_audit_events.d.ts +1 -1
- package/dist/auth/cell_audit_events.d.ts.map +1 -1
- package/dist/auth/cell_audit_events.js +3 -2
- package/dist/auth/cell_audit_metadata.d.ts +11 -0
- package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.js +10 -0
- package/dist/auth/cell_grant_action_specs.d.ts +7 -0
- package/dist/auth/cell_grant_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_grant_action_specs.js +7 -0
- package/dist/auth/cell_grant_actions.d.ts +36 -4
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +20 -3
- package/dist/auth/credential_type_schema.d.ts +3 -2
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +3 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts +18 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +30 -6
- package/dist/auth/role_grant_offer_actions.d.ts +9 -4
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +58 -7
- package/dist/auth/role_grant_offer_notifications.d.ts +3 -2
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +3 -2
- package/dist/auth/role_grant_offer_queries.d.ts +20 -0
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +35 -0
- package/dist/auth/role_grant_queries.d.ts +27 -9
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +40 -13
- package/dist/auth/role_schema.d.ts +14 -8
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +6 -3
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +20 -0
- package/dist/db/CLAUDE.md +9 -2
- package/dist/db/cell_ddl.d.ts +9 -1
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +11 -1
- package/dist/db/cell_queries.d.ts +53 -7
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +61 -7
- package/dist/http/CLAUDE.md +14 -2
- package/dist/http/body_limit.d.ts +3 -1
- package/dist/http/body_limit.d.ts.map +1 -1
- package/dist/http/body_limit.js +6 -1
- package/dist/http/error_schemas.d.ts +8 -0
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +12 -0
- package/dist/http/jsonrpc.d.ts +9 -0
- package/dist/http/jsonrpc.d.ts.map +1 -1
- package/dist/http/jsonrpc.js +17 -0
- package/dist/http/jsonrpc_errors.d.ts +40 -15
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +99 -35
- package/dist/http/proxy.d.ts +4 -2
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +7 -2
- package/dist/http/surface.d.ts +3 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +7 -4
- package/dist/realtime/sse_auth_guard.d.ts.map +1 -1
- package/dist/realtime/sse_auth_guard.js +3 -2
- package/dist/schema_meta.d.ts +92 -1
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +117 -0
- package/dist/server/app_server.d.ts +13 -5
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +32 -8
- package/dist/testing/CLAUDE.md +196 -82
- package/dist/testing/adversarial_input_cases.d.ts +67 -7
- package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
- package/dist/testing/adversarial_input_cases.js +210 -165
- package/dist/testing/app_server.d.ts +3 -1
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.d.ts +3 -2
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.js +5 -3
- package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -1
- package/dist/testing/cross_backend/actor_lookup.js +27 -0
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts +6 -0
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/audit_cross_helpers.js +11 -0
- package/dist/testing/cross_backend/capabilities.d.ts +29 -5
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +10 -6
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +117 -2
- package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_gated_create.js +109 -13
- package/dist/testing/cross_backend/cell_moderate.d.ts +7 -1
- package/dist/testing/cross_backend/cell_moderate.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_moderate.js +68 -4
- package/dist/testing/cross_backend/cell_ref_admission.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_ref_admission.js +18 -9
- package/dist/testing/cross_backend/conformance_table.d.ts +5 -0
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +12 -10
- package/dist/testing/cross_backend/cross_rpc.d.ts +3 -1
- package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
- package/dist/testing/cross_backend/cross_rpc.js +2 -2
- package/dist/testing/cross_backend/default_backend_configs.d.ts +9 -7
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +3 -3
- package/dist/testing/cross_backend/differential.d.ts +7 -0
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +17 -0
- package/dist/testing/cross_backend/expected_schema.json +1 -0
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +5 -4
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +74 -2
- package/dist/testing/cross_backend/rpc_adversarial.d.ts +9 -0
- package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
- package/dist/testing/cross_backend/rpc_adversarial.js +16 -6
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +6 -3
- package/dist/testing/cross_backend/setup.d.ts +2 -2
- package/dist/testing/cross_backend/spine_suites.d.ts +85 -5
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +291 -20
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +15 -0
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +24 -0
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts +18 -19
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts.map +1 -1
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.js +66 -42
- package/dist/testing/cross_backend/testing_backdoor.d.ts +27 -4
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +136 -41
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +30 -15
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +52 -35
- package/dist/testing/cross_backend/transport_composition.js +3 -3
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +6 -3
- package/dist/testing/rpc_attack_surface.d.ts +10 -0
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +15 -3
- package/dist/testing/rpc_envelope_cases.d.ts +5 -2
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +4 -1
- package/dist/testing/rpc_round_trip.js +3 -3
- package/dist/testing/schema_generators.d.ts +99 -2
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +244 -76
- package/dist/testing/stubs.d.ts +4 -3
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +6 -4
- package/dist/zod.d.ts +9 -0
- package/dist/zod.d.ts.map +1 -1
- package/dist/zod.js +20 -0
- package/package.json +1 -1
|
@@ -13,17 +13,24 @@ import '../assert_dev_env.js';
|
|
|
13
13
|
* every other parentless kind stays open, so the plain-create `cell_crud` /
|
|
14
14
|
* `cell_relations` suites are unaffected.
|
|
15
15
|
* - **Contribution** (`root_id` set): the governing root's
|
|
16
|
-
* `
|
|
17
|
-
* entry denies, a present `min_role` the actor lacks globally
|
|
18
|
-
* admits with the entry's `moderation_required`
|
|
19
|
-
* root's
|
|
20
|
-
* the predicate is **pure** — no DB read of
|
|
21
|
-
* single-connection in-memory deadlock a
|
|
16
|
+
* `policy[kind] = {min_role?, moderation_required?}` decides — a missing
|
|
17
|
+
* entry (or no policy) denies, a present `min_role` the actor lacks globally
|
|
18
|
+
* denies, and otherwise it admits with the entry's `moderation_required`
|
|
19
|
+
* folded into the verdict. The root's policy arrives in `input.root_policy`
|
|
20
|
+
* (the handler read it in-tx), so the predicate is **pure** — no DB read of
|
|
21
|
+
* its own (which also dodges the single-connection in-memory deadlock a
|
|
22
|
+
* separate handle would hit — pglet, PGlite).
|
|
23
|
+
*
|
|
24
|
+
* Its `validate_policy` accepts a policy whose every entry is an object with
|
|
25
|
+
* an optional string `min_role` and an optional boolean `moderation_required`,
|
|
26
|
+
* and refuses any other with `ERROR_CELL_POLICY_INVALID`.
|
|
22
27
|
*
|
|
23
28
|
* @module
|
|
24
29
|
*/
|
|
25
30
|
import { has_scoped_role } from '../../auth/request_context.js';
|
|
26
31
|
import { ROLE_ADMIN } from '../../auth/role_schema.js';
|
|
32
|
+
import { ERROR_CELL_POLICY_INVALID } from '../../auth/cell_action_specs.js';
|
|
33
|
+
import { jsonrpc_errors } from '../../http/jsonrpc_errors.js';
|
|
27
34
|
import { SPINE_PARTICIPANT_ROLE } from './spine_surface_constants.js';
|
|
28
35
|
/** The admin-only root kind the test policy gates (talk's `space` analog). */
|
|
29
36
|
export const SPACE_CELL_KIND = 'space';
|
|
@@ -34,26 +41,32 @@ export const SPACE_CELL_KIND = 'space';
|
|
|
34
41
|
*/
|
|
35
42
|
export const PARTICIPATION_ROLE = SPINE_PARTICIPANT_ROLE;
|
|
36
43
|
/**
|
|
37
|
-
* A space `
|
|
44
|
+
* A space `policy` mirroring the test ladder: gated `post` (moderated) +
|
|
38
45
|
* `react` (live) + `comment` (live), each on `PARTICIPATION_ROLE`. `comment`
|
|
39
46
|
* exists so a suite can create a comment under a post (`root_id !==
|
|
40
47
|
* parent_id`) and prove the policy resolves from the governing root (the
|
|
41
48
|
* space), not the immediate parent. Shared by the gated-create and moderate
|
|
42
|
-
* cross suites
|
|
49
|
+
* cross suites, which pass it as a root's `cell_create` `policy`.
|
|
43
50
|
*/
|
|
44
51
|
export const TEST_SPACE_POLICY = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
comment: { min_role: PARTICIPATION_ROLE, moderation_required: false }
|
|
49
|
-
}
|
|
52
|
+
post: { min_role: PARTICIPATION_ROLE, moderation_required: true },
|
|
53
|
+
react: { min_role: PARTICIPATION_ROLE, moderation_required: false },
|
|
54
|
+
comment: { min_role: PARTICIPATION_ROLE, moderation_required: false }
|
|
50
55
|
};
|
|
51
|
-
/**
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
/** Whether `value` is a `ContributionRule` — an object of only those two keys, each its type. */
|
|
57
|
+
const is_contribution_rule = (value) => value !== null &&
|
|
58
|
+
typeof value === 'object' &&
|
|
59
|
+
!Array.isArray(value) &&
|
|
60
|
+
Object.entries(value).every(([key, v]) => {
|
|
61
|
+
if (key === 'min_role')
|
|
62
|
+
return typeof v === 'string';
|
|
63
|
+
if (key === 'moderation_required')
|
|
64
|
+
return typeof v === 'boolean';
|
|
65
|
+
return false;
|
|
66
|
+
});
|
|
67
|
+
/** Pull the governing root's `policy[kind]` rule, defensively. */
|
|
68
|
+
const get_contribution_rule = (policy, kind) => {
|
|
69
|
+
if (policy === null)
|
|
57
70
|
return undefined;
|
|
58
71
|
const rule = policy[kind];
|
|
59
72
|
if (rule === null || typeof rule !== 'object')
|
|
@@ -61,29 +74,40 @@ const get_contribution_rule = (data, kind) => {
|
|
|
61
74
|
return rule;
|
|
62
75
|
};
|
|
63
76
|
/**
|
|
64
|
-
* The directory-model test authorizer — a **pure** function of
|
|
65
|
-
* reads the governing root's policy off `input.
|
|
66
|
-
* handler). Byte-equivalent with the Rust
|
|
77
|
+
* The directory-model test authorizer — `authorize` is a **pure** function of
|
|
78
|
+
* the input (it reads the governing root's policy off `input.root_policy`,
|
|
79
|
+
* supplied by the handler). Byte-equivalent with the Rust
|
|
80
|
+
* `TestCellGatedCreateAuthorize`.
|
|
67
81
|
*/
|
|
68
|
-
export const test_cell_gated_create_authorize =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
export const test_cell_gated_create_authorize = {
|
|
83
|
+
authorize: (auth, input) => {
|
|
84
|
+
// Admin bypass — admins create roots + any kind, live immediately. The
|
|
85
|
+
// global grant only: a scoped `admin` row bypasses nothing.
|
|
86
|
+
if (has_scoped_role(auth, ROLE_ADMIN, null)) {
|
|
87
|
+
return { allow: true, moderation_required: false };
|
|
88
|
+
}
|
|
89
|
+
// Root creation (no governing root): `space` is admin-only; other
|
|
90
|
+
// parentless kinds stay open (the plain-create suites).
|
|
91
|
+
if (input.root_id === null) {
|
|
92
|
+
return input.kind === SPACE_CELL_KIND
|
|
93
|
+
? { allow: false }
|
|
94
|
+
: { allow: true, moderation_required: false };
|
|
95
|
+
}
|
|
96
|
+
// Contribution: resolve the governing root's per-kind policy.
|
|
97
|
+
const rule = get_contribution_rule(input.root_policy, input.kind ?? '');
|
|
98
|
+
if (!rule)
|
|
99
|
+
return { allow: false };
|
|
100
|
+
// `min_role` names no scope, so only the global grant satisfies it.
|
|
101
|
+
const admitted = rule.min_role === undefined || has_scoped_role(auth, rule.min_role, null);
|
|
102
|
+
return admitted
|
|
103
|
+
? { allow: true, moderation_required: rule.moderation_required ?? false }
|
|
104
|
+
: { allow: false };
|
|
105
|
+
},
|
|
106
|
+
validate_policy: (policy) => {
|
|
107
|
+
if (!Object.values(policy).every(is_contribution_rule)) {
|
|
108
|
+
throw jsonrpc_errors.invalid_params('invalid space policy', {
|
|
109
|
+
reason: ERROR_CELL_POLICY_INVALID
|
|
110
|
+
});
|
|
111
|
+
}
|
|
79
112
|
}
|
|
80
|
-
// Contribution: resolve the governing root's per-kind policy.
|
|
81
|
-
const rule = get_contribution_rule(input.root_data, input.kind ?? '');
|
|
82
|
-
if (!rule)
|
|
83
|
-
return { allow: false };
|
|
84
|
-
// `min_role` names no scope, so only the global grant satisfies it.
|
|
85
|
-
const admitted = rule.min_role === undefined || has_scoped_role(auth, rule.min_role, null);
|
|
86
|
-
return admitted
|
|
87
|
-
? { allow: true, moderation_required: rule.moderation_required ?? false }
|
|
88
|
-
: { allow: false };
|
|
89
113
|
};
|
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RpcPathCapabilityGatedCrossSuiteOptions } from './setup.js';
|
|
3
3
|
import { type WsEndpointTarget } from './ws_endpoint.js';
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* A backdoor the suite fires: its method and a params payload its input
|
|
6
|
+
* schema accepts, so a refusal lands on the credential gate, not on validation.
|
|
7
|
+
*/
|
|
8
|
+
export interface TestingBackdoorProbe {
|
|
9
|
+
readonly method: string;
|
|
10
|
+
readonly params?: unknown;
|
|
11
|
+
}
|
|
12
|
+
/** Options for the testing-backdoor suite. */
|
|
13
|
+
export interface TestingBackdoorCrossTestOptions extends RpcPathCapabilityGatedCrossSuiteOptions {
|
|
6
14
|
/**
|
|
7
15
|
* Where the backend's WebSocket endpoint is, for the session-socket cases.
|
|
8
|
-
* Pass it when the backend serves
|
|
16
|
+
* Pass it when the backend serves its `_testing_*` actions on its WS
|
|
9
17
|
* endpoint too; omitted, those cases are skipped.
|
|
10
18
|
*/
|
|
11
19
|
readonly ws?: WsEndpointTarget;
|
|
20
|
+
/**
|
|
21
|
+
* The backend's own daemon-token seams beyond `TESTING_BACKDOOR_METHODS`,
|
|
22
|
+
* each with params its input accepts — fired with the same refused
|
|
23
|
+
* principals as the known backdoors. Each must start with `_testing_` and
|
|
24
|
+
* not be a known backdoor; the call throws otherwise.
|
|
25
|
+
*/
|
|
26
|
+
readonly extra_methods?: ReadonlyArray<TestingBackdoorProbe>;
|
|
12
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Register the backdoor suite: the declaration check over every known
|
|
30
|
+
* backdoor, then the refused-principal rows over the mounted ones.
|
|
31
|
+
*
|
|
32
|
+
* @param options - the fixture, the backend's capabilities, and the optional
|
|
33
|
+
* WS target and extra seams
|
|
34
|
+
* @throws Error - on a declaration or extra method `resolve_backdoor_probes` refuses
|
|
35
|
+
*/
|
|
13
36
|
export declare const describe_testing_backdoor_cross_tests: (options: TestingBackdoorCrossTestOptions) => void;
|
|
14
37
|
//# sourceMappingURL=testing_backdoor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing_backdoor.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_backdoor.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"testing_backdoor.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_backdoor.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA2F9B,OAAO,KAAK,EAAE,uCAAuC,EAAe,MAAM,YAAY,CAAC;AAMvF,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AA0C1E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC1B;AAkDD,8CAA8C;AAC9C,MAAM,WAAW,+BAAgC,SAAQ,uCAAuC;IAC/F;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC7D;AAqDD;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC,GACjD,SAAS,+BAA+B,KACtC,IAgHF,CAAC"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
2
|
/**
|
|
3
|
-
* Cross-backend
|
|
4
|
-
*
|
|
3
|
+
* Cross-backend suite for the `_testing_*` backdoor actions: the backend's
|
|
4
|
+
* declaration of which it mounts, and the credential gate on each.
|
|
5
5
|
*
|
|
6
|
-
* `
|
|
7
|
-
* `
|
|
8
|
-
* `
|
|
9
|
-
* `
|
|
6
|
+
* `TESTING_BACKDOOR_METHODS` (`_testing_reset`, `_testing_drain_effects`,
|
|
7
|
+
* `_testing_mint_session`, `_testing_put_fact`,
|
|
8
|
+
* `_testing_flood_notifications`, `_testing_schema_snapshot`,
|
|
9
|
+
* `_testing_migration_tracker`, `_testing_action_manifest`,
|
|
10
|
+
* `_testing_origin_check`, `_testing_shorten_credential_expiry`) are
|
|
10
11
|
* privileged test-binary actions the production
|
|
11
12
|
* wire never exposes — direct DB writes (full auth wipe, forged session row,
|
|
12
|
-
* raw fact insert), a flood of the caller's own connection,
|
|
13
|
-
* reads (the live schema, the `schema_version` migration
|
|
14
|
-
* RPC registry — the highest info-leak of the set were
|
|
15
|
-
* probe of the origin allowlist parser, and a rewrite of
|
|
16
|
-
* credential expiries. Their only structural fence
|
|
13
|
+
* raw fact insert), the audit barrier, a flood of the caller's own connection,
|
|
14
|
+
* introspection reads (the live schema, the `schema_version` migration
|
|
15
|
+
* tracker, and the live RPC registry — the highest info-leak of the set were
|
|
16
|
+
* the gate to break), a probe of the origin allowlist parser, and a rewrite of
|
|
17
|
+
* an account's credential expiries. Their only structural fence
|
|
17
18
|
* is the **daemon-token** credential gate on
|
|
18
19
|
* each spec's `auth` axis. A test binary live-mounts them on its RPC
|
|
19
20
|
* endpoint (and, on fuz_app's spine binary and the Rust stub, its WS
|
|
@@ -24,7 +25,19 @@ import '../assert_dev_env.js';
|
|
|
24
25
|
* (`live_rpc_endpoints`) fires the same refusals through the auth rows
|
|
25
26
|
* `generate_rpc_auth_conformance_cases` generates for them.
|
|
26
27
|
*
|
|
27
|
-
*
|
|
28
|
+
* **The declaration.** A backend states which it mounts in
|
|
29
|
+
* `capabilities.testing_backdoors`, and the suite holds it to that: each known
|
|
30
|
+
* backdoor the declaration leaves out is sent anonymously and must answer
|
|
31
|
+
* `method_not_found` (404) — both spines look a method up before they
|
|
32
|
+
* authenticate the caller, so an unmounted method answers that whatever the
|
|
33
|
+
* credential — and each declared one runs the rows below, whose anonymous row
|
|
34
|
+
* (a 401, not `method_not_found`) proves it mounted. A wrong declaration fails
|
|
35
|
+
* either way, so the suites that skip on an undeclared backdoor
|
|
36
|
+
* (`describe_spine_cross_suites`) skip only what the backend truly lacks. The
|
|
37
|
+
* check runs on every backend, one mounting none of them included.
|
|
38
|
+
*
|
|
39
|
+
* For every declared backdoor, and each `extra_methods` seam (a consumer's own
|
|
40
|
+
* daemon-token action), three principals:
|
|
28
41
|
*
|
|
29
42
|
* - **anonymous** (no credential) → `401` (pre-authorization auth refuses an
|
|
30
43
|
* account-less caller before anything else).
|
|
@@ -55,13 +68,13 @@ import '../assert_dev_env.js';
|
|
|
55
68
|
* on both impls. Cited property: `security.md` §Test Backdoor Actions
|
|
56
69
|
* (daemon-token-gated, off-surface, DEV-excluded).
|
|
57
70
|
*
|
|
58
|
-
*
|
|
59
|
-
* binary, not the in-process app — like the ws/sse
|
|
60
|
-
* `*.cross.test.ts
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* backend that also serves
|
|
71
|
+
* The credential rows run cross-process only — the `_testing_*` actions are
|
|
72
|
+
* mounted on the spawned binary, not the in-process app — like the ws/sse
|
|
73
|
+
* suites; there, wire from a `*.cross.test.ts`, whose setup fires
|
|
74
|
+
* `_testing_reset`, so the backend must mount that one. In-process, an app
|
|
75
|
+
* mounting none declares none, and the suite runs the declaration rows alone,
|
|
76
|
+
* one per known backdoor. The WS cases run when `ws` is passed — for a
|
|
77
|
+
* backend that also serves its backdoors on its WS endpoint.
|
|
65
78
|
*
|
|
66
79
|
* @module
|
|
67
80
|
*/
|
|
@@ -69,46 +82,49 @@ import { describe, test, assert } from 'vitest';
|
|
|
69
82
|
import { ERROR_CREDENTIAL_TYPE_REQUIRED } from '../../http/error_schemas.js';
|
|
70
83
|
import { JSONRPC_ERROR_CODES } from '../../http/jsonrpc_errors.js';
|
|
71
84
|
import { rpc_call } from '../rpc_helpers.js';
|
|
85
|
+
import { TESTING_METHOD_PREFIX } from '../surface_invariants.js';
|
|
72
86
|
import { is_response_for } from '../transports/ws_client.js';
|
|
73
87
|
import { test_if } from './capabilities.js';
|
|
74
|
-
import { SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
88
|
+
import { SPINE_RPC_PATH, TESTING_BACKDOOR_METHODS } from './spine_surface_constants.js';
|
|
75
89
|
import { open_session_ws } from './ws_endpoint.js';
|
|
76
90
|
/** A well-formed UUID that never names a real row. */
|
|
77
91
|
const NIL_UUID = '00000000-0000-0000-0000-000000000000';
|
|
78
92
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
93
|
+
* A **valid** params payload for each known backdoor (so the session/bearer
|
|
94
|
+
* cases reach the 403 credential gate rather than a 400 on input validation).
|
|
95
|
+
* The handlers never run — the gate refuses first. Keyed by
|
|
96
|
+
* `TestingBackdoorMethod`, so a method added to `TESTING_BACKDOOR_METHODS`
|
|
97
|
+
* fails typecheck here until it has its params.
|
|
82
98
|
*/
|
|
83
|
-
const
|
|
84
|
-
|
|
99
|
+
const BACKDOOR_PARAMS = {
|
|
100
|
+
_testing_reset: {},
|
|
85
101
|
// The audit barrier — its input is void, so the call carries no params.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
102
|
+
_testing_drain_effects: undefined,
|
|
103
|
+
_testing_mint_session: { account_id: NIL_UUID, expires_in_seconds: -60 },
|
|
104
|
+
_testing_put_fact: { content: 'backdoor-probe' },
|
|
89
105
|
// An empty burst — valid input, so it clears the 400 phase; a refused
|
|
90
106
|
// caller never reaches the handler that would queue it.
|
|
91
|
-
|
|
107
|
+
_testing_flood_notifications: { count: 0, size: 0 },
|
|
92
108
|
// The schema-dump read — `exclude_tables` is optional, so `{}` is valid
|
|
93
109
|
// and clears the 400 phase like the writes above.
|
|
94
|
-
|
|
110
|
+
_testing_schema_snapshot: {},
|
|
95
111
|
// The migration-tracker-dump read — input is an empty strict object, so `{}`
|
|
96
112
|
// is valid and clears the 400 phase, reaching the credential gate like the rest.
|
|
97
|
-
|
|
113
|
+
_testing_migration_tracker: {},
|
|
98
114
|
// The RPC-registry-dump read — input is an empty strict object, so `{}` is
|
|
99
115
|
// valid and clears the 400 phase, reaching the credential gate like the rest.
|
|
100
|
-
|
|
116
|
+
_testing_action_manifest: {},
|
|
101
117
|
// The origin conformance probe — a valid `{patterns, origin}` pair, so it
|
|
102
118
|
// clears the 400 phase like the rest.
|
|
103
|
-
|
|
119
|
+
_testing_origin_check: { patterns: 'http://localhost:*', origin: null },
|
|
104
120
|
// The credential-expiry rewrite — a valid `{account_id, seconds}` pair (a
|
|
105
121
|
// syntactically valid UUID; no row needs to match), so it clears the 400
|
|
106
122
|
// phase like the rest.
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
123
|
+
_testing_shorten_credential_expiry: {
|
|
124
|
+
account_id: '00000000-0000-4000-8000-000000000000',
|
|
125
|
+
seconds: 30
|
|
110
126
|
}
|
|
111
|
-
|
|
127
|
+
};
|
|
112
128
|
const principals = [
|
|
113
129
|
{
|
|
114
130
|
name: 'anonymous',
|
|
@@ -139,11 +155,89 @@ const principals = [
|
|
|
139
155
|
})
|
|
140
156
|
}
|
|
141
157
|
];
|
|
158
|
+
/**
|
|
159
|
+
* The known backdoors a backend declares, checked against the known list,
|
|
160
|
+
* and its extra seams, checked against the `_testing_` prefix and the list.
|
|
161
|
+
*
|
|
162
|
+
* @throws Error - on a declared method that isn't a known backdoor, an extra
|
|
163
|
+
* method outside the `_testing_` namespace or naming a known backdoor, or a
|
|
164
|
+
* duplicate
|
|
165
|
+
*/
|
|
166
|
+
const resolve_backdoor_probes = (declared, extra_methods) => {
|
|
167
|
+
const known = new Set(TESTING_BACKDOOR_METHODS);
|
|
168
|
+
const seen = new Set();
|
|
169
|
+
for (const method of declared) {
|
|
170
|
+
if (!known.has(method)) {
|
|
171
|
+
throw new Error(`describe_testing_backdoor_cross_tests: capabilities.testing_backdoors declares ` +
|
|
172
|
+
`'${method}', which is not in TESTING_BACKDOOR_METHODS — pass a consumer seam as extra_methods`);
|
|
173
|
+
}
|
|
174
|
+
if (seen.has(method)) {
|
|
175
|
+
throw new Error(`describe_testing_backdoor_cross_tests: capabilities.testing_backdoors declares '${method}' twice`);
|
|
176
|
+
}
|
|
177
|
+
seen.add(method);
|
|
178
|
+
}
|
|
179
|
+
for (const { method } of extra_methods) {
|
|
180
|
+
if (!method.startsWith(TESTING_METHOD_PREFIX) || known.has(method)) {
|
|
181
|
+
throw new Error(`describe_testing_backdoor_cross_tests: extra method '${method}' must start with ` +
|
|
182
|
+
`'${TESTING_METHOD_PREFIX}' and not be a known backdoor (declare those in capabilities.testing_backdoors)`);
|
|
183
|
+
}
|
|
184
|
+
if (seen.has(method)) {
|
|
185
|
+
throw new Error(`describe_testing_backdoor_cross_tests: extra method '${method}' is listed twice`);
|
|
186
|
+
}
|
|
187
|
+
seen.add(method);
|
|
188
|
+
}
|
|
189
|
+
return [
|
|
190
|
+
...TESTING_BACKDOOR_METHODS.filter((method) => declared.includes(method)).map((method) => ({
|
|
191
|
+
method,
|
|
192
|
+
params: BACKDOOR_PARAMS[method]
|
|
193
|
+
})),
|
|
194
|
+
...extra_methods
|
|
195
|
+
];
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Register the backdoor suite: the declaration check over every known
|
|
199
|
+
* backdoor, then the refused-principal rows over the mounted ones.
|
|
200
|
+
*
|
|
201
|
+
* @param options - the fixture, the backend's capabilities, and the optional
|
|
202
|
+
* WS target and extra seams
|
|
203
|
+
* @throws Error - on a declaration or extra method `resolve_backdoor_probes` refuses
|
|
204
|
+
*/
|
|
142
205
|
export const describe_testing_backdoor_cross_tests = (options) => {
|
|
143
|
-
const { setup_test, ws } = options;
|
|
206
|
+
const { setup_test, capabilities, ws, extra_methods = [] } = options;
|
|
144
207
|
const rpc_path = options.rpc_path ?? SPINE_RPC_PATH;
|
|
208
|
+
const declared = capabilities.testing_backdoors;
|
|
209
|
+
const probes = resolve_backdoor_probes(declared, extra_methods);
|
|
210
|
+
// a declared backdoor's mount is pinned by its anonymous row below (a 401,
|
|
211
|
+
// not `method_not_found`); an undeclared one must not be mounted, so a
|
|
212
|
+
// backend can't mount one its declaration leaves out
|
|
213
|
+
const undeclared = TESTING_BACKDOOR_METHODS.filter((method) => !declared.includes(method));
|
|
214
|
+
// vitest fails a describe holding no test, so a full declaration registers none
|
|
215
|
+
if (undeclared.length > 0) {
|
|
216
|
+
describe('testing backdoor declaration', () => {
|
|
217
|
+
for (const method of undeclared) {
|
|
218
|
+
test(`${method} is undeclared → method_not_found`, async () => {
|
|
219
|
+
const fixture = await setup_test();
|
|
220
|
+
const res = await rpc_call({
|
|
221
|
+
app: fixture.fresh_transport(),
|
|
222
|
+
path: rpc_path,
|
|
223
|
+
method,
|
|
224
|
+
params: BACKDOOR_PARAMS[method]
|
|
225
|
+
});
|
|
226
|
+
assert.ok(!res.ok, `${method}: undeclared in capabilities.testing_backdoors, but the call succeeded`);
|
|
227
|
+
if (!res.ok) {
|
|
228
|
+
assert.strictEqual(res.error.code, JSONRPC_ERROR_CODES.method_not_found, `${method}: undeclared in capabilities.testing_backdoors, but it answers ` +
|
|
229
|
+
`${res.status} (${res.error.code}) — the backend mounts it, so declare it`);
|
|
230
|
+
}
|
|
231
|
+
assert.strictEqual(res.status, 404, `${method}: status`);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
// none declared and no extra seam: no rows, and vitest fails an empty describe
|
|
237
|
+
if (probes.length === 0)
|
|
238
|
+
return;
|
|
145
239
|
describe('testing backdoor credential gate parity', () => {
|
|
146
|
-
for (const { method, params } of
|
|
240
|
+
for (const { method, params } of probes) {
|
|
147
241
|
for (const principal of principals) {
|
|
148
242
|
test(`${method} rejects ${principal.name} → ${principal.status}`, async () => {
|
|
149
243
|
const fixture = await setup_test();
|
|
@@ -158,9 +252,10 @@ export const describe_testing_backdoor_cross_tests = (options) => {
|
|
|
158
252
|
});
|
|
159
253
|
const label = `${method} ${principal.name}`;
|
|
160
254
|
assert.ok(!res.ok, `${label}: expected denial (${principal.status}) but the call succeeded`);
|
|
161
|
-
assert.strictEqual(res.status, principal.status, `${label}: status`);
|
|
162
255
|
// `!res.ok` narrows `res` to the error variant for `res.error`.
|
|
163
256
|
if (!res.ok) {
|
|
257
|
+
assert.notStrictEqual(res.error.code, JSONRPC_ERROR_CODES.method_not_found, `${label}: declared but not mounted — the backend answers method_not_found`);
|
|
258
|
+
assert.strictEqual(res.status, principal.status, `${label}: status`);
|
|
164
259
|
assert.strictEqual(res.error.code, principal.code, `${label}: error.code`);
|
|
165
260
|
if (principal.reason !== undefined) {
|
|
166
261
|
const reason = res.error.data?.reason;
|
|
@@ -170,7 +265,7 @@ export const describe_testing_backdoor_cross_tests = (options) => {
|
|
|
170
265
|
});
|
|
171
266
|
}
|
|
172
267
|
}
|
|
173
|
-
for (const { method, params } of
|
|
268
|
+
for (const { method, params } of probes) {
|
|
174
269
|
test_if(ws !== undefined, `${method} over a session socket → forbidden ${ERROR_CREDENTIAL_TYPE_REQUIRED}`, async () => {
|
|
175
270
|
const fixture = await setup_test();
|
|
176
271
|
const client = await open_session_ws(ws, fixture, { admitted: true });
|
|
@@ -29,13 +29,16 @@ import '../assert_dev_env.js';
|
|
|
29
29
|
*
|
|
30
30
|
* `_testing_reset` — full DB wipe + keeper re-seed + optional
|
|
31
31
|
* secondary-account seeding. The
|
|
32
|
-
* handler
|
|
32
|
+
* handler first fires the consumer-supplied domain-state callback (domain
|
|
33
|
+
* rows depend on auth rows, so a domain table with a restricting FK to
|
|
34
|
+
* `actor` empties before the rows it references go), then wipes every
|
|
35
|
+
* auth-namespace row (no keeper-preserve filter),
|
|
33
36
|
* flips `bootstrap_lock` back to its post-bootstrap shape, seeds a
|
|
34
37
|
* fresh keeper account inline (reusing `create_test_account_with_credentials`
|
|
35
|
-
* so cross-process matches in-process write semantics),
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
38
|
+
* so cross-process matches in-process write semantics), queues the
|
|
39
|
+
* daemon-token cache refresh to point at the new keeper once the reset
|
|
40
|
+
* commits, and seeds any caller-requested `extra_accounts` (also
|
|
41
|
+
* direct-inserted at this setup step). The
|
|
39
42
|
* new keeper + secondary credentials return as the action output so
|
|
40
43
|
* the per-test fixture closes over them.
|
|
41
44
|
*
|
|
@@ -177,6 +180,11 @@ export declare const testing_reset_action_spec: {
|
|
|
177
180
|
* not — nor are eager writes outside `emit` (session touch, token usage),
|
|
178
181
|
* which only the dispatching transport's own flush awaits.
|
|
179
182
|
*
|
|
183
|
+
* The output's `tracked` is `AuditEmitter.is_tracking_inflight` — whether the
|
|
184
|
+
* drain could wait on anything. `cross_drain_effects` refuses `tracked: false`,
|
|
185
|
+
* so a binary whose emitter was built without tracking fails its first audit
|
|
186
|
+
* read instead of racing it. The Rust twin answers the same shape.
|
|
187
|
+
*
|
|
180
188
|
* `auth` gates on the daemon-token credential, matching `_testing_reset`.
|
|
181
189
|
*/
|
|
182
190
|
export declare const testing_drain_effects_action_spec: {
|
|
@@ -192,6 +200,7 @@ export declare const testing_drain_effects_action_spec: {
|
|
|
192
200
|
readonly input: z.ZodVoid;
|
|
193
201
|
readonly output: z.ZodObject<{
|
|
194
202
|
ok: z.ZodBoolean;
|
|
203
|
+
tracked: z.ZodBoolean;
|
|
195
204
|
}, z.core.$strict>;
|
|
196
205
|
readonly async: true;
|
|
197
206
|
readonly description: "Test-binary only — await in-flight fire-and-forget audit writes so a following audit_log_list read is authoritative.";
|
|
@@ -251,7 +260,8 @@ export declare const testing_mint_session_action_spec: {
|
|
|
251
260
|
* emitter the backend's handlers emit through (`deps.audit`), built with
|
|
252
261
|
* `track_inflight: true` (see the spec doc). Mount it on any test endpoint
|
|
253
262
|
* whose suite asserts on audit rows (the spine binary bundles it via
|
|
254
|
-
* `create_testing_actions`; in-process suites mount it directly).
|
|
263
|
+
* `create_testing_actions`; in-process suites mount it directly). Answers
|
|
264
|
+
* `{ok: true, tracked}`, `tracked` read from `audit.is_tracking_inflight()`.
|
|
255
265
|
*
|
|
256
266
|
* @param audit - the backend's emitter, whose in-flight writes the action awaits
|
|
257
267
|
*/
|
|
@@ -626,17 +636,22 @@ export interface CreateTestingActionsOptions {
|
|
|
626
636
|
*/
|
|
627
637
|
readonly daemon_token_state: DaemonTokenState;
|
|
628
638
|
/**
|
|
629
|
-
* Consumer-supplied callback invoked
|
|
630
|
-
* the same transactional `Db` the auth wipes
|
|
639
|
+
* Consumer-supplied callback invoked first, before the auth-table wipe and
|
|
640
|
+
* keeper re-seed, passed the same transactional `Db` the auth wipes then
|
|
641
|
+
* run on. It runs while the previous test's accounts and actors still
|
|
642
|
+
* exist, so a domain table with a restricting FK to `actor` / `account`
|
|
643
|
+
* empties before the auth wipe deletes what it references; it must not
|
|
644
|
+
* depend on the fresh keeper, which doesn't exist yet. DB-domain consumers
|
|
631
645
|
* (e.g. fuz_forge truncating its cell / fact / file tables) MUST use this
|
|
632
646
|
* `db` rather than a separately-pooled connection — under the in-memory
|
|
633
|
-
* drivers' single connection (pglet, PGlite) a second connection deadlocks
|
|
634
|
-
* transaction. `testing_zzz_server` clears
|
|
635
|
-
* terminals + scoped-FS scratch (ignores
|
|
636
|
-
* (`testing/cross_backend/full_spine_mount.ts` and
|
|
637
|
-
* the cell and fact tables. Runs inside
|
|
638
|
-
* as the auth-table writes, so a throw
|
|
639
|
-
* JSON-RPC error and the per-test
|
|
647
|
+
* drivers' single connection (pglet, PGlite) a second connection deadlocks
|
|
648
|
+
* against this still-open transaction. `testing_zzz_server` clears
|
|
649
|
+
* in-memory workspace registry + terminals + scoped-FS scratch (ignores
|
|
650
|
+
* `db`); the spine binaries (`testing/cross_backend/full_spine_mount.ts` and
|
|
651
|
+
* the Rust `testing_spine_stub`) empty the cell and fact tables. Runs inside
|
|
652
|
+
* the same RPC dispatch as the auth-table writes, so a throw rolls the whole
|
|
653
|
+
* reset back and surfaces to the caller as a JSON-RPC error and the per-test
|
|
654
|
+
* fixture short-circuits.
|
|
640
655
|
*/
|
|
641
656
|
readonly reset_state?: (db: Db) => Promise<void> | void;
|
|
642
657
|
}
|
|
@@ -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;AAE9B
|
|
1
|
+
{"version":3,"file":"testing_reset_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"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"}
|