@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,13 +1,31 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
+
/**
|
|
3
|
+
* Bootstrapped app server factory for integration tests.
|
|
4
|
+
*
|
|
5
|
+
* Creates a keeper account, API token, and signed session cookie on a
|
|
6
|
+
* database. By default uses a cached in-memory pglet (one shared WASM instance
|
|
7
|
+
* per loaded copy of `testing/db.ts` — once per run under the `db` project's
|
|
8
|
+
* `isolate: false` + `fileParallelism: false`); pass `db` to use
|
|
9
|
+
* an existing database (any driver) instead.
|
|
10
|
+
*
|
|
11
|
+
* Vitest-free, so the spawned spine binary, the reset actions and a
|
|
12
|
+
* consumer's test server build can import it — its import graph is held to
|
|
13
|
+
* that by `src/test/vitest_free_modules.test.ts`, which is why the
|
|
14
|
+
* vitest-bound database helpers live in `testing/describe_db.ts`. The fully
|
|
15
|
+
* assembled Hono app (`create_test_app`) lives in `testing/test_app.ts`.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
2
19
|
import { object } from '@fuzdev/fuz_schema/schema.ts';
|
|
3
20
|
import { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
4
21
|
import { DEFAULT_TEST_PASSWORD } from './test_credentials.js';
|
|
5
|
-
import { ROLE_KEEPER } from '../auth/role_schema.js';
|
|
22
|
+
import { ROLE_ADMIN, ROLE_KEEPER } from '../auth/role_schema.js';
|
|
6
23
|
import { create_keyring } from '../auth/keyring.js';
|
|
7
24
|
import { generate_api_token } from '../auth/api_token.js';
|
|
8
25
|
import { query_create_account_with_actor } from '../auth/account_queries.js';
|
|
9
26
|
import { query_create_role_grant } from '../auth/role_grant_queries.js';
|
|
10
|
-
import { generate_session_token, hash_session_token,
|
|
27
|
+
import { generate_session_token, hash_session_token, query_create_session } from '../auth/session_queries.js';
|
|
28
|
+
import { create_test_session_row } from './db_entities.js';
|
|
11
29
|
import { query_create_api_token } from '../auth/api_token_queries.js';
|
|
12
30
|
import { create_session_cookie_value } from '../auth/session_cookie.js';
|
|
13
31
|
import { run_migrations } from '../db/migrate.js';
|
|
@@ -15,12 +33,11 @@ import { AUTH_MIGRATION_NS } from '../auth/migrations.js';
|
|
|
15
33
|
import { create_realtime_closer } from '../actions/connection_closer.js';
|
|
16
34
|
import { create_realtime_notification_sender } from '../actions/notification_sender.js';
|
|
17
35
|
import { default_audit_factory } from '../server/app_backend.js';
|
|
18
|
-
import { create_app_server } from '../server/app_server.js';
|
|
19
|
-
import { generate_daemon_token, DAEMON_TOKEN_HEADER } from '../auth/daemon_token.js';
|
|
20
36
|
import { create_default_db_factory } from './db.js';
|
|
21
37
|
import { token_scope_full } from '../auth/token_scope.js';
|
|
22
38
|
import { format_allowed_origins_error, parse_allowed_origins } from '../http/origin.js';
|
|
23
|
-
import {
|
|
39
|
+
import { TEST_ORIGIN } from './test_origin.js';
|
|
40
|
+
import { create_request_tracker } from '../http/pending_effects.js';
|
|
24
41
|
/**
|
|
25
42
|
* Fast password stub for tests that don't exercise login/password flows.
|
|
26
43
|
*
|
|
@@ -32,6 +49,13 @@ export const stub_password_deps = {
|
|
|
32
49
|
verify_password: async (p, h) => h === `stub_hash_${p}`,
|
|
33
50
|
verify_dummy: async () => false
|
|
34
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* The test keeper's roles when none are given — keeper and admin, what a
|
|
54
|
+
* production bootstrap (`bootstrap_account`) grants and the cross-process
|
|
55
|
+
* `_testing_reset` seeds, so a test database starts in a state production
|
|
56
|
+
* reaches. A test that needs a keeper without admin passes `roles`.
|
|
57
|
+
*/
|
|
58
|
+
export const DEFAULT_TEST_KEEPER_ROLES = [ROLE_KEEPER, ROLE_ADMIN];
|
|
35
59
|
/** 64-hex-char test cookie secret — deterministic, never used in production. */
|
|
36
60
|
export const TEST_COOKIE_SECRET = 'a'.repeat(64);
|
|
37
61
|
// Module-level default factory (pglet-wasm unless `set_default_db_factory` installed
|
|
@@ -86,7 +110,7 @@ const resolve_fallback_factory = (migration_namespaces) => {
|
|
|
86
110
|
* `role_grant` (one per role), `api_token`, and `auth_session`.
|
|
87
111
|
*/
|
|
88
112
|
export const create_test_account_with_credentials = async (options) => {
|
|
89
|
-
const { db, keyring,
|
|
113
|
+
const { db, keyring, password, username = 'keeper', password_value = DEFAULT_TEST_PASSWORD, roles = [], email } = options;
|
|
90
114
|
const deps = { db };
|
|
91
115
|
const password_hash = await password.hash_password(password_value);
|
|
92
116
|
// lowercase, as `Username` stores every name production creates, and as the
|
|
@@ -103,16 +127,12 @@ export const create_test_account_with_credentials = async (options) => {
|
|
|
103
127
|
// Create API token (account-scoped — acting actor is per-request)
|
|
104
128
|
const { token: api_token, id: token_id, token_hash } = generate_api_token();
|
|
105
129
|
await query_create_api_token(deps, token_id, account.id, 'test-cli', token_hash, token_scope_full());
|
|
106
|
-
// Create session (account-scoped — acting actor is per-request)
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
session_options,
|
|
113
|
-
account_id: account.id,
|
|
114
|
-
expires_in_seconds: AUTH_SESSION_LIFETIME_MS / 1000
|
|
115
|
-
});
|
|
130
|
+
// Create session (account-scoped — acting actor is per-request), through
|
|
131
|
+
// the production insert (`query_create_session`, the full lifetime on the
|
|
132
|
+
// database clock), as the Rust reset seeds through its production minter.
|
|
133
|
+
const session_token = generate_session_token();
|
|
134
|
+
await query_create_session({ db }, hash_session_token(session_token), account.id);
|
|
135
|
+
const session_cookie = await create_session_cookie_value(keyring, session_token);
|
|
116
136
|
return {
|
|
117
137
|
account: { id: account.id, username: account.username },
|
|
118
138
|
actor: { id: actor.id },
|
|
@@ -134,31 +154,35 @@ export const create_test_account_with_credentials = async (options) => {
|
|
|
134
154
|
* @mutates `options.db` — inserts one `auth_session` row.
|
|
135
155
|
*/
|
|
136
156
|
export const mint_test_session = async (options) => {
|
|
137
|
-
const { db, keyring,
|
|
157
|
+
const { db, keyring, account_id, expires_in_seconds } = options;
|
|
138
158
|
const session_token = generate_session_token();
|
|
139
159
|
const session_hash = hash_session_token(session_token);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const session_cookie = await create_session_cookie_value(keyring, session_token, session_options);
|
|
160
|
+
await create_test_session_row(db, session_hash, account_id, expires_in_seconds);
|
|
161
|
+
const session_cookie = await create_session_cookie_value(keyring, session_token);
|
|
143
162
|
return { session_cookie, session_hash };
|
|
144
163
|
};
|
|
145
164
|
/**
|
|
146
165
|
* Bootstrap the test-DB keeper. Direct-query shortcut for the default
|
|
147
166
|
* `create_test_app` path — bootstrap is not what most tests exercise, so
|
|
148
167
|
* we skip the real `bootstrap_account` flow (no audit row, no
|
|
149
|
-
*
|
|
168
|
+
* keeper set on a daemon-token state); the cross-backend harness drives the real
|
|
150
169
|
* `POST /bootstrap` against every backend it spawns.
|
|
151
170
|
*
|
|
152
171
|
* Flips `bootstrap_lock.bootstrapped = true` so the post-insert DB state
|
|
153
172
|
* matches a real bootstrap completion — production code can trust the
|
|
154
173
|
* lock as the single signal without a belt-and-suspenders
|
|
155
|
-
* `query_account_has_any` defense.
|
|
174
|
+
* `query_account_has_any` defense. Grants `options.roles`, or
|
|
175
|
+
* `DEFAULT_TEST_KEEPER_ROLES` (keeper and admin, as a real bootstrap) when
|
|
176
|
+
* omitted.
|
|
156
177
|
*
|
|
157
178
|
* @mutates the underlying `options.db` — inserts the account/actor/roles/
|
|
158
179
|
* API token/session_cookie rows AND flips `bootstrap_lock.bootstrapped`.
|
|
159
180
|
*/
|
|
160
181
|
export const bootstrap_test_keeper = async (options) => {
|
|
161
|
-
const result = await create_test_account_with_credentials(
|
|
182
|
+
const result = await create_test_account_with_credentials({
|
|
183
|
+
...options,
|
|
184
|
+
roles: options.roles ?? [...DEFAULT_TEST_KEEPER_ROLES]
|
|
185
|
+
});
|
|
162
186
|
// Lock flip — mirrors production `bootstrap_account` so test/prod write
|
|
163
187
|
// semantics stay in parity.
|
|
164
188
|
await options.db.query('UPDATE bootstrap_lock SET bootstrapped = true WHERE id = 1 AND bootstrapped = false');
|
|
@@ -220,7 +244,8 @@ const _build_test_backend = async (options) => {
|
|
|
220
244
|
log: test_log,
|
|
221
245
|
audit: audit_factory({ db, log: test_log }),
|
|
222
246
|
connection_closer: create_realtime_closer(),
|
|
223
|
-
notification_sender: create_realtime_notification_sender()
|
|
247
|
+
notification_sender: create_realtime_notification_sender(),
|
|
248
|
+
request_tracker: create_request_tracker()
|
|
224
249
|
}
|
|
225
250
|
};
|
|
226
251
|
return { backend, keyring: keyring_result.keyring };
|
|
@@ -231,14 +256,15 @@ const _build_test_backend = async (options) => {
|
|
|
231
256
|
* Sets up:
|
|
232
257
|
* - Auth tables (via the cached default factory, or reuses existing `db`)
|
|
233
258
|
* - A keeper account with hashed password
|
|
234
|
-
* - Role
|
|
259
|
+
* - Role grants for each role in `options.roles` (default
|
|
260
|
+
* `DEFAULT_TEST_KEEPER_ROLES`, keeper and admin)
|
|
235
261
|
* - An API token for Bearer auth
|
|
236
262
|
* - A session with a signed cookie value
|
|
237
263
|
*
|
|
238
264
|
* Uses `stub_password_deps` by default — deterministic hashing that works
|
|
239
265
|
* correctly for login/logout tests without Argon2 overhead.
|
|
240
266
|
*
|
|
241
|
-
* @param options -
|
|
267
|
+
* @param options - the database, the keeper's credentials and roles, and the audit factory
|
|
242
268
|
* @returns a `TestAppServer` ready for HTTP testing
|
|
243
269
|
* @mutates the underlying database — when `db` is supplied, first resets the
|
|
244
270
|
* `app_settings` row (`open_signup`, `updated_at`, `updated_by`); in either
|
|
@@ -246,12 +272,11 @@ const _build_test_backend = async (options) => {
|
|
|
246
272
|
* row, and flips `bootstrap_lock.bootstrapped` (`bootstrap_test_keeper`).
|
|
247
273
|
*/
|
|
248
274
|
export const create_test_app_server = async (options) => {
|
|
249
|
-
const {
|
|
275
|
+
const { password = stub_password_deps, username = 'keeper', password_value = DEFAULT_TEST_PASSWORD, roles } = options;
|
|
250
276
|
const { backend, keyring } = await _build_test_backend(options);
|
|
251
277
|
const bootstrapped = await bootstrap_test_keeper({
|
|
252
278
|
db: backend.deps.db,
|
|
253
279
|
keyring,
|
|
254
|
-
session_options,
|
|
255
280
|
password,
|
|
256
281
|
username,
|
|
257
282
|
password_value,
|
|
@@ -283,106 +308,3 @@ export const create_loopback_app_server_options = () => {
|
|
|
283
308
|
env_schema: object({})
|
|
284
309
|
};
|
|
285
310
|
};
|
|
286
|
-
/**
|
|
287
|
-
* The `create_app_server` options both test-app builders share — a fresh
|
|
288
|
-
* object per call, spread ahead of the per-builder options and `app_options`.
|
|
289
|
-
*/
|
|
290
|
-
const test_app_options = () => ({
|
|
291
|
-
...create_loopback_app_server_options(),
|
|
292
|
-
// every limiter off unless `app_options` passes one — a rate-limit test
|
|
293
|
-
// enables just the limiter it pins
|
|
294
|
-
rate_limiters: 'disabled_for_testing',
|
|
295
|
-
await_pending_effects: true
|
|
296
|
-
});
|
|
297
|
-
/** Build request headers carrying `session_cookie` in the `cookie_name` cookie. */
|
|
298
|
-
const create_session_headers_builder = (cookie_name, session_cookie) => (extra) => create_test_request_headers({ cookie: `${cookie_name}=${session_cookie}`, ...extra });
|
|
299
|
-
/** Build request headers carrying `api_token` as a Bearer token. */
|
|
300
|
-
const create_bearer_headers_builder = (api_token) => (extra) => ({
|
|
301
|
-
host: 'localhost',
|
|
302
|
-
authorization: `Bearer ${api_token}`,
|
|
303
|
-
...extra
|
|
304
|
-
});
|
|
305
|
-
/**
|
|
306
|
-
* Create a fully assembled test app with a Hono server, middleware, and routes.
|
|
307
|
-
*
|
|
308
|
-
* Combines `create_test_app_server` + `create_app_server` into a single call.
|
|
309
|
-
* Disables every rate limiter (`rate_limiters: 'disabled_for_testing'`) and
|
|
310
|
-
* logging by default (test-friendly). A limiter passed through `app_options`
|
|
311
|
-
* wins over the mode, so a rate-limit test enables just the one it pins.
|
|
312
|
-
*
|
|
313
|
-
* A fresh Hono app is created each call — middleware closures bind to the
|
|
314
|
-
* server's deps (db, keyring), so reuse across servers is unsafe.
|
|
315
|
-
* The expensive resource (the WASM database) is cached separately in `testing/db.ts`.
|
|
316
|
-
*
|
|
317
|
-
* @param options - test app configuration
|
|
318
|
-
* @returns a `TestApp` ready for HTTP testing
|
|
319
|
-
*/
|
|
320
|
-
export const create_test_app = async (options) => {
|
|
321
|
-
const test_server = await create_test_app_server(options);
|
|
322
|
-
// Daemon token state for keeper auth in tests.
|
|
323
|
-
// Uses a static token (no rotation) — sufficient for request-level testing.
|
|
324
|
-
const test_daemon_token = generate_daemon_token();
|
|
325
|
-
const daemon_token_state = {
|
|
326
|
-
current_token: test_daemon_token,
|
|
327
|
-
previous_token: null,
|
|
328
|
-
rotated_at: new Date(),
|
|
329
|
-
keeper_account_id: test_server.account.id
|
|
330
|
-
};
|
|
331
|
-
const result = await create_app_server({
|
|
332
|
-
...test_app_options(),
|
|
333
|
-
backend: test_server,
|
|
334
|
-
session_options: options.session_options,
|
|
335
|
-
daemon_token_state,
|
|
336
|
-
rpc_endpoints: options.rpc_endpoints,
|
|
337
|
-
bootstrap: options.bootstrap,
|
|
338
|
-
// `auth_cleanup` stays at its default, off: a background pass would
|
|
339
|
-
// delete rows and write audit rows mid-test. A suite that opts in
|
|
340
|
-
// through `app_options` has the schedule stopped by `cleanup`.
|
|
341
|
-
...options.app_options,
|
|
342
|
-
create_route_specs: options.create_route_specs
|
|
343
|
-
});
|
|
344
|
-
const { app, surface_spec } = result;
|
|
345
|
-
const { cookie_name } = options.session_options;
|
|
346
|
-
const { password = stub_password_deps } = options;
|
|
347
|
-
const create_session_headers = create_session_headers_builder(cookie_name, test_server.session_cookie);
|
|
348
|
-
const create_bearer_headers = create_bearer_headers_builder(test_server.api_token);
|
|
349
|
-
const create_daemon_token_headers = (extra) => ({
|
|
350
|
-
host: 'localhost',
|
|
351
|
-
[DAEMON_TOKEN_HEADER]: test_daemon_token,
|
|
352
|
-
...extra
|
|
353
|
-
});
|
|
354
|
-
let account_counter = 0;
|
|
355
|
-
const create_account = async (account_options) => {
|
|
356
|
-
account_counter++;
|
|
357
|
-
const bootstrapped = await create_test_account_with_credentials({
|
|
358
|
-
db: test_server.deps.db,
|
|
359
|
-
keyring: test_server.keyring,
|
|
360
|
-
session_options: options.session_options,
|
|
361
|
-
password,
|
|
362
|
-
username: account_options?.username ?? `test_user_${account_counter}`,
|
|
363
|
-
password_value: account_options?.password_value ?? DEFAULT_TEST_PASSWORD,
|
|
364
|
-
roles: account_options?.roles ?? [],
|
|
365
|
-
...(account_options?.email !== undefined && { email: account_options.email })
|
|
366
|
-
});
|
|
367
|
-
return {
|
|
368
|
-
...bootstrapped,
|
|
369
|
-
create_session_headers: create_session_headers_builder(cookie_name, bootstrapped.session_cookie),
|
|
370
|
-
create_bearer_headers: create_bearer_headers_builder(bootstrapped.api_token)
|
|
371
|
-
};
|
|
372
|
-
};
|
|
373
|
-
return {
|
|
374
|
-
app,
|
|
375
|
-
backend: test_server,
|
|
376
|
-
server: result,
|
|
377
|
-
surface_spec,
|
|
378
|
-
surface: surface_spec.surface,
|
|
379
|
-
route_specs: surface_spec.route_specs,
|
|
380
|
-
create_session_headers,
|
|
381
|
-
create_bearer_headers,
|
|
382
|
-
create_daemon_token_headers,
|
|
383
|
-
create_account,
|
|
384
|
-
// the server's `close`, not the backend's: it also stops an auth cleanup
|
|
385
|
-
// schedule a suite opted into
|
|
386
|
-
cleanup: () => result.close()
|
|
387
|
-
};
|
|
388
|
-
};
|
|
@@ -44,7 +44,7 @@ export interface StandardAttackSurfaceOptions {
|
|
|
44
44
|
snapshot_path: string;
|
|
45
45
|
/** Expected public routes, e.g. `['GET /health', 'POST /api/account/login']`. */
|
|
46
46
|
expected_public_routes: Array<string>;
|
|
47
|
-
/** Expected middleware names for API routes, e.g. `['trusted_proxy', 'origin', 'session', 'request_context', 'bearer_auth']`. */
|
|
47
|
+
/** Expected middleware names for API routes, e.g. `['body_limit', 'host', 'trusted_proxy', 'origin', 'session', 'request_context', 'bearer_auth']`. */
|
|
48
48
|
expected_api_middleware: Array<string>;
|
|
49
49
|
/** All roles in the app (e.g. `['admin', 'keeper']`). */
|
|
50
50
|
roles: Array<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attack_surface.d.ts","sourceRoot":"","sources":["../../src/lib/testing/attack_surface.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAoB7B,OAAO,EAIN,KAAK,4BAA4B,EACjC,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAGN,KAAK,gBAAgB,EACrB,MAAM,wBAAwB,CAAC;AAWhC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAgCzD,oFAAoF;AACpF,MAAM,WAAW,sBAAsB;IACtC,+EAA+E;IAC/E,KAAK,EAAE,MAAM,cAAc,CAAC;IAC5B,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,sBAAsB,KAAG,IA6K3E,CAAC;AAIF,0DAA0D;AAC1D,MAAM,WAAW,4BAA4B;IAC5C,+EAA+E;IAC/E,KAAK,EAAE,MAAM,cAAc,CAAC;IAC5B,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,sBAAsB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtC,
|
|
1
|
+
{"version":3,"file":"attack_surface.d.ts","sourceRoot":"","sources":["../../src/lib/testing/attack_surface.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAoB7B,OAAO,EAIN,KAAK,4BAA4B,EACjC,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAGN,KAAK,gBAAgB,EACrB,MAAM,wBAAwB,CAAC;AAWhC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAgCzD,oFAAoF;AACpF,MAAM,WAAW,sBAAsB;IACtC,+EAA+E;IAC/E,KAAK,EAAE,MAAM,cAAc,CAAC;IAC5B,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,sBAAsB,KAAG,IA6K3E,CAAC;AAIF,0DAA0D;AAC1D,MAAM,WAAW,4BAA4B;IAC5C,+EAA+E;IAC/E,KAAK,EAAE,MAAM,cAAc,CAAC;IAC5B,yDAAyD;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,sBAAsB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtC,uJAAuJ;IACvJ,uBAAuB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvC,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,eAAe,CAAC,EAAE,4BAA4B,CAAC;IAC/C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sCAAsC,GAClD,SAAS,4BAA4B,KACnC,IAqDF,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
-
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
3
2
|
import { type RpcEndpointsSuiteOption } from './rpc_helpers.js';
|
|
4
3
|
import type { AppSurfaceSpec } from '../http/surface.js';
|
|
5
4
|
import type { SetupTest } from './cross_backend/setup.js';
|
|
@@ -22,8 +21,8 @@ export interface AuditCompletenessTestOptions {
|
|
|
22
21
|
* options uniformity.
|
|
23
22
|
*/
|
|
24
23
|
surface_source: AppSurfaceSpec;
|
|
25
|
-
/**
|
|
26
|
-
|
|
24
|
+
/** The session cookie's name — needed for factory-form rpc_endpoints resolution. */
|
|
25
|
+
session_cookie_name: string;
|
|
27
26
|
/**
|
|
28
27
|
* RPC endpoint specs — required. The admin role_grant flow is RPC-only
|
|
29
28
|
* and the suite hard-fails without it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_completeness.d.ts","sourceRoot":"","sources":["../../src/lib/testing/audit_completeness.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"audit_completeness.d.ts","sourceRoot":"","sources":["../../src/lib/testing/audit_completeness.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAsC7B,OAAO,EAKN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AA2B1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,0BAA0B,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;;;OAKG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;;;;;OAMG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B,oFAAoF;IACpF,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,aAAa,EAAE,uBAAuB,CAAC;CACvC;AAkGD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iCAAiC,GAAI,SAAS,4BAA4B,KAAG,IAgnBzF,CAAC"}
|
|
@@ -112,7 +112,7 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
112
112
|
const route_specs = options.surface_source.route_specs;
|
|
113
113
|
// Hard-fail early so consumers see a clear setup error instead of a
|
|
114
114
|
// confusing test failure when `rpc_endpoints` is missing.
|
|
115
|
-
const rpc_endpoints_for_setup = resolve_rpc_endpoints_for_setup(options.rpc_endpoints, options.
|
|
115
|
+
const rpc_endpoints_for_setup = resolve_rpc_endpoints_for_setup(options.rpc_endpoints, options.session_cookie_name);
|
|
116
116
|
const rpc_path = require_rpc_endpoint_path(rpc_endpoints_for_setup);
|
|
117
117
|
describe('audit_log_completeness', () => {
|
|
118
118
|
// --- Account routes ---
|
|
@@ -4,22 +4,27 @@ import { type AuditLogEventJson, type AuditLogInput } from '../auth/audit_log_sc
|
|
|
4
4
|
/**
|
|
5
5
|
* Register per-test `beforeEach` + `afterEach` hooks that catch any audit
|
|
6
6
|
* emission with a metadata shape that fails its `audit_metadata_schemas`
|
|
7
|
-
* entry, an `event_type` not present in the active `AuditLogConfig`,
|
|
8
|
-
* row the emitter failed to write
|
|
7
|
+
* entry, an `event_type` not present in the active `AuditLogConfig`, a
|
|
8
|
+
* row the emitter failed to write, or a success row written outside a
|
|
9
|
+
* transaction (`emit` with none open, or `emit_pool`).
|
|
9
10
|
*
|
|
10
11
|
* The production validation in `query_audit_log` is fail-open — it bumps
|
|
11
12
|
* process-wide counters and proceeds, so a regression that emits an
|
|
12
13
|
* undeclared metadata field or a typo'd event-type lands a row that
|
|
13
14
|
* passes downstream queries but breaks forensics. The emitter's pool write
|
|
14
15
|
* is fail-open too: a refused `INSERT` is logged and counted, the request
|
|
15
|
-
* succeeds, and the row is gone.
|
|
16
|
-
*
|
|
16
|
+
* succeeds, and the row is gone. A success row belongs in the transaction of
|
|
17
|
+
* the change it reports; `emit` refuses one with no transaction open by
|
|
18
|
+
* throwing, which a caller can swallow, and `emit_pool` writes one on the
|
|
19
|
+
* pool. Tests that exercise audit emits should fail loudly when any of these
|
|
20
|
+
* happens.
|
|
17
21
|
*
|
|
18
22
|
* Call at the top of every `describe` / `describe_db` block that fires
|
|
19
23
|
* audit writes through `deps.audit.emit`. Resets counters before each
|
|
20
24
|
* test and asserts zero on completion. A test that makes a write fail on
|
|
21
25
|
* purpose calls `reset_audit_write_failures` (`auth/audit_emitter.ts`) once
|
|
22
|
-
* it has asserted the count
|
|
26
|
+
* it has asserted the count, and one that writes a success row outside a
|
|
27
|
+
* transaction on purpose calls `reset_audit_success_outside_transaction`.
|
|
23
28
|
*
|
|
24
29
|
* Pair with `await_pending_effects: true` (the default for
|
|
25
30
|
* `create_test_app`) so fire-and-forget audit writes have completed by
|
|
@@ -62,7 +67,7 @@ export interface RecordingAuditEmitter {
|
|
|
62
67
|
* `listener_count` reports, and returns a remover with the production
|
|
63
68
|
* semantics (per registration, idempotent) — registered listeners never fire,
|
|
64
69
|
* since this emitter captures `emit` shapes, not fan-out. `drain_inflight` resolves at once
|
|
65
|
-
* and `
|
|
70
|
+
* and `inflight_count` answers 0: a recorded call writes nothing, so nothing is
|
|
66
71
|
* ever in flight.
|
|
67
72
|
*
|
|
68
73
|
* `emit` AND `emit_pool` both append to `calls`, so a test reads either
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_drift_guard.d.ts","sourceRoot":"","sources":["../../src/lib/testing/audit_drift_guard.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAmB7B,OAAO,
|
|
1
|
+
{"version":3,"file":"audit_drift_guard.d.ts","sourceRoot":"","sources":["../../src/lib/testing/audit_drift_guard.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAmB7B,OAAO,EAKN,KAAK,YAAY,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGN,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,yBAAyB,QAAO,IAQ5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,QAAO,IAqBxC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,8BAA8B,GAC1C,YAAY,KAAK,CAAC,aAAa,CAAC,KAC9B,qBAwCF,CAAC;AA4BF,iDAAiD;AACjD,MAAM,WAAW,+BAA+B;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,2BAA2B,GACvC,OAAO,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,SAAS,GAAG,UAAU,CAAC,EACrE,UAAU,+BAA+B,KACvC,IAYF,CAAC"}
|
|
@@ -2,27 +2,32 @@ import './assert_dev_env.js';
|
|
|
2
2
|
import { assert, beforeEach, afterEach } from 'vitest';
|
|
3
3
|
import { format_issue, nullable, object, parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
4
4
|
import { get_audit_metadata_validation_failures, get_audit_unknown_event_type_failures, reset_audit_metadata_validation_failures, reset_audit_unknown_event_type_failures } from '../auth/audit_log_queries.js';
|
|
5
|
-
import { get_audit_write_failures, reset_audit_write_failures } from '../auth/audit_emitter.js';
|
|
5
|
+
import { get_audit_success_outside_transaction, get_audit_write_failures, reset_audit_success_outside_transaction, reset_audit_write_failures } from '../auth/audit_emitter.js';
|
|
6
6
|
import { audit_metadata_schemas } from '../auth/audit_log_schema.js';
|
|
7
7
|
/**
|
|
8
8
|
* Register per-test `beforeEach` + `afterEach` hooks that catch any audit
|
|
9
9
|
* emission with a metadata shape that fails its `audit_metadata_schemas`
|
|
10
|
-
* entry, an `event_type` not present in the active `AuditLogConfig`,
|
|
11
|
-
* row the emitter failed to write
|
|
10
|
+
* entry, an `event_type` not present in the active `AuditLogConfig`, a
|
|
11
|
+
* row the emitter failed to write, or a success row written outside a
|
|
12
|
+
* transaction (`emit` with none open, or `emit_pool`).
|
|
12
13
|
*
|
|
13
14
|
* The production validation in `query_audit_log` is fail-open — it bumps
|
|
14
15
|
* process-wide counters and proceeds, so a regression that emits an
|
|
15
16
|
* undeclared metadata field or a typo'd event-type lands a row that
|
|
16
17
|
* passes downstream queries but breaks forensics. The emitter's pool write
|
|
17
18
|
* is fail-open too: a refused `INSERT` is logged and counted, the request
|
|
18
|
-
* succeeds, and the row is gone.
|
|
19
|
-
*
|
|
19
|
+
* succeeds, and the row is gone. A success row belongs in the transaction of
|
|
20
|
+
* the change it reports; `emit` refuses one with no transaction open by
|
|
21
|
+
* throwing, which a caller can swallow, and `emit_pool` writes one on the
|
|
22
|
+
* pool. Tests that exercise audit emits should fail loudly when any of these
|
|
23
|
+
* happens.
|
|
20
24
|
*
|
|
21
25
|
* Call at the top of every `describe` / `describe_db` block that fires
|
|
22
26
|
* audit writes through `deps.audit.emit`. Resets counters before each
|
|
23
27
|
* test and asserts zero on completion. A test that makes a write fail on
|
|
24
28
|
* purpose calls `reset_audit_write_failures` (`auth/audit_emitter.ts`) once
|
|
25
|
-
* it has asserted the count
|
|
29
|
+
* it has asserted the count, and one that writes a success row outside a
|
|
30
|
+
* transaction on purpose calls `reset_audit_success_outside_transaction`.
|
|
26
31
|
*
|
|
27
32
|
* Pair with `await_pending_effects: true` (the default for
|
|
28
33
|
* `create_test_app`) so fire-and-forget audit writes have completed by
|
|
@@ -33,6 +38,7 @@ export const install_audit_drift_guard = () => {
|
|
|
33
38
|
reset_audit_metadata_validation_failures();
|
|
34
39
|
reset_audit_unknown_event_type_failures();
|
|
35
40
|
reset_audit_write_failures();
|
|
41
|
+
reset_audit_success_outside_transaction();
|
|
36
42
|
});
|
|
37
43
|
afterEach(assert_no_audit_drift);
|
|
38
44
|
};
|
|
@@ -47,6 +53,7 @@ export const assert_no_audit_drift = () => {
|
|
|
47
53
|
assert.strictEqual(get_audit_metadata_validation_failures(), 0, 'audit metadata failed schema validation — see audit_log_schema.audit_metadata_schemas');
|
|
48
54
|
assert.strictEqual(get_audit_unknown_event_type_failures(), 0, 'audit emitted an unknown event_type — see AUDIT_EVENT_TYPES');
|
|
49
55
|
assert.strictEqual(get_audit_write_failures(), 0, 'an audit row failed to write and was lost — the emitter logged the database error');
|
|
56
|
+
assert.strictEqual(get_audit_success_outside_transaction(), 0, 'a success audit row was emitted outside a transaction — write it in the transaction of the change it reports');
|
|
50
57
|
};
|
|
51
58
|
/**
|
|
52
59
|
* Build a no-op `AuditEmitter` that records every `emit`, `emit_pool`, and
|
|
@@ -65,7 +72,7 @@ export const assert_no_audit_drift = () => {
|
|
|
65
72
|
* `listener_count` reports, and returns a remover with the production
|
|
66
73
|
* semantics (per registration, idempotent) — registered listeners never fire,
|
|
67
74
|
* since this emitter captures `emit` shapes, not fan-out. `drain_inflight` resolves at once
|
|
68
|
-
* and `
|
|
75
|
+
* and `inflight_count` answers 0: a recorded call writes nothing, so nothing is
|
|
69
76
|
* ever in flight.
|
|
70
77
|
*
|
|
71
78
|
* `emit` AND `emit_pool` both append to `calls`, so a test reads either
|
|
@@ -122,7 +129,7 @@ export const create_recording_audit_emitter = (calls_ref) => {
|
|
|
122
129
|
},
|
|
123
130
|
listener_count: () => listeners.length,
|
|
124
131
|
drain_inflight: () => Promise.resolve(),
|
|
125
|
-
|
|
132
|
+
inflight_count: () => 0
|
|
126
133
|
};
|
|
127
134
|
return { emitter, calls };
|
|
128
135
|
};
|
|
@@ -13,16 +13,19 @@ export interface AuditReadFixture {
|
|
|
13
13
|
readonly reject_unknown_audit_metadata_keys?: boolean;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Await the backend's in-flight
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* Await the backend's in-flight detached writes (audit rows; on the Rust
|
|
17
|
+
* spine also the token touch and the bootstrap write) via
|
|
18
|
+
* `_testing_drain_effects`, so a following `audit_log_list` sees every row
|
|
19
|
+
* emitted before the call. The backend must mount the action — every spine
|
|
20
|
+
* test binary does; in-process suites mount
|
|
21
|
+
* `create_testing_drain_effects_action`.
|
|
20
22
|
*
|
|
21
|
-
* Refuses
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* Refuses any answer but exactly `{ok: true}` — what both spines answer once
|
|
24
|
+
* their drains have awaited the backend's in-flight detached writes. A backend
|
|
25
|
+
* answering anything else (an unknown key included) is not the drain this
|
|
26
|
+
* contract names, and its audit reads could race the writes — an absent row
|
|
27
|
+
* then reading as a pass. Every audit read runs through here, so each one
|
|
28
|
+
* checks the barrier is live.
|
|
26
29
|
*
|
|
27
30
|
* @param fixture - the per-test fixture, whose daemon token authorizes the drain
|
|
28
31
|
* @param rpc_path - the RPC endpoint the drain action is mounted on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_cross_helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/audit_cross_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAsB9B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAErF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIvE,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,KAAK,cAAc,CAAC;IAC5F,2FAA2F;IAC3F,QAAQ,CAAC,sBAAsB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5F,QAAQ,CAAC,2BAA2B,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjG,8FAA8F;IAC9F,QAAQ,CAAC,kCAAkC,CAAC,EAAE,OAAO,CAAC;CACtD;AAED
|
|
1
|
+
{"version":3,"file":"audit_cross_helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/audit_cross_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAsB9B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAErF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIvE,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,eAAe,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,KAAK,cAAc,CAAC;IAC5F,2FAA2F;IAC3F,QAAQ,CAAC,sBAAsB,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5F,QAAQ,CAAC,2BAA2B,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjG,8FAA8F;IAC9F,QAAQ,CAAC,kCAAkC,CAAC,EAAE,OAAO,CAAC;CACtD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,GAC/B,SAAS,gBAAgB,EACzB,WAAU,MAAuB,KAC/B,OAAO,CAAC,IAAI,CAcd,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,IAAI,CAAC,gBAAgB,EAAE,oCAAoC,CAAC,EACrE,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACxC,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,SAAQ,aAAa,CAAC,MAAM,CAAM,KAChC,IASF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,GAC7B,SAAS,gBAAgB,EACzB,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,WAAU,MAAuB,KAC/B,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAe/C,CAAC"}
|
|
@@ -21,16 +21,19 @@ import { assert_audit_event_metadata } from '../audit_drift_guard.js';
|
|
|
21
21
|
import { cross_rpc_call, expect_output } from './cross_rpc.js';
|
|
22
22
|
import { SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
23
23
|
/**
|
|
24
|
-
* Await the backend's in-flight
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
24
|
+
* Await the backend's in-flight detached writes (audit rows; on the Rust
|
|
25
|
+
* spine also the token touch and the bootstrap write) via
|
|
26
|
+
* `_testing_drain_effects`, so a following `audit_log_list` sees every row
|
|
27
|
+
* emitted before the call. The backend must mount the action — every spine
|
|
28
|
+
* test binary does; in-process suites mount
|
|
29
|
+
* `create_testing_drain_effects_action`.
|
|
28
30
|
*
|
|
29
|
-
* Refuses
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
31
|
+
* Refuses any answer but exactly `{ok: true}` — what both spines answer once
|
|
32
|
+
* their drains have awaited the backend's in-flight detached writes. A backend
|
|
33
|
+
* answering anything else (an unknown key included) is not the drain this
|
|
34
|
+
* contract names, and its audit reads could race the writes — an absent row
|
|
35
|
+
* then reading as a pass. Every audit read runs through here, so each one
|
|
36
|
+
* checks the barrier is live.
|
|
34
37
|
*
|
|
35
38
|
* @param fixture - the per-test fixture, whose daemon token authorizes the drain
|
|
36
39
|
* @param rpc_path - the RPC endpoint the drain action is mounted on
|
|
@@ -38,11 +41,7 @@ import { SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
|
38
41
|
export const cross_drain_effects = async (fixture, rpc_path = SPINE_RPC_PATH) => {
|
|
39
42
|
const drained = await cross_rpc_call(fixture.fresh_transport({ origin: null }), rpc_path, '_testing_drain_effects', undefined, fixture.create_daemon_token_headers());
|
|
40
43
|
assert.ok(drained.ok, `_testing_drain_effects failed: ${JSON.stringify(drained.error)}`);
|
|
41
|
-
|
|
42
|
-
? drained.result.tracked
|
|
43
|
-
: undefined;
|
|
44
|
-
assert.strictEqual(tracked, true, "_testing_drain_effects must answer tracked: true — the backend's audit emitter does not " +
|
|
45
|
-
`track in-flight writes, so the drain waits on nothing (got ${JSON.stringify(drained.result)})`);
|
|
44
|
+
assert.deepStrictEqual(drained.result, { ok: true }, `_testing_drain_effects must answer exactly {ok: true} (got ${JSON.stringify(drained.result)})`);
|
|
46
45
|
};
|
|
47
46
|
/**
|
|
48
47
|
* Assert an audit row's `metadata` carries `expected` — each field compared
|
|
@@ -294,7 +294,9 @@ export interface BackendCapabilities {
|
|
|
294
294
|
* (`_testing_origin_check`), `ws_outbound_overflow`
|
|
295
295
|
* (`_testing_flood_notifications`) — and requires `_testing_put_fact` of a
|
|
296
296
|
* backend declaring `fact_serving` and `_testing_room_evict` of one
|
|
297
|
-
* declaring `rooms`.
|
|
297
|
+
* declaring `rooms`. `default_cross_process_setup` requires
|
|
298
|
+
* `_testing_db_invariants`, its per-test invariant check, unless the setup
|
|
299
|
+
* turns the check off (`exclude_db_invariants: {all: reason}`).
|
|
298
300
|
*
|
|
299
301
|
* fuz_app's spine presets declare every one; the in-process transport none
|
|
300
302
|
* (the backdoor suites are cross-process only).
|
|
@@ -344,12 +346,13 @@ export type FamilyDefaultCapabilities = Omit<BackendCapabilities, MountFlag | 't
|
|
|
344
346
|
export declare const in_process_capabilities: BackendCapabilities;
|
|
345
347
|
/**
|
|
346
348
|
* Conditional `test()` wrapper — registers a vitest case only when
|
|
347
|
-
* `cond` is true; otherwise registers it as
|
|
348
|
-
* surfaces the gated coverage in the
|
|
349
|
+
* `cond` is true; otherwise registers it as a gated skip
|
|
350
|
+
* (`test_skip_gated`), so the run still surfaces the gated coverage in the
|
|
351
|
+
* report and `check_declared_skips` can hold the skip to a declaration.
|
|
349
352
|
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
+
* `test.skipIf(!cond)` with the argument order flipped to match the more
|
|
354
|
+
* readable `test_if(capabilities.ws, ...)` call pattern, and the skip tagged
|
|
355
|
+
* at registration.
|
|
353
356
|
*/
|
|
354
357
|
export declare const test_if: (cond: boolean, name: string, fn: () => void | Promise<void>) => void;
|
|
355
358
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAsD9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,yBAA0B,CAAC;AAEnE,4CAA4C;AAC5C,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC;;;;;;;;;OASG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,2BAA2B,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IAC7E;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,6BAA6B,EAAE,OAAO,CAAC;IAChD;;;;;;;;;OASG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,iBAAiB,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;CACjE;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,IAAI,CACjC,mBAAmB,EACjB,IAAI,GACJ,KAAK,GACL,WAAW,GACX,gBAAgB,GAChB,mBAAmB,GACnB,cAAc,GACd,yBAAyB,GACzB,OAAO,GACP,cAAc,GACd,oBAAoB,GACpB,eAAe,GACf,OAAO,CACT,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,mBAAmB,CAAC,CAAC;AAEnG;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,EAAE,mBAwCpC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,OAAO,EAAE,MAAM,MAAM,EAAE,IAAI,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAG,IAMrF,CAAC"}
|