@fuzdev/fuz_app 0.180.0 → 0.182.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/CLAUDE.md +38 -20
- package/dist/actions/action_rpc.d.ts +25 -6
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +56 -48
- package/dist/actions/action_types.d.ts +31 -13
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +1 -1
- package/dist/actions/notification_sender.d.ts +83 -0
- package/dist/actions/notification_sender.d.ts.map +1 -0
- package/dist/actions/notification_sender.js +85 -0
- package/dist/actions/perform_action.d.ts +13 -4
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +27 -18
- package/dist/actions/register_action_ws.d.ts +20 -2
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +17 -5
- package/dist/actions/ws_socket_session.d.ts +3 -0
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +3 -2
- package/dist/auth/CLAUDE.md +84 -59
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +30 -3
- package/dist/auth/account_queries.d.ts +213 -2
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +255 -2
- package/dist/auth/account_route_schema.d.ts +26 -16
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +10 -24
- package/dist/auth/account_routes.d.ts +5 -7
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +110 -89
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +117 -25
- package/dist/auth/api_token_queries.d.ts +29 -12
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +42 -27
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.d.ts +1 -1
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +10 -12
- package/dist/auth/audit_log_schema.js +4 -4
- package/dist/auth/bearer_auth.d.ts +4 -3
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +37 -32
- package/dist/auth/bootstrap_account.d.ts +65 -37
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +115 -66
- package/dist/auth/bootstrap_route_schema.d.ts +6 -2
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +7 -2
- package/dist/auth/bootstrap_routes.d.ts +50 -33
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +109 -87
- package/dist/auth/bootstrap_token_store.d.ts +60 -0
- package/dist/auth/bootstrap_token_store.d.ts.map +1 -0
- package/dist/auth/bootstrap_token_store.js +39 -0
- package/dist/auth/credential_headers.d.ts +71 -0
- package/dist/auth/credential_headers.d.ts.map +1 -0
- package/dist/auth/credential_headers.js +100 -0
- package/dist/auth/daemon_token.d.ts +13 -1
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token.js +14 -2
- package/dist/auth/daemon_token_middleware.d.ts +10 -11
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +39 -30
- package/dist/auth/deps.d.ts +10 -11
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/invite_queries.d.ts +18 -0
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +24 -0
- package/dist/auth/request_context.d.ts +97 -76
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +93 -104
- package/dist/auth/resolved_auth.d.ts +10 -5
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +2 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts +2 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +5 -3
- package/dist/auth/role_grant_offer_actions.d.ts +7 -11
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +97 -106
- package/dist/auth/role_grant_offer_ddl.d.ts +7 -1
- package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_ddl.js +9 -2
- package/dist/auth/role_grant_offer_notifications.d.ts +87 -38
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +75 -22
- package/dist/auth/role_grant_offer_queries.d.ts +143 -9
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +266 -66
- package/dist/auth/role_grant_offer_schema.js +1 -1
- package/dist/auth/role_grant_queries.d.ts +57 -10
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +81 -22
- package/dist/auth/role_grant_sql.d.ts +21 -0
- package/dist/auth/role_grant_sql.d.ts.map +1 -1
- package/dist/auth/role_grant_sql.js +21 -0
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +9 -2
- package/dist/auth/session_cookie.d.ts +105 -25
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +124 -15
- package/dist/auth/session_middleware.d.ts +83 -54
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +92 -66
- package/dist/auth/session_queries.d.ts +95 -14
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +98 -19
- package/dist/auth/signup_route_schema.d.ts +5 -5
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +4 -4
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +17 -14
- package/dist/auth/standard_rpc_actions.d.ts +6 -19
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/standard_rpc_actions.js +5 -6
- package/dist/auth/token_scope.d.ts +6 -8
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +6 -9
- package/dist/dev/setup.d.ts +6 -1
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +42 -34
- package/dist/hono_context.d.ts +21 -0
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +17 -0
- package/dist/http/CLAUDE.md +156 -48
- package/dist/http/auth_shape.d.ts +4 -4
- package/dist/http/common_routes.js +1 -1
- package/dist/http/db_routes.d.ts +4 -3
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +14 -14
- package/dist/http/dev_route_error_check.d.ts +6 -3
- package/dist/http/dev_route_error_check.d.ts.map +1 -1
- package/dist/http/dev_route_error_check.js +6 -3
- package/dist/http/dev_set_cookie_check.d.ts +53 -0
- package/dist/http/dev_set_cookie_check.d.ts.map +1 -0
- package/dist/http/dev_set_cookie_check.js +80 -0
- package/dist/http/error_schemas.d.ts +45 -22
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +53 -26
- package/dist/http/header_lines.d.ts +42 -0
- package/dist/http/header_lines.d.ts.map +1 -0
- package/dist/http/header_lines.js +80 -0
- package/dist/http/host.d.ts +12 -9
- package/dist/http/host.d.ts.map +1 -1
- package/dist/http/host.js +25 -20
- package/dist/http/origin.d.ts +7 -22
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +11 -25
- package/dist/http/proxy.d.ts +1 -0
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +3 -0
- package/dist/http/request_headers.d.ts +95 -0
- package/dist/http/request_headers.d.ts.map +1 -0
- package/dist/http/request_headers.js +110 -0
- package/dist/http/request_target.d.ts +134 -0
- package/dist/http/request_target.d.ts.map +1 -0
- package/dist/http/request_target.js +193 -0
- package/dist/http/route_error_check.d.ts +4 -11
- package/dist/http/route_error_check.d.ts.map +1 -1
- package/dist/http/route_error_check.js +4 -21
- package/dist/http/route_result.d.ts +127 -23
- package/dist/http/route_result.d.ts.map +1 -1
- package/dist/http/route_result.js +97 -19
- package/dist/http/route_spec.d.ts +299 -83
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +548 -71
- package/dist/http/simple_request.d.ts +19 -14
- package/dist/http/simple_request.d.ts.map +1 -1
- package/dist/http/simple_request.js +17 -29
- package/dist/http/surface.d.ts +2 -0
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +4 -1
- package/dist/realtime/outbound_budget.d.ts +1 -2
- package/dist/realtime/outbound_budget.d.ts.map +1 -1
- package/dist/realtime/outbound_budget.js +1 -2
- package/dist/realtime/sse.d.ts +47 -17
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +115 -93
- package/dist/realtime/sse_constants.d.ts +7 -1
- package/dist/realtime/sse_constants.d.ts.map +1 -1
- package/dist/realtime/sse_constants.js +12 -1
- package/dist/realtime/sse_registry.d.ts +3 -3
- package/dist/realtime/sse_registry.js +3 -3
- package/dist/runtime/deps.d.ts +20 -4
- package/dist/runtime/deps.d.ts.map +1 -1
- package/dist/runtime/mock.d.ts +7 -1
- package/dist/runtime/mock.d.ts.map +1 -1
- package/dist/runtime/mock.js +33 -3
- package/dist/runtime/node.d.ts.map +1 -1
- package/dist/runtime/node.js +2 -1
- package/dist/runtime/secure_file.d.ts +71 -10
- package/dist/runtime/secure_file.d.ts.map +1 -1
- package/dist/runtime/secure_file.js +91 -11
- package/dist/server/app_backend.d.ts +0 -8
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +4 -4
- package/dist/server/app_server.d.ts +54 -33
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +69 -41
- package/dist/server/serve_fact_route.d.ts +3 -3
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +59 -55
- package/dist/server/static.d.ts +20 -0
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/static.js +56 -8
- package/dist/server/unmatched_route.d.ts +42 -0
- package/dist/server/unmatched_route.d.ts.map +1 -0
- package/dist/server/unmatched_route.js +64 -0
- package/dist/testing/CLAUDE.md +406 -1202
- package/dist/testing/app_server.d.ts +3 -1
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +5 -9
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +3 -2
- package/dist/testing/cross_backend/account_lifecycle.d.ts +11 -4
- package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/account_lifecycle.js +320 -6
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts +4 -1
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
- package/dist/testing/cross_backend/build_test_backend_paths.js +1 -1
- package/dist/testing/cross_backend/capabilities.d.ts +68 -5
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +20 -4
- package/dist/testing/cross_backend/cell_gated_create.js +1 -1
- package/dist/testing/cross_backend/conformance_case.d.ts +63 -21
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts +54 -12
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +179 -23
- package/dist/testing/cross_backend/cookie_attributes.js +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +7 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.js +3 -3
- package/dist/testing/cross_backend/credential_conformance.d.ts +196 -0
- package/dist/testing/cross_backend/credential_conformance.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_conformance.js +296 -0
- package/dist/testing/cross_backend/credential_conformance.json +1284 -0
- package/dist/testing/cross_backend/credential_conformance_wire.d.ts +40 -0
- package/dist/testing/cross_backend/credential_conformance_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_conformance_wire.js +293 -0
- package/dist/testing/cross_backend/credential_header_robustness.d.ts +1 -3
- package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_header_robustness.js +24 -55
- package/dist/testing/cross_backend/credential_wire.d.ts +112 -0
- package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_wire.js +188 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +22 -2
- package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -26
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +3 -7
- package/dist/testing/cross_backend/differential.d.ts +1 -1
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +3 -2
- package/dist/testing/cross_backend/differential_normalize.d.ts +23 -6
- package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential_normalize.js +11 -5
- package/dist/testing/cross_backend/full_spine_mount.d.ts +4 -10
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +11 -4
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +4 -0
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +78 -4
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +13 -10
- package/dist/testing/cross_backend/peer_ping_ws.d.ts +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +2 -2
- package/dist/testing/cross_backend/request_header_conformance.d.ts +174 -0
- package/dist/testing/cross_backend/request_header_conformance.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_header_conformance.js +196 -0
- package/dist/testing/cross_backend/request_header_conformance.json +1158 -0
- package/dist/testing/cross_backend/request_header_conformance_wire.d.ts +39 -0
- package/dist/testing/cross_backend/request_header_conformance_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_header_conformance_wire.js +284 -0
- package/dist/testing/cross_backend/request_target_conformance.d.ts +298 -0
- package/dist/testing/cross_backend/request_target_conformance.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_target_conformance.js +186 -0
- package/dist/testing/cross_backend/request_target_conformance.json +3765 -0
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +32 -0
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -0
- package/dist/testing/cross_backend/request_target_conformance_wire.js +278 -0
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +173 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +5 -4
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +185 -31
- package/dist/testing/cross_backend/rpc_adversarial.d.ts +6 -4
- package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
- package/dist/testing/cross_backend/rpc_adversarial.js +5 -2
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +6 -7
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.js +4 -5
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +82 -34
- package/dist/testing/cross_backend/session_cookie_effect.d.ts +43 -0
- package/dist/testing/cross_backend/session_cookie_effect.d.ts.map +1 -0
- package/dist/testing/cross_backend/session_cookie_effect.js +103 -0
- package/dist/testing/cross_backend/session_login.d.ts +24 -0
- package/dist/testing/cross_backend/session_login.d.ts.map +1 -0
- package/dist/testing/cross_backend/session_login.js +31 -0
- package/dist/testing/cross_backend/setup.d.ts +117 -0
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +193 -9
- package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
- package/dist/testing/cross_backend/simple_request.js +5 -0
- package/dist/testing/cross_backend/spine_suites.d.ts +9 -1
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +88 -5
- 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 +8 -5
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +205 -64
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +5 -2
- package/dist/testing/cross_backend/testing_credential_read.d.ts +165 -0
- package/dist/testing/cross_backend/testing_credential_read.d.ts.map +1 -0
- package/dist/testing/cross_backend/testing_credential_read.js +175 -0
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +19 -0
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +22 -6
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +58 -2
- package/dist/testing/cross_backend/transport_composition.d.ts +2 -4
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +13 -10
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +5 -3
- package/dist/testing/cross_backend/ws_endpoint.d.ts +11 -1
- package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_endpoint.js +19 -2
- package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_role_gated.js +2 -3
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +28 -12
- package/dist/testing/cross_backend/xfail.d.ts +44 -11
- package/dist/testing/cross_backend/xfail.d.ts.map +1 -1
- package/dist/testing/cross_backend/xfail.js +68 -23
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +4 -3
- package/dist/testing/integration.d.ts +1 -2
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +14 -8
- package/dist/testing/integration_helpers.d.ts +50 -3
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +87 -9
- package/dist/testing/middleware.d.ts +3 -1
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +14 -7
- package/dist/testing/resolved_auth.d.ts +3 -1
- package/dist/testing/resolved_auth.d.ts.map +1 -1
- package/dist/testing/resolved_auth.js +4 -4
- package/dist/testing/round_trip.d.ts +6 -2
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +17 -6
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +7 -0
- package/dist/testing/rpc_helpers.d.ts +4 -2
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +6 -1
- package/dist/testing/rpc_round_trip.d.ts +13 -2
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +25 -6
- package/dist/testing/schema_generators.d.ts +2 -2
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +4 -4
- package/dist/testing/stubs.d.ts +2 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +13 -10
- package/dist/testing/transports/fetch_transport.d.ts +6 -3
- package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
- package/dist/testing/transports/fetch_transport.js +31 -19
- package/dist/testing/transports/raw_http.d.ts +61 -1
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +61 -1
- package/dist/testing/transports/ws_raw_client.d.ts +20 -0
- package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_raw_client.js +10 -4
- package/dist/testing/transports/ws_transport.d.ts +21 -1
- package/dist/testing/transports/ws_transport.d.ts.map +1 -1
- package/dist/testing/transports/ws_transport.js +58 -20
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +8 -4
- package/package.json +1 -1
|
@@ -12,14 +12,19 @@ import '../assert_dev_env.js';
|
|
|
12
12
|
* - `role_grant_revoked` (flat, omits `revoked_by`) → revokee (active grant
|
|
13
13
|
* revoked by the `role_grant_revoke` action), for a global grant and a
|
|
14
14
|
* scoped one unless `scope_kind` is `null`
|
|
15
|
-
* - `role_grant_offer_supersede` → each
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* - `role_grant_offer_supersede` → each live party of an offer a cascade ended:
|
|
16
|
+
* an accept's siblings' grantors (`reason: 'sibling_accepted'`, the
|
|
17
|
+
* recipient being the caller), both parties of every offer a revoke ends
|
|
18
|
+
* (`reason: 'role_grant_revoked'` — the revokee's incoming siblings and its
|
|
19
|
+
* own outgoing offers), and the other party of every offer an account
|
|
20
|
+
* removal ends (`reason: 'account_deleted'`, delete and purge — gated on
|
|
21
|
+
* `capabilities.account_lifecycle` too; the removed account's socket closes
|
|
22
|
+
* and hears none of it)
|
|
18
23
|
*
|
|
19
24
|
* These exercise only spine primitives (accounts, role-grants, offers, WS
|
|
20
25
|
* notifications) — zero consumer domain — so the suite lives here and runs
|
|
21
|
-
* against any backend that
|
|
22
|
-
*
|
|
26
|
+
* against any backend that mounts the standard RPC actions and a WS endpoint
|
|
27
|
+
* their notifications reach: fuz_app's own spine self-tests
|
|
23
28
|
* (`testing_spine_server` + the Rust `testing_spine_stub`) and downstream
|
|
24
29
|
* twin-impl consumers (the fuz_forge Deno/Hono + Rust `fuz_forge_server`
|
|
25
30
|
* backends) alike.
|
|
@@ -35,7 +40,10 @@ import '../assert_dev_env.js';
|
|
|
35
40
|
* but the answers to its own requests, behind a `heartbeat` barrier on its
|
|
36
41
|
* socket (`assert_bystander_heard_nothing` says why the barrier makes the
|
|
37
42
|
* silence meaningful). A fan-out that reached past its target account fails
|
|
38
|
-
* there.
|
|
43
|
+
* there. The target is held the same way, behind a barrier of its own: its
|
|
44
|
+
* socket heard exactly the notifications the case addressed to it, each once,
|
|
45
|
+
* in order — so a backend delivering one twice (a registry reached through
|
|
46
|
+
* two paths) fails, which the frame's own `wait_for` can't see.
|
|
39
47
|
*
|
|
40
48
|
* Sends are queued on the post-commit drain (handler-emit, not audit-derived),
|
|
41
49
|
* so a frame may land a beat after the RPC resolves — `WsClient.wait_for` polls
|
|
@@ -47,11 +55,12 @@ import '../assert_dev_env.js';
|
|
|
47
55
|
* guard), and accept stays idempotent on the role_grant while still superseding
|
|
48
56
|
* pending siblings. Gated on `capabilities.ws`.
|
|
49
57
|
*
|
|
50
|
-
* The revoke
|
|
58
|
+
* The revoke cases revoke the revokee's only `ROLE_ADMIN` grant. On an endpoint
|
|
51
59
|
* gated on that role (`ws_required_roles`) the revokee's socket loses its
|
|
52
60
|
* access by the same revoke: it is closed with `WS_CLOSE_PERMISSION_REVOKED`,
|
|
53
|
-
* and
|
|
54
|
-
* so the
|
|
61
|
+
* and its notifications may or may not reach it first (nothing orders the
|
|
62
|
+
* two), so the cases assert the close there — and at most the start of what it
|
|
63
|
+
* would have heard, in order — and the frames on an ungated endpoint.
|
|
55
64
|
*
|
|
56
65
|
* Cross-process only: `create_admitted_ws_transport` needs a real bound socket, so wire
|
|
57
66
|
* it from a `*.cross.test.ts` file, never an in-process setup. Authed cookies
|
|
@@ -64,23 +73,38 @@ import { assert, describe } from 'vitest';
|
|
|
64
73
|
import { parse_or_throw } from '@fuzdev/fuz_schema/schema.ts';
|
|
65
74
|
import { rpc_call } from '../rpc_helpers.js';
|
|
66
75
|
import { WS_ADMISSION_PROBE_ID } from '../transports/ws_transport.js';
|
|
67
|
-
import { is_notification_with, is_response_for } from '../transports/ws_client.js';
|
|
76
|
+
import { is_notification, is_notification_with, is_response_for } from '../transports/ws_client.js';
|
|
68
77
|
import { ROLE_ADMIN, is_builtin_role } from '../../auth/role_schema.js';
|
|
69
|
-
import { WS_CLOSE_PERMISSION_REVOKED } from '../../actions/transports.js';
|
|
78
|
+
import { WS_CLOSE_PERMISSION_REVOKED, WS_CLOSE_PERMISSION_REVOKED_REASON } from '../../actions/transports.js';
|
|
70
79
|
import { ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD, ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, ROLE_GRANT_REVOKED_NOTIFICATION_METHOD, RoleGrantOfferReceivedParams, RoleGrantOfferAcceptedParams, RoleGrantOfferDeclinedParams, RoleGrantOfferRetractedParams, RoleGrantOfferSupersedeParams, RoleGrantRevokedParams } from '../../auth/role_grant_offer_notifications.js';
|
|
71
80
|
import { test_if } from './capabilities.js';
|
|
72
81
|
import { create_active_role_grant, create_pending_role_grant_offer } from './role_grant_cross_helpers.js';
|
|
82
|
+
import { cross_account_purge } from './revocation_drivers.js';
|
|
73
83
|
import { SPINE_PARTICIPANT_ROLE, SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
74
84
|
import { open_session_ws } from './ws_endpoint.js';
|
|
75
85
|
/** The request id the bystander's barrier `heartbeat` goes out under. */
|
|
76
86
|
const BYSTANDER_BARRIER_ID = 'bystander_barrier';
|
|
87
|
+
/** The request id the target's barrier `heartbeat` goes out under. */
|
|
88
|
+
const TARGET_BARRIER_ID = 'target_barrier';
|
|
89
|
+
/**
|
|
90
|
+
* Name each frame a socket received but the answers to its admission probe and
|
|
91
|
+
* its barrier: a notification by its method, anything else as its JSON, so an
|
|
92
|
+
* unexpected response shows in the assertion's diff.
|
|
93
|
+
*/
|
|
94
|
+
const to_heard_frames = (ws) => ws.messages
|
|
95
|
+
.filter((msg) => !is_response_for(WS_ADMISSION_PROBE_ID)(msg) && !is_response_for(TARGET_BARRIER_ID)(msg))
|
|
96
|
+
.map((msg) => {
|
|
97
|
+
const method = msg?.method;
|
|
98
|
+
return typeof method === 'string' ? method : JSON.stringify(msg);
|
|
99
|
+
});
|
|
77
100
|
/**
|
|
78
101
|
* Register the role-grant-offer WS notification suite — cases over a real
|
|
79
102
|
* upgrade, one per server-initiated notification (received / accepted /
|
|
80
|
-
* declined / retracted / revoke, global and scoped, + supersede on
|
|
81
|
-
*
|
|
82
|
-
* lifecycle RPC, and strict-parses the delivered
|
|
83
|
-
* params schema. Gated on `capabilities.ws
|
|
103
|
+
* declined / retracted / revoke, global and scoped, + supersede on the accept,
|
|
104
|
+
* revoke, delete and purge cascades). Each opens every party's socket, drives
|
|
105
|
+
* the lifecycle RPC, and strict-parses the delivered frames against their
|
|
106
|
+
* canonical params schema. Gated on `capabilities.ws`, the removals on
|
|
107
|
+
* `capabilities.account_lifecycle` too.
|
|
84
108
|
*/
|
|
85
109
|
export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
86
110
|
const { setup_test, capabilities, ws_required_roles = [] } = options;
|
|
@@ -131,7 +155,8 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
131
155
|
* frame can be written while the pass is still pushing — a window the
|
|
132
156
|
* barrier's round trip outlasts in practice. Either way the check covers
|
|
133
157
|
* every pass of the drain, not just the one that reached the target: TS
|
|
134
|
-
*
|
|
158
|
+
* calls every queued send in one synchronous loop
|
|
159
|
+
* (`flush_post_commit_effects`), and `PostCommitEffects::drain_all` joins
|
|
135
160
|
* effects whose notify futures push synchronously, so every pass
|
|
136
161
|
* completes in the drain's first poll.
|
|
137
162
|
*/
|
|
@@ -140,6 +165,34 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
140
165
|
const strays = bystander_ws.messages.filter((msg) => !is_response_for(WS_ADMISSION_PROBE_ID)(msg) && !is_response_for(BYSTANDER_BARRIER_ID)(msg));
|
|
141
166
|
assert.deepStrictEqual(strays, [], 'a bystander socket received frames addressed to others');
|
|
142
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* Assert the targeted socket heard exactly `expected` — the notifications
|
|
170
|
+
* the case addressed to it, in order, each once — and nothing else but the
|
|
171
|
+
* answers to its own requests. Called once the targeted frame has landed,
|
|
172
|
+
* behind a `heartbeat` barrier on the target's own socket, which makes the
|
|
173
|
+
* absence of a second copy a finding for the reason
|
|
174
|
+
* `assert_bystander_heard_nothing` gives: a fan-out queues every copy it
|
|
175
|
+
* sends in the pass that sent the first, ahead of the barrier's response.
|
|
176
|
+
*/
|
|
177
|
+
const assert_target_heard_exactly = async (target_ws, expected) => {
|
|
178
|
+
await target_ws.request(TARGET_BARRIER_ID, 'heartbeat', {}, 5000);
|
|
179
|
+
assert.deepStrictEqual(to_heard_frames(target_ws), expected, 'the target socket did not hear exactly the notifications addressed to it, each once');
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Wait for the `role_grant_offer_supersede` frame of `offer_id` on `ws` and
|
|
183
|
+
* strict-parse its params against the canonical wire schema.
|
|
184
|
+
*/
|
|
185
|
+
const wait_for_supersede = async (ws, offer_id) => {
|
|
186
|
+
const frame = await ws.wait_for(is_notification_with(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, (p) => p.offer.id === offer_id), 5000);
|
|
187
|
+
const params = parse_or_throw(RoleGrantOfferSupersedeParams, frame.params);
|
|
188
|
+
assert.strictEqual(params.offer.id, offer_id);
|
|
189
|
+
assert.isNotNull(params.offer.superseded_at);
|
|
190
|
+
return params;
|
|
191
|
+
};
|
|
192
|
+
/** The offer ids of the supersede frames `ws` heard, in order. */
|
|
193
|
+
const supersede_offer_ids = (ws) => ws.messages
|
|
194
|
+
.filter(is_notification(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD))
|
|
195
|
+
.map((msg) => msg.params.offer.id);
|
|
143
196
|
/** Drive a JSON-RPC call over the fixture's HTTP transport. */
|
|
144
197
|
const rpc = (fixture, method, params, headers) => rpc_call({ app: fixture.transport, path: SPINE_RPC_PATH, method, params, headers });
|
|
145
198
|
/** A fresh pending `ROLE_ADMIN` offer, from the keeper unless a grantor is given. */
|
|
@@ -171,6 +224,9 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
171
224
|
const params = parse_or_throw(RoleGrantOfferReceivedParams, frame.params);
|
|
172
225
|
assert.strictEqual(params.offer.to_account_id, recipient.account.id);
|
|
173
226
|
assert.strictEqual(params.offer.role, ROLE_ADMIN);
|
|
227
|
+
await assert_target_heard_exactly(recipient_ws, [
|
|
228
|
+
ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD
|
|
229
|
+
]);
|
|
174
230
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
175
231
|
}
|
|
176
232
|
finally {
|
|
@@ -196,6 +252,9 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
196
252
|
const params = parse_or_throw(RoleGrantOfferAcceptedParams, frame.params);
|
|
197
253
|
assert.strictEqual(params.offer.id, offer.id);
|
|
198
254
|
assert.isNotNull(params.offer.accepted_at);
|
|
255
|
+
await assert_target_heard_exactly(grantor, [
|
|
256
|
+
ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD
|
|
257
|
+
]);
|
|
199
258
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
200
259
|
}
|
|
201
260
|
finally {
|
|
@@ -221,6 +280,9 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
221
280
|
assert.strictEqual(params.offer.id, offer.id);
|
|
222
281
|
// Decline reason rides inside the offer row, not a sibling field.
|
|
223
282
|
assert.strictEqual(params.offer.decline_reason, 'no thanks');
|
|
283
|
+
await assert_target_heard_exactly(grantor, [
|
|
284
|
+
ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD
|
|
285
|
+
]);
|
|
224
286
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
225
287
|
}
|
|
226
288
|
finally {
|
|
@@ -247,6 +309,11 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
247
309
|
assert.strictEqual(params.offer.id, offer.id);
|
|
248
310
|
assert.strictEqual(params.offer.to_account_id, recipient.account.id);
|
|
249
311
|
assert.isNotNull(params.offer.retracted_at);
|
|
312
|
+
// the offer's create, made with the socket open, notified it first
|
|
313
|
+
await assert_target_heard_exactly(recipient_ws, [
|
|
314
|
+
ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD,
|
|
315
|
+
ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD
|
|
316
|
+
]);
|
|
250
317
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
251
318
|
}
|
|
252
319
|
finally {
|
|
@@ -290,13 +357,18 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
290
357
|
const closed = await revokee_ws.wait_for_close(5000);
|
|
291
358
|
assert.ok(closed, 'the gated socket did not close after the revoke');
|
|
292
359
|
assert.strictEqual(revokee_ws.close_code, WS_CLOSE_PERMISSION_REVOKED);
|
|
360
|
+
assert.strictEqual(revokee_ws.close_reason, WS_CLOSE_PERMISSION_REVOKED_REASON);
|
|
293
361
|
const early = revokee_ws.messages.find(is_revoke_frame);
|
|
294
362
|
if (early)
|
|
295
363
|
assert_flat_revoke(early);
|
|
364
|
+
// a closed socket takes no barrier: what reached it ahead of the
|
|
365
|
+
// close is the notification once, or nothing
|
|
366
|
+
assert.deepStrictEqual(to_heard_frames(revokee_ws), early ? [ROLE_GRANT_REVOKED_NOTIFICATION_METHOD] : [], 'the gated socket heard more than the one notification before its close');
|
|
296
367
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
297
368
|
return;
|
|
298
369
|
}
|
|
299
370
|
assert_flat_revoke(await revokee_ws.wait_for(is_revoke_frame, 5000));
|
|
371
|
+
await assert_target_heard_exactly(revokee_ws, [ROLE_GRANT_REVOKED_NOTIFICATION_METHOD]);
|
|
300
372
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
301
373
|
}
|
|
302
374
|
finally {
|
|
@@ -328,6 +400,7 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
328
400
|
assert.strictEqual(params.scope_kind, scope_kind);
|
|
329
401
|
assert.strictEqual(params.scope_id, scope_id);
|
|
330
402
|
assert.strictEqual(params.reason, null);
|
|
403
|
+
await assert_target_heard_exactly(revokee_ws, [ROLE_GRANT_REVOKED_NOTIFICATION_METHOD]);
|
|
331
404
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
332
405
|
}
|
|
333
406
|
finally {
|
|
@@ -363,6 +436,9 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
363
436
|
// cause_id points at the accepted sibling (grantor 2's offer).
|
|
364
437
|
assert.strictEqual(params.cause_id, grantor2_offer.id);
|
|
365
438
|
assert.isNotNull(params.offer.superseded_at);
|
|
439
|
+
await assert_target_heard_exactly(grantor1_ws, [
|
|
440
|
+
ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD
|
|
441
|
+
]);
|
|
366
442
|
await assert_bystander_heard_nothing(bystander_ws);
|
|
367
443
|
}
|
|
368
444
|
finally {
|
|
@@ -373,39 +449,117 @@ export const describe_role_grant_offer_notification_ws_tests = (options) => {
|
|
|
373
449
|
await bystander_ws.close();
|
|
374
450
|
}
|
|
375
451
|
});
|
|
376
|
-
test_if(capabilities.ws,
|
|
452
|
+
test_if(capabilities.ws, "revoke supersedes the revokee's pending offers both ways and notifies both parties of each", async () => {
|
|
377
453
|
const fixture = await setup_test();
|
|
378
454
|
const grantor = await fixture.create_account({ roles: [ROLE_ADMIN] });
|
|
379
455
|
const revokee = await fixture.create_account({ roles: [ROLE_ADMIN] });
|
|
456
|
+
const recipient = await fixture.create_account({ roles: [ROLE_ADMIN] });
|
|
380
457
|
const role_grant_id = await create_active_role_grant(fixture, revokee, {
|
|
381
458
|
rpc_path: SPINE_RPC_PATH
|
|
382
459
|
});
|
|
383
|
-
// A
|
|
384
|
-
// the revoke
|
|
460
|
+
// A pending sibling for the revoked grant's (account, role), and an
|
|
461
|
+
// offer the revokee made — the revoke's two cascades, in that order.
|
|
385
462
|
const sibling_offer = await create_pending_offer(fixture, revokee.account.id, grantor.create_session_headers());
|
|
386
|
-
|
|
463
|
+
const outgoing_offer = await create_pending_offer(fixture, recipient.account.id, revokee.create_session_headers());
|
|
387
464
|
const bystander_ws = await open_bystander(fixture);
|
|
465
|
+
const grantor_ws = await open_ws(grantor);
|
|
466
|
+
const revokee_ws = await open_ws(revokee);
|
|
467
|
+
const recipient_ws = await open_ws(recipient);
|
|
388
468
|
try {
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
const frame = await grantor_ws.wait_for(is_notification_with(ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD, (p) => p.offer.id === sibling_offer.id), 5000);
|
|
394
|
-
const params = parse_or_throw(RoleGrantOfferSupersedeParams, frame.params);
|
|
395
|
-
assert.strictEqual(params.offer.id, sibling_offer.id);
|
|
469
|
+
const revoked = await rpc(fixture, 'role_grant_revoke', { actor_id: revokee.actor.id, role_grant_id }, fixture.create_session_headers());
|
|
470
|
+
assert.isTrue(revoked.ok, `revoke failed: ${JSON.stringify(revoked)}`);
|
|
471
|
+
const assert_supersede = async (ws, offer_id) => {
|
|
472
|
+
const params = await wait_for_supersede(ws, offer_id);
|
|
396
473
|
assert.strictEqual(params.reason, 'role_grant_revoked');
|
|
397
474
|
// cause_id points at the revoked role_grant.
|
|
398
475
|
assert.strictEqual(params.cause_id, role_grant_id);
|
|
399
|
-
|
|
400
|
-
|
|
476
|
+
};
|
|
477
|
+
// the sibling's grantor and the outgoing offer's recipient
|
|
478
|
+
await assert_supersede(grantor_ws, sibling_offer.id);
|
|
479
|
+
await assert_target_heard_exactly(grantor_ws, [
|
|
480
|
+
ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD
|
|
481
|
+
]);
|
|
482
|
+
await assert_supersede(recipient_ws, outgoing_offer.id);
|
|
483
|
+
await assert_target_heard_exactly(recipient_ws, [
|
|
484
|
+
ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD
|
|
485
|
+
]);
|
|
486
|
+
// the revokee is the sibling's recipient and the outgoing offer's
|
|
487
|
+
// grantor: the revoke, then the two offers in the cascade's order
|
|
488
|
+
const revokee_heard = [
|
|
489
|
+
ROLE_GRANT_REVOKED_NOTIFICATION_METHOD,
|
|
490
|
+
ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD,
|
|
491
|
+
ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD
|
|
492
|
+
];
|
|
493
|
+
if (revoke_closes_the_socket) {
|
|
494
|
+
// the gated socket closes with the revoke, hearing at most the
|
|
495
|
+
// start of what it would have heard, in order
|
|
496
|
+
const closed = await revokee_ws.wait_for_close(5000);
|
|
497
|
+
assert.ok(closed, 'the gated socket did not close after the revoke');
|
|
498
|
+
assert.strictEqual(revokee_ws.close_code, WS_CLOSE_PERMISSION_REVOKED);
|
|
499
|
+
const heard = to_heard_frames(revokee_ws);
|
|
500
|
+
assert.deepStrictEqual(heard, revokee_heard.slice(0, heard.length));
|
|
401
501
|
}
|
|
402
|
-
|
|
403
|
-
await
|
|
502
|
+
else {
|
|
503
|
+
await assert_supersede(revokee_ws, outgoing_offer.id);
|
|
504
|
+
await assert_target_heard_exactly(revokee_ws, revokee_heard);
|
|
505
|
+
assert.deepStrictEqual(supersede_offer_ids(revokee_ws), [sibling_offer.id, outgoing_offer.id], "the revokee hears the sibling's supersede, then its own offer's");
|
|
404
506
|
}
|
|
507
|
+
await assert_bystander_heard_nothing(bystander_ws);
|
|
405
508
|
}
|
|
406
509
|
finally {
|
|
510
|
+
await Promise.all([recipient_ws.close(), revokee_ws.close(), grantor_ws.close()]);
|
|
407
511
|
await bystander_ws.close();
|
|
408
512
|
}
|
|
409
513
|
});
|
|
514
|
+
/**
|
|
515
|
+
* The account removals: `remove` ends `removed`'s account, whose pending
|
|
516
|
+
* offers both ways are superseded with `reason: 'account_deleted'`, the
|
|
517
|
+
* account as the grantor's cause and its actor as the recipient's. Each
|
|
518
|
+
* offer's other party hears it once; the removed account's socket closes
|
|
519
|
+
* and hears none of it.
|
|
520
|
+
*/
|
|
521
|
+
const removal_case = async (remove) => {
|
|
522
|
+
const fixture = await setup_test();
|
|
523
|
+
const removed = await fixture.create_account({ roles: [ROLE_ADMIN] });
|
|
524
|
+
const recipient = await fixture.create_account({ roles: [ROLE_ADMIN] });
|
|
525
|
+
const grantor = await fixture.create_account({ roles: [ROLE_ADMIN] });
|
|
526
|
+
const outgoing_offer = await create_pending_offer(fixture, recipient.account.id, removed.create_session_headers());
|
|
527
|
+
const incoming_offer = await create_pending_offer(fixture, removed.account.id, grantor.create_session_headers());
|
|
528
|
+
const bystander_ws = await open_bystander(fixture);
|
|
529
|
+
const removed_ws = await open_ws(removed);
|
|
530
|
+
const recipient_ws = await open_ws(recipient);
|
|
531
|
+
const grantor_ws = await open_ws(grantor);
|
|
532
|
+
try {
|
|
533
|
+
await remove(fixture, removed);
|
|
534
|
+
// the recipient is sent the grantor's actor, an id it already holds —
|
|
535
|
+
// never the removed account's id; the grantor is sent the removed
|
|
536
|
+
// account, its offer's `to_account_id`
|
|
537
|
+
for (const [ws, offer_id, cause_id] of [
|
|
538
|
+
[recipient_ws, outgoing_offer.id, removed.actor.id],
|
|
539
|
+
[grantor_ws, incoming_offer.id, removed.account.id]
|
|
540
|
+
]) {
|
|
541
|
+
const params = await wait_for_supersede(ws, offer_id);
|
|
542
|
+
assert.strictEqual(params.reason, 'account_deleted');
|
|
543
|
+
assert.strictEqual(params.cause_id, cause_id);
|
|
544
|
+
await assert_target_heard_exactly(ws, [ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD]);
|
|
545
|
+
}
|
|
546
|
+
const closed = await removed_ws.wait_for_close(5000);
|
|
547
|
+
assert.ok(closed, "the removed account's socket did not close");
|
|
548
|
+
// binds only on a spine that delivers a frame queued ahead of the close;
|
|
549
|
+
// one whose close drops it passes either way, so the spine's own fan-out
|
|
550
|
+
// tests are what hold a send to the removed account out
|
|
551
|
+
assert.deepStrictEqual(to_heard_frames(removed_ws), [], "the removed account's socket heard a notification before its close");
|
|
552
|
+
await assert_bystander_heard_nothing(bystander_ws);
|
|
553
|
+
}
|
|
554
|
+
finally {
|
|
555
|
+
await Promise.all([grantor_ws.close(), recipient_ws.close(), removed_ws.close()]);
|
|
556
|
+
await bystander_ws.close();
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
test_if(capabilities.ws && capabilities.account_lifecycle, "delete supersedes the account's pending offers both ways and notifies each other party", () => removal_case(async (fixture, removed) => {
|
|
560
|
+
const deleted = await rpc(fixture, 'account_delete', { account_id: removed.account.id }, fixture.create_session_headers());
|
|
561
|
+
assert.isTrue(deleted.ok, `delete failed: ${JSON.stringify(deleted)}`);
|
|
562
|
+
}));
|
|
563
|
+
test_if(capabilities.ws && capabilities.account_lifecycle, "purge supersedes the account's pending offers both ways and notifies each other party", () => removal_case((fixture, removed) => cross_account_purge(fixture, SPINE_RPC_PATH, removed.account.id)));
|
|
410
564
|
});
|
|
411
565
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
2
|
import { type AppSurfaceSpec, type RpcEndpointSpec } from '../../http/surface.js';
|
|
3
3
|
import type { RpcPathCrossSuiteOptions } from './setup.js';
|
|
4
|
+
import { type XfailMarker } from './xfail.js';
|
|
4
5
|
/** Options for `describe_rpc_adversarial_cross_tests`. */
|
|
5
6
|
export interface RpcAdversarialCrossTestOptions extends RpcPathCrossSuiteOptions {
|
|
6
7
|
/** The declared surface; the endpoint at `rpc_path` supplies the methods and their input schemas. */
|
|
@@ -31,12 +32,13 @@ export interface RpcAdversarialCrossTestOptions extends RpcPathCrossSuiteOptions
|
|
|
31
32
|
readonly xfail_params?: ReadonlyArray<RpcParamsXfail>;
|
|
32
33
|
}
|
|
33
34
|
/** Generated params cases of one method marked `xfail_until`, by case label. */
|
|
34
|
-
export interface RpcParamsXfail {
|
|
35
|
+
export interface RpcParamsXfail extends XfailMarker {
|
|
35
36
|
readonly method: string;
|
|
36
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* `InputTestCase.label`s of `generate_rpc_params_test_cases(method's input)`.
|
|
39
|
+
* A label naming no generated case fails the suite.
|
|
40
|
+
*/
|
|
37
41
|
readonly labels: ReadonlyArray<string>;
|
|
38
|
-
readonly tracking_id: string;
|
|
39
|
-
readonly reason: string;
|
|
40
42
|
}
|
|
41
43
|
/**
|
|
42
44
|
* Run the cross-process malformed-envelope and invalid-params suite.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc_adversarial.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/rpc_adversarial.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA6E9B,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,uBAAuB,CAAC;AAoB/B,OAAO,KAAK,EAAE,wBAAwB,EAAe,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc_adversarial.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/rpc_adversarial.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA6E9B,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,uBAAuB,CAAC;AAoB/B,OAAO,KAAK,EAAE,wBAAwB,EAAe,MAAM,YAAY,CAAC;AAExE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAG3D,0DAA0D;AAC1D,MAAM,WAAW,8BAA+B,SAAQ,wBAAwB;IAC/E,qGAAqG;IACrG,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC7D,wEAAwE;IACxE,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxE;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACtD;AAED,gFAAgF;AAChF,MAAM,WAAW,cAAe,SAAQ,WAAW;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACvC;AAmGD;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,GAChD,SAAS,8BAA8B,KACrC,IAkKF,CAAC"}
|
|
@@ -270,9 +270,12 @@ export const describe_rpc_adversarial_cross_tests = (options) => {
|
|
|
270
270
|
continue;
|
|
271
271
|
}
|
|
272
272
|
matched_xfails.add(key);
|
|
273
|
-
xfail_until(xfail
|
|
273
|
+
xfail_until(xfail, `${method}: [${tc.label}] → 400 invalid_params`, async () => {
|
|
274
274
|
const failure = await check_case(await setup_test(), action, tc);
|
|
275
|
-
|
|
275
|
+
// the failure text itself, so `fails_with` can read the answer;
|
|
276
|
+
// an assertion would print it truncated
|
|
277
|
+
if (failure !== null)
|
|
278
|
+
assert.fail(failure);
|
|
276
279
|
});
|
|
277
280
|
}
|
|
278
281
|
if (param_cases.length === 0)
|
|
@@ -13,8 +13,8 @@ import '../assert_dev_env.js';
|
|
|
13
13
|
* single-keeper daemon) is not this shape.
|
|
14
14
|
*
|
|
15
15
|
* The route shapes come from `create_account_route_shapes` and friends, never
|
|
16
|
-
* the live route factories, which statically pull
|
|
17
|
-
* `hono/streaming`. Handlers are never invoked — the suites read `method`,
|
|
16
|
+
* the live route factories, which statically pull the query layer and, for
|
|
17
|
+
* the audit stream, `hono/streaming`. Handlers are never invoked — the suites read `method`,
|
|
18
18
|
* `path`, `auth` and the schemas, and live dispatch happens in the spawned
|
|
19
19
|
* binary — so routes and actions carry no-op handlers.
|
|
20
20
|
*
|
|
@@ -28,11 +28,10 @@ import type { AppSurfaceSpec, RpcEndpointSpec } from '../../http/surface.js';
|
|
|
28
28
|
import type { AppServerContext } from '../../server/app_server_context.js';
|
|
29
29
|
/**
|
|
30
30
|
* The routes `fuz_auth::account_router` mounts, relative to `/api/account`. An
|
|
31
|
-
* allowlist rather than every account route shape
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* names it.
|
|
31
|
+
* allowlist rather than every account route shape, so a route the TS spine
|
|
32
|
+
* gains ahead of the Rust router never has the suites probe a 404: a shape
|
|
33
|
+
* fuz_app renames or drops fails the surface build; one it adds stays off the
|
|
34
|
+
* surface until the Rust router mounts it and this list names it.
|
|
36
35
|
*/
|
|
37
36
|
export declare const ACCOUNT_ROUTER_PATHS: readonly ["/status", "/login", "/logout", "/password"];
|
|
38
37
|
/** Options for `create_rust_spine_consumer_rpc_endpoints`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rust_spine_consumer_surface.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/rust_spine_consumer_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,8BAA8B,CAAC;AAM/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E
|
|
1
|
+
{"version":3,"file":"rust_spine_consumer_surface.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/rust_spine_consumer_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAA6B,MAAM,8BAA8B,CAAC;AAM/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAKnE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,wDAAyD,CAAC;AAK3F,8DAA8D;AAC9D,MAAM,WAAW,oCAAoC;IACpD;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACzE,yFAAyF;IACzF,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjD,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,6DAA6D;AAC7D,MAAM,WAAW,mCAAoC,SAAQ,oCAAoC;IAChG,gEAAgE;IAChE,QAAQ,CAAC,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wCAAwC,GACpD,SAAS,oCAAoC,KAC3C,CAAC,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,eAAe,CAAC,CA+BpD,CAAC;AAiCF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uCAAuC,GACnD,SAAS,mCAAmC,KAC1C,cAUA,CAAC"}
|
|
@@ -9,11 +9,10 @@ import { create_test_app_surface_spec, stub_route_spec } from '../stubs.js';
|
|
|
9
9
|
import { SPINE_ACCOUNT_PATH_PREFIX, SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
10
10
|
/**
|
|
11
11
|
* The routes `fuz_auth::account_router` mounts, relative to `/api/account`. An
|
|
12
|
-
* allowlist rather than every account route shape
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* names it.
|
|
12
|
+
* allowlist rather than every account route shape, so a route the TS spine
|
|
13
|
+
* gains ahead of the Rust router never has the suites probe a 404: a shape
|
|
14
|
+
* fuz_app renames or drops fails the surface build; one it adds stays off the
|
|
15
|
+
* surface until the Rust router mounts it and this list names it.
|
|
17
16
|
*/
|
|
18
17
|
export const ACCOUNT_ROUTER_PATHS = ['/status', '/login', '/logout', '/password'];
|
|
19
18
|
/** Surface generation never invokes handlers — see the module doc. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session_cap.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/session_cap.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"session_cap.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/session_cap.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA+E9B,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAOzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,gDAAgD;AAChD,MAAM,WAAW,0BAA0B;IAC1C,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,gCAAgC,GAAI,SAAS,0BAA0B,KAAG,IA8QtF,CAAC"}
|