@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
|
@@ -25,7 +25,7 @@ export declare const TESTING_ACTION_AUTH: {
|
|
|
25
25
|
* fuz_app's spine binary mounts, so an action added there fails until it is
|
|
26
26
|
* listed here.
|
|
27
27
|
*/
|
|
28
|
-
export declare const TESTING_BACKDOOR_METHODS: readonly ["_testing_reset", "_testing_drain_effects", "_testing_mint_session", "_testing_put_fact", "_testing_flood_notifications", "_testing_schema_snapshot", "_testing_migration_tracker", "_testing_action_manifest", "_testing_origin_check", "_testing_credential_read", "_testing_shorten_credential_expiry", "_testing_room_evict"];
|
|
28
|
+
export declare const TESTING_BACKDOOR_METHODS: readonly ["_testing_reset", "_testing_drain_effects", "_testing_mint_session", "_testing_put_fact", "_testing_flood_notifications", "_testing_schema_snapshot", "_testing_migration_tracker", "_testing_db_invariants", "_testing_action_manifest", "_testing_origin_check", "_testing_credential_read", "_testing_shorten_credential_expiry", "_testing_room_evict"];
|
|
29
29
|
/** A `_testing_*` backdoor the shipped cross suites know — see `TESTING_BACKDOOR_METHODS`. */
|
|
30
30
|
export type TestingBackdoorMethod = (typeof TESTING_BACKDOOR_METHODS)[number];
|
|
31
31
|
/** RPC endpoint mount path — matches the binary's `/api/rpc`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spine_surface_constants.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/spine_surface_constants.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA4B9B;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;;;CAIF,CAAC;AAE/B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"spine_surface_constants.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/spine_surface_constants.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA4B9B;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;;;CAIF,CAAC;AAE/B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,uWAc3B,CAAC;AAEX,8FAA8F;AAC9F,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,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O,MAAM,yBAAyB,8BAA8B,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,6BAA6B,CAAC"}
|
|
@@ -41,11 +41,19 @@ export interface CrossProcessSseTestOptions {
|
|
|
41
41
|
readonly logout_path?: string;
|
|
42
42
|
/** REST password-change route path, for its close case. Default `/api/account/password`. */
|
|
43
43
|
readonly password_path?: string;
|
|
44
|
+
/**
|
|
45
|
+
* A role the stream is not gated on, which the keep case assigns globally
|
|
46
|
+
* and revokes, the stream staying open — one the backend's registry holds
|
|
47
|
+
* with the `admin` grant path. Default `SPINE_PARTICIPANT_ROLE`, the
|
|
48
|
+
* spine's own; `ROLE_ADMIN`, the stream's own gate, skips that case.
|
|
49
|
+
*/
|
|
50
|
+
readonly other_role?: string;
|
|
44
51
|
}
|
|
45
52
|
/**
|
|
46
53
|
* Register the cross-process SSE round-trip suite. Its cases run over a
|
|
47
54
|
* real streaming `fetch`: connected-comment, audit data frame, account-wide
|
|
48
|
-
* close-on-revoke, session-scoped close-on-revoke, close on
|
|
55
|
+
* close-on-revoke, session-scoped close-on-revoke, close on a revoke of the
|
|
56
|
+
* gating role's global grant and not on other role revokes, close on account delete,
|
|
49
57
|
* close on admin token revoke-all, logout, password change and purge, and the
|
|
50
58
|
* per-session cap.
|
|
51
59
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse_round_trip.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/sse_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"sse_round_trip.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/sse_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAgH9B,OAAO,EAAE,KAAK,mBAAmB,EAAW,MAAM,mBAAmB,CAAC;AAItE,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAYzD,4DAA4D;AAC5D,MAAM,WAAW,0BAA0B;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,+GAA+G;IAC/G,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,wFAAwF;IACxF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAwID;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,GAAI,SAAS,0BAA0B,KAAG,IAsdtF,CAAC"}
|
|
@@ -33,23 +33,32 @@ import '../assert_dev_env.js';
|
|
|
33
33
|
* stream registered under the named session's hash, while the caller's own
|
|
34
34
|
* stream stays open and still receives a broadcast — so a backend closing
|
|
35
35
|
* the whole account, or the caller's streams, on a session revoke fails it.
|
|
36
|
-
* 5. **close on
|
|
36
|
+
* 5. **close on a role revoke** (gated on `rpc_path`) — `role_grant_revoke`
|
|
37
|
+
* of a second admin's global `admin` grant, the role the stream is gated on,
|
|
38
|
+
* closes its stream; a revoke of its global grant of a role the stream
|
|
39
|
+
* isn't gated on (`other_role`, skipped when it is `admin`) leaves the
|
|
40
|
+
* stream open and still receiving. The stream's gate is global-only
|
|
41
|
+
* (`admin` can't be scoped), so scope matching is held on the role-gated
|
|
42
|
+
* WebSocket by `describe_ws_role_gated_cross_tests`.
|
|
43
|
+
* 6. **close on account delete** (gated on `rpc_path` and
|
|
37
44
|
* `capabilities.account_lifecycle`) — the keeper soft-deletes a second
|
|
38
45
|
* admin whose stream is open; the delete revokes its credentials and
|
|
39
46
|
* closes its stream.
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* `POST /
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
47
|
+
* 7. **close on the shared revocations** (gated on `rpc_path`; purge also
|
|
48
|
+
* on `capabilities.account_lifecycle`) — `admin_token_revoke_all`,
|
|
49
|
+
* `POST /password`, and `account_purge` of a second admin each close its
|
|
50
|
+
* stream, and its `POST /logout` closes the stream of the session it ends
|
|
51
|
+
* while a second session's stream stays open and still receives a
|
|
52
|
+
* broadcast — the rows `create_account_revocations` shares with the WS
|
|
53
|
+
* suite.
|
|
54
|
+
* 8. **per-session cap** — one stream past `max_per_scope` on one session
|
|
46
55
|
* closes the oldest (evict-oldest, no final frame) and leaves every other
|
|
47
56
|
* stream open. With `rpc_path`, each stream is proven admitted as it opens
|
|
48
57
|
* and each survivor proven open after the overflow by a broadcast frame;
|
|
49
58
|
* without it, by the connect comment and a short silence.
|
|
50
59
|
*
|
|
51
|
-
* Cases 2–
|
|
52
|
-
* it. Every close case (3–
|
|
60
|
+
* Cases 2–7 need `rpc_path` (each drives an RPC method); 1 and 8 run without
|
|
61
|
+
* it. Every close case (3–7, and 8 when `rpc_path` is given) first proves its
|
|
53
62
|
* stream **admitted**: after the connect comment, an admin writes one audit
|
|
54
63
|
* row (`app_settings_update`, `open_signup` set to its reset value) and the
|
|
55
64
|
* stream must deliver its frame. The comment alone proves nothing — a
|
|
@@ -57,12 +66,12 @@ import '../assert_dev_env.js';
|
|
|
57
66
|
* then ends — so a close observed without it can't tell a working revocation
|
|
58
67
|
* from a broken admission.
|
|
59
68
|
*
|
|
60
|
-
* The close-on-revoke matrix is layered: cases 3–
|
|
61
|
-
*
|
|
62
|
-
* stock stream admits sessions only
|
|
63
|
-
* WebSocket by `describe_cross_process_ws_tests
|
|
64
|
-
*
|
|
65
|
-
*
|
|
69
|
+
* The close-on-revoke matrix is layered: cases 3–7 exercise the account-wide,
|
|
70
|
+
* session-scoped and role-matched paths cross-process; `token_revoke`
|
|
71
|
+
* (token-scoped — the stock stream admits sessions only) has its bearer close
|
|
72
|
+
* covered on the WebSocket by `describe_cross_process_ws_tests`. A close seen
|
|
73
|
+
* cross-process is the union of the revoking handler's and the audit guard's
|
|
74
|
+
* (`create_revocation_guard`), so a case goes red only when both miss.
|
|
66
75
|
*
|
|
67
76
|
* Gated on `capabilities.sse` — backends without an end-to-end SSE stream
|
|
68
77
|
* skip (the cases still surface as `.skip` in the report). Cross-process
|
|
@@ -75,6 +84,7 @@ import { assert, describe } from 'vitest';
|
|
|
75
84
|
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
76
85
|
import { account_session_list_action_spec, account_session_revoke_action_spec, account_session_revoke_all_action_spec } from '../../auth/account_action_specs.js';
|
|
77
86
|
import { account_delete_action_spec, admin_session_revoke_all_action_spec, app_settings_update_action_spec } from '../../auth/admin_action_specs.js';
|
|
87
|
+
import { role_grant_assign_action_spec, role_grant_revoke_action_spec } from '../../auth/role_grant_offer_action_specs.js';
|
|
78
88
|
import { ROLE_ADMIN } from '../../auth/role_schema.js';
|
|
79
89
|
import { AUDIT_LOG_SSE_MAX_PER_SCOPE, audit_log_event_specs } from '../../realtime/audit_log_sse.js';
|
|
80
90
|
import { SSE_CONNECTED_COMMENT } from '../../realtime/sse_constants.js';
|
|
@@ -83,8 +93,9 @@ import { create_rpc_post_init } from '../rpc_helpers.js';
|
|
|
83
93
|
import { DEFAULT_TEST_PASSWORD } from '../test_credentials.js';
|
|
84
94
|
import { test_if } from './capabilities.js';
|
|
85
95
|
import { create_account_revocations } from './revocation_drivers.js';
|
|
96
|
+
import { create_active_role_grant } from './role_grant_cross_helpers.js';
|
|
86
97
|
import { login_fresh_session } from './session_login.js';
|
|
87
|
-
import { SPINE_ACCOUNT_LOGIN_PATH, SPINE_ACCOUNT_LOGOUT_PATH, SPINE_ACCOUNT_PASSWORD_PATH, SPINE_SSE_PATH } from './spine_surface_constants.js';
|
|
98
|
+
import { SPINE_ACCOUNT_LOGIN_PATH, SPINE_ACCOUNT_LOGOUT_PATH, SPINE_ACCOUNT_PASSWORD_PATH, SPINE_PARTICIPANT_ROLE, SPINE_SSE_PATH } from './spine_surface_constants.js';
|
|
88
99
|
/** The audit event a session revoke-all writes, what the data-frame and cap cases read. */
|
|
89
100
|
const SESSION_REVOKE_ALL_EVENT = 'session_revoke_all';
|
|
90
101
|
/** The `data:` payload of a frame, or `null` for a comment frame. */
|
|
@@ -183,7 +194,8 @@ const open_admitted_stream = async (options) => {
|
|
|
183
194
|
/**
|
|
184
195
|
* Register the cross-process SSE round-trip suite. Its cases run over a
|
|
185
196
|
* real streaming `fetch`: connected-comment, audit data frame, account-wide
|
|
186
|
-
* close-on-revoke, session-scoped close-on-revoke, close on
|
|
197
|
+
* close-on-revoke, session-scoped close-on-revoke, close on a revoke of the
|
|
198
|
+
* gating role's global grant and not on other role revokes, close on account delete,
|
|
187
199
|
* close on admin token revoke-all, logout, password change and purge, and the
|
|
188
200
|
* per-session cap.
|
|
189
201
|
*/
|
|
@@ -191,6 +203,7 @@ export const describe_cross_process_sse_tests = (options) => {
|
|
|
191
203
|
const { setup_test, capabilities, base_url, rpc_path, origin, login_path = SPINE_ACCOUNT_LOGIN_PATH, logout_path = SPINE_ACCOUNT_LOGOUT_PATH, password_path = SPINE_ACCOUNT_PASSWORD_PATH } = options;
|
|
192
204
|
const sse_path = options.sse_path ?? SPINE_SSE_PATH;
|
|
193
205
|
const max_per_scope = options.max_per_scope === undefined ? AUDIT_LOG_SSE_MAX_PER_SCOPE : options.max_per_scope;
|
|
206
|
+
const other_role = options.other_role ?? SPINE_PARTICIPANT_ROLE;
|
|
194
207
|
/** `open_admitted_stream` on this suite's endpoint, the keeper as the probe's admin. */
|
|
195
208
|
const open_admitted = (fixture, cookies, label) => open_admitted_stream({
|
|
196
209
|
base_url,
|
|
@@ -272,8 +285,6 @@ export const describe_cross_process_sse_tests = (options) => {
|
|
|
272
285
|
// stream on each, and the second revokes the first: the named session's
|
|
273
286
|
// stream must close and the caller's own stay open and receiving, which a
|
|
274
287
|
// backend closing the whole account, or the caller's streams, fails.
|
|
275
|
-
// `role_grant_revoke`'s role-matched close is covered by `fuz_realtime`'s
|
|
276
|
-
// SSE registry unit tests.
|
|
277
288
|
test_if(capabilities.sse && rpc_path !== undefined, 'stream closes on a single session_revoke of the subscriber session', async () => {
|
|
278
289
|
const fixture = await setup_test();
|
|
279
290
|
const target = await fixture.create_account({
|
|
@@ -323,6 +334,69 @@ export const describe_cross_process_sse_tests = (options) => {
|
|
|
323
334
|
await Promise.all(streams.map((sse) => sse.close()));
|
|
324
335
|
}
|
|
325
336
|
});
|
|
337
|
+
// The stream is gated on `ROLE_ADMIN` and never rechecks it, so revoking a
|
|
338
|
+
// subscriber's global admin grant must close it — the role-matched close
|
|
339
|
+
// (`{kind: 'role'}`), which reaches only a stream whose gate is the role.
|
|
340
|
+
// The keeper's own admin grant can't be revoked, so the subscriber is a
|
|
341
|
+
// second admin, its grant the one `create_account` gave it.
|
|
342
|
+
test_if(capabilities.sse && rpc_path !== undefined, 'stream closes when a global grant of its gating role is revoked', async () => {
|
|
343
|
+
const fixture = await setup_test();
|
|
344
|
+
const target = await fixture.create_account({
|
|
345
|
+
username: 'sse_role_revoke',
|
|
346
|
+
roles: [ROLE_ADMIN]
|
|
347
|
+
});
|
|
348
|
+
// idempotent on the admin grant the account already holds
|
|
349
|
+
const role_grant_id = await create_active_role_grant(fixture, target, { rpc_path });
|
|
350
|
+
const cookie = target.create_session_headers().cookie;
|
|
351
|
+
assert.ok(cookie, 'expected a session cookie for the target account');
|
|
352
|
+
const sse = await open_admitted(fixture, [cookie]);
|
|
353
|
+
try {
|
|
354
|
+
const res = await fixture.transport(rpc_path, create_rpc_post_init(role_grant_revoke_action_spec.method, {
|
|
355
|
+
actor_id: target.actor.id,
|
|
356
|
+
role_grant_id
|
|
357
|
+
}));
|
|
358
|
+
assert.strictEqual(res.status, 200, `role_grant_revoke RPC failed (status=${res.status})`);
|
|
359
|
+
const closed = await sse.wait_for_close(2000);
|
|
360
|
+
assert.ok(closed, 'stream did not close within 2s after role_grant_revoke');
|
|
361
|
+
}
|
|
362
|
+
finally {
|
|
363
|
+
await sse.close();
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
// Only a grant of the gating role reaches the stream: a global revoke of
|
|
367
|
+
// a role the stream isn't gated on closes nothing, and the stream stays
|
|
368
|
+
// open and still receives a broadcast. Scope matching can't be held here
|
|
369
|
+
// (`admin` is global-only); `describe_ws_role_gated_cross_tests` holds it.
|
|
370
|
+
test_if(capabilities.sse && rpc_path !== undefined && other_role !== ROLE_ADMIN, 'a revoke of a global grant of another role leaves the stream open', async () => {
|
|
371
|
+
const fixture = await setup_test();
|
|
372
|
+
const target = await fixture.create_account({
|
|
373
|
+
username: 'sse_role_keep',
|
|
374
|
+
roles: [ROLE_ADMIN]
|
|
375
|
+
});
|
|
376
|
+
const assigned = await fixture.transport(rpc_path, create_rpc_post_init(role_grant_assign_action_spec.method, {
|
|
377
|
+
to_account_id: target.account.id,
|
|
378
|
+
role: other_role
|
|
379
|
+
}));
|
|
380
|
+
const body = (await assigned.json());
|
|
381
|
+
assert.strictEqual(assigned.status, 200, `role_grant_assign failed: ${JSON.stringify(body)}`);
|
|
382
|
+
const role_grant_id = body.result?.role_grant_id;
|
|
383
|
+
assert.ok(typeof role_grant_id === 'string', JSON.stringify(body));
|
|
384
|
+
const cookie = target.create_session_headers().cookie;
|
|
385
|
+
assert.ok(cookie, 'expected a session cookie for the target account');
|
|
386
|
+
const sse = await open_admitted(fixture, [cookie]);
|
|
387
|
+
try {
|
|
388
|
+
const res = await fixture.transport(rpc_path, create_rpc_post_init(role_grant_revoke_action_spec.method, {
|
|
389
|
+
actor_id: target.actor.id,
|
|
390
|
+
role_grant_id
|
|
391
|
+
}));
|
|
392
|
+
assert.strictEqual(res.status, 200, `role_grant_revoke of ${other_role} failed (status=${res.status})`);
|
|
393
|
+
// still open, and still broadcast to
|
|
394
|
+
await read_probe_frame(sse, fixture.transport, rpc_path, 'the kept stream');
|
|
395
|
+
}
|
|
396
|
+
finally {
|
|
397
|
+
await sse.close();
|
|
398
|
+
}
|
|
399
|
+
});
|
|
326
400
|
// A soft-deleted account's credentials stop authenticating, and a stream
|
|
327
401
|
// never rechecks its own — so the delete must close it. The keeper
|
|
328
402
|
// deletes a second admin whose stream is open; the keeper's own admin
|
|
@@ -348,18 +422,22 @@ export const describe_cross_process_sse_tests = (options) => {
|
|
|
348
422
|
await sse.close();
|
|
349
423
|
}
|
|
350
424
|
});
|
|
351
|
-
// The
|
|
352
|
-
//
|
|
353
|
-
//
|
|
354
|
-
//
|
|
425
|
+
// The revocations of `revocation_drivers.ts`, shared with the WS suite,
|
|
426
|
+
// each close the target admin's stream on the session they were sent on.
|
|
427
|
+
// A session-scoped one (logout) leaves a second session's stream open and
|
|
428
|
+
// receiving, so a backend closing the whole account on it fails. Without
|
|
429
|
+
// `rpc_path` the rows still register, as skipped cases, and never run —
|
|
430
|
+
// so the empty path is never sent.
|
|
355
431
|
const revocations = create_account_revocations({
|
|
356
432
|
capabilities,
|
|
357
433
|
rpc_path: rpc_path ?? '',
|
|
358
434
|
logout_path,
|
|
359
435
|
password_path
|
|
360
436
|
});
|
|
361
|
-
for (const { label, slug, gate, revoke } of revocations) {
|
|
362
|
-
test_if(capabilities.sse && gate && rpc_path !== undefined,
|
|
437
|
+
for (const { label, slug, gate, closes, revoke } of revocations) {
|
|
438
|
+
test_if(capabilities.sse && gate && rpc_path !== undefined, closes === 'session'
|
|
439
|
+
? `stream closes on ${label} of its session, and the account's other session's stays`
|
|
440
|
+
: `stream closes on ${label} of the subscriber account`, async () => {
|
|
363
441
|
const fixture = await setup_test();
|
|
364
442
|
const target = await fixture.create_account({
|
|
365
443
|
username: `sse_revoke_${slug}`,
|
|
@@ -368,14 +446,32 @@ export const describe_cross_process_sse_tests = (options) => {
|
|
|
368
446
|
});
|
|
369
447
|
const cookie = target.create_session_headers().cookie;
|
|
370
448
|
assert.ok(cookie, 'expected a session cookie for the target account');
|
|
371
|
-
const
|
|
449
|
+
const streams = [];
|
|
372
450
|
try {
|
|
451
|
+
const sse = await open_admitted(fixture, [cookie]);
|
|
452
|
+
streams.push(sse);
|
|
453
|
+
let survivor = null;
|
|
454
|
+
if (closes === 'session') {
|
|
455
|
+
// a second login, a second session of the same account on its own jar
|
|
456
|
+
const second_transport = await login_fresh_session(fixture, {
|
|
457
|
+
login_path,
|
|
458
|
+
username: target.account.username,
|
|
459
|
+
password: DEFAULT_TEST_PASSWORD,
|
|
460
|
+
label: 'the second login'
|
|
461
|
+
});
|
|
462
|
+
survivor = await open_admitted(fixture, second_transport.cookies(), 'second session stream');
|
|
463
|
+
streams.push(survivor);
|
|
464
|
+
}
|
|
373
465
|
await revoke(fixture, target);
|
|
374
466
|
const closed = await sse.wait_for_close(2000);
|
|
375
467
|
assert.ok(closed, `stream did not close within 2s after ${label}`);
|
|
468
|
+
if (survivor !== null) {
|
|
469
|
+
// still open, and still broadcast to
|
|
470
|
+
await read_probe_frame(survivor, fixture.transport, rpc_path, 'second session stream');
|
|
471
|
+
}
|
|
376
472
|
}
|
|
377
473
|
finally {
|
|
378
|
-
await
|
|
474
|
+
await Promise.all(streams.map((stream) => stream.close()));
|
|
379
475
|
}
|
|
380
476
|
});
|
|
381
477
|
}
|
|
@@ -33,7 +33,6 @@ import '../assert_dev_env.js';
|
|
|
33
33
|
*
|
|
34
34
|
* @module
|
|
35
35
|
*/
|
|
36
|
-
import type { SessionOptions } from '../../auth/session_cookie.js';
|
|
37
36
|
import type { RoleRegistry } from '../../auth/role_schema.js';
|
|
38
37
|
import type { AppSurfaceSpec } from '../../http/surface.js';
|
|
39
38
|
import { type RpcSuccessFixtures } from '../rpc_round_trip.js';
|
|
@@ -62,8 +61,8 @@ export interface StandardCrossProcessTestOptions {
|
|
|
62
61
|
* suites in the bundle read no flags and take no capability field.
|
|
63
62
|
*/
|
|
64
63
|
capabilities: BackendCapabilities;
|
|
65
|
-
/**
|
|
66
|
-
|
|
64
|
+
/** The session cookie's name — read for the session cookie and the factory-form `rpc_endpoints` resolution. */
|
|
65
|
+
session_cookie_name: string;
|
|
67
66
|
/**
|
|
68
67
|
* RPC endpoint specs — required. The standard integration tests drive
|
|
69
68
|
* `account_verify`, `account_session_*`, `account_token_*` through the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/standard.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"standard.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/standard.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAiC,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE9F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,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CAAC,EAAE,GAAG,CAC1B,MAAM,EACN,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CACnF,CAAC;CACF;AAED;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,GACjD,SAAS,+BAA+B,KACtC,IA6CF,CAAC"}
|
|
@@ -14,7 +14,7 @@ export const describe_standard_cross_process_tests = (options) => {
|
|
|
14
14
|
setup_test: options.setup_test,
|
|
15
15
|
surface_source: options.surface_source,
|
|
16
16
|
capabilities: options.capabilities,
|
|
17
|
-
|
|
17
|
+
session_cookie_name: options.session_cookie_name,
|
|
18
18
|
rpc_endpoints: options.rpc_endpoints,
|
|
19
19
|
error_coverage_min: options.error_coverage_min,
|
|
20
20
|
base_url: options.base_url,
|
|
@@ -32,7 +32,7 @@ export const describe_standard_cross_process_tests = (options) => {
|
|
|
32
32
|
describe_rpc_round_trip_tests({
|
|
33
33
|
setup_test: options.setup_test,
|
|
34
34
|
surface_source: options.surface_source,
|
|
35
|
-
|
|
35
|
+
session_cookie_name: options.session_cookie_name,
|
|
36
36
|
rpc_endpoints: options.rpc_endpoints,
|
|
37
37
|
skip_methods: options.rpc_skip_methods,
|
|
38
38
|
input_overrides: options.rpc_input_overrides,
|
|
@@ -48,7 +48,7 @@ export const describe_standard_cross_process_tests = (options) => {
|
|
|
48
48
|
describe_standard_admin_integration_tests({
|
|
49
49
|
setup_test: options.setup_test,
|
|
50
50
|
surface_source: options.surface_source,
|
|
51
|
-
|
|
51
|
+
session_cookie_name: options.session_cookie_name,
|
|
52
52
|
roles: options.roles,
|
|
53
53
|
rpc_endpoints: options.rpc_endpoints,
|
|
54
54
|
admin_prefix: options.admin_prefix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing_backdoor.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/testing_backdoor.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA2F9B,OAAO,KAAK,EAAE,uCAAuC,EAAe,MAAM,YAAY,CAAC;AAMvF,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"testing_backdoor.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/testing_backdoor.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA2F9B,OAAO,KAAK,EAAE,uCAAuC,EAAe,MAAM,YAAY,CAAC;AAMvF,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAmD1E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC1B;AAkDD,8CAA8C;AAC9C,MAAM,WAAW,+BAAgC,SAAQ,uCAAuC;IAC/F;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CAC7D;AAqDD;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC,GACjD,SAAS,+BAA+B,KACtC,IAgHF,CAAC"}
|
|
@@ -6,13 +6,13 @@ import '../assert_dev_env.js';
|
|
|
6
6
|
* `TESTING_BACKDOOR_METHODS` (`_testing_reset`, `_testing_drain_effects`,
|
|
7
7
|
* `_testing_mint_session`, `_testing_put_fact`,
|
|
8
8
|
* `_testing_flood_notifications`, `_testing_schema_snapshot`,
|
|
9
|
-
* `_testing_migration_tracker`, `_testing_action_manifest`,
|
|
9
|
+
* `_testing_migration_tracker`, `_testing_db_invariants`, `_testing_action_manifest`,
|
|
10
10
|
* `_testing_origin_check`, `_testing_credential_read`,
|
|
11
11
|
* `_testing_shorten_credential_expiry`, `_testing_room_evict`) are privileged test-binary actions the production
|
|
12
12
|
* wire never exposes — direct DB writes (full auth wipe, forged session row,
|
|
13
13
|
* raw fact insert), the audit barrier, a flood of the caller's own connection,
|
|
14
14
|
* introspection reads (the live schema, the `schema_version` migration
|
|
15
|
-
* tracker, and the live RPC registry — the highest info-leak of the set were
|
|
15
|
+
* tracker, the database invariant rows, and the live RPC registry — the highest info-leak of the set were
|
|
16
16
|
* the gate to break), a probe of the origin allowlist parser, a rewrite of
|
|
17
17
|
* an account's credential expiries, and an eviction from the room registry. Their only structural fence
|
|
18
18
|
* is the **daemon-token** credential gate on
|
|
@@ -110,6 +110,8 @@ const BACKDOOR_PARAMS = {
|
|
|
110
110
|
_testing_schema_snapshot: {},
|
|
111
111
|
// The migration-tracker-dump read — its input is void, so the call carries no params.
|
|
112
112
|
_testing_migration_tracker: undefined,
|
|
113
|
+
// The database-invariants read — its input is void, so the call carries no params.
|
|
114
|
+
_testing_db_invariants: undefined,
|
|
113
115
|
// The RPC-registry-dump read — its input is void, so the call carries no params.
|
|
114
116
|
_testing_action_manifest: undefined,
|
|
115
117
|
// The origin conformance probe — a valid `{patterns, origin}` pair, so it
|
|
@@ -14,7 +14,6 @@ import '../assert_dev_env.js';
|
|
|
14
14
|
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
15
15
|
import { type RpcAction } from '../../actions/action_types.js';
|
|
16
16
|
import type { Keyring } from '../../auth/keyring.js';
|
|
17
|
-
import { type SessionOptions } from '../../auth/session_cookie.js';
|
|
18
17
|
/**
|
|
19
18
|
* The `data.reason` of every refusal `_testing_credential_read` gives its
|
|
20
19
|
* `lines`: a value that is no list of strings, a list or a line over its cap
|
|
@@ -48,12 +47,12 @@ export declare const TestingCredentialReadInput: import("@fuzdev/fuz_schema/sche
|
|
|
48
47
|
}>;
|
|
49
48
|
export type TestingCredentialReadInput = Infer<typeof TestingCredentialReadInput>;
|
|
50
49
|
/**
|
|
51
|
-
* What a request's `Cookie` lines hold of the session cookie — the
|
|
52
|
-
*
|
|
53
|
-
* lowercase.
|
|
50
|
+
* What a request's `Cookie` lines hold of the session cookie — the `kind` of
|
|
51
|
+
* a `SessionCookieRead` (`parse_session_from_cookies`), the wire form of the
|
|
52
|
+
* Rust spine's `fuz_auth::SessionCookieRead`, its variants in lowercase.
|
|
54
53
|
*/
|
|
55
|
-
export declare const
|
|
56
|
-
export type
|
|
54
|
+
export declare const SessionCookieReadKind: import("@fuzdev/fuz_schema/schema.ts").OneOfSchema<readonly ["absent", "invalid", "valid"]>;
|
|
55
|
+
export type SessionCookieReadKind = Infer<typeof SessionCookieReadKind>;
|
|
57
56
|
/**
|
|
58
57
|
* Output of `_testing_credential_read`, a `@fuzdev/fuz_schema` `object`: how
|
|
59
58
|
* each credential leg reads the lines, before any database work.
|
|
@@ -76,8 +75,8 @@ export type TestingCredentialReadOutput = Infer<typeof TestingCredentialReadOutp
|
|
|
76
75
|
export interface TestingCredentialReadDeps {
|
|
77
76
|
/** The server's cookie keyring. */
|
|
78
77
|
readonly keyring: Keyring;
|
|
79
|
-
/** The server's session
|
|
80
|
-
readonly
|
|
78
|
+
/** The server's session cookie name. */
|
|
79
|
+
readonly session_cookie_name: string;
|
|
81
80
|
}
|
|
82
81
|
/**
|
|
83
82
|
* Split `Name: value` lines into the per-name lines the credential readers
|
|
@@ -93,13 +92,13 @@ export declare const parse_testing_header_lines: (lines: ReadonlyArray<string>)
|
|
|
93
92
|
/**
|
|
94
93
|
* Answer one `_testing_credential_read` input: read each credential out of
|
|
95
94
|
* the lines with the readers the auth middleware legs call
|
|
96
|
-
* (`
|
|
95
|
+
* (`parse_session_from_cookies`,
|
|
97
96
|
* `read_bearer_token`, `read_daemon_token`). The action handler and the
|
|
98
97
|
* conformance table's unit test both call this, so the table checks the same
|
|
99
98
|
* functions the wire serves.
|
|
100
99
|
*
|
|
101
100
|
* @param input - the header lines
|
|
102
|
-
* @param deps - the keyring
|
|
101
|
+
* @param deps - the keyring the cookie is verified with, and its name
|
|
103
102
|
* @returns the reading the Rust twin returns for the same lines
|
|
104
103
|
* @throws ThrownJsonrpcError `invalid_params` for a line `parse_testing_header_lines` refuses
|
|
105
104
|
*/
|
|
@@ -159,7 +158,7 @@ export declare const testing_credential_read_action_spec: {
|
|
|
159
158
|
/**
|
|
160
159
|
* Build the standalone `_testing_credential_read` action (see the spec doc).
|
|
161
160
|
*
|
|
162
|
-
* @param deps - the server's keyring and session
|
|
161
|
+
* @param deps - the server's keyring and session cookie name
|
|
163
162
|
*/
|
|
164
163
|
export declare const create_testing_credential_read_action: (deps: TestingCredentialReadDeps) => RpcAction;
|
|
165
164
|
//# sourceMappingURL=testing_credential_read.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing_credential_read.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/testing_credential_read.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;GAWG;AAEH,OAAO,EAQN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"testing_credential_read.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/testing_credential_read.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;GAWG;AAEH,OAAO,EAQN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAI3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAOrD;;;;;;;;;GASG;AACH,eAAO,MAAM,kCAAkC,wBAAwB,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,uCAAuC,OAAO,CAAC;AAE5D,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,KAAK,CAAC;AA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, string } from '@fuzdev/fuz_schema/schema.ts';
|
|
15
15
|
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
16
16
|
import { rpc_action } from '../../actions/action_types.js';
|
|
17
|
-
import { read_bearer_token, read_daemon_token
|
|
17
|
+
import { read_bearer_token, read_daemon_token } from '../../auth/credential_headers.js';
|
|
18
18
|
import { DAEMON_TOKEN_HEADER } from '../../auth/daemon_token.js';
|
|
19
|
-
import {
|
|
19
|
+
import { parse_session_from_cookies } from '../../auth/session_cookie.js';
|
|
20
20
|
import { trim_optional_whitespace } from '../../http/header_lines.js';
|
|
21
21
|
import { jsonrpc_errors } from '../../http/jsonrpc_errors.js';
|
|
22
22
|
import { bounded_string } from '../../primitive_schemas.js';
|
|
@@ -53,11 +53,11 @@ export const TestingCredentialReadInput = object({
|
|
|
53
53
|
lines: meta(pipe(array(bounded_string({ max: TESTING_CREDENTIAL_READ_LINE_LENGTH_MAX })), max_length(TESTING_CREDENTIAL_READ_LINES_MAX)), { invalid_reason: ERROR_TESTING_CREDENTIAL_READ_LINE })
|
|
54
54
|
});
|
|
55
55
|
/**
|
|
56
|
-
* What a request's `Cookie` lines hold of the session cookie — the
|
|
57
|
-
*
|
|
58
|
-
* lowercase.
|
|
56
|
+
* What a request's `Cookie` lines hold of the session cookie — the `kind` of
|
|
57
|
+
* a `SessionCookieRead` (`parse_session_from_cookies`), the wire form of the
|
|
58
|
+
* Rust spine's `fuz_auth::SessionCookieRead`, its variants in lowercase.
|
|
59
59
|
*/
|
|
60
|
-
export const
|
|
60
|
+
export const SessionCookieReadKind = one_of(['absent', 'invalid', 'valid']);
|
|
61
61
|
/**
|
|
62
62
|
* Output of `_testing_credential_read`, a `@fuzdev/fuz_schema` `object`: how
|
|
63
63
|
* each credential leg reads the lines, before any database work.
|
|
@@ -69,7 +69,7 @@ export const TestingCredentialReadOutput = object({
|
|
|
69
69
|
* the server's keyring and its signed expiry is ahead. Says nothing about
|
|
70
70
|
* the `auth_session` row.
|
|
71
71
|
*/
|
|
72
|
-
session_cookie:
|
|
72
|
+
session_cookie: SessionCookieReadKind,
|
|
73
73
|
/** The API token the bearer leg would look up, or `null` when it reads none. */
|
|
74
74
|
bearer_token: nullable(string),
|
|
75
75
|
/** The daemon token the daemon leg would compare, or `null` when it reads none. */
|
|
@@ -120,21 +120,21 @@ export const parse_testing_header_lines = (lines) => {
|
|
|
120
120
|
/**
|
|
121
121
|
* Answer one `_testing_credential_read` input: read each credential out of
|
|
122
122
|
* the lines with the readers the auth middleware legs call
|
|
123
|
-
* (`
|
|
123
|
+
* (`parse_session_from_cookies`,
|
|
124
124
|
* `read_bearer_token`, `read_daemon_token`). The action handler and the
|
|
125
125
|
* conformance table's unit test both call this, so the table checks the same
|
|
126
126
|
* functions the wire serves.
|
|
127
127
|
*
|
|
128
128
|
* @param input - the header lines
|
|
129
|
-
* @param deps - the keyring
|
|
129
|
+
* @param deps - the keyring the cookie is verified with, and its name
|
|
130
130
|
* @returns the reading the Rust twin returns for the same lines
|
|
131
131
|
* @throws ThrownJsonrpcError `invalid_params` for a line `parse_testing_header_lines` refuses
|
|
132
132
|
*/
|
|
133
133
|
export const run_testing_credential_read = async (input, deps) => {
|
|
134
134
|
const header = parse_testing_header_lines(input.lines);
|
|
135
|
-
const session = await
|
|
135
|
+
const session = await parse_session_from_cookies(header('cookie'), deps.keyring, deps.session_cookie_name);
|
|
136
136
|
return {
|
|
137
|
-
session_cookie: session.
|
|
137
|
+
session_cookie: session.kind,
|
|
138
138
|
bearer_token: read_bearer_token(header('authorization')),
|
|
139
139
|
daemon_token: read_daemon_token(header(DAEMON_TOKEN_HEADER.toLowerCase()))
|
|
140
140
|
};
|
|
@@ -170,6 +170,6 @@ export const testing_credential_read_action_spec = {
|
|
|
170
170
|
/**
|
|
171
171
|
* Build the standalone `_testing_credential_read` action (see the spec doc).
|
|
172
172
|
*
|
|
173
|
-
* @param deps - the server's keyring and session
|
|
173
|
+
* @param deps - the server's keyring and session cookie name
|
|
174
174
|
*/
|
|
175
175
|
export const create_testing_credential_read_action = (deps) => rpc_action(testing_credential_read_action_spec, (input) => run_testing_credential_read(input, deps));
|