@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
package/dist/http/proxy.js
CHANGED
|
@@ -32,10 +32,12 @@ export const normalize_ip = (ip) => canonicalize_ip(ip);
|
|
|
32
32
|
*
|
|
33
33
|
* Accepts plain IPs (`'127.0.0.1'`, `'::1'`) and CIDR notation (`'10.0.0.0/8'`, `'fe80::/10'`).
|
|
34
34
|
* Plain IPs are normalized (lowercase, IPv4-mapped IPv6 stripped) and validated.
|
|
35
|
-
* CIDR prefixes are validated against address family bounds.
|
|
35
|
+
* CIDR prefixes are validated against address family bounds. A `/0` prefix is
|
|
36
|
+
* refused for either family: it trusts every client as a proxy, so the client's
|
|
37
|
+
* own `X-Forwarded-For` would choose the IP every per-IP limiter keys on.
|
|
36
38
|
*
|
|
37
39
|
* @param entry - IP address or CIDR notation
|
|
38
|
-
* @throws Error on invalid IP, invalid CIDR network,
|
|
40
|
+
* @throws Error on invalid IP, invalid CIDR network, NaN/negative/over-range prefix, or a `/0` prefix
|
|
39
41
|
*/
|
|
40
42
|
export const parse_proxy_entry = (entry) => {
|
|
41
43
|
const slash_index = entry.indexOf('/');
|
|
@@ -59,6 +61,9 @@ export const parse_proxy_entry = (entry) => {
|
|
|
59
61
|
throw new Error(`Invalid CIDR prefix (not an integer): ${entry}`);
|
|
60
62
|
}
|
|
61
63
|
const address_type = distinctRemoteAddr(network_str);
|
|
64
|
+
if (prefix === 0 && (address_type === 'IPv4' || address_type === 'IPv6')) {
|
|
65
|
+
throw new Error(`CIDR prefix 0 trusts every address as a proxy: ${entry}`);
|
|
66
|
+
}
|
|
62
67
|
if (address_type === 'IPv4') {
|
|
63
68
|
if (prefix > 32) {
|
|
64
69
|
throw new Error(`Invalid CIDR prefix for IPv4 (max 32): ${entry}`);
|
|
@@ -174,7 +174,7 @@ export interface RouteSpec {
|
|
|
174
174
|
* scope-narrowed API token reaches no non-RPC surface that reads account
|
|
175
175
|
* data, and `auth.required_scope` is refused on a route that admits
|
|
176
176
|
* anonymous callers. Read the credential through `get_public_account_id`
|
|
177
|
-
* (`auth/request_context.ts`), not `
|
|
177
|
+
* (`auth/request_context.ts`), not `get_resolved_auth`, so a narrowed token is
|
|
178
178
|
* answered as the anonymous caller. The RPC endpoint is the exception — its
|
|
179
179
|
* dispatcher gates each method against the scope.
|
|
180
180
|
*/
|
|
@@ -258,8 +258,9 @@ export declare const apply_middleware_specs: (app: Hono, specs: Array<Middleware
|
|
|
258
258
|
* adds input validation middleware (for routes with non-null input schemas),
|
|
259
259
|
* runs the optional authorization phase to resolve the acting actor + build
|
|
260
260
|
* the request context, wraps handler with DEV-only output and error
|
|
261
|
-
* validation, wraps with error catch layer (
|
|
262
|
-
*
|
|
261
|
+
* validation, wraps with error catch layer (a thrown JSON-RPC error,
|
|
262
|
+
* recognized via `to_thrown_jsonrpc_error`, maps to its status; any other
|
|
263
|
+
* throw to a 500), and registers the route.
|
|
263
264
|
*
|
|
264
265
|
* Per-route middleware order: content type (415, `POST` only) → params →
|
|
265
266
|
* query → pre-authorization auth guards (401 + rule-3 scope) →
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_spec.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/route_spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAW,IAAI,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,MAAM,E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CAAC,SAAS,CAAC,KAAG,KAAK,CAAC,SAAS,CAK3F,CAAC"}
|
package/dist/http/route_spec.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { DEV } from 'esm-env';
|
|
16
16
|
import { ERROR_INVALID_JSON_BODY, ERROR_INVALID_REQUEST_BODY, ERROR_INVALID_ROUTE_PARAMS, ERROR_INVALID_QUERY_PARAMS, ERROR_UNSUPPORTED_CONTENT_TYPE } from './error_schemas.js';
|
|
17
17
|
import { is_post_content_type_refused } from './simple_request.js';
|
|
18
|
-
import {
|
|
18
|
+
import { jsonrpc_error_code_to_http_status, jsonrpc_error_code_to_name, dev_only, to_thrown_jsonrpc_error } from './jsonrpc_errors.js';
|
|
19
19
|
import { is_null_schema, merge_error_schemas } from './schema_helpers.js';
|
|
20
20
|
import { dispatch_with_post_commit_rollback } from './pending_effects.js';
|
|
21
21
|
import { assert_route_auth_acting_biconditional } from './auth_shape.js';
|
|
@@ -58,9 +58,10 @@ const create_content_type_check = (spec) => {
|
|
|
58
58
|
* and for null-input routes (no body expected). For other routes with input
|
|
59
59
|
* schemas, returns a middleware that parses and validates the JSON body,
|
|
60
60
|
* storing the result on the context as `validated_input`. Input validation
|
|
61
|
-
* runs
|
|
62
|
-
*
|
|
63
|
-
*
|
|
61
|
+
* runs after the authorization phase and the post-authorization guards, so a
|
|
62
|
+
* caller they refuse never sees a parse failure; the authorization phase reads
|
|
63
|
+
* `acting` off the raw body itself (`read_route_acting` in
|
|
64
|
+
* `auth/request_context.ts`), treating a malformed body as no selector.
|
|
64
65
|
*
|
|
65
66
|
* @mutates `c.var.validated_input` - set to the parsed and validated body on success
|
|
66
67
|
*/
|
|
@@ -135,13 +136,21 @@ const create_query_validation = (query_schema) => {
|
|
|
135
136
|
};
|
|
136
137
|
return [validate];
|
|
137
138
|
};
|
|
139
|
+
/** Whether a JSON body is the catch layer's `{error: 'internal_error'}` shape. */
|
|
140
|
+
const is_internal_error_body = (body) => body !== null &&
|
|
141
|
+
typeof body === 'object' &&
|
|
142
|
+
body.error === 'internal_error';
|
|
138
143
|
/**
|
|
139
144
|
* Wrap a handler with DEV-only output and error validation.
|
|
140
145
|
*
|
|
141
146
|
* In development, validates 2xx JSON responses against the output schema
|
|
142
|
-
* and non-2xx responses against declared error schemas.
|
|
147
|
+
* and non-2xx responses against declared error schemas. Wraps the error
|
|
148
|
+
* catch layer, so the body built from a thrown error is validated too — except
|
|
149
|
+
* a 500 `internal_error`, which the catch layer can answer on any route and so
|
|
150
|
+
* is always accepted.
|
|
143
151
|
* Logs an error for mismatches and returns the response unchanged —
|
|
144
|
-
* does not throw.
|
|
152
|
+
* does not throw. Non-JSON responses (SSE, binary) are skipped. In
|
|
153
|
+
* production, returns the handler unchanged.
|
|
145
154
|
*/
|
|
146
155
|
const wrap_output_validation = (handler, output_schema, error_schemas, log) => {
|
|
147
156
|
if (!DEV)
|
|
@@ -154,34 +163,28 @@ const wrap_output_validation = (handler, output_schema, error_schemas, log) => {
|
|
|
154
163
|
const content_type = response.headers.get('Content-Type');
|
|
155
164
|
if (!content_type?.includes('application/json'))
|
|
156
165
|
return response;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
log.error(`Output schema mismatch: ${c.req.method} ${c.req.path}`, result.error.issues);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
catch {
|
|
167
|
-
// clone() or json() failed on a response claiming application/json
|
|
168
|
-
}
|
|
166
|
+
const schema = response.ok ? output_schema : error_schemas?.[response.status];
|
|
167
|
+
if (!schema)
|
|
168
|
+
return response;
|
|
169
|
+
let body;
|
|
170
|
+
try {
|
|
171
|
+
body = await response.clone().json();
|
|
169
172
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
}
|
|
173
|
+
catch {
|
|
174
|
+
// clone() or json() failed on a response claiming application/json
|
|
175
|
+
return response;
|
|
176
|
+
}
|
|
177
|
+
// the catch layer can answer `internal_error` on any route, so no route
|
|
178
|
+
// declares it — checking it against a route's 500 schema would only
|
|
179
|
+
// misreport a schema problem the route can't fix
|
|
180
|
+
if (response.status === 500 && is_internal_error_body(body))
|
|
181
|
+
return response;
|
|
182
|
+
const result = schema.safeParse(body);
|
|
183
|
+
if (!result.success) {
|
|
184
|
+
const label = response.ok
|
|
185
|
+
? 'Output schema mismatch'
|
|
186
|
+
: `Error schema mismatch (${response.status})`;
|
|
187
|
+
log.error(`${label}: ${c.req.method} ${c.req.path}`, result.error.issues);
|
|
185
188
|
}
|
|
186
189
|
return response;
|
|
187
190
|
};
|
|
@@ -199,9 +202,12 @@ export const apply_middleware_specs = (app, specs) => {
|
|
|
199
202
|
/**
|
|
200
203
|
* Wrap a handler with error catch logic.
|
|
201
204
|
*
|
|
202
|
-
* Catches
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
+
* Catches a thrown JSON-RPC error — a `ThrownJsonrpcError` from any copy of
|
|
206
|
+
* fuz_app, recognized by its brand (`to_thrown_jsonrpc_error`) — and maps it
|
|
207
|
+
* to a flat REST `ApiError` body (`{error: <reason>, message?, ...rest_data}`)
|
|
208
|
+
* at the matching HTTP status.
|
|
209
|
+
* Catches anything else, a foreign error class carrying a JSON-RPC `code`
|
|
210
|
+
* included, and maps to `{error: 'internal_error', message?}`
|
|
205
211
|
* at 500 (`message` populated only in DEV). Existing handlers that return
|
|
206
212
|
* `c.json()` directly are unaffected — the catch layer only activates when
|
|
207
213
|
* something is thrown.
|
|
@@ -229,9 +235,11 @@ const wrap_error_catch = (handler, log) => {
|
|
|
229
235
|
return await handler(c, next);
|
|
230
236
|
}
|
|
231
237
|
catch (err) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
238
|
+
// recognized by brand, so a second fuz_app copy's error maps too
|
|
239
|
+
const thrown = to_thrown_jsonrpc_error(err);
|
|
240
|
+
if (thrown) {
|
|
241
|
+
const status = jsonrpc_error_code_to_http_status(thrown.code);
|
|
242
|
+
return c.json(build_rest_error_body(thrown), status);
|
|
235
243
|
}
|
|
236
244
|
// generic error — internal_error. Raw exception messages can leak
|
|
237
245
|
// internals; surface them only in development (same gate as the
|
|
@@ -246,7 +254,7 @@ const wrap_error_catch = (handler, log) => {
|
|
|
246
254
|
};
|
|
247
255
|
};
|
|
248
256
|
/**
|
|
249
|
-
* Build the REST body for a thrown
|
|
257
|
+
* Build the REST body for a thrown JSON-RPC error. Splits out
|
|
250
258
|
* for unit-test directness and keeps the catch handler readable.
|
|
251
259
|
*
|
|
252
260
|
* Reason resolution order:
|
|
@@ -286,8 +294,9 @@ const build_rest_error_body = (err) => {
|
|
|
286
294
|
* adds input validation middleware (for routes with non-null input schemas),
|
|
287
295
|
* runs the optional authorization phase to resolve the acting actor + build
|
|
288
296
|
* the request context, wraps handler with DEV-only output and error
|
|
289
|
-
* validation, wraps with error catch layer (
|
|
290
|
-
*
|
|
297
|
+
* validation, wraps with error catch layer (a thrown JSON-RPC error,
|
|
298
|
+
* recognized via `to_thrown_jsonrpc_error`, maps to its status; any other
|
|
299
|
+
* throw to a 500), and registers the route.
|
|
291
300
|
*
|
|
292
301
|
* Per-route middleware order: content type (415, `POST` only) → params →
|
|
293
302
|
* query → pre-authorization auth guards (401 + rule-3 scope) →
|
|
@@ -363,10 +372,10 @@ export const apply_route_specs = (app, specs, resolve_auth_guards, log, db, auth
|
|
|
363
372
|
? db.transaction(async (tx) => inner(c, { db: tx, ...route_context }))
|
|
364
373
|
: inner(c, { db, ...route_context }));
|
|
365
374
|
};
|
|
366
|
-
// Step 2:
|
|
367
|
-
handler = wrap_output_validation(handler, spec.output, merged_errors, log);
|
|
368
|
-
// Step 3: error catch layer
|
|
375
|
+
// Step 2: error catch layer — a thrown error becomes its REST body here
|
|
369
376
|
handler = wrap_error_catch(handler, log);
|
|
377
|
+
// Step 3: output validation, outside the catch so thrown-error bodies are checked too
|
|
378
|
+
handler = wrap_output_validation(handler, spec.output, merged_errors, log);
|
|
370
379
|
app.on(spec.method, [spec.path], ...content_type_check, ...params_validation, ...query_validation, ...pre_authorization_guards, ...authorization, ...post_authorization_guards, ...input_validation, handler);
|
|
371
380
|
}
|
|
372
381
|
};
|
package/dist/http/surface.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { MiddlewareSpec } from './middleware_spec.js';
|
|
|
12
12
|
import type { RouteSpec } from './route_spec.js';
|
|
13
13
|
import type { RouteAuth } from './auth_shape.js';
|
|
14
14
|
import type { RateLimitKey, RouteErrorSchemas } from './error_schemas.js';
|
|
15
|
-
import type { RpcAction } from '../actions/
|
|
15
|
+
import type { RpcAction } from '../actions/action_types.js';
|
|
16
16
|
import type { ActionKind } from '../actions/action_spec.js';
|
|
17
17
|
import type { ResolvedWsEndpointSpec } from '../actions/ws_endpoint_spec.js';
|
|
18
18
|
import type { Sensitivity } from '../sensitivity.js';
|
|
@@ -198,7 +198,9 @@ export interface GenerateAppSurfaceOptions {
|
|
|
198
198
|
*/
|
|
199
199
|
export declare const collect_middleware_errors: (middleware: Array<MiddlewareSpec>, route_path: string) => RouteErrorSchemas | null;
|
|
200
200
|
/**
|
|
201
|
-
* Convert env schema to surface entries using `.meta()` metadata
|
|
201
|
+
* Convert env schema to surface entries using `.meta()` metadata, read
|
|
202
|
+
* through each field's wrappers — `schema_meta_value` for the description,
|
|
203
|
+
* the wider fail-safe `schema_sensitivity` walk for secrets.
|
|
202
204
|
*
|
|
203
205
|
* @param schema - Zod object schema with `.meta()` on fields
|
|
204
206
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;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C,cAAc,CAAC,EACjC,YAAY,MAAM,KAChB,iBAAiB,GAAG,IAQtB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,CAAC,CAAC,SAAS,KAAG,KAAK,CAAC,aAAa,CAe9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,KAAK,CAAC,SAAS,CAAC,KAAG,KAAK,CAAC,eAAe,CAOtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,yBAAyB,KAAG,UA4HzE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,yBAAyB,KAAG,cAS5E,CAAC"}
|
package/dist/http/surface.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { schema_to_surface, middleware_spec_applies, merge_error_schemas, is_null_schema, is_strict_object_schema } from './schema_helpers.js';
|
|
11
|
+
import { schema_meta_value, schema_sensitivity } from '../schema_meta.js';
|
|
11
12
|
// --- Surface generation ---
|
|
12
13
|
/**
|
|
13
14
|
* Collect error schemas from all middleware that applies to a route path.
|
|
@@ -24,7 +25,9 @@ export const collect_middleware_errors = (middleware, route_path) => {
|
|
|
24
25
|
return Object.keys(errors).length > 0 ? errors : null;
|
|
25
26
|
};
|
|
26
27
|
/**
|
|
27
|
-
* Convert env schema to surface entries using `.meta()` metadata
|
|
28
|
+
* Convert env schema to surface entries using `.meta()` metadata, read
|
|
29
|
+
* through each field's wrappers — `schema_meta_value` for the description,
|
|
30
|
+
* the wider fail-safe `schema_sensitivity` walk for secrets.
|
|
28
31
|
*
|
|
29
32
|
* @param schema - Zod object schema with `.meta()` on fields
|
|
30
33
|
*/
|
|
@@ -32,12 +35,12 @@ export const env_schema_to_surface = (schema) => {
|
|
|
32
35
|
const entries = [];
|
|
33
36
|
for (const [name, field_schema] of Object.entries(schema.shape)) {
|
|
34
37
|
const field = field_schema;
|
|
35
|
-
const meta = field.meta();
|
|
36
38
|
const undef_result = field.safeParse(undefined);
|
|
37
39
|
entries.push({
|
|
38
40
|
name,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
// read through wrappers — a `.meta()` under `.optional()` is not on the outer schema
|
|
42
|
+
description: schema_meta_value(field, 'description') ?? '',
|
|
43
|
+
sensitivity: schema_sensitivity(field) ?? null,
|
|
41
44
|
has_default: undef_result.success && undef_result.data !== undefined,
|
|
42
45
|
optional: undef_result.success
|
|
43
46
|
});
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Usable in tests, the adversarial auth runner, and future surface explorer UI.
|
|
5
5
|
* Replaces duplicated inline `.filter()` patterns.
|
|
6
6
|
*
|
|
7
|
-
* Categorical filters (`
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Categorical filters (`filter_role_routes`, `filter_keeper_routes`,
|
|
8
|
+
* `filter_credential_gated_routes`) and `surface_auth_summary` group the
|
|
9
|
+
* flat-record `RouteAuth` shape into categorical buckets for adversarial test
|
|
10
|
+
* runners and the surface explorer. The buckets are
|
|
11
11
|
* derived views over the authority axes (`account`, `actor`, `roles`,
|
|
12
12
|
* `credential_types`) — see `http/auth_shape.ts` for the canonical shape.
|
|
13
13
|
*
|
|
@@ -20,11 +20,6 @@ export declare const filter_protected_routes: (surface: AppSurface) => Array<App
|
|
|
20
20
|
export declare const filter_public_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
21
21
|
/** Filter all role-guarded routes (any role declared on `auth.roles`). */
|
|
22
22
|
export declare const filter_role_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
23
|
-
/**
|
|
24
|
-
* Filter routes that require basic authentication only — `account === 'required'`
|
|
25
|
-
* with no role / credential gate.
|
|
26
|
-
*/
|
|
27
|
-
export declare const filter_authenticated_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
28
23
|
/** Filter routes that require keeper credentials (`daemon_token`). */
|
|
29
24
|
export declare const filter_keeper_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
30
25
|
/**
|
|
@@ -38,58 +33,22 @@ export declare const filter_keeper_routes: (surface: AppSurface) => Array<AppSur
|
|
|
38
33
|
* in it answers `credential_type_required` to a channel it does not admit.
|
|
39
34
|
*/
|
|
40
35
|
export declare const filter_credential_gated_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
41
|
-
/** Filter routes whose `auth.roles` includes the named role. */
|
|
42
|
-
export declare const filter_routes_for_role: (surface: AppSurface, role: string) => Array<AppSurfaceRoute>;
|
|
43
|
-
/**
|
|
44
|
-
* Categorize a `RouteAuth` into one of the legacy auth buckets.
|
|
45
|
-
*
|
|
46
|
-
* Returns:
|
|
47
|
-
* - `'none'` for fully public routes (account === 'none' && actor === 'none')
|
|
48
|
-
* - `'keeper'` when `credential_types` includes `'daemon_token'`
|
|
49
|
-
* - `'role:<name>'` for each role declared on `auth.roles` (multi-role specs
|
|
50
|
-
* are emitted multiple times; callers that need single-bucket grouping
|
|
51
|
-
* should pre-collapse)
|
|
52
|
-
* - `'credential:<type>'` for each channel a role-less route's
|
|
53
|
-
* `credential_types` admits — the session-only gates (`POST /logout`,
|
|
54
|
-
* `POST /password`, the `account_*` credential-lifecycle actions), plus any
|
|
55
|
-
* channel a consumer registers
|
|
56
|
-
* - `'authenticated'` for `account === 'required'` without role / credential gate
|
|
57
|
-
* - `'optional'` when either axis is `'optional'` and no other bucket fits
|
|
58
|
-
* - `'other'` as a last-resort bucket for shapes that don't match above
|
|
59
|
-
*
|
|
60
|
-
* Keeper is tested before the role bucket and the general credential bucket
|
|
61
|
-
* after it, which is not an inconsistency: keeper is an authority *level* — a
|
|
62
|
-
* ceiling no session or api token reaches — so it names the route, while a
|
|
63
|
-
* session gate is a *channel* restriction layered over whatever authority the
|
|
64
|
-
* route already declares. So the audit SSE stream, gated to the session
|
|
65
|
-
* channel and to the admin role, buckets as `role:admin`.
|
|
66
|
-
*/
|
|
67
|
-
export type RouteAuthCategory = 'none' | 'authenticated' | 'optional' | 'keeper' | `role:${string}` | `credential:${string}` | 'other';
|
|
68
|
-
/**
|
|
69
|
-
* Group routes by auth category (see `RouteAuthCategory`). Multi-role specs
|
|
70
|
-
* appear under each of their role buckets.
|
|
71
|
-
*/
|
|
72
|
-
export declare const routes_by_auth_type: (surface: AppSurface) => Map<string, Array<AppSurfaceRoute>>;
|
|
73
|
-
/** Filter routes whose path starts with `prefix`. */
|
|
74
|
-
export declare const filter_routes_by_prefix: (surface: AppSurface, prefix: string) => Array<AppSurfaceRoute>;
|
|
75
36
|
/** Filter routes that have a non-null input schema. */
|
|
76
37
|
export declare const filter_routes_with_input: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
77
38
|
/** Filter routes that have a non-null params schema. */
|
|
78
39
|
export declare const filter_routes_with_params: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
79
40
|
/** Filter routes that have a non-null query schema. */
|
|
80
41
|
export declare const filter_routes_with_query: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
81
|
-
/** Filter routes that are mutations (POST, PUT, DELETE, PATCH). */
|
|
82
|
-
export declare const filter_mutation_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
83
|
-
/** Filter routes that declare rate limiting. */
|
|
84
|
-
export declare const filter_rate_limited_routes: (surface: AppSurface) => Array<AppSurfaceRoute>;
|
|
85
42
|
/** Format a route as `'METHOD /path'` (e.g. `'GET /health'`). */
|
|
86
43
|
export declare const format_route_key: (route: AppSurfaceRoute) => string;
|
|
87
44
|
/**
|
|
88
45
|
* Summarize route auth distribution across the surface.
|
|
89
46
|
*
|
|
90
|
-
* Categorical view over the flat auth record
|
|
91
|
-
* `
|
|
92
|
-
*
|
|
47
|
+
* Categorical view over the flat auth record — `none`, `keeper`, `role` and
|
|
48
|
+
* `credential` (counted per name), `authenticated`, `optional`, `other`.
|
|
49
|
+
* Keeper outranks a role, and a role outranks a channel gate, so the audit
|
|
50
|
+
* SSE stream (admin role, session channel) counts under `role`. Multi-role
|
|
51
|
+
* and multi-channel specs contribute one count per role / channel they admit.
|
|
93
52
|
*
|
|
94
53
|
* @returns counts by auth category, with role and channel counts broken out
|
|
95
54
|
* by name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface_query.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/surface_query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"surface_query.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/surface_query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAUhE,6DAA6D;AAC7D,eAAO,MAAM,uBAAuB,GAAI,SAAS,UAAU,KAAG,KAAK,CAAC,eAAe,CAC7B,CAAC;AAEvD,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,GAAI,SAAS,UAAU,KAAG,KAAK,CAAC,eAAe,CAC3B,CAAC;AAEtD,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,GAAI,SAAS,UAAU,KAAG,KAAK,CAAC,eAAe,CAC3B,CAAC;AAEpD,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,GAAI,SAAS,UAAU,KAAG,KAAK,CAAC,eAAe,CAC3B,CAAC;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,8BAA8B,GAAI,SAAS,UAAU,KAAG,KAAK,CAAC,eAAe,CAC3B,CAAC;AAsChE,uDAAuD;AACvD,eAAO,MAAM,wBAAwB,GAAI,SAAS,UAAU,KAAG,KAAK,CAAC,eAAe,CAC9B,CAAC;AAEvD,wDAAwD;AACxD,eAAO,MAAM,yBAAyB,GAAI,SAAS,UAAU,KAAG,KAAK,CAAC,eAAe,CAC9B,CAAC;AAExD,uDAAuD;AACvD,eAAO,MAAM,wBAAwB,GAAI,SAAS,UAAU,KAAG,KAAK,CAAC,eAAe,CAC9B,CAAC;AAEvD,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,GAAI,OAAO,eAAe,KAAG,MAAyC,CAAC;AAEpG;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAChC,SAAS,UAAU,KACjB;IACF,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CAsCd,CAAC"}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Usable in tests, the adversarial auth runner, and future surface explorer UI.
|
|
5
5
|
* Replaces duplicated inline `.filter()` patterns.
|
|
6
6
|
*
|
|
7
|
-
* Categorical filters (`
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Categorical filters (`filter_role_routes`, `filter_keeper_routes`,
|
|
8
|
+
* `filter_credential_gated_routes`) and `surface_auth_summary` group the
|
|
9
|
+
* flat-record `RouteAuth` shape into categorical buckets for adversarial test
|
|
10
|
+
* runners and the surface explorer. The buckets are
|
|
11
11
|
* derived views over the authority axes (`account`, `actor`, `roles`,
|
|
12
12
|
* `credential_types`) — see `http/auth_shape.ts` for the canonical shape.
|
|
13
13
|
*
|
|
@@ -20,11 +20,6 @@ export const filter_protected_routes = (surface) => surface.routes.filter((r) =>
|
|
|
20
20
|
export const filter_public_routes = (surface) => surface.routes.filter((r) => is_public_auth(r.auth));
|
|
21
21
|
/** Filter all role-guarded routes (any role declared on `auth.roles`). */
|
|
22
22
|
export const filter_role_routes = (surface) => surface.routes.filter((r) => is_role_auth(r.auth));
|
|
23
|
-
/**
|
|
24
|
-
* Filter routes that require basic authentication only — `account === 'required'`
|
|
25
|
-
* with no role / credential gate.
|
|
26
|
-
*/
|
|
27
|
-
export const filter_authenticated_routes = (surface) => surface.routes.filter((r) => is_plain_authenticated_auth(r.auth));
|
|
28
23
|
/** Filter routes that require keeper credentials (`daemon_token`). */
|
|
29
24
|
export const filter_keeper_routes = (surface) => surface.routes.filter((r) => is_keeper_auth(r.auth));
|
|
30
25
|
/**
|
|
@@ -38,74 +33,37 @@ export const filter_keeper_routes = (surface) => surface.routes.filter((r) => is
|
|
|
38
33
|
* in it answers `credential_type_required` to a channel it does not admit.
|
|
39
34
|
*/
|
|
40
35
|
export const filter_credential_gated_routes = (surface) => surface.routes.filter((r) => is_credential_gated_auth(r.auth));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
group.push(r);
|
|
56
|
-
};
|
|
57
|
-
for (const r of surface.routes) {
|
|
58
|
-
const auth = r.auth;
|
|
59
|
-
if (is_public_auth(auth)) {
|
|
60
|
-
push('none', r);
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
if (is_keeper_auth(auth)) {
|
|
64
|
-
push('keeper', r);
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
if (is_role_auth(auth)) {
|
|
68
|
-
for (const role of auth.roles)
|
|
69
|
-
push(`role:${role}`, r);
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
if (is_credential_gated_auth(auth)) {
|
|
73
|
-
for (const credential_type of auth.credential_types)
|
|
74
|
-
push(`credential:${credential_type}`, r);
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
if (is_plain_authenticated_auth(auth)) {
|
|
78
|
-
push('authenticated', r);
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
if (auth.account === 'optional' || auth.actor === 'optional') {
|
|
82
|
-
push('optional', r);
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
push('other', r);
|
|
86
|
-
}
|
|
87
|
-
return groups;
|
|
36
|
+
const categorize_route_auth = (auth) => {
|
|
37
|
+
if (is_public_auth(auth))
|
|
38
|
+
return { kind: 'none' };
|
|
39
|
+
if (is_keeper_auth(auth))
|
|
40
|
+
return { kind: 'keeper' };
|
|
41
|
+
if (is_role_auth(auth))
|
|
42
|
+
return { kind: 'role', names: auth.roles };
|
|
43
|
+
if (is_credential_gated_auth(auth))
|
|
44
|
+
return { kind: 'credential', names: auth.credential_types };
|
|
45
|
+
if (is_plain_authenticated_auth(auth))
|
|
46
|
+
return { kind: 'authenticated' };
|
|
47
|
+
if (auth.account === 'optional' || auth.actor === 'optional')
|
|
48
|
+
return { kind: 'optional' };
|
|
49
|
+
return { kind: 'other' };
|
|
88
50
|
};
|
|
89
|
-
/** Filter routes whose path starts with `prefix`. */
|
|
90
|
-
export const filter_routes_by_prefix = (surface, prefix) => surface.routes.filter((r) => r.path.startsWith(prefix));
|
|
91
51
|
/** Filter routes that have a non-null input schema. */
|
|
92
52
|
export const filter_routes_with_input = (surface) => surface.routes.filter((r) => r.input_schema !== null);
|
|
93
53
|
/** Filter routes that have a non-null params schema. */
|
|
94
54
|
export const filter_routes_with_params = (surface) => surface.routes.filter((r) => r.params_schema !== null);
|
|
95
55
|
/** Filter routes that have a non-null query schema. */
|
|
96
56
|
export const filter_routes_with_query = (surface) => surface.routes.filter((r) => r.query_schema !== null);
|
|
97
|
-
/** Filter routes that are mutations (POST, PUT, DELETE, PATCH). */
|
|
98
|
-
export const filter_mutation_routes = (surface) => surface.routes.filter((r) => r.is_mutation);
|
|
99
|
-
/** Filter routes that declare rate limiting. */
|
|
100
|
-
export const filter_rate_limited_routes = (surface) => surface.routes.filter((r) => r.rate_limit_key !== null);
|
|
101
57
|
/** Format a route as `'METHOD /path'` (e.g. `'GET /health'`). */
|
|
102
58
|
export const format_route_key = (route) => `${route.method} ${route.path}`;
|
|
103
59
|
/**
|
|
104
60
|
* Summarize route auth distribution across the surface.
|
|
105
61
|
*
|
|
106
|
-
* Categorical view over the flat auth record
|
|
107
|
-
* `
|
|
108
|
-
*
|
|
62
|
+
* Categorical view over the flat auth record — `none`, `keeper`, `role` and
|
|
63
|
+
* `credential` (counted per name), `authenticated`, `optional`, `other`.
|
|
64
|
+
* Keeper outranks a role, and a role outranks a channel gate, so the audit
|
|
65
|
+
* SSE stream (admin role, session channel) counts under `role`. Multi-role
|
|
66
|
+
* and multi-channel specs contribute one count per role / channel they admit.
|
|
109
67
|
*
|
|
110
68
|
* @returns counts by auth category, with role and channel counts broken out
|
|
111
69
|
* by name
|
|
@@ -119,36 +77,32 @@ export const surface_auth_summary = (surface) => {
|
|
|
119
77
|
let keeper = 0;
|
|
120
78
|
let other = 0;
|
|
121
79
|
for (const r of surface.routes) {
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
none
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (auth.account === 'optional' || auth.actor === 'optional') {
|
|
148
|
-
optional++;
|
|
149
|
-
continue;
|
|
80
|
+
const bucket = categorize_route_auth(r.auth);
|
|
81
|
+
switch (bucket.kind) {
|
|
82
|
+
case 'none':
|
|
83
|
+
none++;
|
|
84
|
+
break;
|
|
85
|
+
case 'keeper':
|
|
86
|
+
keeper++;
|
|
87
|
+
break;
|
|
88
|
+
case 'authenticated':
|
|
89
|
+
authenticated++;
|
|
90
|
+
break;
|
|
91
|
+
case 'optional':
|
|
92
|
+
optional++;
|
|
93
|
+
break;
|
|
94
|
+
case 'other':
|
|
95
|
+
other++;
|
|
96
|
+
break;
|
|
97
|
+
case 'role':
|
|
98
|
+
for (const name of bucket.names)
|
|
99
|
+
role.set(name, (role.get(name) ?? 0) + 1);
|
|
100
|
+
break;
|
|
101
|
+
case 'credential':
|
|
102
|
+
for (const name of bucket.names)
|
|
103
|
+
credential.set(name, (credential.get(name) ?? 0) + 1);
|
|
104
|
+
break;
|
|
150
105
|
}
|
|
151
|
-
other++;
|
|
152
106
|
}
|
|
153
107
|
return { none, authenticated, optional, role, credential, keeper, other };
|
|
154
108
|
};
|