@fuzdev/fuz_app 0.147.0 → 0.149.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 +8 -6
- package/dist/actions/action_codegen.d.ts +15 -1
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +23 -2
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +14 -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 +23 -3
- package/dist/auth/CLAUDE.md +3 -2
- 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/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +29 -8
- package/dist/auth/audit_emitter.d.ts +14 -0
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +5 -1
- package/dist/auth/cell_action_specs.d.ts +3 -1
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.js +5 -5
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +2 -3
- package/dist/auth/cell_data_schema.d.ts +1 -1
- package/dist/auth/cell_data_schema.js +1 -1
- package/dist/auth/cell_field_action_specs.d.ts +4 -3
- package/dist/auth/cell_field_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_field_action_specs.js +5 -6
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.js +8 -1
- package/dist/auth/cell_item_action_specs.d.ts +4 -2
- package/dist/auth/cell_item_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_item_action_specs.js +5 -5
- package/dist/auth/cell_item_actions.d.ts.map +1 -1
- package/dist/auth/cell_item_actions.js +8 -1
- package/dist/auth/role_grant_offer_action_specs.d.ts +2 -0
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +8 -4
- package/dist/http/CLAUDE.md +14 -2
- 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_errors.d.ts +40 -15
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +90 -35
- package/dist/primitive_schemas.d.ts +1 -1
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +2 -1
- package/dist/schema_meta.d.ts +80 -0
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +71 -1
- package/dist/testing/CLAUDE.md +853 -146
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +73 -5
- package/dist/testing/adversarial_input.d.ts +0 -47
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +4 -340
- package/dist/testing/adversarial_input_cases.d.ts +124 -0
- package/dist/testing/adversarial_input_cases.d.ts.map +1 -0
- package/dist/testing/adversarial_input_cases.js +393 -0
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +24 -20
- package/dist/testing/audit_drift_guard.d.ts +30 -3
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.js +55 -3
- package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/account_lifecycle.js +29 -12
- package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -1
- package/dist/testing/cross_backend/actor_lookup.js +7 -25
- package/dist/testing/cross_backend/app_settings.d.ts.map +1 -1
- package/dist/testing/cross_backend/app_settings.js +4 -6
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts +57 -0
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -0
- package/dist/testing/cross_backend/audit_cross_helpers.js +89 -0
- package/dist/testing/cross_backend/backend_config.d.ts +2 -1
- package/dist/testing/cross_backend/backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size.d.ts +6 -0
- package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size.js +26 -44
- package/dist/testing/cross_backend/body_size_smuggling.d.ts +5 -0
- package/dist/testing/cross_backend/body_size_smuggling.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size_smuggling.js +7 -14
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts +3 -1
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.d.ts +78 -59
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +25 -24
- package/dist/testing/cross_backend/cargo_binary.d.ts +70 -0
- package/dist/testing/cross_backend/cargo_binary.d.ts.map +1 -0
- package/dist/testing/cross_backend/cargo_binary.js +148 -0
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +174 -3
- package/dist/testing/cross_backend/cell_gated_create.d.ts +0 -60
- package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_gated_create.js +9 -487
- package/dist/testing/cross_backend/cell_grant_role.d.ts +14 -2
- package/dist/testing/cross_backend/cell_grant_role.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_grant_role.js +22 -12
- package/dist/testing/cross_backend/cell_moderate.d.ts +66 -0
- package/dist/testing/cross_backend/cell_moderate.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_moderate.js +511 -0
- package/dist/testing/cross_backend/cell_ref_admission.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_ref_admission.js +1 -1
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +40 -19
- package/dist/testing/cross_backend/conformance_case.d.ts +43 -4
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.js +29 -1
- package/dist/testing/cross_backend/conformance_rpc_auth.d.ts +93 -0
- package/dist/testing/cross_backend/conformance_rpc_auth.d.ts.map +1 -0
- package/dist/testing/cross_backend/conformance_rpc_auth.js +125 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +144 -4
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +297 -65
- package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -1
- package/dist/testing/cross_backend/cookie_attributes.js +3 -2
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts +38 -5
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_cross_backend_global_setup.js +24 -3
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +5 -5
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_deadline.d.ts +10 -6
- package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_deadline.js +32 -31
- package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_header_robustness.js +4 -6
- package/dist/testing/cross_backend/{cell_cross_helpers.d.ts → cross_rpc.d.ts} +14 -2
- package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -0
- package/dist/testing/cross_backend/{cell_cross_helpers.js → cross_rpc.js} +31 -7
- package/dist/testing/cross_backend/default_backend_configs.d.ts +58 -61
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +97 -91
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +2 -2
- package/dist/testing/cross_backend/differential.d.ts +126 -0
- package/dist/testing/cross_backend/differential.d.ts.map +1 -0
- package/dist/testing/cross_backend/differential.js +201 -0
- package/dist/testing/cross_backend/differential_normalize.d.ts +150 -0
- package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -0
- package/dist/testing/cross_backend/differential_normalize.js +153 -0
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +27 -17
- package/dist/testing/cross_backend/full_spine_mount.d.ts +15 -0
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +55 -1
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +6 -5
- package/dist/testing/cross_backend/in_process_setup.d.ts +12 -2
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +10 -7
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +13 -18
- package/dist/testing/cross_backend/origin.js +1 -1
- package/dist/testing/cross_backend/origin_conformance.js +1 -1
- package/dist/testing/cross_backend/origin_scope.d.ts +6 -0
- package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_scope.js +13 -12
- package/dist/testing/cross_backend/peer_ping_ws.d.ts +2 -5
- package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +14 -24
- package/dist/testing/cross_backend/postgres_database.d.ts +85 -0
- package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -0
- package/dist/testing/cross_backend/postgres_database.js +140 -0
- package/dist/testing/cross_backend/provided_context.d.ts +28 -0
- package/dist/testing/cross_backend/provided_context.d.ts.map +1 -0
- package/dist/testing/cross_backend/provided_context.js +35 -0
- package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
- package/dist/testing/cross_backend/query_shape.js +10 -12
- package/dist/testing/cross_backend/ready.js +2 -2
- package/dist/testing/cross_backend/revocation_drivers.d.ts +4 -3
- package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
- package/dist/testing/cross_backend/revocation_drivers.js +1 -1
- package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts +3 -2
- 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 +13 -0
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -0
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +203 -0
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +2 -5
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +203 -111
- package/dist/testing/cross_backend/role_grant_participation.d.ts +13 -0
- package/dist/testing/cross_backend/role_grant_participation.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_participation.js +32 -21
- package/dist/testing/cross_backend/role_grant_role_grammar.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_role_grammar.js +6 -9
- package/dist/testing/cross_backend/rpc_adversarial.d.ts +47 -0
- package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -0
- package/dist/testing/cross_backend/rpc_adversarial.js +302 -0
- package/dist/testing/cross_backend/rpc_success_fixtures.d.ts +24 -0
- package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -0
- package/dist/testing/cross_backend/rpc_success_fixtures.js +124 -0
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +101 -0
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -0
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +113 -0
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts +10 -0
- 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 +33 -21
- package/dist/testing/cross_backend/session_cap.d.ts +9 -8
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +9 -4
- package/dist/testing/cross_backend/session_cookie_codec.js +1 -1
- package/dist/testing/cross_backend/setup.d.ts +58 -56
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +29 -29
- package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
- package/dist/testing/cross_backend/simple_request.js +4 -4
- package/dist/testing/cross_backend/spawn_backend.d.ts +59 -10
- package/dist/testing/cross_backend/spawn_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/spawn_backend.js +219 -60
- package/dist/testing/cross_backend/spine_suites.d.ts +311 -0
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -0
- package/dist/testing/cross_backend/spine_suites.js +897 -0
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +44 -0
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +53 -0
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +3 -4
- package/dist/testing/cross_backend/standard.d.ts +18 -1
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +2 -0
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts +24 -0
- 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 +15 -0
- package/dist/testing/cross_backend/testing_backdoor.d.ts +29 -12
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +143 -51
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +30 -14
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +58 -37
- package/dist/testing/cross_backend/testing_server_bun.js +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +1 -1
- package/dist/testing/cross_backend/token_scope_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_scope_surface.js +9 -13
- package/dist/testing/cross_backend/transport_composition.d.ts +26 -2
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +81 -51
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +8 -0
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +23 -13
- package/dist/testing/cross_backend/ws_action_rate_limit.d.ts +2 -5
- package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_action_rate_limit.js +8 -14
- package/dist/testing/cross_backend/ws_connection_cap.d.ts +4 -9
- package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_connection_cap.js +11 -12
- package/dist/testing/cross_backend/ws_endpoint.d.ts +52 -0
- package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -0
- package/dist/testing/cross_backend/ws_endpoint.js +54 -0
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts +2 -5
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_inbound_dispatch.js +9 -15
- package/dist/testing/cross_backend/ws_outbound_overflow.d.ts +2 -7
- package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.js +5 -9
- package/dist/testing/cross_backend/ws_role_gated.d.ts +4 -5
- package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_role_gated.js +12 -21
- package/dist/testing/cross_backend/ws_round_trip.d.ts +12 -9
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +29 -34
- package/dist/testing/db_entities.d.ts +16 -3
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/db_entities.js +28 -5
- package/dist/testing/integration_helpers.d.ts +61 -2
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +75 -18
- package/dist/testing/round_trip.d.ts +17 -0
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +67 -24
- 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 +27 -140
- package/dist/testing/rpc_envelope_cases.d.ts +114 -0
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -0
- package/dist/testing/rpc_envelope_cases.js +243 -0
- package/dist/testing/rpc_helpers.d.ts +31 -0
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +35 -14
- package/dist/testing/rpc_round_trip.d.ts +62 -6
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +151 -39
- 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 +261 -73
- package/dist/testing/standard.d.ts +26 -0
- package/dist/testing/standard.d.ts.map +1 -1
- package/dist/testing/standard.js +4 -1
- 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/testing/transports/raw_http.d.ts +21 -0
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +30 -0
- package/dist/zod.d.ts +9 -0
- package/dist/zod.d.ts.map +1 -1
- package/dist/zod.js +20 -0
- package/package.json +6 -4
- package/dist/testing/cross_backend/actor_search.d.ts +0 -6
- package/dist/testing/cross_backend/actor_search.d.ts.map +0 -1
- package/dist/testing/cross_backend/actor_search.js +0 -90
- package/dist/testing/cross_backend/cell_cross_helpers.d.ts.map +0 -1
|
@@ -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,16 +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
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
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.
|
|
639
655
|
*/
|
|
640
656
|
readonly reset_state?: (db: Db) => Promise<void> | void;
|
|
641
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":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAOzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAA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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
|
*
|
|
@@ -87,7 +90,7 @@ import { query_put_fact_holder } from '../../db/fact_holder_queries.js';
|
|
|
87
90
|
import { ROLE_ADMIN, ROLE_KEEPER } from '../../auth/role_schema.js';
|
|
88
91
|
import { query_schema_snapshot, SchemaSnapshot, query_migration_tracker, MigrationTracker } from '../schema_introspect.js';
|
|
89
92
|
import { ActionManifest, build_action_manifest } from './action_manifest.js';
|
|
90
|
-
import {
|
|
93
|
+
import { create_test_extra_actor } from '../db_entities.js';
|
|
91
94
|
import { create_test_account_with_credentials, mint_test_session } from '../app_server.js';
|
|
92
95
|
import { DEFAULT_TEST_PASSWORD } from '../test_credentials.js';
|
|
93
96
|
import { TESTING_ACTION_AUTH } from './spine_surface_constants.js';
|
|
@@ -179,6 +182,11 @@ export const testing_reset_action_spec = {
|
|
|
179
182
|
* not — nor are eager writes outside `emit` (session touch, token usage),
|
|
180
183
|
* which only the dispatching transport's own flush awaits.
|
|
181
184
|
*
|
|
185
|
+
* The output's `tracked` is `AuditEmitter.is_tracking_inflight` — whether the
|
|
186
|
+
* drain could wait on anything. `cross_drain_effects` refuses `tracked: false`,
|
|
187
|
+
* so a binary whose emitter was built without tracking fails its first audit
|
|
188
|
+
* read instead of racing it. The Rust twin answers the same shape.
|
|
189
|
+
*
|
|
182
190
|
* `auth` gates on the daemon-token credential, matching `_testing_reset`.
|
|
183
191
|
*/
|
|
184
192
|
export const testing_drain_effects_action_spec = {
|
|
@@ -188,7 +196,13 @@ export const testing_drain_effects_action_spec = {
|
|
|
188
196
|
auth: TESTING_ACTION_AUTH,
|
|
189
197
|
side_effects: false,
|
|
190
198
|
input: z.void(),
|
|
191
|
-
output: z.strictObject({
|
|
199
|
+
output: z.strictObject({
|
|
200
|
+
ok: z.boolean(),
|
|
201
|
+
tracked: z.boolean().meta({
|
|
202
|
+
description: "Whether the backend's audit emitter tracks in-flight writes — false means the drain " +
|
|
203
|
+
'waited on nothing and is no barrier.'
|
|
204
|
+
})
|
|
205
|
+
}),
|
|
192
206
|
async: true,
|
|
193
207
|
description: 'Test-binary only — await in-flight fire-and-forget audit writes so a following audit_log_list read is authoritative.'
|
|
194
208
|
};
|
|
@@ -250,13 +264,14 @@ export const testing_mint_session_action_spec = {
|
|
|
250
264
|
* emitter the backend's handlers emit through (`deps.audit`), built with
|
|
251
265
|
* `track_inflight: true` (see the spec doc). Mount it on any test endpoint
|
|
252
266
|
* whose suite asserts on audit rows (the spine binary bundles it via
|
|
253
|
-
* `create_testing_actions`; in-process suites mount it directly).
|
|
267
|
+
* `create_testing_actions`; in-process suites mount it directly). Answers
|
|
268
|
+
* `{ok: true, tracked}`, `tracked` read from `audit.is_tracking_inflight()`.
|
|
254
269
|
*
|
|
255
270
|
* @param audit - the backend's emitter, whose in-flight writes the action awaits
|
|
256
271
|
*/
|
|
257
272
|
export const create_testing_drain_effects_action = (audit) => rpc_action(testing_drain_effects_action_spec, async () => {
|
|
258
273
|
await audit.drain_inflight();
|
|
259
|
-
return { ok: true };
|
|
274
|
+
return { ok: true, tracked: audit.is_tracking_inflight() };
|
|
260
275
|
});
|
|
261
276
|
/**
|
|
262
277
|
* `_testing_put_fact` — seed an **embedded** fact (`fact.bytes`) for the
|
|
@@ -613,8 +628,18 @@ export const create_testing_actions = (deps, options) => {
|
|
|
613
628
|
const log = deps.log;
|
|
614
629
|
return [
|
|
615
630
|
rpc_action(testing_reset_action_spec, async (input, ctx) => {
|
|
616
|
-
log.info('[_testing_reset] resetting auth state + re-seeding keeper');
|
|
617
|
-
// 1.
|
|
631
|
+
log.info('[_testing_reset] resetting domain + auth state + re-seeding keeper');
|
|
632
|
+
// 1. Fire domain-state reset (zzz workspaces/terminals/scratch,
|
|
633
|
+
// fuz_forge cell/fact/file truncation, the spine binaries' cell +
|
|
634
|
+
// fact wipe) first: domain rows depend on auth rows, so a domain
|
|
635
|
+
// table with a restricting FK to `actor` would make the auth wipe
|
|
636
|
+
// below fail once it holds a row.
|
|
637
|
+
// Pass the transactional `ctx.db` so DB-domain truncation runs
|
|
638
|
+
// on the same connection — a separate pool connection deadlocks
|
|
639
|
+
// against this open transaction under the in-memory drivers.
|
|
640
|
+
if (reset_state)
|
|
641
|
+
await reset_state(ctx.db);
|
|
642
|
+
// 2. Wipe every auth-namespace row. No keeper-preserve filter —
|
|
618
643
|
// the fresh-keeper-per-test contract means mutation-cascade
|
|
619
644
|
// tests (password change, revoke-all) and hardcoded-username
|
|
620
645
|
// signup-uniqueness tests can't leak between cases.
|
|
@@ -631,13 +656,13 @@ export const create_testing_actions = (deps, options) => {
|
|
|
631
656
|
await ctx.db.query('DELETE FROM role_grant');
|
|
632
657
|
await ctx.db.query('DELETE FROM actor');
|
|
633
658
|
await ctx.db.query('DELETE FROM account');
|
|
634
|
-
//
|
|
659
|
+
// 3. Reset singleton `app_settings` to production defaults
|
|
635
660
|
// (matches in-process `_build_test_backend` behavior in
|
|
636
661
|
// `app_server.ts`). Tests that flipped `open_signup` mid-run
|
|
637
662
|
// revert.
|
|
638
663
|
await ctx.db.query('UPDATE app_settings SET open_signup = false, updated_at = NULL, updated_by = NULL ' +
|
|
639
664
|
'WHERE open_signup = true OR updated_at IS NOT NULL');
|
|
640
|
-
//
|
|
665
|
+
// 4. Flip `bootstrap_lock` to its post-bootstrap shape. Production
|
|
641
666
|
// `bootstrap_account` flips this to `true` on success; the
|
|
642
667
|
// in-process `bootstrap_test_keeper` mirrors the flip. We're
|
|
643
668
|
// about to seed the keeper here, so the final state needs to
|
|
@@ -645,7 +670,7 @@ export const create_testing_actions = (deps, options) => {
|
|
|
645
670
|
// to `false` — nothing reads it between our DELETEs and the
|
|
646
671
|
// UPDATE.
|
|
647
672
|
await ctx.db.query('UPDATE bootstrap_lock SET bootstrapped = true WHERE id = 1');
|
|
648
|
-
//
|
|
673
|
+
// 5. Seed the fresh keeper inline. Reuses the same primitive
|
|
649
674
|
// in-process tests use (`create_test_account_with_credentials`)
|
|
650
675
|
// so cross-process and in-process write semantics stay in
|
|
651
676
|
// parity — same hash, same account+actor+role_grants+
|
|
@@ -662,7 +687,19 @@ export const create_testing_actions = (deps, options) => {
|
|
|
662
687
|
password_value: DEFAULT_TEST_PASSWORD,
|
|
663
688
|
roles: [ROLE_KEEPER, ROLE_ADMIN, ...(input.extra_keeper_roles ?? [])]
|
|
664
689
|
});
|
|
665
|
-
//
|
|
690
|
+
// 6. Refresh the daemon-token cache so subsequent daemon-token
|
|
691
|
+
// requests resolve to the freshly seeded keeper. The
|
|
692
|
+
// middleware's lazy-refresh path only fires when the cached
|
|
693
|
+
// id is null, so the reset sets it — after the commit, queued as
|
|
694
|
+
// soon as the keeper exists, so a reset that rolls back after it
|
|
695
|
+
// (a failing extra seed, a failed COMMIT) leaves the cache on the
|
|
696
|
+
// keeper still in the database rather than one that never
|
|
697
|
+
// landed, and the next reset can still authenticate.
|
|
698
|
+
const keeper_account_id = keeper.account.id;
|
|
699
|
+
emit_after_commit(ctx, () => {
|
|
700
|
+
daemon_token_state.keeper_account_id = keeper_account_id;
|
|
701
|
+
});
|
|
702
|
+
// 7. Seed any caller-requested extras. These are bootstrap-time
|
|
666
703
|
// secondaries — the bypass exists in the same cradle the
|
|
667
704
|
// keeper does, not as a free-form runtime action.
|
|
668
705
|
const extras = [];
|
|
@@ -678,35 +715,19 @@ export const create_testing_actions = (deps, options) => {
|
|
|
678
715
|
});
|
|
679
716
|
extras.push(seeded);
|
|
680
717
|
}
|
|
681
|
-
//
|
|
718
|
+
// 8. Seed any additional keeper actors. Same bootstrap-cradle
|
|
682
719
|
// bypass as extra_accounts — no production wire path mints a
|
|
683
720
|
// second actor, so the multi-actor `acting` branches need this
|
|
684
721
|
// direct insert. Order-preserving so the fixture can address
|
|
685
|
-
// them positionally
|
|
722
|
+
// them positionally, and seeded at the wall clock so they sort
|
|
723
|
+
// after the keeper's bootstrap actor in insert order
|
|
724
|
+
// (`create_test_extra_actor`), as on the Rust spine
|
|
725
|
+
// (`query_create_actor_with_clock_timestamp`).
|
|
686
726
|
const extra_actors = [];
|
|
687
727
|
for (const name of input.extra_actors ?? []) {
|
|
688
|
-
const seeded_actor = await
|
|
728
|
+
const seeded_actor = await create_test_extra_actor(ctx.db, keeper.account.id, name);
|
|
689
729
|
extra_actors.push({ id: seeded_actor.id, name: seeded_actor.name });
|
|
690
730
|
}
|
|
691
|
-
// 6. Refresh the daemon-token cache so subsequent daemon-token
|
|
692
|
-
// requests resolve to the freshly seeded keeper. The
|
|
693
|
-
// middleware's lazy-refresh path only fires when the cached
|
|
694
|
-
// id is null, so the reset sets it — after the commit, so a
|
|
695
|
-
// reset that rolls back (a throwing `reset_state`, a failed
|
|
696
|
-
// COMMIT) leaves the cache on the keeper still in the database
|
|
697
|
-
// rather than one that never landed, and the next reset can
|
|
698
|
-
// still authenticate.
|
|
699
|
-
const keeper_account_id = keeper.account.id;
|
|
700
|
-
emit_after_commit(ctx, () => {
|
|
701
|
-
daemon_token_state.keeper_account_id = keeper_account_id;
|
|
702
|
-
});
|
|
703
|
-
// 7. Fire domain-state reset (zzz workspaces/terminals/scratch,
|
|
704
|
-
// fuz_forge cell/fact/file truncation, or no-op for spine_stub).
|
|
705
|
-
// Pass the transactional `ctx.db` so DB-domain truncation runs
|
|
706
|
-
// on the same connection — a separate pool connection deadlocks
|
|
707
|
-
// against this open transaction under the in-memory drivers.
|
|
708
|
-
if (reset_state)
|
|
709
|
-
await reset_state(ctx.db);
|
|
710
731
|
return { ...keeper, extra_accounts: extras, extra_actors };
|
|
711
732
|
}),
|
|
712
733
|
rpc_action(testing_mint_session_action_spec, async (input, ctx) => {
|
|
@@ -72,7 +72,7 @@ export const create_bun_testing_adapter = () => {
|
|
|
72
72
|
// hang), and the client runtime — a single server-closed WS is
|
|
73
73
|
// necessary and sufficient. Client-initiated close or leaving the
|
|
74
74
|
// socket open both stop cleanly in ~0ms. In this suite the trigger is
|
|
75
|
-
// any server-initiated WS close — a revocation's (the
|
|
75
|
+
// any server-initiated WS close — a revocation's (the WS round-trip suite's
|
|
76
76
|
// close-on-revoke cases), a cap eviction's, an oversized message's —
|
|
77
77
|
// which is why teardown hangs after those and not under HTTP-only or
|
|
78
78
|
// client-closed WS traffic.
|
|
@@ -37,7 +37,7 @@ import '../assert_dev_env.js';
|
|
|
37
37
|
*/
|
|
38
38
|
import { describe, test, assert } from 'vitest';
|
|
39
39
|
import { account_token_create_action_spec, account_token_list_action_spec, API_TOKEN_NAME_LENGTH_MAX, TokenCreateOutput, TokenListOutput } from '../../auth/account_action_specs.js';
|
|
40
|
-
import { cross_rpc_call, error_reason, expect_output } from './
|
|
40
|
+
import { cross_rpc_call, error_reason, expect_output } from './cross_rpc.js';
|
|
41
41
|
import { assert_iso8601_seconds } from './wire_shapes.js';
|
|
42
42
|
import { SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
43
43
|
/** TTL used by the bounded-mint case. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_scope_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/token_scope_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgF9B,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"token_scope_surface.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/token_scope_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgF9B,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,YAAY,CAAC;AAmB1E,wDAAwD;AACxD,MAAM,WAAW,iCAAkC,SAAQ,uCAAuC;IACjG,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AA6DD,eAAO,MAAM,wCAAwC,GACpD,SAAS,iCAAiC,KACxC,IAqKF,CAAC"}
|
|
@@ -70,13 +70,9 @@ import '../assert_dev_env.js';
|
|
|
70
70
|
import { describe, assert } from 'vitest';
|
|
71
71
|
import { ERROR_CREDENTIAL_TYPE_REQUIRED, ERROR_TOKEN_SCOPE_REQUIRED } from '../../http/error_schemas.js';
|
|
72
72
|
import { test_if } from './capabilities.js';
|
|
73
|
-
import { cross_rpc_call } from './
|
|
73
|
+
import { cross_rpc_call } from './cross_rpc.js';
|
|
74
74
|
import { mint_narrowed_api_token } from './narrowed_api_token.js';
|
|
75
|
-
import { SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
76
|
-
/** Default audit-log SSE path — the `audit_stream` surface. */
|
|
77
|
-
const DEFAULT_SSE_PATH = '/api/admin/audit/stream';
|
|
78
|
-
/** The account status read, which answers a narrowed token as anonymous. */
|
|
79
|
-
const STATUS_PATH = '/api/account/status';
|
|
75
|
+
import { SPINE_ACCOUNT_STATUS_PATH, SPINE_RPC_PATH, SPINE_SSE_PATH } from './spine_surface_constants.js';
|
|
80
76
|
/**
|
|
81
77
|
* A well-formed hash that no fact has. The scope gate is a pre-authorization
|
|
82
78
|
* guard, so it fires before the handler ever looks the hash up — but *params*
|
|
@@ -127,7 +123,7 @@ const assert_channel_denied = async (fresh_transport, path, token, credential_ty
|
|
|
127
123
|
export const describe_token_scope_surface_cross_tests = (options) => {
|
|
128
124
|
const { setup_test, capabilities } = options;
|
|
129
125
|
const rpc_path = options.rpc_path ?? SPINE_RPC_PATH;
|
|
130
|
-
const sse_path = options.sse_path ??
|
|
126
|
+
const sse_path = options.sse_path ?? SPINE_SSE_PATH;
|
|
131
127
|
describe('token scope non-RPC surface parity', () => {
|
|
132
128
|
/**
|
|
133
129
|
* The non-vacuity control for every denial below: a narrowed token is
|
|
@@ -155,7 +151,7 @@ export const describe_token_scope_surface_cross_tests = (options) => {
|
|
|
155
151
|
});
|
|
156
152
|
await assert_channel_denied(fixture.fresh_transport, sse_path, token, ['session']);
|
|
157
153
|
});
|
|
158
|
-
test_if(capabilities.
|
|
154
|
+
test_if(capabilities.fact_serving_admin_hash, 'a narrowed token is refused the bare-hash fact read (surface:fact_bare)', async () => {
|
|
159
155
|
const fixture = await setup_test();
|
|
160
156
|
const token = await mint_narrowed_api_token({
|
|
161
157
|
app: fixture.transport,
|
|
@@ -173,7 +169,7 @@ export const describe_token_scope_surface_cross_tests = (options) => {
|
|
|
173
169
|
* scope denial satisfies the property, so the assertion is on what the
|
|
174
170
|
* response must *not* be.
|
|
175
171
|
*/
|
|
176
|
-
test_if(capabilities.
|
|
172
|
+
test_if(capabilities.fact_serving_admin_hash, 'a full token is not refused by the scope gate on the same route', async () => {
|
|
177
173
|
const fixture = await setup_test();
|
|
178
174
|
const res = await fixture.fresh_transport({ origin: null })(`/api/facts/${ABSENT_FACT_HASH}`, { headers: fixture.create_bearer_headers() });
|
|
179
175
|
const body = (await res.json().catch(() => undefined));
|
|
@@ -193,14 +189,14 @@ export const describe_token_scope_surface_cross_tests = (options) => {
|
|
|
193
189
|
session_headers: fixture.create_session_headers(),
|
|
194
190
|
methods: [ADMITTED_METHOD]
|
|
195
191
|
});
|
|
196
|
-
const anonymous = await fixture.fresh_transport({ origin: null })(
|
|
197
|
-
const narrowed = await fixture.fresh_transport({ origin: null })(
|
|
192
|
+
const anonymous = await fixture.fresh_transport({ origin: null })(SPINE_ACCOUNT_STATUS_PATH, {});
|
|
193
|
+
const narrowed = await fixture.fresh_transport({ origin: null })(SPINE_ACCOUNT_STATUS_PATH, {
|
|
198
194
|
headers: { authorization: `Bearer ${token}` }
|
|
199
195
|
});
|
|
200
196
|
assert.strictEqual(anonymous.status, 401, 'anonymous status must be 401');
|
|
201
197
|
assert.strictEqual(narrowed.status, 401, 'a narrowed token must read status as anonymous');
|
|
202
198
|
assert.strictEqual(await narrowed.text(), await anonymous.text(), 'the narrowed answer must be the anonymous one, byte for byte');
|
|
203
|
-
const full = await fixture.fresh_transport({ origin: null })(
|
|
199
|
+
const full = await fixture.fresh_transport({ origin: null })(SPINE_ACCOUNT_STATUS_PATH, {
|
|
204
200
|
headers: fixture.create_bearer_headers()
|
|
205
201
|
});
|
|
206
202
|
assert.strictEqual(full.status, 200, 'a full-scope bearer must read the account');
|
|
@@ -218,7 +214,7 @@ export const describe_token_scope_surface_cross_tests = (options) => {
|
|
|
218
214
|
* *holds* the role — so both orderings look identical there, which is
|
|
219
215
|
* exactly why this divergence survived as long as it did.
|
|
220
216
|
*/
|
|
221
|
-
test_if(capabilities.
|
|
217
|
+
test_if(capabilities.fact_serving_admin_hash, 'scope outranks role — a narrowed token lacking the role hears about its scope', async () => {
|
|
222
218
|
const fixture = await setup_test();
|
|
223
219
|
const non_admin = await fixture.create_account({ username: 'scope_before_role' });
|
|
224
220
|
const token = await mint_narrowed_api_token({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
2
|
import { type BackendCapabilities } from './capabilities.js';
|
|
3
|
-
import type { RpcPathCapabilityGatedCrossSuiteOptions } from './setup.js';
|
|
3
|
+
import type { RpcPathCapabilityGatedCrossSuiteOptions, SetupTest } from './setup.js';
|
|
4
4
|
/** A transport's front door, as the table's rows name it. */
|
|
5
5
|
export type TransportCompositionSurface = 'rest_post' | 'rest_password' | 'rpc_post' | 'rpc_get' | 'ws_upgrade' | 'sse';
|
|
6
6
|
/** What a probe sends, as the table's columns name it. */
|
|
7
|
-
export type TransportCompositionProbe = 'foreign_origin' | 'unreadable_origin' | 'duplicated_origin' | 'over_cap_foreign_origin' | 'no_credential' | 'narrowed_token';
|
|
7
|
+
export type TransportCompositionProbe = 'foreign_origin' | 'unreadable_origin' | 'duplicated_origin' | 'over_cap_foreign_origin' | 'no_credential' | 'narrowed_token' | 'multi_actor_no_acting';
|
|
8
8
|
/** The refusal a case expects. */
|
|
9
9
|
export interface TransportCompositionExpect {
|
|
10
10
|
readonly status: number;
|
|
@@ -25,6 +25,21 @@ export interface TransportCompositionCase {
|
|
|
25
25
|
}
|
|
26
26
|
/** The front-door table — one case per cell of the module doc's matrix. */
|
|
27
27
|
export declare const transport_composition_cases: ReadonlyArray<TransportCompositionCase>;
|
|
28
|
+
/**
|
|
29
|
+
* The rows that need a multi-actor keeper — run only given
|
|
30
|
+
* `TransportCompositionCrossTestOptions.multi_actor`, on its fixture.
|
|
31
|
+
*/
|
|
32
|
+
export declare const transport_composition_multi_actor_cases: ReadonlyArray<TransportCompositionCase>;
|
|
33
|
+
/** The multi-actor rows' fixture, and how a backend known to diverge runs them. */
|
|
34
|
+
export interface TransportCompositionMultiActorOptions {
|
|
35
|
+
/** Per-test fixture whose keeper is seeded with at least one `extra_actors` entry. */
|
|
36
|
+
readonly setup_test: SetupTest;
|
|
37
|
+
/** Run the multi-actor rows as `xfail_until` — for a backend known to admit them. */
|
|
38
|
+
readonly xfail?: {
|
|
39
|
+
readonly tracking_id: string;
|
|
40
|
+
readonly reason: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
28
43
|
/** Options for `describe_transport_composition_cross_tests`. */
|
|
29
44
|
export interface TransportCompositionCrossTestOptions extends RpcPathCapabilityGatedCrossSuiteOptions {
|
|
30
45
|
/**
|
|
@@ -47,6 +62,15 @@ export interface TransportCompositionCrossTestOptions extends RpcPathCapabilityG
|
|
|
47
62
|
readonly ws_path?: string;
|
|
48
63
|
/** Audit-log SSE path. Default `/api/admin/audit/stream`. */
|
|
49
64
|
readonly sse_path?: string;
|
|
65
|
+
/** Run the multi-actor rows (`transport_composition_multi_actor_cases`). */
|
|
66
|
+
readonly multi_actor?: TransportCompositionMultiActorOptions;
|
|
67
|
+
/**
|
|
68
|
+
* The backend's request-body cap on `rpc_path`, in bytes; the RPC row's
|
|
69
|
+
* over-cap probe declares a length one past it. Default
|
|
70
|
+
* `SPINE_BODY_LIMIT_DEFAULT_BYTES`. The REST rows probe past that default,
|
|
71
|
+
* the cap a backend keeps off its RPC path.
|
|
72
|
+
*/
|
|
73
|
+
readonly rpc_max_body_bytes?: number;
|
|
50
74
|
}
|
|
51
75
|
/**
|
|
52
76
|
* Register the front-door table's cases — one test per cell, each on a fresh
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport_composition.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/transport_composition.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"transport_composition.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/transport_composition.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgG9B,OAAO,EAAW,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEtE,OAAO,KAAK,EAAE,uCAAuC,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAWlG,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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