@fuzdev/fuz_app 0.150.0 → 0.152.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 +324 -299
- package/dist/actions/action_bridge.d.ts +5 -86
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +4 -84
- 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_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 -34
- 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 -298
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +155 -923
- 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 +52 -75
- 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 +70 -44
- 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_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 +5 -5
- package/dist/auth/actor_search_queries.d.ts.map +1 -1
- package/dist/auth/actor_search_queries.js +7 -7
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +3 -1
- 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 +12 -42
- package/dist/auth/all_cell_actions.d.ts +6 -4
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.js +1 -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 +3 -3
- package/dist/auth/audit_emitter.js +2 -2
- 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 +13 -21
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +10 -18
- 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/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_actions.d.ts +22 -13
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +105 -167
- 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_metadata.d.ts +1 -1
- package/dist/auth/cell_audit_metadata.js +1 -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 +2 -2
- package/dist/auth/cell_grant_action_specs.js +3 -3
- package/dist/auth/cell_grant_actions.d.ts +73 -11
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +63 -55
- 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 +5 -5
- package/dist/auth/credential_type_schema.js +5 -5
- 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 +99 -14
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +26 -13
- package/dist/auth/role_grant_offer_actions.d.ts +13 -7
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +14 -12
- package/dist/auth/role_grant_offer_notifications.d.ts +3 -3
- package/dist/auth/role_grant_offer_notifications.js +1 -1
- package/dist/auth/role_grant_offer_queries.d.ts +0 -5
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +9 -41
- package/dist/auth/role_grant_queries.d.ts +17 -67
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +34 -106
- 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/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 +1 -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 +9 -4
- package/dist/db/cell_ddl.d.ts +5 -142
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +17 -16
- 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 +12 -48
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +24 -55
- 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/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_errors.d.ts +22 -2
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +41 -3
- 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/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 +1 -1
- package/dist/http/surface.d.ts.map +1 -1
- 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 +30 -10
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +85 -21
- 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 +62 -51
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +84 -71
- 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 +179 -158
- 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 -77
- 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/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 +13 -7
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- 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_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 +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- 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/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 +9 -2
- 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 +23 -1
- 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_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 +45 -3
- 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 +9 -8
- 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 -96
- package/dist/actions/transports_ws_auth_guard.d.ts.map +0 -1
- package/dist/actions/transports_ws_auth_guard.js +0 -141
- 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 -239
- 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
|
@@ -1,274 +1,86 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* WebSocket JSON-RPC
|
|
2
|
+
* WebSocket JSON-RPC endpoint — the WS transport binding.
|
|
3
3
|
*
|
|
4
4
|
* Consumers declare WS endpoints on `create_app_server`'s `ws_endpoints`,
|
|
5
|
-
* which mounts each through `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* resolution + optional role). This module stays exported as the
|
|
9
|
-
* lower-level entry point for tests that drive the dispatcher directly via
|
|
10
|
-
* `create_ws_test_harness`.
|
|
5
|
+
* which mounts each through `register_action_ws`; call it directly only to
|
|
6
|
+
* mount an endpoint outside that assembly. Tests drive the dispatcher
|
|
7
|
+
* directly via `create_ws_test_harness`.
|
|
11
8
|
*
|
|
12
|
-
*
|
|
13
|
-
* both transports parse their wire envelope, then call the shared
|
|
14
|
-
* `perform_action` core (`actions/perform_action.ts`) for the post-parse
|
|
15
|
-
* pipeline. WS-specific concerns — connection lifecycle, heartbeat,
|
|
16
|
-
* cancel-notification interception, socket-scoped notify — stay in this
|
|
17
|
-
* module; everything else (auth gates, input validation, authorization
|
|
18
|
-
* phase, rate limiting, transactional dispatch, DEV output validation,
|
|
19
|
-
* thrown-error normalization) is shared.
|
|
20
|
-
*
|
|
21
|
-
* ## Auth expectations
|
|
22
|
-
*
|
|
23
|
-
* The consumer is responsible for rejecting unauthenticated upgrades
|
|
24
|
-
* *before* routing to this handler (fuz_app's `require_auth` middleware,
|
|
25
|
-
* or `register_ws_endpoint` which wires it for you). Per-action auth
|
|
26
|
-
* runs inside `perform_action` on every message via the same gates HTTP
|
|
27
|
-
* RPC uses.
|
|
28
|
-
*
|
|
29
|
-
* ## Admission: the revocation race
|
|
9
|
+
* ## The upgrade route
|
|
30
10
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* logout, password change, token revoke, account delete) closes the sockets
|
|
34
|
-
* *registered* under what it revoked, so one landing in that gap would close
|
|
35
|
-
* nothing, and the socket would then be admitted on the dead credential and
|
|
36
|
-
* keep it: per-message dispatch re-authorizes the *actor*, never the session
|
|
37
|
-
* or token — and its admission could evict a live socket of the same account
|
|
38
|
-
* past the cap.
|
|
11
|
+
* One `GET path` route, its guards in coarse-to-fine order — the route-spec
|
|
12
|
+
* pipeline's, from `fuz_auth_guard_resolver`:
|
|
39
13
|
*
|
|
40
|
-
* `
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* (`
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
14
|
+
* 1. `verify_request_source(allowed_origins)` — a disallowed origin is
|
|
15
|
+
* refused before the upgrade handshake runs (403).
|
|
16
|
+
* 2. `require_auth` — an unauthenticated upgrade is refused (401).
|
|
17
|
+
* 3. `require_token_scope('surface:ws_upgrade')` — rule 3: a narrowed token
|
|
18
|
+
* cannot hold a socket (403 `token_scope_required`). Server-initiated
|
|
19
|
+
* pushes (broadcasts, role-grant-offer notifications, peer requests)
|
|
20
|
+
* reach whatever the account's connection reaches, with no per-recipient
|
|
21
|
+
* filter to narrow them by, so a scoped token that could upgrade would
|
|
22
|
+
* observe far more than it was granted.
|
|
23
|
+
* 4. **Authorization phase** (`run_authorization_phase`) — the acting actor
|
|
24
|
+
* from the `?acting=<uuid>` query string (`parse_acting`; malformed reads
|
|
25
|
+
* as omitted), against the authenticated account, building the
|
|
26
|
+
* `RequestContext` per-message dispatch reads (400s on actor selection).
|
|
27
|
+
* Multi-actor accounts must supply `?acting`; single-actor accounts work
|
|
28
|
+
* without it.
|
|
29
|
+
* 5. `require_role(required_roles)`, for a gated endpoint (403).
|
|
48
30
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* announces a success row to the listeners behind it too. So no interleaving
|
|
54
|
-
* admits a revoked credential; `docs/security.md` §Connection Admission says
|
|
55
|
-
* what that rests on.
|
|
31
|
+
* Only `GET` is mounted (Hono serves `HEAD` through it), so any other method
|
|
32
|
+
* on the path is a 404. The guards run as middleware ahead of
|
|
33
|
+
* `upgradeWebSocket`, whose callback must return `WSEvents` and so cannot
|
|
34
|
+
* produce a refusal.
|
|
56
35
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* revocation landing in between would close nothing (`close_sockets_for_role`
|
|
66
|
-
* matches registrations), and the socket would be admitted without the role
|
|
67
|
-
* for its lifetime. The re-read reads the acting actor's grants afresh and
|
|
68
|
-
* admits on a global grant of any listed role, as the gate did.
|
|
69
|
-
*
|
|
70
|
-
* A refused upgrade is closed with `WS_CLOSE_SESSION_REVOKED` (4001, the
|
|
71
|
-
* reason a revoked socket gets) for a dead credential or a deleted acting actor,
|
|
72
|
-
* `WS_CLOSE_PERMISSION_REVOKED` (4006) for a lost role, or
|
|
73
|
-
* `WS_CLOSE_INTERNAL_ERROR` (1011) when a re-read itself failed — fail
|
|
74
|
-
* closed, never admitted unchecked. The handshake has already answered `101`,
|
|
75
|
-
* so a refusal can only be a close frame.
|
|
76
|
-
*
|
|
77
|
-
* Once the server is shutting down (`AppServer.close` ran the transport's
|
|
78
|
-
* `close_all_sockets`) a refusal is `WS_CLOSE_GOING_AWAY` instead, so the
|
|
79
|
-
* client reconnects rather than treating its credential as revoked: an upgrade
|
|
80
|
-
* pending at the close-all is closed by it — and its abort makes the refusal
|
|
81
|
-
* that follows the re-read send nothing more, even when the database closed
|
|
82
|
-
* under that re-read — and one that registers after it is born closed and
|
|
83
|
-
* skips the re-read (`BackendWebsocketTransport` module doc, "Shutdown").
|
|
84
|
-
*
|
|
85
|
-
* Frames that arrive before admission are queued, not dispatched: nothing runs
|
|
86
|
-
* on a credential that has not been re-read. They dispatch in arrival order
|
|
87
|
-
* once the socket is admitted and `on_socket_open` has completed, and are
|
|
88
|
-
* dropped unread on a refusal. The queue holds at most
|
|
89
|
-
* `MAX_PRE_ADMISSION_FRAMES` frames and
|
|
90
|
-
* `PRE_ADMISSION_QUEUE_BYTES_FACTOR` × `max_message_bytes` bytes; past either
|
|
91
|
-
* the socket is closed.
|
|
36
|
+
* Symmetric to `create_rpc_endpoint` (from `actions/action_rpc.ts`):
|
|
37
|
+
* both transports parse their wire envelope, then call the shared
|
|
38
|
+
* `perform_action` core (`actions/perform_action.ts`) for the post-parse
|
|
39
|
+
* pipeline. WS-specific concerns — connection lifecycle, heartbeat,
|
|
40
|
+
* cancel-notification interception, socket-scoped notify — live in
|
|
41
|
+
* `actions/ws_socket_session.ts`; everything else (auth gates, input
|
|
42
|
+
* validation, authorization phase, rate limiting, transactional dispatch, DEV
|
|
43
|
+
* output validation, thrown-error normalization) is shared.
|
|
92
44
|
*
|
|
93
|
-
* ##
|
|
45
|
+
* ## Per-message auth
|
|
94
46
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* the earlier of a session's cookie and row, an API token's row, none for a
|
|
98
|
-
* daemon token or an eternal token). From admission, a timer closes it at the
|
|
99
|
-
* deadline with `WS_CLOSE_SESSION_REVOKED` (4001) and
|
|
100
|
-
* `WS_CLOSE_CREDENTIAL_EXPIRED_REASON`. The wait is a chain of timers of at
|
|
101
|
-
* most an hour (`schedule_credential_deadline`), so a session's 30 days — past
|
|
102
|
-
* `setTimeout`'s ceiling — does not fire at once, and each wake-up checks the
|
|
103
|
-
* wall clock too, so a host suspend does not extend the deadline.
|
|
47
|
+
* Per-action auth runs inside `perform_action` on every message via the same
|
|
48
|
+
* gates HTTP RPC uses.
|
|
104
49
|
*
|
|
105
|
-
* ##
|
|
50
|
+
* ## Per-socket lifecycle
|
|
106
51
|
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* So every server-side close — revocation, cap eviction, heartbeat timeout,
|
|
111
|
-
* an oversized message, a refused admission — removes the connection from the
|
|
112
|
-
* transport and aborts the socket's signal *at close time*, and `onMessage`
|
|
113
|
-
* drops any frame on a socket that has ended. A connection the transport no
|
|
114
|
-
* longer holds though nothing closed its socket (a bare `remove_connection`)
|
|
115
|
-
* is ended on its next frame (`BackendWebsocketTransport.is_registered`), with
|
|
116
|
-
* `WS_CLOSE_INTERNAL_ERROR` — it must not linger as a socket that reads
|
|
117
|
-
* everything and answers nothing.
|
|
52
|
+
* Admission (the revocation race), the credential deadline, and the rule that a
|
|
53
|
+
* server-closed socket dispatches nothing are the per-socket half, in
|
|
54
|
+
* `actions/ws_socket_session.ts`.
|
|
118
55
|
*
|
|
119
56
|
* @module
|
|
120
57
|
*/
|
|
121
58
|
import type { Hono } from 'hono';
|
|
122
|
-
import type { UpgradeWebSocket
|
|
59
|
+
import type { UpgradeWebSocket } from 'hono/ws';
|
|
123
60
|
import { type Logger as LoggerType } from '@fuzdev/fuz_util/log.ts';
|
|
124
|
-
import type { Uuid } from '../primitive_schemas.js';
|
|
125
61
|
import type { RoleName } from '../auth/role_schema.js';
|
|
62
|
+
import type { EffectErrorContext } from '../http/pending_effects.js';
|
|
126
63
|
import type { RateLimiter } from '../rate_limiter.js';
|
|
127
64
|
import type { Db } from '../db/db.js';
|
|
128
65
|
import { type Action } from './action_types.js';
|
|
129
66
|
import type { RealtimeCloser } from './connection_closer.js';
|
|
130
|
-
import {
|
|
131
|
-
|
|
132
|
-
export declare const DEFAULT_SERVER_HEARTBEAT_TIMEOUT = 60000;
|
|
133
|
-
/**
|
|
134
|
-
* Max inbound frames one socket may have queued while it is still opening —
|
|
135
|
-
* between the handshake and the end of the credential re-check plus
|
|
136
|
-
* `on_socket_open`. One more closes the socket with
|
|
137
|
-
* `WS_CLOSE_POLICY_VIOLATION`.
|
|
138
|
-
*
|
|
139
|
-
* Frames sent before the socket is open wait rather than dispatch (nothing
|
|
140
|
-
* runs on a credential that has not been re-read), and a runtime adapter hands
|
|
141
|
-
* them over with no backpressure, so the wait needs a bound. This is the count
|
|
142
|
-
* half; `PRE_ADMISSION_QUEUE_BYTES_FACTOR` is the byte half.
|
|
143
|
-
*
|
|
144
|
-
* Sized so a client flushing its durable queue on reopen never meets it at the
|
|
145
|
-
* default `DEFAULT_QUEUE_MAX_SIZE` (`actions/socket.svelte.ts`). A consumer
|
|
146
|
-
* that raises the client's queue above this cap makes a full flush overflow
|
|
147
|
-
* it: the socket closes with `WS_CLOSE_POLICY_VIOLATION`, the flushed requests
|
|
148
|
-
* fail, and the client reconnects.
|
|
149
|
-
*/
|
|
150
|
-
export declare const MAX_PRE_ADMISSION_FRAMES = 256;
|
|
151
|
-
/**
|
|
152
|
-
* The byte budget of one socket's pre-admission queue, as a multiple of the
|
|
153
|
-
* endpoint's `max_message_bytes`: the frames queued while the socket is still
|
|
154
|
-
* opening may total at most this many maximum-size messages. The frame that
|
|
155
|
-
* would pass it closes the socket with `WS_CLOSE_POLICY_VIOLATION`.
|
|
156
|
-
*
|
|
157
|
-
* The count cap alone (`MAX_PRE_ADMISSION_FRAMES`) would let each pending
|
|
158
|
-
* socket hold that many full-size messages, and pending sockets are not
|
|
159
|
-
* capped per account — a registration that is never admitted must not be able
|
|
160
|
-
* to pin that much memory. Small requests, which is what a client flushes on
|
|
161
|
-
* reopen, meet the count cap long before this one.
|
|
162
|
-
*
|
|
163
|
-
* A client whose queued requests total more than this budget and flushes
|
|
164
|
-
* them all on reopen overflows it: the socket closes, the flushed requests
|
|
165
|
-
* fail, and the client reconnects.
|
|
166
|
-
*/
|
|
167
|
-
export declare const PRE_ADMISSION_QUEUE_BYTES_FACTOR = 4;
|
|
168
|
-
/**
|
|
169
|
-
* The close reason sent with `WS_CLOSE_POLICY_VIOLATION` when a socket
|
|
170
|
-
* overflows its pre-admission queue, by count or by bytes.
|
|
171
|
-
*/
|
|
172
|
-
export declare const WS_CLOSE_PRE_ADMISSION_OVERFLOW_REASON = "too much sent before the socket opened";
|
|
173
|
-
/**
|
|
174
|
-
* Max requests one socket may have dispatching at once. A request that
|
|
175
|
-
* arrives past it is answered `queue_overflow` with its id
|
|
176
|
-
* (`WS_INBOUND_DISPATCH_OVERFLOW_MESSAGE`) and not dispatched; the socket
|
|
177
|
-
* stays open, and the requests already running keep answering.
|
|
178
|
-
*
|
|
179
|
-
* A runtime adapter can hand frames over without awaiting the previous one's
|
|
180
|
-
* dispatch (`@hono/node-ws` does not await `onMessage`), so without a ceiling
|
|
181
|
-
* one socket could hold any number of handlers — and their pooled database
|
|
182
|
-
* work — at once. Shedding rather than queueing keeps the socket reading, so a
|
|
183
|
-
* reply to a server-initiated request still reaches the handler awaiting it.
|
|
184
|
-
* Generous, so ordinary pipelining never meets it. Same value as the Rust
|
|
185
|
-
* spine's `MAX_INBOUND_DISPATCHES_PER_CONN`.
|
|
186
|
-
*
|
|
187
|
-
* Counted are the requests that passed envelope validation and are not yet
|
|
188
|
-
* answered — the entries of the socket's cancellation map. Notifications,
|
|
189
|
-
* replies to server-initiated requests, and refused frames never count.
|
|
190
|
-
*/
|
|
191
|
-
export declare const MAX_INBOUND_DISPATCHES_PER_CONNECTION = 128;
|
|
67
|
+
import { ConnectionRegistry } from './connection_registry.js';
|
|
68
|
+
import { type SocketCloseContext, type SocketOpenContext } from './ws_socket_session.js';
|
|
192
69
|
/**
|
|
193
|
-
*
|
|
194
|
-
* `
|
|
70
|
+
* Default receive silence (ms) past which the server closes a socket with
|
|
71
|
+
* `WS_CLOSE_SERVER_HEARTBEAT_TIMEOUT` — the `receive_timeout` of
|
|
72
|
+
* `register_action_ws`. Twin of the Rust spine's `DEFAULT_WS_RECEIVE_TIMEOUT`.
|
|
195
73
|
*/
|
|
196
|
-
export declare const
|
|
74
|
+
export declare const DEFAULT_WS_RECEIVE_TIMEOUT = 60000;
|
|
197
75
|
/**
|
|
198
|
-
* The `
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
76
|
+
* The longest `receive_timeout` `register_action_ws` accepts — 2³¹ − 1 ms,
|
|
77
|
+
* about 24.8 days, the longest delay a timer honors (the same bound as the
|
|
78
|
+
* SSE keep-alive). It keeps the receive check's half-timeout tick well inside
|
|
79
|
+
* that delay; `Infinity`, or a timeout of about 2³² ms and up, would make the
|
|
80
|
+
* tick fire every millisecond on every socket. TS-only: the Rust spine's
|
|
81
|
+
* `Duration` takes any length.
|
|
203
82
|
*/
|
|
204
|
-
export declare const
|
|
205
|
-
/**
|
|
206
|
-
* Context passed to the `on_socket_open` hook.
|
|
207
|
-
*
|
|
208
|
-
* Fires once the connection is **admitted** — registered in the transport and
|
|
209
|
-
* its credential re-checked (so `connection_id` is valid, and broadcasts reach
|
|
210
|
-
* it) — and before any client message dispatches. A socket refused at
|
|
211
|
-
* admission never reaches it. Consumers use this to bootstrap per-socket
|
|
212
|
-
* domain state — e.g. spawning a per-account unit and pushing an initial state
|
|
213
|
-
* snapshot.
|
|
214
|
-
*/
|
|
215
|
-
export interface SocketOpenContext {
|
|
216
|
-
/**
|
|
217
|
-
* The raw WebSocket context — exposed for edge cases; prefer `notify` for
|
|
218
|
-
* sends. A frame sent on it directly bypasses the connection's outbound
|
|
219
|
-
* budget and its ordering with queued frames.
|
|
220
|
-
*/
|
|
221
|
-
ws: WSContext;
|
|
222
|
-
/** Connection id assigned by `BackendWebsocketTransport.register_pending`. */
|
|
223
|
-
connection_id: Uuid;
|
|
224
|
-
/** Auth identity registered for this connection. */
|
|
225
|
-
identity: ConnectionIdentity;
|
|
226
|
-
/**
|
|
227
|
-
* Send a JSON-RPC notification to just this socket. Mirrors `ctx.notify`
|
|
228
|
-
* on per-message handler contexts — same socket-scoped semantics.
|
|
229
|
-
*/
|
|
230
|
-
notify: (method: string, params: unknown) => void;
|
|
231
|
-
/**
|
|
232
|
-
* Fires when this socket ends — the client closed it, or the server did
|
|
233
|
-
* (revocation, cap eviction, heartbeat timeout), at the moment the server
|
|
234
|
-
* closes rather than when the close handshake lands. Threaded through to
|
|
235
|
-
* every handler's `ctx.signal`.
|
|
236
|
-
*/
|
|
237
|
-
signal: AbortSignal;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Context passed to the `on_socket_close` hook.
|
|
241
|
-
*
|
|
242
|
-
* Fires after the transport has removed the connection — `connection_id` and
|
|
243
|
-
* `identity` are the values captured at open, so consumer cleanup reads them
|
|
244
|
-
* from here, not from the transport. Fires for both client-initiated closes
|
|
245
|
-
* (Hono onClose) and server-initiated closes — a revocation, the per-account
|
|
246
|
-
* connection cap's eviction, and a heartbeat timeout all call `ws.close()`,
|
|
247
|
-
* which triggers Hono's onClose. Fires only for a socket that was admitted: one
|
|
248
|
-
* refused at admission never ran `on_socket_open`, so it has no close hook
|
|
249
|
-
* either.
|
|
250
|
-
*/
|
|
251
|
-
export interface SocketCloseContext {
|
|
252
|
-
/**
|
|
253
|
-
* The WebSocket context the close event carried. Not necessarily the object
|
|
254
|
-
* `on_socket_open` received — an adapter may build one per event — so key
|
|
255
|
-
* per-socket state on `connection_id`.
|
|
256
|
-
*/
|
|
257
|
-
ws: WSContext;
|
|
258
|
-
/** Connection id captured at open time. */
|
|
259
|
-
connection_id: Uuid;
|
|
260
|
-
/** Auth identity captured at open time — the transport no longer holds it. */
|
|
261
|
-
identity: ConnectionIdentity;
|
|
262
|
-
}
|
|
263
|
-
export interface ServerHeartbeatOptions {
|
|
264
|
-
/**
|
|
265
|
-
* Receive-silence (ms) past which the server closes the socket with
|
|
266
|
-
* `WS_CLOSE_SERVER_HEARTBEAT_TIMEOUT`. Any incoming message resets
|
|
267
|
-
* the counter — chatty clients never trip it. First `timeout`
|
|
268
|
-
* window after socket open is exempt (cold-start grace).
|
|
269
|
-
*/
|
|
270
|
-
timeout?: number;
|
|
271
|
-
}
|
|
83
|
+
export declare const WS_RECEIVE_TIMEOUT_MAX = 2147483647;
|
|
272
84
|
/** Options for `register_action_ws`. */
|
|
273
85
|
export interface RegisterActionWsOptions {
|
|
274
86
|
/** Mount path (e.g., `/api/ws`). */
|
|
@@ -277,6 +89,13 @@ export interface RegisterActionWsOptions {
|
|
|
277
89
|
app: Hono;
|
|
278
90
|
/** Hono's `upgradeWebSocket` helper from the runtime adapter. */
|
|
279
91
|
upgradeWebSocket: UpgradeWebSocket;
|
|
92
|
+
/**
|
|
93
|
+
* Origin allowlist regexes for the upgrade — passed straight to
|
|
94
|
+
* `verify_request_source`, the route's first guard. `create_app_server`
|
|
95
|
+
* passes the server's `allowed_origins` unless the `WsEndpointSpec` narrows
|
|
96
|
+
* them.
|
|
97
|
+
*/
|
|
98
|
+
allowed_origins: ReadonlyArray<RegExp>;
|
|
280
99
|
/**
|
|
281
100
|
* The actions registered on this endpoint — each carries a spec (drives
|
|
282
101
|
* method lookup, per-action auth, input/output validation) and an
|
|
@@ -298,46 +117,48 @@ export interface RegisterActionWsOptions {
|
|
|
298
117
|
*/
|
|
299
118
|
db: Db;
|
|
300
119
|
/**
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
120
|
+
* Roles permitted to upgrade — any-of disjunction, global grants only,
|
|
121
|
+
* mounted as the route's `require_role` gate (403). Omit (or pass `[]`)
|
|
122
|
+
* for any authenticated account. The per-action `auth` in each spec still
|
|
123
|
+
* applies at dispatch time — this is a coarse upgrade-time gate on who may
|
|
124
|
+
* hold a socket, and so on who receives the endpoint's server pushes.
|
|
125
|
+
*
|
|
126
|
+
* It holds for the socket's life: recorded on every registration
|
|
304
127
|
* (`ConnectionIdentity.required_roles`), so a revoked global grant of a
|
|
305
|
-
* listed role closes the socket (`
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
* the upgrade; mount the 403 gate in front (`register_ws_endpoint` does).
|
|
310
|
-
* Omit, or pass `[]`, for an ungated endpoint.
|
|
128
|
+
* listed role closes the socket (a `role` close target, any listed role
|
|
129
|
+
* — see its over-close), and re-read at admission against the acting
|
|
130
|
+
* actor's grants, so a revocation that landed between the gate and the
|
|
131
|
+
* registration refuses the upgrade with `WS_CLOSE_PERMISSION_REVOKED`.
|
|
311
132
|
*/
|
|
312
133
|
required_roles?: ReadonlyArray<RoleName>;
|
|
313
134
|
/**
|
|
314
|
-
* Existing
|
|
135
|
+
* Existing registry to register connections with. When omitted, a fresh
|
|
315
136
|
* one is created and returned in the result. Pass your own to keep a
|
|
316
|
-
* handle for `
|
|
137
|
+
* handle for `send_to` / `broadcast` before the mount.
|
|
317
138
|
*/
|
|
318
|
-
|
|
139
|
+
registry?: ConnectionRegistry;
|
|
319
140
|
/**
|
|
320
141
|
* The backend's closer — `deps.connection_closer`. This endpoint's
|
|
321
|
-
*
|
|
142
|
+
* registry is added to it, so every revocation handler's close reaches
|
|
322
143
|
* the sockets opened here. Required so it can't be forgotten: left out of
|
|
323
|
-
* the closer, a
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
* (a harness driving the dispatcher directly), or when the
|
|
144
|
+
* the closer, no revocation closes a registry's sockets — neither the
|
|
145
|
+
* handlers' closes nor the revocation guard, which closes through the same
|
|
146
|
+
* closer. Pass `null` only when no revocation has to reach this registry
|
|
147
|
+
* (a harness driving the dispatcher directly), or when the registry was
|
|
327
148
|
* added by hand.
|
|
328
149
|
*
|
|
329
|
-
* The
|
|
150
|
+
* The registry is added once the mount succeeds, so a mount that throws
|
|
330
151
|
* adds nothing. The addition is permanent — its remover is not returned.
|
|
331
152
|
* A caller that must release the membership (as `create_app_server` does
|
|
332
|
-
* on close) passes `null` and adds the
|
|
153
|
+
* on close) passes `null` and adds the registry itself, holding the
|
|
333
154
|
* remover `RealtimeCloser.add` returns.
|
|
334
155
|
*/
|
|
335
156
|
connection_closer: RealtimeCloser | null;
|
|
336
157
|
/**
|
|
337
|
-
* Per-account connection cap for the
|
|
338
|
-
* `
|
|
158
|
+
* Per-account connection cap for the registry this call creates — see
|
|
159
|
+
* `ConnectionRegistryOptions.max_connections_per_account`
|
|
339
160
|
* (evict-oldest, closing with `WS_CLOSE_CONNECTION_LIMIT`; `null`
|
|
340
|
-
* disables). Rejected alongside `
|
|
161
|
+
* disables). Rejected alongside `registry`: a supplied registry carries
|
|
341
162
|
* its own cap, set where it was constructed.
|
|
342
163
|
*
|
|
343
164
|
* @default DEFAULT_MAX_CONNECTIONS_PER_ACCOUNT
|
|
@@ -345,32 +166,41 @@ export interface RegisterActionWsOptions {
|
|
|
345
166
|
max_connections_per_account?: number | null;
|
|
346
167
|
/**
|
|
347
168
|
* Byte budget of the frames waiting to be written to one connection, for
|
|
348
|
-
* the
|
|
349
|
-
* `
|
|
169
|
+
* the registry this call creates — see
|
|
170
|
+
* `ConnectionRegistryOptions.outbound_queue_bytes` (a frame that does
|
|
350
171
|
* not fit closes the socket with `WS_CLOSE_OUTBOUND_OVERFLOW`). Not derived
|
|
351
|
-
* from `max_message_bytes`. Rejected alongside `
|
|
352
|
-
*
|
|
172
|
+
* from `max_message_bytes`. Rejected alongside `registry`: a supplied
|
|
173
|
+
* registry carries its own budget, set where it was constructed.
|
|
353
174
|
*
|
|
354
175
|
* @default DEFAULT_WS_OUTBOUND_QUEUE_BYTES
|
|
355
176
|
*/
|
|
356
177
|
outbound_queue_bytes?: number;
|
|
357
178
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
*
|
|
179
|
+
* Receive silence (ms) past which the server closes a socket with
|
|
180
|
+
* `WS_CLOSE_SERVER_HEARTBEAT_TIMEOUT`. Any incoming message resets the
|
|
181
|
+
* count — chatty clients never trip it — and the first window after
|
|
182
|
+
* admission is exempt (cold-start grace). `null` keeps silent sockets open:
|
|
183
|
+
* only do this if the upstream stack (TCP keepalive, a proxy's idle
|
|
184
|
+
* timeout) already owns disconnect detection. Must be positive and at most
|
|
185
|
+
* `WS_RECEIVE_TIMEOUT_MAX` — registration throws otherwise. Twin of the
|
|
186
|
+
* Rust spine's `ActionWsOptions.receive_timeout`.
|
|
187
|
+
*
|
|
188
|
+
* @default DEFAULT_WS_RECEIVE_TIMEOUT
|
|
362
189
|
*/
|
|
363
|
-
|
|
364
|
-
/** Optional per-message delay for testing loading states. Ignored when `0`. */
|
|
365
|
-
artificial_delay?: number;
|
|
190
|
+
receive_timeout?: number | null;
|
|
366
191
|
/**
|
|
367
192
|
* Cap on one inbound message, in bytes (UTF-8 for text frames). A larger
|
|
368
193
|
* message closes the socket with `WS_CLOSE_MESSAGE_TOO_BIG` before it's
|
|
369
194
|
* parsed — there's no per-message error reply, matching the Rust spine.
|
|
370
195
|
* The cap is checked after the runtime adapter has buffered the message,
|
|
371
196
|
* so it bounds dispatch work, not memory; bound the adapter's own frame
|
|
372
|
-
* limit too (e.g. `ws`'s `maxPayload`) where memory matters
|
|
373
|
-
*
|
|
197
|
+
* limit too (e.g. `ws`'s `maxPayload`) where memory matters, set above this
|
|
198
|
+
* cap — twice it, as the cross-backend test adapters do. A message past the
|
|
199
|
+
* frame limit is refused by the adapter without
|
|
200
|
+
* `WS_CLOSE_MESSAGE_TOO_BIG_REASON` (`ws` closes with the code and an empty
|
|
201
|
+
* reason, Bun drops the socket), so a frame limit equal to this cap loses
|
|
202
|
+
* the reason a message just over it gets. A consumer that raises it passes
|
|
203
|
+
* the same value to the client's
|
|
374
204
|
* `FrontendWebsocketTransportOptions.max_message_bytes`.
|
|
375
205
|
*
|
|
376
206
|
* @default DEFAULT_WS_MAX_MESSAGE_BYTES
|
|
@@ -379,11 +209,12 @@ export interface RegisterActionWsOptions {
|
|
|
379
209
|
/** Optional logger; defaults to `[ws]` namespace. */
|
|
380
210
|
log?: LoggerType;
|
|
381
211
|
/**
|
|
382
|
-
* Called once per socket, after the connection is admitted
|
|
383
|
-
* "Admission").
|
|
212
|
+
* Called once per socket, after the connection is admitted
|
|
213
|
+
* (`actions/ws_socket_session.ts`, "Admission: the revocation race").
|
|
214
|
+
* Awaited before any inbound frame is dispatched — every
|
|
384
215
|
* frame the client sends meanwhile waits in arrival order, replies to
|
|
385
216
|
* server-initiated requests included: a hook that awaits
|
|
386
|
-
* `
|
|
217
|
+
* `registry.request_connection` on its own connection gets no reply until
|
|
387
218
|
* it returns, so start such a request without awaiting it. Throwing logs an
|
|
388
219
|
* error and closes the socket with an `internal_error` frame and
|
|
389
220
|
* `WS_CLOSE_INTERNAL_ERROR` — a failing bootstrap should not leave a
|
|
@@ -391,7 +222,7 @@ export interface RegisterActionWsOptions {
|
|
|
391
222
|
*/
|
|
392
223
|
on_socket_open?: (ctx: SocketOpenContext) => void | Promise<void>;
|
|
393
224
|
/**
|
|
394
|
-
* Called once per admitted socket on close, *after* the
|
|
225
|
+
* Called once per admitted socket on close, *after* the registry has
|
|
395
226
|
* removed the connection — a slow hook never holds a dead entry that
|
|
396
227
|
* broadcasts still target and the per-account cap still counts. Receives
|
|
397
228
|
* `connection_id` and `identity` captured at open time, the same whether the
|
|
@@ -417,15 +248,23 @@ export interface RegisterActionWsOptions {
|
|
|
417
248
|
* dispatcher.
|
|
418
249
|
*/
|
|
419
250
|
action_account_rate_limiter: RateLimiter | null;
|
|
251
|
+
/**
|
|
252
|
+
* Called when an eager pending effect of a frame's action rejects, after
|
|
253
|
+
* the rejection is logged — the WS half of `create_app_server`'s
|
|
254
|
+
* `on_effect_error`, which threads it here for the endpoints it mounts.
|
|
255
|
+
* The context carries `transport: 'ws'`, the action method, and `path`.
|
|
256
|
+
*/
|
|
257
|
+
on_effect_error?: (error: unknown, context: EffectErrorContext) => void;
|
|
420
258
|
}
|
|
421
259
|
/** Result of `register_action_ws`. */
|
|
422
260
|
export interface RegisterActionWsResult {
|
|
423
|
-
/** The
|
|
424
|
-
|
|
261
|
+
/** The registry bound to the endpoint — supplied or freshly created. */
|
|
262
|
+
registry: ConnectionRegistry;
|
|
425
263
|
}
|
|
426
264
|
/**
|
|
427
|
-
* Mount a JSON-RPC WebSocket endpoint
|
|
428
|
-
*
|
|
265
|
+
* Mount a JSON-RPC WebSocket endpoint — the upgrade route with its origin,
|
|
266
|
+
* auth, token-scope, acting-actor, and role guards (module doc, "The upgrade
|
|
267
|
+
* route") — that dispatches via the shared `perform_action` core.
|
|
429
268
|
*
|
|
430
269
|
* Wire behavior:
|
|
431
270
|
* - Batch JSON-RPC is rejected (single-message only).
|
|
@@ -445,8 +284,8 @@ export interface RegisterActionWsResult {
|
|
|
445
284
|
* - Authorization phase runs **per message** — role_grant changes during a
|
|
446
285
|
* connection lifetime are picked up on the next message without any
|
|
447
286
|
* in-place refresh. Authentication invalidation closes the socket: the
|
|
448
|
-
* revocation handlers through `connection_closer`, and
|
|
449
|
-
* on the audit row.
|
|
287
|
+
* revocation handlers through `connection_closer`, and the revocation guard
|
|
288
|
+
* (`create_revocation_guard`) on the audit row.
|
|
450
289
|
* - Admission re-reads the credential once, after the handshake: a socket
|
|
451
290
|
* whose session or token was revoked while it was upgrading closes with
|
|
452
291
|
* `WS_CLOSE_SESSION_REVOKED`, one that lost a role `required_roles` lists
|
|
@@ -454,23 +293,23 @@ export interface RegisterActionWsResult {
|
|
|
454
293
|
* `WS_CLOSE_INTERNAL_ERROR`. Frames sent before admission wait for it.
|
|
455
294
|
* - A revoked global grant of a role `required_roles` lists closes the
|
|
456
295
|
* account's sockets on this endpoint with `WS_CLOSE_PERMISSION_REVOKED`,
|
|
457
|
-
* through
|
|
296
|
+
* through the revocation guard; nothing more is sent on them.
|
|
458
297
|
* - A socket the server has closed dispatches nothing more, whether or not
|
|
459
298
|
* its client answers the close.
|
|
460
299
|
* - Every frame sent — responses, error frames, notifications — goes through
|
|
461
|
-
* the
|
|
300
|
+
* the registry's outbound queue. A connection with more waiting than its
|
|
462
301
|
* `outbound_queue_bytes` budget closes with `WS_CLOSE_OUTBOUND_OVERFLOW`, and
|
|
463
302
|
* the response of the request whose handler overflowed it is not sent.
|
|
464
303
|
*
|
|
465
|
-
* @returns the
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
* @mutates options.
|
|
304
|
+
* @returns the registry (supplied or freshly created) — retain it to broadcast
|
|
305
|
+
* @mutates options.app - registers the `GET path` upgrade route, its guards
|
|
306
|
+
* ahead of `upgradeWebSocket`
|
|
307
|
+
* @mutates options.registry - per socket, registers, admits, and removes a
|
|
469
308
|
* connection via `register_pending` / `admit` / `remove_connection`
|
|
470
|
-
* @mutates options.connection_closer - adds the endpoint's
|
|
309
|
+
* @mutates options.connection_closer - adds the endpoint's registry, once the
|
|
471
310
|
* mount has succeeded
|
|
472
311
|
* @throws Error when `max_connections_per_account` or `outbound_queue_bytes`
|
|
473
|
-
* is passed alongside `
|
|
312
|
+
* is passed alongside `registry`, when the cap is neither `null` nor a
|
|
474
313
|
* positive integer, when the budget is not a positive integer, or when
|
|
475
314
|
* `actions` fails to compile (`compile_action_registry`)
|
|
476
315
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register_action_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/register_action_ws.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"register_action_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/register_action_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAU,KAAK,MAAM,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAS5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAGN,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAEtB,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,aAAgB,CAAC;AAEpD,wCAAwC;AACxC,MAAM,WAAW,uBAAuB;IACvC,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,GAAG,EAAE,IAAI,CAAC;IACV,iEAAiE;IACjE,gBAAgB,EAAE,gBAAgB,CAAC;IACnC;;;;;OAKG;IACH,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACvC;;;;;;;OAOG;IACH,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B;;;;;;;;;OASG;IACH,EAAE,EAAE,EAAE,CAAC;IACP;;;;;;;;;;;;;OAaG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,EAAE,cAAc,GAAG,IAAI,CAAC;IACzC;;;;;;;;OAQG;IACH,2BAA2B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C;;;;;;;;;OASG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE;;;;;;;;OAQG;IACH,sBAAsB,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3C;;;;;;OAMG;IACH,2BAA2B,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACxE;AAED,sCAAsC;AACtC,MAAM,WAAW,sBAAsB;IACtC,wEAAwE;IACxE,QAAQ,EAAE,kBAAkB,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,uBAAuB,KAAG,sBAoLrE,CAAC"}
|