@fuzdev/fuz_app 0.149.0 → 0.151.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/actions/CLAUDE.md +327 -300
- package/dist/actions/action_bridge.d.ts +5 -79
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +4 -74
- package/dist/actions/action_codegen.d.ts +8 -166
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +19 -95
- package/dist/actions/action_dispatcher.d.ts +10 -0
- package/dist/actions/action_dispatcher.d.ts.map +1 -1
- package/dist/actions/action_dispatcher.js +9 -6
- package/dist/actions/action_event.d.ts +1 -2
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +7 -13
- package/dist/actions/action_event_helpers.d.ts +1 -40
- package/dist/actions/action_event_helpers.d.ts.map +1 -1
- package/dist/actions/action_event_helpers.js +1 -25
- package/dist/actions/action_event_types.d.ts +1 -1
- package/dist/actions/action_event_types.d.ts.map +1 -1
- package/dist/actions/action_rpc.d.ts +10 -215
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +56 -111
- package/dist/actions/action_spec.d.ts +2 -2
- package/dist/actions/action_spec.js +2 -2
- package/dist/actions/action_types.d.ts +229 -8
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +56 -5
- package/dist/actions/broadcast_api.d.ts +22 -17
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/broadcast_api.js +16 -27
- package/dist/actions/cancel.d.ts +4 -13
- package/dist/actions/cancel.d.ts.map +1 -1
- package/dist/actions/cancel.js +5 -17
- package/dist/actions/compile_action_registry.d.ts +1 -2
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/connection_closer.d.ts +120 -50
- package/dist/actions/connection_closer.d.ts.map +1 -1
- package/dist/actions/connection_closer.js +139 -31
- package/dist/actions/{transports_ws_backend.d.ts → connection_registry.d.ts} +120 -132
- package/dist/actions/connection_registry.d.ts.map +1 -0
- package/dist/actions/{transports_ws_backend.js → connection_registry.js} +149 -152
- package/dist/actions/frontend_rpc_client.d.ts +52 -2
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +42 -4
- package/dist/actions/peer_ping.d.ts +7 -9
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_ping.js +6 -8
- package/dist/actions/peer_request.d.ts +6 -5
- package/dist/actions/peer_request.d.ts.map +1 -1
- package/dist/actions/peer_request.js +6 -5
- package/dist/actions/perform_action.d.ts +36 -28
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +60 -31
- package/dist/actions/protocol.d.ts +14 -0
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +18 -0
- package/dist/actions/register_action_ws.d.ts +137 -292
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +155 -903
- package/dist/actions/socket.svelte.d.ts +9 -0
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/socket.svelte.js +16 -5
- package/dist/actions/transports.d.ts +88 -34
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +76 -76
- package/dist/actions/transports_http.d.ts +48 -12
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_http.js +75 -44
- package/dist/actions/transports_ws.d.ts +29 -0
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/transports_ws.js +34 -8
- package/dist/actions/ws_endpoint_spec.d.ts +53 -76
- package/dist/actions/ws_endpoint_spec.d.ts.map +1 -1
- package/dist/actions/ws_endpoint_spec.js +27 -10
- package/dist/actions/ws_outbound_writer.d.ts +3 -3
- package/dist/actions/ws_outbound_writer.js +3 -3
- package/dist/actions/ws_socket_session.d.ts +321 -0
- package/dist/actions/ws_socket_session.d.ts.map +1 -0
- package/dist/actions/ws_socket_session.js +783 -0
- package/dist/auth/CLAUDE.md +132 -68
- package/dist/auth/account_action_specs.d.ts +2 -0
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_actions.d.ts +1 -1
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +9 -3
- package/dist/auth/account_queries.d.ts +10 -0
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +27 -17
- package/dist/auth/account_routes.d.ts +2 -1
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +14 -17
- package/dist/auth/account_schema.d.ts +5 -5
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +5 -2
- package/dist/auth/actor_lookup_actions.d.ts +1 -1
- package/dist/auth/actor_lookup_actions.d.ts.map +1 -1
- package/dist/auth/actor_lookup_actions.js +1 -1
- package/dist/auth/actor_lookup_queries.d.ts +3 -2
- package/dist/auth/actor_lookup_queries.d.ts.map +1 -1
- package/dist/auth/actor_lookup_queries.js +6 -3
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.js +2 -1
- package/dist/auth/actor_search_actions.d.ts +1 -1
- package/dist/auth/actor_search_actions.d.ts.map +1 -1
- package/dist/auth/actor_search_actions.js +1 -1
- package/dist/auth/actor_search_queries.d.ts +10 -7
- package/dist/auth/actor_search_queries.d.ts.map +1 -1
- package/dist/auth/actor_search_queries.js +18 -11
- package/dist/auth/admin_action_specs.d.ts +4 -4
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +7 -5
- package/dist/auth/admin_actions.d.ts +1 -1
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +47 -48
- package/dist/auth/all_cell_actions.d.ts +14 -3
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.js +2 -1
- package/dist/auth/api_token_queries.d.ts +1 -0
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +1 -0
- package/dist/auth/audit_emitter.d.ts +12 -6
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +11 -5
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +3 -2
- package/dist/auth/audit_log_routes.d.ts +20 -11
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +49 -29
- package/dist/auth/audit_log_schema.d.ts +14 -21
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +19 -23
- package/dist/auth/bearer_auth.d.ts +7 -4
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +21 -15
- package/dist/auth/bootstrap_account.d.ts +25 -1
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +37 -4
- package/dist/auth/bootstrap_routes.d.ts +3 -2
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +5 -4
- package/dist/auth/cell_action_helpers.d.ts +89 -0
- package/dist/auth/cell_action_helpers.d.ts.map +1 -0
- package/dist/auth/cell_action_helpers.js +113 -0
- package/dist/auth/cell_action_specs.d.ts +215 -15
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.js +103 -16
- package/dist/auth/cell_actions.d.ts +58 -27
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +206 -161
- package/dist/auth/cell_audit_actions.d.ts +1 -1
- package/dist/auth/cell_audit_actions.d.ts.map +1 -1
- package/dist/auth/cell_audit_actions.js +3 -12
- package/dist/auth/cell_audit_events.d.ts +1 -1
- package/dist/auth/cell_audit_events.d.ts.map +1 -1
- package/dist/auth/cell_audit_events.js +3 -2
- package/dist/auth/cell_audit_metadata.d.ts +12 -1
- package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.js +11 -1
- package/dist/auth/cell_field_actions.d.ts +1 -1
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.js +16 -66
- package/dist/auth/cell_grant_action_specs.d.ts +9 -2
- package/dist/auth/cell_grant_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_grant_action_specs.js +10 -3
- package/dist/auth/cell_grant_actions.d.ts +105 -11
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +81 -56
- package/dist/auth/cell_grant_audit_metadata.d.ts +6 -3
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_grant_audit_metadata.js +7 -4
- package/dist/auth/cell_item_actions.d.ts +1 -1
- package/dist/auth/cell_item_actions.d.ts.map +1 -1
- package/dist/auth/cell_item_actions.js +21 -82
- package/dist/auth/cleanup.d.ts +1 -1
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +6 -3
- package/dist/auth/credential_deadline.d.ts +3 -3
- package/dist/auth/credential_deadline.js +3 -3
- package/dist/auth/credential_type_schema.d.ts +8 -7
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +8 -7
- package/dist/auth/daemon_token_middleware.d.ts +12 -6
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +28 -17
- package/dist/auth/deps.d.ts +4 -4
- package/dist/auth/fail_floor.d.ts +55 -0
- package/dist/auth/fail_floor.d.ts.map +1 -0
- package/dist/auth/fail_floor.js +63 -0
- package/dist/auth/invite_queries.d.ts +3 -15
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +3 -21
- package/dist/auth/middleware.d.ts +12 -7
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +42 -29
- package/dist/auth/migrations.d.ts +5 -33
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +9 -16
- package/dist/auth/request_context.d.ts +101 -71
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +137 -140
- package/dist/auth/resolved_auth.d.ts +122 -36
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +89 -38
- package/dist/auth/role_grant_offer_action_specs.d.ts +117 -16
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +51 -16
- package/dist/auth/role_grant_offer_actions.d.ts +22 -11
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +72 -19
- package/dist/auth/role_grant_offer_notifications.d.ts +6 -5
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +4 -3
- package/dist/auth/role_grant_offer_queries.d.ts +20 -5
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +40 -37
- package/dist/auth/role_grant_queries.d.ts +44 -76
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +73 -118
- package/dist/auth/role_grant_sql.d.ts +42 -0
- package/dist/auth/role_grant_sql.d.ts.map +1 -0
- package/dist/auth/role_grant_sql.js +54 -0
- package/dist/auth/role_schema.d.ts +14 -8
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +6 -3
- package/dist/auth/scope_kind_schema.d.ts +1 -1
- package/dist/auth/scope_kind_schema.js +1 -1
- package/dist/auth/self_service_role_actions.d.ts +1 -1
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +21 -1
- package/dist/auth/session_queries.d.ts +2 -1
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +2 -1
- package/dist/auth/signup_routes.d.ts +2 -1
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +14 -13
- package/dist/auth/standard_rpc_actions.d.ts +1 -1
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/token_scope.d.ts +19 -46
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +23 -41
- package/dist/db/CLAUDE.md +18 -6
- package/dist/db/cell_ddl.d.ts +5 -134
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +28 -17
- package/dist/db/cell_field_queries.d.ts +0 -13
- package/dist/db/cell_field_queries.d.ts.map +1 -1
- package/dist/db/cell_field_queries.js +0 -16
- package/dist/db/cell_grant_queries.d.ts +10 -5
- package/dist/db/cell_grant_queries.d.ts.map +1 -1
- package/dist/db/cell_grant_queries.js +13 -7
- package/dist/db/cell_item_queries.d.ts +0 -7
- package/dist/db/cell_item_queries.d.ts.map +1 -1
- package/dist/db/cell_item_queries.js +0 -10
- package/dist/db/cell_queries.d.ts +65 -55
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +85 -62
- package/dist/db/cell_view_sql.d.ts +1 -6
- package/dist/db/cell_view_sql.d.ts.map +1 -1
- package/dist/db/cell_view_sql.js +1 -2
- package/dist/db/fact_ddl.d.ts +5 -30
- package/dist/db/fact_ddl.d.ts.map +1 -1
- package/dist/db/fact_ddl.js +14 -13
- package/dist/db/fact_store.d.ts +11 -0
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/fact_store.js +4 -1
- package/dist/db/migrate.d.ts +44 -6
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +63 -4
- package/dist/dev/setup.d.ts +18 -14
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +42 -39
- package/dist/env/dotenv.d.ts +2 -2
- package/dist/env/dotenv.js +2 -2
- package/dist/env/update_env_variable.d.ts +33 -21
- package/dist/env/update_env_variable.d.ts.map +1 -1
- package/dist/env/update_env_variable.js +54 -35
- package/dist/hono_context.d.ts +15 -90
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +9 -56
- package/dist/http/CLAUDE.md +35 -20
- package/dist/http/auth_shape.d.ts +1 -8
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +6 -12
- package/dist/http/body_limit.d.ts +3 -1
- package/dist/http/body_limit.d.ts.map +1 -1
- package/dist/http/body_limit.js +6 -1
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +3 -2
- package/dist/http/db_routes.d.ts +3 -3
- package/dist/http/db_routes.js +3 -3
- package/dist/http/error_schemas.d.ts +1 -2
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +1 -2
- package/dist/http/health_schema.d.ts +16 -0
- package/dist/http/health_schema.d.ts.map +1 -0
- package/dist/http/health_schema.js +12 -0
- package/dist/http/jsonrpc.d.ts +9 -0
- package/dist/http/jsonrpc.d.ts.map +1 -1
- package/dist/http/jsonrpc.js +17 -0
- package/dist/http/jsonrpc_errors.d.ts +22 -2
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +70 -23
- package/dist/http/jsonrpc_helpers.d.ts +60 -17
- package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
- package/dist/http/jsonrpc_helpers.js +67 -25
- package/dist/http/origin.d.ts +30 -1
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +46 -9
- package/dist/http/origin_wildcard.d.ts +97 -0
- package/dist/http/origin_wildcard.d.ts.map +1 -0
- package/dist/http/origin_wildcard.js +142 -0
- package/dist/http/pending_effects.d.ts +28 -0
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +32 -1
- package/dist/http/proxy.d.ts +4 -2
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +7 -2
- package/dist/http/route_spec.d.ts +4 -3
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +54 -45
- package/dist/http/surface.d.ts +4 -2
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +7 -4
- package/dist/http/surface_query.d.ts +9 -50
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +48 -94
- package/dist/realtime/audit_log_sse.d.ts +180 -0
- package/dist/realtime/audit_log_sse.d.ts.map +1 -0
- package/dist/realtime/audit_log_sse.js +154 -0
- package/dist/realtime/sse.d.ts +21 -6
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +33 -10
- package/dist/realtime/sse_constants.d.ts +29 -2
- package/dist/realtime/sse_constants.d.ts.map +1 -1
- package/dist/realtime/sse_constants.js +35 -2
- package/dist/realtime/{subscriber_registry.d.ts → sse_registry.d.ts} +12 -12
- package/dist/realtime/sse_registry.d.ts.map +1 -0
- package/dist/realtime/{subscriber_registry.js → sse_registry.js} +4 -4
- package/dist/schema_meta.d.ts +52 -1
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +123 -6
- package/dist/sensitivity.d.ts +9 -3
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/sensitivity.js +3 -2
- package/dist/server/app_backend.d.ts +8 -5
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +6 -12
- package/dist/server/app_server.d.ts +73 -54
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +115 -78
- package/dist/server/app_server_context.d.ts +1 -1
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.d.ts +24 -20
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +24 -34
- package/dist/server/serve_fact_route.d.ts +12 -16
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +59 -34
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/static.js +2 -2
- package/dist/testing/CLAUDE.md +213 -179
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +10 -19
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +8 -0
- package/dist/testing/app_server.d.ts +9 -75
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +31 -112
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +3 -4
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +4 -5
- package/dist/testing/auth_apps.d.ts +3 -3
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +9 -6
- package/dist/testing/connection_closer_helpers.d.ts +8 -16
- package/dist/testing/connection_closer_helpers.d.ts.map +1 -1
- package/dist/testing/connection_closer_helpers.js +7 -20
- package/dist/testing/cross_backend/action_manifest.d.ts +15 -4
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +13 -3
- package/dist/testing/cross_backend/action_manifest_parity.d.ts +15 -7
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest_parity.js +8 -1
- package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -1
- package/dist/testing/cross_backend/actor_lookup.js +27 -0
- package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size.js +25 -22
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts +22 -3
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
- package/dist/testing/cross_backend/build_test_backend_paths.js +34 -11
- package/dist/testing/cross_backend/capabilities.d.ts +15 -8
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_gated_create.js +109 -13
- package/dist/testing/cross_backend/cell_grant_role.js +2 -2
- package/dist/testing/cross_backend/cell_grant_steward.d.ts +4 -0
- package/dist/testing/cross_backend/cell_grant_steward.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_grant_steward.js +120 -0
- package/dist/testing/cross_backend/cell_moderate.d.ts +7 -1
- package/dist/testing/cross_backend/cell_moderate.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_moderate.js +68 -4
- package/dist/testing/cross_backend/cell_ref_admission.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_ref_admission.js +18 -9
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +21 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +6 -1
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +12 -10
- package/dist/testing/cross_backend/default_backend_configs.d.ts +18 -4
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +29 -9
- package/dist/testing/cross_backend/default_spine_surface.d.ts +7 -7
- package/dist/testing/cross_backend/default_spine_surface.js +2 -2
- package/dist/testing/cross_backend/differential.d.ts +7 -0
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +17 -0
- package/dist/testing/cross_backend/expected_schema.json +1 -0
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +48 -0
- package/dist/testing/cross_backend/full_spine_mount.d.ts +3 -4
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +13 -5
- package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_scope.js +5 -13
- package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +29 -4
- package/dist/testing/cross_backend/postgres_database.d.ts +32 -0
- package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -1
- package/dist/testing/cross_backend/postgres_database.js +56 -1
- package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
- package/dist/testing/cross_backend/query_shape.js +18 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +96 -2
- package/dist/testing/cross_backend/rpc_success_fixtures.js +2 -2
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts +17 -5
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +5 -4
- package/dist/testing/cross_backend/session_cap.d.ts +8 -0
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +66 -2
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +5 -4
- package/dist/testing/cross_backend/spine_suites.d.ts +4 -1
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +21 -0
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +22 -7
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +22 -7
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +4 -3
- package/dist/testing/cross_backend/standard.d.ts +6 -12
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts +18 -19
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts.map +1 -1
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.js +66 -42
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts +8 -0
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts.map +1 -0
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.js +22 -0
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +4 -6
- package/dist/testing/cross_backend/testing_origin_check.d.ts +1 -1
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.js +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +10 -5
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +7 -6
- package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.js +5 -4
- package/dist/testing/cross_backend/testing_server_core.d.ts +6 -7
- package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_core.js +1 -1
- package/dist/testing/cross_backend/testing_server_node.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_node.js +13 -2
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +68 -0
- package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +48 -6
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +16 -2
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +11 -8
- package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_action_rate_limit.js +30 -12
- package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_connection_cap.js +5 -7
- package/dist/testing/cross_backend/ws_endpoint.d.ts +2 -3
- package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_envelope.d.ts +17 -0
- package/dist/testing/cross_backend/ws_envelope.d.ts.map +1 -0
- package/dist/testing/cross_backend/ws_envelope.js +172 -0
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts +16 -0
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_inbound_dispatch.js +8 -4
- package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.js +5 -8
- package/dist/testing/cross_backend/ws_role_gated.js +2 -2
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +6 -4
- package/dist/{cli/daemon.d.ts → testing/daemon_info.d.ts} +15 -47
- package/dist/testing/daemon_info.d.ts.map +1 -0
- package/dist/testing/daemon_info.js +108 -0
- package/dist/testing/daemon_token_rotation.js +1 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +3 -4
- package/dist/testing/db.js +2 -2
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +35 -65
- package/dist/testing/integration_helpers.d.ts +0 -15
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +2 -42
- package/dist/testing/middleware.d.ts +20 -12
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +49 -40
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +13 -22
- package/dist/testing/resolved_auth.d.ts +30 -0
- package/dist/testing/resolved_auth.d.ts.map +1 -0
- package/dist/testing/resolved_auth.js +41 -0
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +3 -0
- package/dist/testing/rpc_helpers.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +2 -1
- package/dist/testing/sse_round_trip.d.ts +5 -4
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/stubs.d.ts +2 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +24 -21
- package/dist/testing/test_origin.d.ts +25 -0
- package/dist/testing/test_origin.d.ts.map +1 -0
- package/dist/testing/test_origin.js +28 -0
- package/dist/testing/transports/raw_http.d.ts +54 -0
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +58 -0
- package/dist/testing/transports/ws_raw_client.d.ts +8 -0
- package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_raw_client.js +13 -0
- package/dist/testing/transports/ws_transport.d.ts +15 -2
- package/dist/testing/transports/ws_transport.d.ts.map +1 -1
- package/dist/testing/transports/ws_transport.js +4 -2
- package/dist/testing/ws_round_trip.d.ts +27 -25
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +34 -26
- package/dist/ui/AccountSessions.svelte +48 -19
- package/dist/ui/AccountSessions.svelte.d.ts +2 -17
- package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAccounts.svelte +6 -1
- package/dist/ui/AdminAuditLog.svelte +61 -22
- package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
- package/dist/ui/AdminInvites.svelte +1 -1
- package/dist/ui/AdminOverview.svelte +76 -37
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
- package/dist/ui/AdminRoleGrantHistory.svelte +6 -1
- package/dist/ui/AdminSessions.svelte +1 -1
- package/dist/ui/AppShell.svelte +3 -2
- package/dist/ui/AppShell.svelte.d.ts +3 -2
- package/dist/ui/AppShell.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +121 -35
- package/dist/ui/Datatable.svelte +33 -18
- package/dist/ui/Datatable.svelte.d.ts +2 -14
- package/dist/ui/Datatable.svelte.d.ts.map +1 -1
- package/dist/ui/OpenSignupToggle.svelte +10 -1
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
- package/dist/ui/PopoverButton.svelte +13 -8
- package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferForm.svelte +3 -2
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts +3 -2
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferHistory.svelte +3 -3
- package/dist/ui/RoleGrantOfferInbox.svelte +19 -15
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
- package/dist/ui/SurfaceExplorer.svelte +66 -27
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts +7 -14
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +14 -9
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +6 -4
- package/dist/ui/admin_invites_state.svelte.d.ts +2 -2
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.d.ts +9 -9
- package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.js +9 -9
- package/dist/ui/app_settings_state.svelte.d.ts +2 -2
- package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.d.ts +70 -13
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +239 -47
- package/dist/ui/backend_probe.svelte.d.ts +93 -0
- package/dist/ui/backend_probe.svelte.d.ts.map +1 -0
- package/dist/ui/backend_probe.svelte.js +140 -0
- package/dist/ui/format_scope.d.ts +7 -7
- package/dist/ui/format_scope.d.ts.map +1 -1
- package/dist/ui/format_scope.js +4 -4
- package/dist/ui/keyed_async_slot.svelte.d.ts +2 -2
- package/dist/ui/keyed_async_slot.svelte.js +2 -2
- package/dist/ui/popover.svelte.d.ts +18 -19
- package/dist/ui/popover.svelte.d.ts.map +1 -1
- package/dist/ui/popover.svelte.js +103 -16
- package/dist/ui/role_grant_offers_state.svelte.d.ts +41 -46
- package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.js +37 -19
- package/dist/ui/ui_format.d.ts +17 -0
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +20 -0
- package/package.json +2 -1
- package/dist/actions/register_ws_endpoint.d.ts +0 -79
- package/dist/actions/register_ws_endpoint.d.ts.map +0 -1
- package/dist/actions/register_ws_endpoint.js +0 -109
- package/dist/actions/transports_ws_auth_guard.d.ts +0 -94
- package/dist/actions/transports_ws_auth_guard.d.ts.map +0 -1
- package/dist/actions/transports_ws_auth_guard.js +0 -138
- package/dist/actions/transports_ws_backend.d.ts.map +0 -1
- package/dist/cli/args.d.ts +0 -55
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -100
- package/dist/cli/config.d.ts +0 -47
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js +0 -77
- package/dist/cli/daemon.d.ts.map +0 -1
- package/dist/cli/daemon.js +0 -181
- package/dist/cli/help.d.ts +0 -124
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -215
- package/dist/cli/logger.d.ts +0 -46
- package/dist/cli/logger.d.ts.map +0 -1
- package/dist/cli/logger.js +0 -48
- package/dist/cli/util.d.ts +0 -36
- package/dist/cli/util.d.ts.map +0 -1
- package/dist/cli/util.js +0 -50
- package/dist/realtime/sse_auth_guard.d.ts +0 -197
- package/dist/realtime/sse_auth_guard.d.ts.map +0 -1
- package/dist/realtime/sse_auth_guard.js +0 -238
- package/dist/realtime/subscriber_registry.d.ts.map +0 -1
- package/dist/testing/bootstrap_success.d.ts +0 -29
- package/dist/testing/bootstrap_success.d.ts.map +0 -1
- package/dist/testing/bootstrap_success.js +0 -144
- package/dist/testing/mock_fs.d.ts +0 -20
- package/dist/testing/mock_fs.d.ts.map +0 -1
- package/dist/testing/mock_fs.js +0 -28
- package/dist/testing/standard.d.ts +0 -122
- package/dist/testing/standard.d.ts.map +0 -1
- package/dist/testing/standard.js +0 -73
- package/dist/testing/testing_rate_limiter.d.ts +0 -65
- package/dist/testing/testing_rate_limiter.d.ts.map +0 -1
- package/dist/testing/testing_rate_limiter.js +0 -80
|
@@ -4,11 +4,11 @@ import '../assert_dev_env.js';
|
|
|
4
4
|
* real upgrade.
|
|
5
5
|
*
|
|
6
6
|
* Both spines hold what waits to be written to one WebSocket to a byte budget
|
|
7
|
-
* (`
|
|
7
|
+
* (`ConnectionRegistry`'s `outbound_queue_bytes` on the TS side, the
|
|
8
8
|
* Rust `fuz_realtime` outbound queue on the other; both default to 4 MiB, each
|
|
9
9
|
* waiting frame charged its UTF-8 length plus 64 bytes). A frame that does not
|
|
10
|
-
* fit closes the socket with `WS_CLOSE_OUTBOUND_OVERFLOW` and
|
|
11
|
-
* `
|
|
10
|
+
* fit closes the socket with `WS_CLOSE_OUTBOUND_OVERFLOW` and
|
|
11
|
+
* `WS_CLOSE_OUTBOUND_OVERFLOW_REASON`; the credential stays good, so a client reconnects
|
|
12
12
|
* under its ordinary backoff. The code and the reason are therefore wire
|
|
13
13
|
* contract, and this suite is the pin that runs on both.
|
|
14
14
|
*
|
|
@@ -59,15 +59,12 @@ import '../assert_dev_env.js';
|
|
|
59
59
|
*/
|
|
60
60
|
import { assert, describe } from 'vitest';
|
|
61
61
|
import { create_jsonrpc_request } from '../../http/jsonrpc_helpers.js';
|
|
62
|
+
import { WS_CLOSE_OUTBOUND_OVERFLOW, WS_CLOSE_OUTBOUND_OVERFLOW_REASON } from '../../actions/transports.js';
|
|
62
63
|
import { create_admitted_ws_transport } from '../transports/ws_transport.js';
|
|
63
64
|
import { is_notification, is_response_for } from '../transports/ws_client.js';
|
|
64
65
|
import { test_if } from './capabilities.js';
|
|
65
66
|
import { cross_rpc_call } from './cross_rpc.js';
|
|
66
67
|
import { open_session_ws } from './ws_endpoint.js';
|
|
67
|
-
/** The close code both spines send on an outbound overflow. */
|
|
68
|
-
const WS_CLOSE_OUTBOUND_OVERFLOW = 4005;
|
|
69
|
-
/** The close reason both spines send with it. */
|
|
70
|
-
const OUTBOUND_OVERFLOW_REASON = 'outbound queue overflow';
|
|
71
68
|
const FLOOD_METHOD = '_testing_flood_notifications';
|
|
72
69
|
const FLOOD_NOTIFICATION_METHOD = '_testing_flood';
|
|
73
70
|
const HEARTBEAT_METHOD = 'heartbeat';
|
|
@@ -214,7 +211,7 @@ export const describe_ws_outbound_overflow_cross_tests = (options) => {
|
|
|
214
211
|
const closed = await client.wait_for_close(CLOSE_TIMEOUT_MS);
|
|
215
212
|
assert.ok(closed, 'the flooded socket did not close');
|
|
216
213
|
assert.strictEqual(client.close_code, WS_CLOSE_OUTBOUND_OVERFLOW);
|
|
217
|
-
assert.strictEqual(client.close_reason,
|
|
214
|
+
assert.strictEqual(client.close_reason, WS_CLOSE_OUTBOUND_OVERFLOW_REASON);
|
|
218
215
|
// the response of the request whose handler overflowed is not sent
|
|
219
216
|
assert.strictEqual(client.messages.some(is_response_for('overflows')), false, 'no response may follow an overflow');
|
|
220
217
|
// frames accepted before the overflow may or may not arrive; any
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
2
|
/**
|
|
3
3
|
* Cross-process **role-gated WebSocket** suite — a socket admitted by an
|
|
4
|
-
* endpoint's role gate (`
|
|
4
|
+
* endpoint's role gate (`register_action_ws`'s `required_roles`) loses it
|
|
5
5
|
* with the role.
|
|
6
6
|
*
|
|
7
7
|
* A role gate decides who may hold a socket, and so who receives the
|
|
@@ -11,7 +11,7 @@ import '../assert_dev_env.js';
|
|
|
11
11
|
* listed role is revoked — with `WS_CLOSE_PERMISSION_REVOKED`, not the
|
|
12
12
|
* session-revoked code, since the credential is still good — and send nothing
|
|
13
13
|
* after the close. The ungated sockets of the same account, on the same
|
|
14
|
-
*
|
|
14
|
+
* registry, stay open: the gate is per endpoint, not per account. A scoped
|
|
15
15
|
* grant never admits at a role gate, so revoking one closes nothing.
|
|
16
16
|
*
|
|
17
17
|
* Runs against a backend that mounts, beside its ungated `ws_path`, a second
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws_round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/ws_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ws_round_trip.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/ws_round_trip.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAuH9B,OAAO,EAAE,KAAK,mBAAmB,EAAW,MAAM,mBAAmB,CAAC;AAItE,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,YAAY,CAAC;AAKzD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAK1E,2DAA2D;AAC3D,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IAClE;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,wFAAwF;IACxF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAClD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,+BAA+B,GAAI,SAAS,yBAAyB,KAAG,IAwdpF,CAAC"}
|
|
@@ -19,7 +19,7 @@ import '../assert_dev_env.js';
|
|
|
19
19
|
* every WS endpoint — so the suite needs no knowledge of a consumer's domain
|
|
20
20
|
* WS methods. It validates the transport, not the domain.
|
|
21
21
|
*
|
|
22
|
-
* Three cases mirror the upgrade
|
|
22
|
+
* Three cases mirror the upgrade route `register_action_ws` mounts (origin
|
|
23
23
|
* check → `require_auth` → dispatch): an authenticated upgrade round-trips
|
|
24
24
|
* `heartbeat` (the first case), and an anonymous upgrade and a
|
|
25
25
|
* disallowed-origin upgrade are refused (after the spine-parity cases).
|
|
@@ -37,7 +37,7 @@ import '../assert_dev_env.js';
|
|
|
37
37
|
* shapes (absent, `{}`) and refuses a declared param with `invalid_params`, and a
|
|
38
38
|
* message over the backend's cap (`max_message_bytes`, default
|
|
39
39
|
* `DEFAULT_WS_MAX_MESSAGE_BYTES`) closes the socket with
|
|
40
|
-
* `WS_CLOSE_MESSAGE_TOO_BIG`.
|
|
40
|
+
* `WS_CLOSE_MESSAGE_TOO_BIG` and `WS_CLOSE_MESSAGE_TOO_BIG_REASON`.
|
|
41
41
|
*
|
|
42
42
|
* The cases after the refused upgrades (gated on `rpc_path`) cover
|
|
43
43
|
* server-initiated close.
|
|
@@ -82,7 +82,7 @@ import '../assert_dev_env.js';
|
|
|
82
82
|
import { assert, describe } from 'vitest';
|
|
83
83
|
import { assert_rejects } from '@fuzdev/fuz_util/testing.ts';
|
|
84
84
|
import { heartbeat_action_spec } from '../../actions/heartbeat.js';
|
|
85
|
-
import { DEFAULT_WS_MAX_MESSAGE_BYTES, WS_CLOSE_MESSAGE_TOO_BIG, WS_CLOSE_SESSION_REVOKED, WS_CLOSE_SESSION_REVOKED_REASON } from '../../actions/transports.js';
|
|
85
|
+
import { DEFAULT_WS_MAX_MESSAGE_BYTES, WS_CLOSE_MESSAGE_TOO_BIG, WS_CLOSE_MESSAGE_TOO_BIG_REASON, WS_CLOSE_SESSION_REVOKED, WS_CLOSE_SESSION_REVOKED_REASON } from '../../actions/transports.js';
|
|
86
86
|
import { account_session_revoke_all_action_spec, account_token_create_action_spec, account_token_revoke_action_spec, TokenCreateOutput, TokenRevokeOutput } from '../../auth/account_action_specs.js';
|
|
87
87
|
import { DEFAULT_MAX_TOKENS } from '../../auth/account_route_schema.js';
|
|
88
88
|
import { account_delete_action_spec } from '../../auth/admin_action_specs.js';
|
|
@@ -219,7 +219,8 @@ export const describe_cross_process_ws_tests = (options) => {
|
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
221
|
// Both spines cap an inbound message (`DEFAULT_WS_MAX_MESSAGE_BYTES` by
|
|
222
|
-
// default) and close the socket on a larger one rather than replying
|
|
222
|
+
// default) and close the socket on a larger one rather than replying,
|
|
223
|
+
// lingering so the close frame and its reason arrive.
|
|
223
224
|
test_if(capabilities.ws, 'an oversized message closes the socket with WS_CLOSE_MESSAGE_TOO_BIG', async () => {
|
|
224
225
|
const client = await open_authed();
|
|
225
226
|
try {
|
|
@@ -232,6 +233,7 @@ export const describe_cross_process_ws_tests = (options) => {
|
|
|
232
233
|
const closed = await client.wait_for_close(5000);
|
|
233
234
|
assert.ok(closed, 'socket did not close within 5s of an oversized message');
|
|
234
235
|
assert.strictEqual(client.close_code, WS_CLOSE_MESSAGE_TOO_BIG);
|
|
236
|
+
assert.strictEqual(client.close_reason, WS_CLOSE_MESSAGE_TOO_BIG_REASON);
|
|
235
237
|
}
|
|
236
238
|
finally {
|
|
237
239
|
// the server may reset the connection under the unread tail
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
+
import './assert_dev_env.js';
|
|
1
2
|
/**
|
|
2
|
-
* Daemon
|
|
3
|
-
*
|
|
4
|
-
* Provides daemon info schema, PID file management, and process lifecycle
|
|
5
|
-
* operations. Separates lifecycle from presentation — `stop_daemon` returns
|
|
6
|
-
* a result object instead of logging directly.
|
|
3
|
+
* Daemon-info file plumbing for the testing servers — `~/.{name}/run/daemon.json`,
|
|
4
|
+
* written at startup and read for stale-process detection.
|
|
7
5
|
*
|
|
8
6
|
* @module
|
|
9
7
|
*/
|
|
10
8
|
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
11
|
-
import {
|
|
9
|
+
import type { CommandDeps, EnvDeps, FsReadDeps, FsWriteDeps, LogDeps } from '../runtime/deps.js';
|
|
10
|
+
/**
|
|
11
|
+
* Get an app's home directory path (`~/.{name}`).
|
|
12
|
+
*
|
|
13
|
+
* @param runtime - runtime with `env_get` capability
|
|
14
|
+
* @param name - application name (e.g., `"tx"`, `"zzz"`)
|
|
15
|
+
* @returns path to the app directory, or null if `$HOME` is not set
|
|
16
|
+
*/
|
|
17
|
+
export declare const get_app_dir: (runtime: Pick<EnvDeps, "env_get">, name: string) => string | null;
|
|
12
18
|
/**
|
|
13
19
|
* Daemon info schema for `~/.{name}/run/daemon.json`, a strict
|
|
14
20
|
* `@fuzdev/fuz_schema` object schema.
|
|
15
21
|
*/
|
|
16
22
|
export declare const DaemonInfo: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
17
23
|
version: number;
|
|
18
|
-
pid: number;
|
|
19
24
|
port: number;
|
|
25
|
+
pid: number;
|
|
20
26
|
started: string;
|
|
21
27
|
app_version: string;
|
|
22
28
|
}, {
|
|
23
29
|
version: number;
|
|
24
|
-
pid: number;
|
|
25
30
|
port: number;
|
|
31
|
+
pid: number;
|
|
26
32
|
started: string;
|
|
27
33
|
app_version: string;
|
|
28
34
|
}, "object", {
|
|
@@ -72,42 +78,4 @@ export declare const read_daemon_info: (runtime: Pick<EnvDeps, "env_get"> & Pick
|
|
|
72
78
|
* @returns `true` if the process is running
|
|
73
79
|
*/
|
|
74
80
|
export declare const is_daemon_running: (runtime: CommandDeps, pid: number) => Promise<boolean>;
|
|
75
|
-
|
|
76
|
-
* Check if a daemon is healthy by probing its `/health` endpoint.
|
|
77
|
-
*
|
|
78
|
-
* Complements `is_daemon_running` (PID check) with an HTTP liveness probe.
|
|
79
|
-
* Requires the daemon to register a `/health` route (e.g. via `create_health_route_spec`).
|
|
80
|
-
*
|
|
81
|
-
* @param deps - runtime with fetch capability
|
|
82
|
-
* @param port - port the daemon should be listening on
|
|
83
|
-
* @param host - hostname (default `localhost`)
|
|
84
|
-
* @param timeout_ms - request timeout in milliseconds (default 2000)
|
|
85
|
-
* @returns `true` if the health endpoint responds with 2xx
|
|
86
|
-
*/
|
|
87
|
-
export declare const check_daemon_health: (deps: FetchDeps, port: number, host?: string, timeout_ms?: number) => Promise<boolean>;
|
|
88
|
-
/**
|
|
89
|
-
* Result of a `stop_daemon` operation.
|
|
90
|
-
*/
|
|
91
|
-
export interface StopDaemonResult {
|
|
92
|
-
/** Whether a daemon was stopped. */
|
|
93
|
-
stopped: boolean;
|
|
94
|
-
/** PID of the stopped daemon, if any. */
|
|
95
|
-
pid?: number;
|
|
96
|
-
/** Human-readable message describing the outcome. */
|
|
97
|
-
message: string;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Stop a running daemon by sending SIGTERM and cleaning up the PID file.
|
|
101
|
-
*
|
|
102
|
-
* Returns a result object instead of logging directly, separating
|
|
103
|
-
* lifecycle from presentation. Errors removing the PID file are swallowed
|
|
104
|
-
* (the daemon's own shutdown handler may have removed it concurrently).
|
|
105
|
-
*
|
|
106
|
-
* @param runtime - runtime with command, file, and env capabilities
|
|
107
|
-
* @param name - application name
|
|
108
|
-
* @returns result describing the outcome
|
|
109
|
-
* @mutates filesystem - removes `~/.{name}/run/daemon.json` on success or when corrupt
|
|
110
|
-
* @mutates external process - sends `SIGTERM` to the daemon process via `kill`
|
|
111
|
-
*/
|
|
112
|
-
export declare const stop_daemon: (runtime: Pick<EnvDeps, "env_get"> & Pick<FsReadDeps, "stat" | "read_text_file"> & FsRemoveDeps & CommandDeps & LogDeps, name: string) => Promise<StopDaemonResult>;
|
|
113
|
-
//# sourceMappingURL=daemon.d.ts.map
|
|
81
|
+
//# sourceMappingURL=daemon_info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon_info.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/daemon_info.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;GAKG;AAEH,OAAO,EAMN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGjG;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,MAAM,KAAG,MAAM,GAAG,IAGtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;IACtB,sBAAsB;;IAEtB,yBAAyB;;IAEzB,uCAAuC;;IAEvC,yCAAyC;;IAEzC,0CAA0C;;EAEzC,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAChC,SAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EACjC,MAAM,MAAM,KACV,MAAM,GAAG,IAGX,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC7B,SAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,QAAQ,CAAC,EAC7F,MAAM,MAAM,EACZ,MAAM,UAAU,KACd,OAAO,CAAC,IAAI,CAWd,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC5B,SAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,CAAC,GAAG,OAAO,EACzF,MAAM,MAAM,KACV,OAAO,CAAC,UAAU,GAAG,IAAI,CAwB3B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAU,SAAS,WAAW,EAAE,KAAK,MAAM,KAAG,OAAO,CAAC,OAAO,CAG1F,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import './assert_dev_env.js';
|
|
2
|
+
/**
|
|
3
|
+
* Daemon-info file plumbing for the testing servers — `~/.{name}/run/daemon.json`,
|
|
4
|
+
* written at startup and read for stale-process detection.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import { format_issue, number, object, parse, string } from '@fuzdev/fuz_schema/schema.ts';
|
|
9
|
+
import { write_file_atomic } from '../runtime/fs.js';
|
|
10
|
+
/**
|
|
11
|
+
* Get an app's home directory path (`~/.{name}`).
|
|
12
|
+
*
|
|
13
|
+
* @param runtime - runtime with `env_get` capability
|
|
14
|
+
* @param name - application name (e.g., `"tx"`, `"zzz"`)
|
|
15
|
+
* @returns path to the app directory, or null if `$HOME` is not set
|
|
16
|
+
*/
|
|
17
|
+
export const get_app_dir = (runtime, name) => {
|
|
18
|
+
const home = runtime.env_get('HOME');
|
|
19
|
+
return home ? `${home}/.${name}` : null;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Daemon info schema for `~/.{name}/run/daemon.json`, a strict
|
|
23
|
+
* `@fuzdev/fuz_schema` object schema.
|
|
24
|
+
*/
|
|
25
|
+
export const DaemonInfo = object({
|
|
26
|
+
/** Schema version. */
|
|
27
|
+
version: number,
|
|
28
|
+
/** Server process ID. */
|
|
29
|
+
pid: number,
|
|
30
|
+
/** Port the server is listening on. */
|
|
31
|
+
port: number,
|
|
32
|
+
/** ISO timestamp when server started. */
|
|
33
|
+
started: string,
|
|
34
|
+
/** Package version of the application. */
|
|
35
|
+
app_version: string
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Get the daemon info file path (`~/.{name}/run/daemon.json`).
|
|
39
|
+
*
|
|
40
|
+
* @param runtime - runtime with `env_get` capability
|
|
41
|
+
* @param name - application name
|
|
42
|
+
* @returns path to `daemon.json`, or null if `$HOME` is not set
|
|
43
|
+
*/
|
|
44
|
+
export const get_daemon_info_path = (runtime, name) => {
|
|
45
|
+
const app_dir = get_app_dir(runtime, name);
|
|
46
|
+
return app_dir ? `${app_dir}/run/daemon.json` : null;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Write daemon info to the PID file, creating directories as needed.
|
|
50
|
+
*
|
|
51
|
+
* @param runtime - runtime with file write and env capabilities
|
|
52
|
+
* @param name - application name
|
|
53
|
+
* @param info - daemon info to write
|
|
54
|
+
* @mutates filesystem - creates `~/.{name}/run/` and atomically writes `daemon.json`
|
|
55
|
+
* @throws Error if `$HOME` is not set
|
|
56
|
+
*/
|
|
57
|
+
export const write_daemon_info = async (runtime, name, info) => {
|
|
58
|
+
const app_dir = get_app_dir(runtime, name);
|
|
59
|
+
if (!app_dir) {
|
|
60
|
+
throw new Error('$HOME not set');
|
|
61
|
+
}
|
|
62
|
+
const run_dir = `${app_dir}/run`;
|
|
63
|
+
await runtime.mkdir(run_dir, { recursive: true });
|
|
64
|
+
const content = JSON.stringify(info, null, '\t');
|
|
65
|
+
await write_file_atomic(runtime, `${run_dir}/daemon.json`, content + '\n');
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Read and validate daemon info from the PID file.
|
|
69
|
+
*
|
|
70
|
+
* @param runtime - runtime with file read and env capabilities
|
|
71
|
+
* @param name - application name
|
|
72
|
+
* @returns parsed daemon info, or null if missing or invalid
|
|
73
|
+
*/
|
|
74
|
+
export const read_daemon_info = async (runtime, name) => {
|
|
75
|
+
const daemon_path = get_daemon_info_path(runtime, name);
|
|
76
|
+
if (!daemon_path) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const stat = await runtime.stat(daemon_path);
|
|
80
|
+
if (!stat) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const content = await runtime.read_text_file(daemon_path);
|
|
85
|
+
const parsed = JSON.parse(content);
|
|
86
|
+
const result = parse(DaemonInfo, parsed);
|
|
87
|
+
if (!result.ok) {
|
|
88
|
+
runtime.warn(`Invalid daemon.json: ${result.issues.map(format_issue).join('; ')}`);
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
return result.value;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
runtime.warn('Failed to parse daemon.json');
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Check if a process is running by PID.
|
|
100
|
+
*
|
|
101
|
+
* @param runtime - runtime with command execution capability
|
|
102
|
+
* @param pid - process ID to check
|
|
103
|
+
* @returns `true` if the process is running
|
|
104
|
+
*/
|
|
105
|
+
export const is_daemon_running = async (runtime, pid) => {
|
|
106
|
+
const result = await runtime.run_command('kill', ['-0', String(pid)]);
|
|
107
|
+
return result.success;
|
|
108
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
2
|
import { write_file_atomic } from '../runtime/fs.js';
|
|
3
|
-
import { get_app_dir } from '
|
|
3
|
+
import { get_app_dir } from './daemon_info.js';
|
|
4
4
|
import { generate_daemon_token } from '../auth/daemon_token.js';
|
|
5
5
|
import { resolve_keeper_account_id } from '../auth/daemon_token_middleware.js';
|
|
6
6
|
/** Default rotation interval in milliseconds (30 seconds). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_exposure.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/data_exposure.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAqB7B,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"data_exposure.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/data_exposure.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAqB7B,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAiBrE,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,0BAA0B,CAAC;AAIvE;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,GAAI,QAAQ,OAAO,KAAG,GAAG,CAAC,MAAM,CAuB9E,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,yCAAyC,GACrD,SAAS,UAAU,EACnB,mBAAkB,aAAa,CAAC,MAAM,CAA6B,KACjE,IAWF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wCAAwC,GACpD,SAAS,UAAU,EACnB,oBAAmB,aAAa,CAAC,MAAM,CAA8B,KACnE,IAgBF,CAAC;AAIF,kDAAkD;AAClD,MAAM,WAAW,uBAAuB;IACvC,kEAAkE;IAClE,UAAU,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B,2FAA2F;IAC3F,gBAAgB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,kDAAkD;IAClD,WAAW,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS,uBAAuB,KAAG,IA0L/E,CAAC"}
|
|
@@ -17,6 +17,7 @@ import './assert_dev_env.js';
|
|
|
17
17
|
*/
|
|
18
18
|
import { describe, test, beforeAll, assert } from 'vitest';
|
|
19
19
|
import { ROLE_ADMIN } from '../auth/role_schema.js';
|
|
20
|
+
import { create_test_request_headers } from './test_origin.js';
|
|
20
21
|
import { resolve_valid_path, generate_valid_body, to_route_content_type } from './schema_generators.js';
|
|
21
22
|
import { is_null_schema, is_strict_object_schema } from '../http/schema_helpers.js';
|
|
22
23
|
import { is_keeper_auth, is_public_auth } from '../http/auth_shape.js';
|
|
@@ -142,11 +143,9 @@ export const describe_data_exposure_tests = (options) => {
|
|
|
142
143
|
const url = resolve_valid_path(spec.path, spec.params);
|
|
143
144
|
const res = await fixture.transport(url, {
|
|
144
145
|
method: spec.method,
|
|
145
|
-
headers: {
|
|
146
|
-
host: 'localhost',
|
|
147
|
-
origin: 'http://localhost:5173',
|
|
146
|
+
headers: create_test_request_headers({
|
|
148
147
|
'content-type': to_route_content_type(spec)
|
|
149
|
-
}
|
|
148
|
+
})
|
|
150
149
|
});
|
|
151
150
|
if (res.headers.get('Content-Type')?.includes('text/event-stream')) {
|
|
152
151
|
await res.body?.cancel();
|
package/dist/testing/db.js
CHANGED
|
@@ -11,10 +11,10 @@ import './assert_dev_env.js';
|
|
|
11
11
|
* ```ts
|
|
12
12
|
* import {create_default_db_factory, create_pg_factory} from '@fuzdev/fuz_app/testing/db.ts';
|
|
13
13
|
* import {run_migrations} from '@fuzdev/fuz_app/db/migrate.ts';
|
|
14
|
-
* import {
|
|
14
|
+
* import {AUTH_MIGRATION_NS} from '@fuzdev/fuz_app/auth/migrations.ts';
|
|
15
15
|
*
|
|
16
16
|
* const init_schema = async (db) => {
|
|
17
|
-
* await run_migrations(db, [
|
|
17
|
+
* await run_migrations(db, [AUTH_MIGRATION_NS]);
|
|
18
18
|
* };
|
|
19
19
|
* const default_factory = create_default_db_factory(init_schema);
|
|
20
20
|
* const pg_factory = create_pg_factory(init_schema, process.env.TEST_DATABASE_URL);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/integration.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAsB7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAMhE,OAAO,EAKN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAkB1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAW,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAKpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/integration.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAsB7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAMhE,OAAO,EAKN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAkB1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAW,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAKpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAK1D;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC9C;;;;OAIG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;;;;;;;;OASG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B,kEAAkE;IAClE,YAAY,EAAE,mBAAmB,CAAC;IAClC;;;;OAIG;IACH,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC;;;;;;;;;;;;OAYG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,mCAAmC,GAC/C,SAAS,8BAA8B,KACrC,IA28CF,CAAC"}
|
|
@@ -27,6 +27,7 @@ import { LoginOutput, AccountStatusOutput } from '../auth/account_route_schema.j
|
|
|
27
27
|
import { test_if } from './cross_backend/capabilities.js';
|
|
28
28
|
import { assert_iso8601_seconds, assert_iso8601_seconds_nullable } from './cross_backend/wire_shapes.js';
|
|
29
29
|
import { DEFAULT_TEST_PASSWORD } from './test_credentials.js';
|
|
30
|
+
import { create_test_request_headers, TEST_ORIGIN } from './test_origin.js';
|
|
30
31
|
import { create_test_raw_api_token } from './entities.js';
|
|
31
32
|
/**
|
|
32
33
|
* Standard integration test suite for fuz_app auth routes.
|
|
@@ -90,9 +91,8 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
90
91
|
// (when the consumer wires signup) + the shared RPC endpoint.
|
|
91
92
|
// Bootstrap (when the consumer wires it via the top-level `bootstrap`
|
|
92
93
|
// option in `mode: 'live'`) is intentionally excluded — this suite has
|
|
93
|
-
// no describe block that drives bootstrap; the
|
|
94
|
-
//
|
|
95
|
-
// `create_test_app_for_bootstrap`. Consumer-specific
|
|
94
|
+
// no describe block that drives bootstrap; the cross-backend harness
|
|
95
|
+
// drives the real `POST /bootstrap`. Consumer-specific
|
|
96
96
|
// routes would dilute the ratio; admin-role routes are scoped to
|
|
97
97
|
// the admin suite instead.
|
|
98
98
|
const auth_routes = route_specs.filter(is_suite_auth_route);
|
|
@@ -116,11 +116,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
116
116
|
assert.ok(login_route, 'Expected POST /login route — ensure create_route_specs includes account routes');
|
|
117
117
|
const res = await fixture.transport(login_route.path, {
|
|
118
118
|
method: 'POST',
|
|
119
|
-
headers: {
|
|
120
|
-
host: 'localhost',
|
|
121
|
-
origin: 'http://localhost:5173',
|
|
119
|
+
headers: create_test_request_headers({
|
|
122
120
|
'content-type': 'application/json'
|
|
123
|
-
},
|
|
121
|
+
}),
|
|
124
122
|
body: JSON.stringify({
|
|
125
123
|
username: fixture.account.username,
|
|
126
124
|
password: DEFAULT_TEST_PASSWORD
|
|
@@ -139,11 +137,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
139
137
|
assert.ok(login_route, 'Expected POST /login route — ensure create_route_specs includes account routes');
|
|
140
138
|
const res = await fixture.transport(login_route.path, {
|
|
141
139
|
method: 'POST',
|
|
142
|
-
headers: {
|
|
143
|
-
host: 'localhost',
|
|
144
|
-
origin: 'http://localhost:5173',
|
|
140
|
+
headers: create_test_request_headers({
|
|
145
141
|
'content-type': 'application/json'
|
|
146
|
-
},
|
|
142
|
+
}),
|
|
147
143
|
body: JSON.stringify({
|
|
148
144
|
username: fixture.account.username,
|
|
149
145
|
password: 'wrong-password'
|
|
@@ -160,11 +156,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
160
156
|
assert.ok(login_route, 'Expected POST /login route — ensure create_route_specs includes account routes');
|
|
161
157
|
const res = await fixture.transport(login_route.path, {
|
|
162
158
|
method: 'POST',
|
|
163
|
-
headers: {
|
|
164
|
-
host: 'localhost',
|
|
165
|
-
origin: 'http://localhost:5173',
|
|
159
|
+
headers: create_test_request_headers({
|
|
166
160
|
'content-type': 'application/json'
|
|
167
|
-
},
|
|
161
|
+
}),
|
|
168
162
|
body: JSON.stringify({
|
|
169
163
|
username: 'nonexistent_user',
|
|
170
164
|
password: DEFAULT_TEST_PASSWORD
|
|
@@ -181,11 +175,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
181
175
|
assert.ok(login_route, 'Expected POST /login route — ensure create_route_specs includes account routes');
|
|
182
176
|
const res = await fixture.transport(login_route.path, {
|
|
183
177
|
method: 'POST',
|
|
184
|
-
headers: {
|
|
185
|
-
host: 'localhost',
|
|
186
|
-
origin: 'http://localhost:5173',
|
|
178
|
+
headers: create_test_request_headers({
|
|
187
179
|
'content-type': 'application/json'
|
|
188
|
-
},
|
|
180
|
+
}),
|
|
189
181
|
body: JSON.stringify({
|
|
190
182
|
username: ` ${fixture.account.username} `,
|
|
191
183
|
password: DEFAULT_TEST_PASSWORD
|
|
@@ -204,11 +196,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
204
196
|
// Login
|
|
205
197
|
const login_res = await fixture.transport(login_route.path, {
|
|
206
198
|
method: 'POST',
|
|
207
|
-
headers: {
|
|
208
|
-
host: 'localhost',
|
|
209
|
-
origin: 'http://localhost:5173',
|
|
199
|
+
headers: create_test_request_headers({
|
|
210
200
|
'content-type': 'application/json'
|
|
211
|
-
},
|
|
201
|
+
}),
|
|
212
202
|
body: JSON.stringify({
|
|
213
203
|
username: fixture.account.username,
|
|
214
204
|
password: DEFAULT_TEST_PASSWORD
|
|
@@ -221,9 +211,7 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
221
211
|
const cookie_match = new RegExp(`${cookie_name}=([^;]+)`).exec(set_cookie);
|
|
222
212
|
assert.ok(cookie_match?.[1]);
|
|
223
213
|
const login_cookie = cookie_match[1];
|
|
224
|
-
const create_headers = () => ({
|
|
225
|
-
host: 'localhost',
|
|
226
|
-
origin: 'http://localhost:5173',
|
|
214
|
+
const create_headers = () => create_test_request_headers({
|
|
227
215
|
cookie: `${cookie_name}=${login_cookie}`
|
|
228
216
|
});
|
|
229
217
|
// Verify works
|
|
@@ -263,11 +251,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
263
251
|
assert.ok(login_route, 'Expected POST /login route — ensure create_route_specs includes account routes');
|
|
264
252
|
const make_login = (username, password) => fixture.transport(login_route.path, {
|
|
265
253
|
method: 'POST',
|
|
266
|
-
headers: {
|
|
267
|
-
host: 'localhost',
|
|
268
|
-
origin: 'http://localhost:5173',
|
|
254
|
+
headers: create_test_request_headers({
|
|
269
255
|
'content-type': 'application/json'
|
|
270
|
-
},
|
|
256
|
+
}),
|
|
271
257
|
body: JSON.stringify({ username, password })
|
|
272
258
|
});
|
|
273
259
|
// wrong password for existing user
|
|
@@ -294,11 +280,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
294
280
|
assert.ok(login_route, 'Expected POST /login route — ensure create_route_specs includes account routes');
|
|
295
281
|
const res = await fixture.transport(login_route.path, {
|
|
296
282
|
method: 'POST',
|
|
297
|
-
headers: {
|
|
298
|
-
host: 'localhost',
|
|
299
|
-
origin: 'http://localhost:5173',
|
|
283
|
+
headers: create_test_request_headers({
|
|
300
284
|
'content-type': 'application/json'
|
|
301
|
-
},
|
|
285
|
+
}),
|
|
302
286
|
body: JSON.stringify({
|
|
303
287
|
username: fixture.account.username,
|
|
304
288
|
password: DEFAULT_TEST_PASSWORD
|
|
@@ -366,11 +350,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
366
350
|
assert.ok(login_route, 'Expected POST /login route — ensure create_route_specs includes account routes');
|
|
367
351
|
const res = await fixture.transport(login_route.path, {
|
|
368
352
|
method: 'POST',
|
|
369
|
-
headers: {
|
|
370
|
-
host: 'localhost',
|
|
371
|
-
origin: 'http://localhost:5173',
|
|
353
|
+
headers: create_test_request_headers({
|
|
372
354
|
'content-type': 'application/json'
|
|
373
|
-
},
|
|
355
|
+
}),
|
|
374
356
|
body: JSON.stringify({
|
|
375
357
|
username: fixture.account.username,
|
|
376
358
|
password: DEFAULT_TEST_PASSWORD
|
|
@@ -528,11 +510,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
528
510
|
// Login with new password works
|
|
529
511
|
const login_res = await fixture.transport(login_route.path, {
|
|
530
512
|
method: 'POST',
|
|
531
|
-
headers: {
|
|
532
|
-
host: 'localhost',
|
|
533
|
-
origin: 'http://localhost:5173',
|
|
513
|
+
headers: create_test_request_headers({
|
|
534
514
|
'content-type': 'application/json'
|
|
535
|
-
},
|
|
515
|
+
}),
|
|
536
516
|
body: JSON.stringify({
|
|
537
517
|
username: fixture.account.username,
|
|
538
518
|
password: 'new-password-456'
|
|
@@ -641,7 +621,7 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
641
621
|
params: undefined,
|
|
642
622
|
headers: {
|
|
643
623
|
...bearer_headers,
|
|
644
|
-
origin:
|
|
624
|
+
origin: TEST_ORIGIN,
|
|
645
625
|
'content-type': 'application/json'
|
|
646
626
|
}
|
|
647
627
|
});
|
|
@@ -878,11 +858,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
878
858
|
assert.ok(login_route, 'Expected POST /login route — ensure create_route_specs includes account routes');
|
|
879
859
|
const res = await fixture.transport(login_route.path, {
|
|
880
860
|
method: 'POST',
|
|
881
|
-
headers: {
|
|
882
|
-
host: 'localhost',
|
|
883
|
-
origin: 'http://localhost:5173',
|
|
861
|
+
headers: create_test_request_headers({
|
|
884
862
|
'content-type': 'application/json'
|
|
885
|
-
},
|
|
863
|
+
}),
|
|
886
864
|
body: JSON.stringify({
|
|
887
865
|
username: 'nonexistent_user_xyz',
|
|
888
866
|
password: 'any-password'
|
|
@@ -909,11 +887,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
909
887
|
assert.ok(logout_route, 'Expected POST /logout route — ensure create_route_specs includes account routes');
|
|
910
888
|
const res = await fixture.fresh_transport()(logout_route.path, {
|
|
911
889
|
method: 'POST',
|
|
912
|
-
headers: {
|
|
913
|
-
host: 'localhost',
|
|
914
|
-
origin: 'http://localhost:5173',
|
|
890
|
+
headers: create_test_request_headers({
|
|
915
891
|
'content-type': 'application/json'
|
|
916
|
-
},
|
|
892
|
+
}),
|
|
917
893
|
body: JSON.stringify({})
|
|
918
894
|
});
|
|
919
895
|
assert.strictEqual(res.status, 401);
|
|
@@ -1041,7 +1017,7 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
1041
1017
|
method: 'POST',
|
|
1042
1018
|
headers: {
|
|
1043
1019
|
...bearer_headers,
|
|
1044
|
-
origin:
|
|
1020
|
+
origin: TEST_ORIGIN,
|
|
1045
1021
|
'content-type': 'application/json'
|
|
1046
1022
|
}
|
|
1047
1023
|
});
|
|
@@ -1057,7 +1033,7 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
1057
1033
|
});
|
|
1058
1034
|
const res = await fixture.fresh_transport()(password_route.path, {
|
|
1059
1035
|
method: 'POST',
|
|
1060
|
-
headers: { ...bearer_headers, referer:
|
|
1036
|
+
headers: { ...bearer_headers, referer: `${TEST_ORIGIN}/admin` }
|
|
1061
1037
|
});
|
|
1062
1038
|
assert.strictEqual(res.status, 401, 'Bearer with Referer should be discarded → unauthenticated');
|
|
1063
1039
|
error_collector.record(route_specs, 'POST', password_route.path, 401);
|
|
@@ -1171,11 +1147,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
1171
1147
|
// Try to sign up with a different email — should fail (no matching invite)
|
|
1172
1148
|
const signup_res = await fixture.transport(signup_route.path, {
|
|
1173
1149
|
method: 'POST',
|
|
1174
|
-
headers: {
|
|
1175
|
-
host: 'localhost',
|
|
1176
|
-
origin: 'http://localhost:5173',
|
|
1150
|
+
headers: create_test_request_headers({
|
|
1177
1151
|
'content-type': 'application/json'
|
|
1178
|
-
},
|
|
1152
|
+
}),
|
|
1179
1153
|
body: JSON.stringify({
|
|
1180
1154
|
username: 'eve_attacker',
|
|
1181
1155
|
password: 'test-password-123456',
|
|
@@ -1223,11 +1197,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
1223
1197
|
// Attempt 1: signup with a non-matching email (no invite match) → 403
|
|
1224
1198
|
const no_match_res = await fixture.transport(signup_route.path, {
|
|
1225
1199
|
method: 'POST',
|
|
1226
|
-
headers: {
|
|
1227
|
-
host: 'localhost',
|
|
1228
|
-
origin: 'http://localhost:5173',
|
|
1200
|
+
headers: create_test_request_headers({
|
|
1229
1201
|
'content-type': 'application/json'
|
|
1230
|
-
},
|
|
1202
|
+
}),
|
|
1231
1203
|
body: JSON.stringify({
|
|
1232
1204
|
username: 'nomatch_user',
|
|
1233
1205
|
password: 'test-password-123456',
|
|
@@ -1249,11 +1221,9 @@ export const describe_standard_integration_tests = (options) => {
|
|
|
1249
1221
|
// Attempt 2: signup with the invited email but a colliding username → 409
|
|
1250
1222
|
const conflict_res = await fixture.transport(signup_route.path, {
|
|
1251
1223
|
method: 'POST',
|
|
1252
|
-
headers: {
|
|
1253
|
-
host: 'localhost',
|
|
1254
|
-
origin: 'http://localhost:5173',
|
|
1224
|
+
headers: create_test_request_headers({
|
|
1255
1225
|
'content-type': 'application/json'
|
|
1256
|
-
},
|
|
1226
|
+
}),
|
|
1257
1227
|
body: JSON.stringify({
|
|
1258
1228
|
username: existing_user.account.username,
|
|
1259
1229
|
password: 'test-password-123456',
|