@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
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import '../assert_dev_env.js';
|
|
2
|
+
/**
|
|
3
|
+
* What the raw-socket conformance suites share: the accounts that name a
|
|
4
|
+
* credential, the raw `account_verify` request and upgrade they send, and how
|
|
5
|
+
* they read which credential an answer is for.
|
|
6
|
+
*
|
|
7
|
+
* Each of the three credentials belongs to a different account — the session
|
|
8
|
+
* cookie and the API token to two seeded `extra_accounts`, the daemon token to
|
|
9
|
+
* the keeper — so the account `account_verify` answers as names the
|
|
10
|
+
* credential that authenticated, and a 401 names none.
|
|
11
|
+
* `credential_conformance_wire.ts` and `request_header_conformance_wire.ts`
|
|
12
|
+
* read their rows' outcomes this way.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
import { assert } from 'vitest';
|
|
17
|
+
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
18
|
+
import { SessionAccountJson } from '../../auth/account_schema.js';
|
|
19
|
+
import { CREDENTIAL_TYPE_API_TOKEN, CREDENTIAL_TYPE_DAEMON_TOKEN, CREDENTIAL_TYPE_SESSION } from '../../auth/credential_type_schema.js';
|
|
20
|
+
import { ROLE_ADMIN, ROLE_KEEPER } from '../../auth/role_schema.js';
|
|
21
|
+
import { JSONRPC_ERROR_CODES } from '../../http/jsonrpc_errors.js';
|
|
22
|
+
import { raw_http_exchange, raw_http_parse_json, raw_http_parse_response, raw_http_request, RAW_HTTP_READ_TIMEOUT_MS } from '../transports/raw_http.js';
|
|
23
|
+
import { is_raw_ws_close, RAW_WS_OPCODE_TEXT } from '../transports/ws_raw_client.js';
|
|
24
|
+
/**
|
|
25
|
+
* The `extra_accounts` username whose session cookie the suites send. Their
|
|
26
|
+
* `setup_test` must seed it, with `CREDENTIAL_SESSION_ACCOUNT_PASSWORD`.
|
|
27
|
+
*/
|
|
28
|
+
export const CREDENTIAL_SESSION_ACCOUNT_USERNAME = 'credential_session';
|
|
29
|
+
/**
|
|
30
|
+
* The password the `CREDENTIAL_SESSION_ACCOUNT_USERNAME` account is seeded
|
|
31
|
+
* with (`ExtraAccountSpec.password_value`) — the credential suite's login
|
|
32
|
+
* case signs in as it.
|
|
33
|
+
*/
|
|
34
|
+
export const CREDENTIAL_SESSION_ACCOUNT_PASSWORD = 'credential-session-password';
|
|
35
|
+
/**
|
|
36
|
+
* The `extra_accounts` username whose API token the suites send. Their
|
|
37
|
+
* `setup_test` must seed it.
|
|
38
|
+
*/
|
|
39
|
+
export const CREDENTIAL_BEARER_ACCOUNT_USERNAME = 'credential_bearer';
|
|
40
|
+
/**
|
|
41
|
+
* The seeding the credential suites need: the two accounts, each holding
|
|
42
|
+
* `ws_required_roles` so it can open a socket where the upgrade is
|
|
43
|
+
* role-gated, and the keeper behind the daemon token holding them too.
|
|
44
|
+
*
|
|
45
|
+
* @param ws_required_roles - the roles the backend's WebSocket upgrade requires
|
|
46
|
+
*/
|
|
47
|
+
export const create_credential_wire_seed = (ws_required_roles = []) => ({
|
|
48
|
+
// the keeper already holds the builtin roles
|
|
49
|
+
extra_keeper_roles: ws_required_roles.filter((role) => role !== ROLE_KEEPER && role !== ROLE_ADMIN),
|
|
50
|
+
extra_accounts: [
|
|
51
|
+
{
|
|
52
|
+
username: CREDENTIAL_SESSION_ACCOUNT_USERNAME,
|
|
53
|
+
password_value: CREDENTIAL_SESSION_ACCOUNT_PASSWORD,
|
|
54
|
+
roles: [...ws_required_roles]
|
|
55
|
+
},
|
|
56
|
+
{ username: CREDENTIAL_BEARER_ACCOUNT_USERNAME, roles: [...ws_required_roles] }
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
/** A credential reading for a failure message. */
|
|
60
|
+
export const format_authenticated_credential = (credential) => typeof credential === 'object' && credential !== null
|
|
61
|
+
? credential.unexpected
|
|
62
|
+
: String(credential);
|
|
63
|
+
/**
|
|
64
|
+
* The fixture's three credential accounts.
|
|
65
|
+
*
|
|
66
|
+
* @throws AssertionError when the fixture lacks the seeded accounts, or two credentials share one
|
|
67
|
+
*/
|
|
68
|
+
export const read_credential_wire_accounts = (fixture) => {
|
|
69
|
+
const session = fixture.extra_accounts[CREDENTIAL_SESSION_ACCOUNT_USERNAME];
|
|
70
|
+
const bearer = fixture.extra_accounts[CREDENTIAL_BEARER_ACCOUNT_USERNAME];
|
|
71
|
+
assert.ok(session && bearer, `the suite's setup_test must seed the extra_accounts '${CREDENTIAL_SESSION_ACCOUNT_USERNAME}' ` +
|
|
72
|
+
`and '${CREDENTIAL_BEARER_ACCOUNT_USERNAME}'`);
|
|
73
|
+
const ids = new Set([session.account.id, bearer.account.id, fixture.account.id]);
|
|
74
|
+
assert.strictEqual(ids.size, 3, 'the three credentials belong to three accounts');
|
|
75
|
+
return { session, bearer, keeper_id: fixture.account.id };
|
|
76
|
+
};
|
|
77
|
+
/** The id of the `account_verify` call the suites send. */
|
|
78
|
+
export const CREDENTIAL_WIRE_VERIFY_ID = 'credential';
|
|
79
|
+
/** The `account_verify` call the suites send — an RPC body, and a socket frame. */
|
|
80
|
+
export const CREDENTIAL_WIRE_VERIFY_BODY = JSON.stringify({
|
|
81
|
+
jsonrpc: '2.0',
|
|
82
|
+
id: CREDENTIAL_WIRE_VERIFY_ID,
|
|
83
|
+
method: 'account_verify'
|
|
84
|
+
});
|
|
85
|
+
/** An upgrade request's own header lines, with RFC 6455's sample key. */
|
|
86
|
+
export const WS_UPGRADE_HEADER_LINES = [
|
|
87
|
+
'Connection: Upgrade',
|
|
88
|
+
'Upgrade: websocket',
|
|
89
|
+
'Sec-WebSocket-Version: 13',
|
|
90
|
+
'Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ=='
|
|
91
|
+
];
|
|
92
|
+
/** How long an accepted socket has to answer its `account_verify` frame. */
|
|
93
|
+
const VERIFY_FRAME_TIMEOUT_MS = 5_000;
|
|
94
|
+
/**
|
|
95
|
+
* The credential an `account_verify` envelope names, by the account it
|
|
96
|
+
* answers as.
|
|
97
|
+
*
|
|
98
|
+
* @param suite - the calling suite, named in the throw
|
|
99
|
+
* @throws Error when the backend has no `account_verify` there — a missing requirement, not a row's failure
|
|
100
|
+
*/
|
|
101
|
+
export const credential_of_verify_envelope = (envelope, accounts, where, suite) => {
|
|
102
|
+
const { result, error } = (envelope ?? {});
|
|
103
|
+
if (error?.code === JSONRPC_ERROR_CODES.method_not_found) {
|
|
104
|
+
throw new Error(`${suite}: the backend answers method_not_found for account_verify on ${where} — ` +
|
|
105
|
+
'the suite reads which credential authenticated from it');
|
|
106
|
+
}
|
|
107
|
+
const account = parse(SessionAccountJson, result);
|
|
108
|
+
if (!account.ok)
|
|
109
|
+
return { unexpected: 'an answer whose result is no account' };
|
|
110
|
+
switch (account.value.id) {
|
|
111
|
+
case accounts.session.account.id:
|
|
112
|
+
return CREDENTIAL_TYPE_SESSION;
|
|
113
|
+
case accounts.bearer.account.id:
|
|
114
|
+
return CREDENTIAL_TYPE_API_TOKEN;
|
|
115
|
+
case accounts.keeper_id:
|
|
116
|
+
return CREDENTIAL_TYPE_DAEMON_TOKEN;
|
|
117
|
+
default:
|
|
118
|
+
return { unexpected: 'an account behind none of the three credentials' };
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* `POST` `account_verify` to `rpc_path` carrying `header_lines` (and
|
|
123
|
+
* `Connection: close`), read until the server closes.
|
|
124
|
+
*/
|
|
125
|
+
export const send_raw_verify = async (request) => {
|
|
126
|
+
const { received } = await raw_http_exchange(request.base_url, raw_http_request({
|
|
127
|
+
method: 'POST',
|
|
128
|
+
path: request.rpc_path,
|
|
129
|
+
host: request.host,
|
|
130
|
+
header_lines: [...request.header_lines, 'Connection: close'],
|
|
131
|
+
body: CREDENTIAL_WIRE_VERIFY_BODY
|
|
132
|
+
}), { read_timeout_ms: RAW_HTTP_READ_TIMEOUT_MS });
|
|
133
|
+
return { received, response: raw_http_parse_response(received) };
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* The credential an RPC `account_verify` response names; `null` for a 401.
|
|
137
|
+
*
|
|
138
|
+
* @param suite - the calling suite, named in a throw
|
|
139
|
+
*/
|
|
140
|
+
export const credential_of_verify_response = (response, accounts, rpc_path, suite) => {
|
|
141
|
+
if (response.status === 401)
|
|
142
|
+
return null;
|
|
143
|
+
const envelope = raw_http_parse_json(response.body);
|
|
144
|
+
const credential = credential_of_verify_envelope(envelope, accounts, `the RPC endpoint (${rpc_path})`, suite);
|
|
145
|
+
if (response.status !== 200)
|
|
146
|
+
return { unexpected: `status ${response.status}` };
|
|
147
|
+
return credential;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Send a WebSocket upgrade to `ws_path` carrying `header_lines` after the
|
|
151
|
+
* upgrade's own lines, and read the first response — for an upgrade the
|
|
152
|
+
* caller expects refused.
|
|
153
|
+
*/
|
|
154
|
+
export const send_raw_upgrade = async (request) => {
|
|
155
|
+
const { received } = await raw_http_exchange(request.base_url, raw_http_request({
|
|
156
|
+
method: 'GET',
|
|
157
|
+
path: request.ws_path,
|
|
158
|
+
host: request.host,
|
|
159
|
+
header_lines: [...WS_UPGRADE_HEADER_LINES, ...request.header_lines]
|
|
160
|
+
}), { read_timeout_ms: RAW_HTTP_READ_TIMEOUT_MS, until: 'response' });
|
|
161
|
+
return { received, response: raw_http_parse_response(received) };
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Ask an accepted socket who it is: send `account_verify` and read the
|
|
165
|
+
* credential its answer names.
|
|
166
|
+
*
|
|
167
|
+
* @param suite - the calling suite, named in a throw
|
|
168
|
+
* @returns the credential, or why none could be read
|
|
169
|
+
*/
|
|
170
|
+
export const verify_socket_credential = async (client, accounts, ws_path, suite) => {
|
|
171
|
+
client.send_text(CREDENTIAL_WIRE_VERIFY_BODY);
|
|
172
|
+
let frame;
|
|
173
|
+
try {
|
|
174
|
+
frame = await client.wait_for((candidate) => is_raw_ws_close(candidate) ||
|
|
175
|
+
(candidate.opcode === RAW_WS_OPCODE_TEXT &&
|
|
176
|
+
raw_http_parse_json(candidate.payload.toString('utf-8'))
|
|
177
|
+
?.id === CREDENTIAL_WIRE_VERIFY_ID), VERIFY_FRAME_TIMEOUT_MS);
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
return { failure: 'the accepted socket never answered account_verify' };
|
|
181
|
+
}
|
|
182
|
+
if (is_raw_ws_close(frame)) {
|
|
183
|
+
return { failure: 'the accepted socket closed instead of answering account_verify' };
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
credential: credential_of_verify_envelope(raw_http_parse_json(frame.payload.toString('utf-8')), accounts, `the WebSocket endpoint (${ws_path}), which capabilities.ws_account_actions says mounts it`, suite)
|
|
187
|
+
};
|
|
188
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default_backend_configs.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/default_backend_configs.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAA8B,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAiBlG;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,cAAc,CAAC;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,mBAAmB,MAAM,KAAG,MAS/D,CAAC;AAcF,2CAA2C;AAC3C,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAC5C,QAAQ,CAAC,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACjD;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GACjC,SAAS,yBAAyB,KAChC,MAAM,CAAC,MAAM,EAAE,MAAM,CAKtB,CAAC;AAEH,gCAAgC;AAChC,MAAM,WAAW,gBAAgB;IAChC,oFAAoF;IACpF,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,6EAA6E;IAC7E,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IACxC,iFAAiF;IACjF,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACzC,4FAA4F;IAC5F,QAAQ,CAAC,4BAA4B,CAAC,EAAE,MAAM,CAAC;CAC/C;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,gBAAgB,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAc1E,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"default_backend_configs.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/default_backend_configs.ts"],"names":[],"mappings":"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"}
|
|
@@ -120,7 +120,18 @@ export const ts_default_capabilities = Object.freeze({
|
|
|
120
120
|
ws_handshake_pipelining: true,
|
|
121
121
|
// `@hono/node-server` drops a refused upgrade's body, so a Node-served backend
|
|
122
122
|
// sends none. A Bun-served one overrides to `true`.
|
|
123
|
-
ws_refusal_body: false
|
|
123
|
+
ws_refusal_body: false,
|
|
124
|
+
// `@hono/node-server` answers an upgrade whose first `Host` line is empty
|
|
125
|
+
// with a bodiless 400 before the app runs. A Bun-served one overrides to `[]`.
|
|
126
|
+
ws_upgrade_runtime_refusals: Object.freeze(['empty_host']),
|
|
127
|
+
// Node builds the request's URL by the WHATWG parser, dot segments resolved;
|
|
128
|
+
// Bun does the same.
|
|
129
|
+
runtime_resolves_dot_segments: true,
|
|
130
|
+
// `create_app_server`'s unmatched-route handler answers outside `/api`
|
|
131
|
+
// unless the backend mounts a static fallback of its own there.
|
|
132
|
+
spine_fallback: true,
|
|
133
|
+
// `create_app_server` mounts the host gate unless `host_gate: false`.
|
|
134
|
+
host_gate: true
|
|
124
135
|
});
|
|
125
136
|
/**
|
|
126
137
|
* Capabilities for the Rust family — only what the family guarantees, as with
|
|
@@ -139,7 +150,16 @@ export const rust_default_capabilities = Object.freeze({
|
|
|
139
150
|
// stream, where they wait for the read loop that starts at admission.
|
|
140
151
|
ws_handshake_pipelining: true,
|
|
141
152
|
// axum sends a refused upgrade's response as built, body included.
|
|
142
|
-
ws_refusal_body: true
|
|
153
|
+
ws_refusal_body: true,
|
|
154
|
+
// hyper hands an upgrade with an empty `Host` to the host gate.
|
|
155
|
+
ws_upgrade_runtime_refusals: Object.freeze([]),
|
|
156
|
+
// axum routes the raw path, dot segments kept.
|
|
157
|
+
runtime_resolves_dot_segments: false,
|
|
158
|
+
// `fuz_actions::server::fallback_group` answers outside `/api` unless the
|
|
159
|
+
// backend's fallback group is its own.
|
|
160
|
+
spine_fallback: true,
|
|
161
|
+
// `compose_stack` mounts the host gate unless `StackOptions::host_gate` is off.
|
|
162
|
+
host_gate: true
|
|
143
163
|
});
|
|
144
164
|
/** Bootstrap block built from the default secrets + supplied paths. */
|
|
145
165
|
const build_default_bootstrap = (paths, overrides) => ({
|
|
@@ -17,7 +17,6 @@ import '../assert_dev_env.js';
|
|
|
17
17
|
* @module
|
|
18
18
|
*/
|
|
19
19
|
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
20
|
-
import type { NotificationSender } from '../../auth/role_grant_offer_notifications.js';
|
|
21
20
|
import { type RoleRegistry } from '../../auth/role_schema.js';
|
|
22
21
|
import { type SessionOptions } from '../../auth/session_cookie.js';
|
|
23
22
|
import { type RouteSpec } from '../../http/route_spec.js';
|
|
@@ -40,26 +39,6 @@ export declare const spine_session_options: SessionOptions<string>;
|
|
|
40
39
|
* (`admin_account_list.grantable_roles` carries it on both spines).
|
|
41
40
|
*/
|
|
42
41
|
export declare const spine_roles: RoleRegistry;
|
|
43
|
-
/** Options for `spine_rpc_endpoints`. */
|
|
44
|
-
export interface SpineRpcEndpointsOptions {
|
|
45
|
-
/**
|
|
46
|
-
* WS notification sender threaded into the role-grant-offer sub-factory for
|
|
47
|
-
* server-initiated fan-out (`role_grant_offer_received` / `_accepted` /
|
|
48
|
-
* `_declined` / `_retracted` / `_supersede`, flat `role_grant_revoked`).
|
|
49
|
-
*
|
|
50
|
-
* **Shared-instance trap.** Pass the SAME `ConnectionRegistry`
|
|
51
|
-
* instance the WS endpoint registers connections against — the registry
|
|
52
|
-
* *is* the fan-out target, so a separate instance would fan out to an
|
|
53
|
-
* empty registry and reach nobody (silently). The TS spine binary
|
|
54
|
-
* constructs one `ConnectionRegistry` and threads it both here and into
|
|
55
|
-
* `register_action_ws`.
|
|
56
|
-
*
|
|
57
|
-
* Omitted (the default) for the shared `create_spine_surface_spec` path —
|
|
58
|
-
* surface generation doesn't depend on it, and it must stay absent there so
|
|
59
|
-
* the declared snapshot is unaffected.
|
|
60
|
-
*/
|
|
61
|
-
readonly notification_sender?: NotificationSender | null;
|
|
62
|
-
}
|
|
63
42
|
/**
|
|
64
43
|
* Factory-form RPC endpoints over the per-test `ctx.deps`. `create_app_server`
|
|
65
44
|
* (in the binary) owns live dispatch; the surface builder invokes the factory
|
|
@@ -70,12 +49,8 @@ export interface SpineRpcEndpointsOptions {
|
|
|
70
49
|
* `actions` (see `testing/cross_backend/testing_reset_actions.ts`); it is intentionally excluded
|
|
71
50
|
* here so it stays off the declared surface (the harness calls it directly
|
|
72
51
|
* over the daemon-token channel).
|
|
73
|
-
*
|
|
74
|
-
* `options.notification_sender`, when supplied, reaches the role-grant-offer
|
|
75
|
-
* sub-factory so the spine emits the WS notification family — see
|
|
76
|
-
* `SpineRpcEndpointsOptions`.
|
|
77
52
|
*/
|
|
78
|
-
export declare const spine_rpc_endpoints: (ctx: AppServerContext
|
|
53
|
+
export declare const spine_rpc_endpoints: (ctx: AppServerContext) => Array<RpcEndpointSpec>;
|
|
79
54
|
/**
|
|
80
55
|
* Account REST + signup route specs under `/api/account` (bootstrap
|
|
81
56
|
* auto-mounted by the surface builder / `create_app_server`), plus the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default_spine_surface.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/default_spine_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAItD,OAAO,
|
|
1
|
+
{"version":3,"file":"default_spine_surface.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/default_spine_surface.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAItD,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI1F,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAgB3E;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,MAAM,CAAwC,CAAC;AAElG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,EAAE,YAGxB,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAI,KAAK,gBAAgB,KAAG,KAAK,CAAC,eAAe,CAKhF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,GAAI,KAAK,gBAAgB,KAAG,KAAK,CAAC,SAAS,CAgC/E,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,GAAI,MAAM,MAAM,KAAG,SAC+B,CAAC;AAE7F;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,QAAO,cAS1C,CAAC"}
|
|
@@ -12,7 +12,7 @@ import { create_test_app_surface_spec } from '../stubs.js';
|
|
|
12
12
|
// Pure path / role / fixture-URL constants live on the hono-free
|
|
13
13
|
// `spine_surface_constants.ts` leaf so cross-process suite modules can import them
|
|
14
14
|
// without dragging this module's eager in-process route handlers
|
|
15
|
-
// (→ `
|
|
15
|
+
// (→ `audit_log_routes` → `hono/streaming`). Import only the constants this
|
|
16
16
|
// module uses internally; callers that need a bare constant reach for the leaf.
|
|
17
17
|
import { SPINE_ACCOUNT_PATH_PREFIX, SPINE_CELL_EDITOR_ROLE, SPINE_EXPECTED_SCHEMA_URL, SPINE_PARTICIPANT_ROLE, SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
18
18
|
/**
|
|
@@ -45,15 +45,11 @@ export const spine_roles = create_role_registry([
|
|
|
45
45
|
* `actions` (see `testing/cross_backend/testing_reset_actions.ts`); it is intentionally excluded
|
|
46
46
|
* here so it stays off the declared surface (the harness calls it directly
|
|
47
47
|
* over the daemon-token channel).
|
|
48
|
-
*
|
|
49
|
-
* `options.notification_sender`, when supplied, reaches the role-grant-offer
|
|
50
|
-
* sub-factory so the spine emits the WS notification family — see
|
|
51
|
-
* `SpineRpcEndpointsOptions`.
|
|
52
48
|
*/
|
|
53
|
-
export const spine_rpc_endpoints = (ctx
|
|
49
|
+
export const spine_rpc_endpoints = (ctx) => [
|
|
54
50
|
{
|
|
55
51
|
path: SPINE_RPC_PATH,
|
|
56
|
-
actions: create_standard_rpc_actions(
|
|
52
|
+
actions: create_standard_rpc_actions(ctx.deps, { roles: spine_roles })
|
|
57
53
|
}
|
|
58
54
|
];
|
|
59
55
|
/**
|
|
@@ -64,7 +64,7 @@ export interface KnownDivergencePath {
|
|
|
64
64
|
* A tracked, accepted difference between the two backends.
|
|
65
65
|
*
|
|
66
66
|
* `what_differs` lists the normalized-response paths that differ
|
|
67
|
-
* (`DifferentialDiff.path` — `status`, `headers.<name>`,
|
|
67
|
+
* (`DifferentialDiff.path` — `status`, `headers.<name>`, `session_cookie`,
|
|
68
68
|
* `body.error.data.reason`), each optionally with the value each side shows
|
|
69
69
|
* (`KnownDivergencePath`). A matched case may differ there and nowhere else.
|
|
70
70
|
* An entry naming cases must still differ on each of them; one naming
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"differential.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/differential.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"differential.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/differential.ts"],"names":[],"mappings":"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"}
|
|
@@ -8,7 +8,8 @@ import '../assert_dev_env.js';
|
|
|
8
8
|
* does any body difference on a case pinned by status alone.
|
|
9
9
|
* `describe_differential_conformance_tests` sends every case to two backends,
|
|
10
10
|
* normalizes both responses (`normalize_differential_response`), and asserts
|
|
11
|
-
* they are equal: status, header names,
|
|
11
|
+
* they are equal: status, header names, what each does to the session cookie,
|
|
12
|
+
* and the whole body.
|
|
12
13
|
*
|
|
13
14
|
* Each case runs on a fresh fixture per backend — each backend's own
|
|
14
15
|
* `setup_test`, so separate databases and separate keepers, which is why the
|
|
@@ -144,7 +145,7 @@ export const describe_differential_conformance_tests = (options) => {
|
|
|
144
145
|
resolved_rpc_endpoints,
|
|
145
146
|
request_headers: DIFFERENTIAL_REQUEST_HEADERS,
|
|
146
147
|
...(backend.ws && { ws: backend.ws })
|
|
147
|
-
}));
|
|
148
|
+
}), options.session_options.cookie_name);
|
|
148
149
|
describe(options.suite_name ?? 'differential conformance', () => {
|
|
149
150
|
// per entry: the cases it matched, the ones that ran to a diff, and
|
|
150
151
|
// whether any of them showed it
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
|
+
import { type SessionCookieEffect } from './session_cookie_effect.js';
|
|
2
3
|
/**
|
|
3
4
|
* Response normalization for the cross-backend differential.
|
|
4
5
|
*
|
|
@@ -39,6 +40,13 @@ import '../assert_dev_env.js';
|
|
|
39
40
|
* and the header values that are contracts are pinned per backend by the
|
|
40
41
|
* conformance table's `expect.headers` and its no-fingerprint floor. A
|
|
41
42
|
* header one backend sends and the other doesn't is still a difference.
|
|
43
|
+
* - **The session cookie's effect, classified.** Since `set-cookie` values are
|
|
44
|
+
* not compared, a clear and a mint would both read as the one header name;
|
|
45
|
+
* `session_cookie` is what the response does to the session cookie
|
|
46
|
+
* (`classify_session_cookie_effect`, the reading the conformance table
|
|
47
|
+
* asserts `expect.set_cookie` with), so one backend clearing where the other
|
|
48
|
+
* mints, or clearing where the other sends nothing, differs at
|
|
49
|
+
* `session_cookie`.
|
|
42
50
|
*
|
|
43
51
|
* `diff_differential_responses` lists every place two normalized responses
|
|
44
52
|
* differ, one entry per leaf path, which is what a known-divergence ledger
|
|
@@ -66,12 +74,19 @@ export interface DifferentialResponse {
|
|
|
66
74
|
readonly body: unknown;
|
|
67
75
|
/** Sorted response header names, minus `VOLATILE_HEADER_NAMES`. */
|
|
68
76
|
readonly header_names: ReadonlyArray<string>;
|
|
77
|
+
/**
|
|
78
|
+
* What the response does to the session cookie, `'unrecognized'` for lines
|
|
79
|
+
* of no shape `SessionCookieEffect` names.
|
|
80
|
+
*/
|
|
81
|
+
readonly session_cookie: SessionCookieEffect | 'unrecognized';
|
|
69
82
|
}
|
|
70
83
|
/** The raw response `normalize_differential_response` takes. */
|
|
71
84
|
export interface DifferentialRawResponse {
|
|
72
85
|
readonly status: number;
|
|
73
86
|
/** Header snapshot with lowercased names (`headers_to_record`'s shape). */
|
|
74
87
|
readonly headers: Readonly<Record<string, string>>;
|
|
88
|
+
/** Every `Set-Cookie` line, in order. */
|
|
89
|
+
readonly set_cookies: ReadonlyArray<string>;
|
|
75
90
|
readonly body: unknown;
|
|
76
91
|
}
|
|
77
92
|
/**
|
|
@@ -98,14 +113,16 @@ export declare const VOLATILE_VALUE_PATTERNS: ReadonlyArray<VolatileValuePattern
|
|
|
98
113
|
* Normalize one response into its `DifferentialResponse`. Pure; numbering
|
|
99
114
|
* restarts for every call.
|
|
100
115
|
*
|
|
101
|
-
* @param response - the raw status, header snapshot and JSON body
|
|
116
|
+
* @param response - the raw status, header snapshot, `Set-Cookie` lines and JSON body
|
|
117
|
+
* @param session_cookie_name - the session cookie's name, which `session_cookie` classifies
|
|
102
118
|
* @returns the canonical form
|
|
103
119
|
*/
|
|
104
|
-
export declare const normalize_differential_response: (response: DifferentialRawResponse) => DifferentialResponse;
|
|
120
|
+
export declare const normalize_differential_response: (response: DifferentialRawResponse, session_cookie_name: string) => DifferentialResponse;
|
|
105
121
|
/**
|
|
106
122
|
* One place two normalized responses differ. `path` is dotted from the
|
|
107
|
-
* response root (`status`, `headers.x-example`, `
|
|
108
|
-
* `body.result.accounts[0]`); `a` / `b` are the
|
|
123
|
+
* response root (`status`, `headers.x-example`, `session_cookie`,
|
|
124
|
+
* `body.error.data.reason`, `body.result.accounts[0]`); `a` / `b` are the
|
|
125
|
+
* values on each side,
|
|
109
126
|
* `undefined` where a side has nothing there. A header one side sent and the
|
|
110
127
|
* other didn't is `headers.<name>`, with `true` on the side that sent it.
|
|
111
128
|
* An object one side lacks is compared key by key, so each of its keys is its
|
|
@@ -119,8 +136,8 @@ export interface DifferentialDiff {
|
|
|
119
136
|
}
|
|
120
137
|
/**
|
|
121
138
|
* Every place two normalized responses differ, in a stable order: status,
|
|
122
|
-
* then header names, then the
|
|
123
|
-
* the responses are equal.
|
|
139
|
+
* then header names, then the session cookie's effect, then the body
|
|
140
|
+
* depth-first with keys sorted. Empty when the responses are equal.
|
|
124
141
|
*
|
|
125
142
|
* @param a - one backend's normalized response
|
|
126
143
|
* @param b - the other's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"differential_normalize.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/differential_normalize.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"differential_normalize.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/differential_normalize.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAEN,KAAK,mBAAmB,EACxB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACpC,mBAAmB;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,mBAAmB,GAAG,cAAc,CAAC;CAC9D;AAED,gEAAgE;AAChE,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,yCAAyC;IACzC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAMvD,CAAC;AAEF,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACpC,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC,oBAAoB,CAUvE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC3C,UAAU,uBAAuB,EACjC,qBAAqB,MAAM,KACzB,oBA4CF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;CACpB;AA6BD;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GACvC,GAAG,oBAAoB,EACvB,GAAG,oBAAoB,KACrB,KAAK,CAAC,gBAAgB,CAexB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,MAAM,EAAE,MAAM,MAAM,KAAG,OAEoB,CAAC;AAE9F;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACrC,OAAO,aAAa,CAAC,gBAAgB,CAAC,EACtC,QAAQ;IAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,KAChD,MAOU,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
|
+
import { classify_session_cookie_effect } from './session_cookie_effect.js';
|
|
2
3
|
/**
|
|
3
4
|
* Response headers left out of `header_names`: framing and per-request
|
|
4
5
|
* headers each HTTP server sets its own way, which say nothing about the
|
|
@@ -32,10 +33,11 @@ export const VOLATILE_VALUE_PATTERNS = [
|
|
|
32
33
|
* Normalize one response into its `DifferentialResponse`. Pure; numbering
|
|
33
34
|
* restarts for every call.
|
|
34
35
|
*
|
|
35
|
-
* @param response - the raw status, header snapshot and JSON body
|
|
36
|
+
* @param response - the raw status, header snapshot, `Set-Cookie` lines and JSON body
|
|
37
|
+
* @param session_cookie_name - the session cookie's name, which `session_cookie` classifies
|
|
36
38
|
* @returns the canonical form
|
|
37
39
|
*/
|
|
38
|
-
export const normalize_differential_response = (response) => {
|
|
40
|
+
export const normalize_differential_response = (response, session_cookie_name) => {
|
|
39
41
|
const seen = new Map();
|
|
40
42
|
const placeholder = (kind, value) => {
|
|
41
43
|
let values = seen.get(kind);
|
|
@@ -77,7 +79,8 @@ export const normalize_differential_response = (response) => {
|
|
|
77
79
|
header_names: Object.keys(response.headers)
|
|
78
80
|
.map((name) => name.toLowerCase())
|
|
79
81
|
.filter((name) => !VOLATILE_HEADER_NAMES.includes(name))
|
|
80
|
-
.sort()
|
|
82
|
+
.sort(),
|
|
83
|
+
session_cookie: classify_session_cookie_effect(response.set_cookies, session_cookie_name) ?? 'unrecognized'
|
|
81
84
|
};
|
|
82
85
|
};
|
|
83
86
|
const is_record = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
@@ -109,8 +112,8 @@ const diff_values = (path, a, b, out) => {
|
|
|
109
112
|
};
|
|
110
113
|
/**
|
|
111
114
|
* Every place two normalized responses differ, in a stable order: status,
|
|
112
|
-
* then header names, then the
|
|
113
|
-
* the responses are equal.
|
|
115
|
+
* then header names, then the session cookie's effect, then the body
|
|
116
|
+
* depth-first with keys sorted. Empty when the responses are equal.
|
|
114
117
|
*
|
|
115
118
|
* @param a - one backend's normalized response
|
|
116
119
|
* @param b - the other's
|
|
@@ -127,6 +130,9 @@ export const diff_differential_responses = (a, b) => {
|
|
|
127
130
|
out.push({ path: `headers.${name}`, a: in_a || undefined, b: in_b || undefined });
|
|
128
131
|
}
|
|
129
132
|
}
|
|
133
|
+
if (a.session_cookie !== b.session_cookie) {
|
|
134
|
+
out.push({ path: 'session_cookie', a: a.session_cookie, b: b.session_cookie });
|
|
135
|
+
}
|
|
130
136
|
diff_values('body', a.body, b.body, out);
|
|
131
137
|
return out;
|
|
132
138
|
};
|
|
@@ -15,6 +15,7 @@ import '../assert_dev_env.js';
|
|
|
15
15
|
* - the full cell verb set (CRUD + grant + field + item + audit),
|
|
16
16
|
* - the opt-in `actor_lookup` / `actor_search` resolvers,
|
|
17
17
|
* - the `_testing_origin_check` probe the origin conformance table drives,
|
|
18
|
+
* - the `_testing_credential_read` probe the credential conformance table drives,
|
|
18
19
|
* - the `_testing_shorten_credential_expiry` seam the credential-deadline
|
|
19
20
|
* suite drives,
|
|
20
21
|
* - the `_testing_room_evict` seam the rooms suite drives, over the room
|
|
@@ -44,7 +45,6 @@ import { ConnectionRegistry } from '../../actions/connection_registry.js';
|
|
|
44
45
|
import { RoomRegistry } from '../../actions/room_registry.js';
|
|
45
46
|
import type { AppDeps } from '../../auth/deps.js';
|
|
46
47
|
import type { DaemonTokenState } from '../../auth/daemon_token.js';
|
|
47
|
-
import type { NotificationSender } from '../../auth/role_grant_offer_notifications.js';
|
|
48
48
|
import type { RpcEndpointSpec } from '../../http/surface.js';
|
|
49
49
|
/**
|
|
50
50
|
* The spine binary's room registry over `connections`: exclusive — one seat
|
|
@@ -65,12 +65,6 @@ export interface FullSpineMountOptions {
|
|
|
65
65
|
* state satisfies it.
|
|
66
66
|
*/
|
|
67
67
|
readonly daemon_token_state: DaemonTokenState;
|
|
68
|
-
/**
|
|
69
|
-
* WS notification sender for the role-grant-offer fan-out. Pass the SAME
|
|
70
|
-
* `ConnectionRegistry` the WS endpoint registers connections against
|
|
71
|
-
* (the registry is the fan-out target). Omitted for enumeration.
|
|
72
|
-
*/
|
|
73
|
-
readonly notification_sender?: NotificationSender | null;
|
|
74
68
|
/**
|
|
75
69
|
* The room registry the room verbs and `_testing_room_evict` run on — built
|
|
76
70
|
* by `create_spine_room_registry` over the SAME `ConnectionRegistry` the WS
|
|
@@ -89,10 +83,10 @@ export interface FullSpineMountOptions {
|
|
|
89
83
|
* Mirrors the previous inline assembly in `testing_spine_server.ts` exactly —
|
|
90
84
|
* `session_options` is pinned to `spine_session_options` (the binary's cookie
|
|
91
85
|
* config) and `roles` to `spine_roles` (carrying `cell_editor`), so the only
|
|
92
|
-
* runtime-varying inputs are the daemon-token state
|
|
86
|
+
* runtime-varying inputs are the daemon-token state and the room registry.
|
|
93
87
|
*
|
|
94
88
|
* @param deps - the backend `AppDeps` (stub deps suffice for method enumeration)
|
|
95
|
-
* @param options - daemon-token state + optional
|
|
89
|
+
* @param options - daemon-token state + optional room registry
|
|
96
90
|
* @returns every `RpcAction` the binary exposes, in mount order
|
|
97
91
|
*/
|
|
98
92
|
export declare const build_full_spine_rpc_actions: (deps: AppDeps, options: FullSpineMountOptions) => Array<RpcAction>;
|
|
@@ -121,7 +115,7 @@ export interface FullSpineMount {
|
|
|
121
115
|
* (never dispatched) on Rust.
|
|
122
116
|
*
|
|
123
117
|
* @param deps - the backend `AppDeps`
|
|
124
|
-
* @param options - daemon-token state + optional
|
|
118
|
+
* @param options - daemon-token state + optional room registry
|
|
125
119
|
* @returns the RPC and WS action lists, built once and sharing handler instances
|
|
126
120
|
*/
|
|
127
121
|
export declare const build_full_spine_mount: (deps: AppDeps, options: FullSpineMountOptions) => FullSpineMount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full_spine_mount.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/full_spine_mount.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"full_spine_mount.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/full_spine_mount.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAS1E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAMnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA2C7D;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GAAI,aAAa,kBAAkB,KAAG,YAC1B,CAAC;AAEpD,6EAA6E;AAC7E,MAAM,WAAW,qBAAqB;IACrC;;;;;;OAMG;IACH,QAAQ,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;IAC9C;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;CACtC;AASD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,GACxC,MAAM,OAAO,EACb,SAAS,qBAAqB,KAC5B,KAAK,CAAC,SAAS,CAAwD,CAAC;AAyE3E,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC9B,gFAAgF;IAChF,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACnC;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GAClC,MAAM,OAAO,EACb,SAAS,qBAAqB,KAC5B,cAYF,CAAC;AAaF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,QAAO,KAAK,CAAC,eAAe,CAOvE,CAAC"}
|
|
@@ -14,6 +14,7 @@ import { CELL_DROP_TABLES } from '../../db/cell_ddl.js';
|
|
|
14
14
|
import { FACT_DROP_TABLES } from '../../db/fact_ddl.js';
|
|
15
15
|
import { create_testing_action_manifest_action, create_testing_actions, create_testing_room_evict_action, create_testing_shorten_credential_expiry_action } from './testing_reset_actions.js';
|
|
16
16
|
import { test_room_authorize } from './test_room_authorize.js';
|
|
17
|
+
import { create_testing_credential_read_action } from './testing_credential_read.js';
|
|
17
18
|
import { create_testing_origin_check_action } from './testing_origin_check.js';
|
|
18
19
|
import { test_cell_gated_create_authorize } from './test_cell_gated_create_authorize.js';
|
|
19
20
|
import { test_cell_grant_steward_revoke_authorize } from './test_cell_grant_steward_revoke_authorize.js';
|
|
@@ -57,10 +58,10 @@ export const create_spine_room_registry = (connections) => new RoomRegistry(conn
|
|
|
57
58
|
* Mirrors the previous inline assembly in `testing_spine_server.ts` exactly —
|
|
58
59
|
* `session_options` is pinned to `spine_session_options` (the binary's cookie
|
|
59
60
|
* config) and `roles` to `spine_roles` (carrying `cell_editor`), so the only
|
|
60
|
-
* runtime-varying inputs are the daemon-token state
|
|
61
|
+
* runtime-varying inputs are the daemon-token state and the room registry.
|
|
61
62
|
*
|
|
62
63
|
* @param deps - the backend `AppDeps` (stub deps suffice for method enumeration)
|
|
63
|
-
* @param options - daemon-token state + optional
|
|
64
|
+
* @param options - daemon-token state + optional room registry
|
|
64
65
|
* @returns every `RpcAction` the binary exposes, in mount order
|
|
65
66
|
*/
|
|
66
67
|
export const build_full_spine_rpc_actions = (deps, options) => build_full_spine_actions(deps, options).rpc_actions;
|
|
@@ -76,7 +77,7 @@ const build_full_spine_actions = (deps, options) => {
|
|
|
76
77
|
limiter: new RoomRateLimiter(DEFAULT_ROOM_RATE_LIMIT)
|
|
77
78
|
});
|
|
78
79
|
const actions = [
|
|
79
|
-
...create_standard_rpc_actions(
|
|
80
|
+
...create_standard_rpc_actions(deps, { roles: spine_roles }),
|
|
80
81
|
...create_testing_actions(deps, {
|
|
81
82
|
session_options: spine_session_options,
|
|
82
83
|
daemon_token_state: options.daemon_token_state,
|
|
@@ -102,6 +103,12 @@ const build_full_spine_actions = (deps, options) => {
|
|
|
102
103
|
// the origin conformance table's probe — kept out of
|
|
103
104
|
// `create_testing_actions` (see its spec doc)
|
|
104
105
|
create_testing_origin_check_action(),
|
|
106
|
+
// the credential conformance table's probe, over the binary's keyring and
|
|
107
|
+
// cookie name — out of `create_testing_actions` for the same reason
|
|
108
|
+
create_testing_credential_read_action({
|
|
109
|
+
keyring: deps.keyring,
|
|
110
|
+
session_options: spine_session_options
|
|
111
|
+
}),
|
|
105
112
|
// the credential-deadline suite's shorten-only seam — kept out of
|
|
106
113
|
// `create_testing_actions` for the same reason
|
|
107
114
|
create_testing_shorten_credential_expiry_action(),
|
|
@@ -134,7 +141,7 @@ const build_full_spine_actions = (deps, options) => {
|
|
|
134
141
|
* (never dispatched) on Rust.
|
|
135
142
|
*
|
|
136
143
|
* @param deps - the backend `AppDeps`
|
|
137
|
-
* @param options - daemon-token state + optional
|
|
144
|
+
* @param options - daemon-token state + optional room registry
|
|
138
145
|
* @returns the RPC and WS action lists, built once and sharing handler instances
|
|
139
146
|
*/
|
|
140
147
|
export const build_full_spine_mount = (deps, options) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity_parity.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/identity_parity.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"identity_parity.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/identity_parity.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA8H9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA0B5C,uDAAuD;AACvD,MAAM,WAAW,8BAA8B;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,oFAAoF;IACpF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAsKD,eAAO,MAAM,oCAAoC,GAChD,SAAS,8BAA8B,KACrC,IA6gBF,CAAC"}
|
|
@@ -104,6 +104,10 @@ import '../assert_dev_env.js';
|
|
|
104
104
|
* cross-process leg (`cross_backend/spine_suites.cross.test.ts`, the TS spine
|
|
105
105
|
* binaries + Rust `testing_spine_stub` over real HTTP).
|
|
106
106
|
*
|
|
107
|
+
* The accepted-case rows answer 403 no-matching-invite, so a backend with a
|
|
108
|
+
* signup denial floor pays it per row; the spine surface zeroes
|
|
109
|
+
* `signup_fail_floor_ms`.
|
|
110
|
+
*
|
|
107
111
|
* @module
|
|
108
112
|
*/
|
|
109
113
|
import { describe, test, assert } from 'vitest';
|