@fuzdev/fuz_app 0.175.0 → 0.177.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 +6 -4
- package/dist/actions/CLAUDE.md +10 -8
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_dispatcher.d.ts.map +1 -1
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event_data.d.ts +37 -255
- package/dist/actions/action_event_data.d.ts.map +1 -1
- package/dist/actions/action_event_helpers.d.ts.map +1 -1
- package/dist/actions/action_event_types.d.ts +2 -2
- package/dist/actions/action_event_types.d.ts.map +1 -1
- package/dist/actions/action_registry.d.ts.map +1 -1
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_spec.d.ts +3 -3
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/cancel.d.ts +5 -13
- package/dist/actions/cancel.d.ts.map +1 -1
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/connection_closer.d.ts.map +1 -1
- package/dist/actions/connection_registry.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/heartbeat.d.ts +2 -2
- package/dist/actions/heartbeat.d.ts.map +1 -1
- package/dist/actions/peer_ping.d.ts +16 -56
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_request.d.ts.map +1 -1
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/rpc_client.d.ts.map +1 -1
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/ws_endpoint_spec.d.ts.map +1 -1
- package/dist/actions/ws_outbound_writer.d.ts +8 -8
- package/dist/actions/ws_outbound_writer.d.ts.map +1 -1
- package/dist/actions/ws_outbound_writer.js +8 -11
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/auth/CLAUDE.md +1 -1
- package/dist/auth/account_action_specs.d.ts +114 -591
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_route_schema.d.ts +66 -360
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_schema.d.ts +82 -463
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/actor_lookup_action_specs.d.ts +25 -164
- package/dist/auth/actor_lookup_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_lookup_actions.d.ts.map +1 -1
- package/dist/auth/actor_lookup_queries.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.d.ts +27 -165
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_actions.d.ts.map +1 -1
- package/dist/auth/actor_search_queries.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.d.ts +355 -2575
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/all_action_spec_registries.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/api_token.d.ts +1 -1
- package/dist/auth/api_token.d.ts.map +1 -1
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/app_settings_queries.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.d.ts +9 -37
- package/dist/auth/app_settings_schema.d.ts.map +1 -1
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_log_ddl.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.d.ts +2 -11
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.d.ts +164 -728
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/auth_ddl.d.ts.map +1 -1
- package/dist/auth/auth_guard_resolver.d.ts.map +1 -1
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.d.ts +18 -102
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/cell_action_helpers.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.d.ts +826 -5965
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_audit_action_specs.d.ts +40 -280
- package/dist/auth/cell_audit_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_audit_actions.d.ts.map +1 -1
- package/dist/auth/cell_audit_events.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.d.ts +18 -84
- package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_authorize.d.ts.map +1 -1
- package/dist/auth/cell_data_schema.d.ts +3 -9
- package/dist/auth/cell_data_schema.d.ts.map +1 -1
- package/dist/auth/cell_field_action_specs.d.ts +96 -663
- package/dist/auth/cell_field_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_audit_metadata.d.ts +8 -44
- package/dist/auth/cell_field_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_grant_action_specs.d.ts +141 -1008
- package/dist/auth/cell_grant_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_audit_metadata.d.ts +25 -179
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_item_action_specs.d.ts +129 -903
- package/dist/auth/cell_item_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_item_actions.d.ts.map +1 -1
- package/dist/auth/cell_item_audit_metadata.d.ts +12 -61
- package/dist/auth/cell_item_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_ref_admission.d.ts.map +1 -1
- package/dist/auth/cell_relation_list_limit.d.ts +1 -1
- package/dist/auth/cell_relation_list_limit.d.ts.map +1 -1
- package/dist/auth/cell_relation_visibility.d.ts.map +1 -1
- package/dist/auth/cell_steward.d.ts.map +1 -1
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/credential_deadline.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.d.ts +1 -1
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/daemon_token.d.ts +1 -1
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/fail_floor.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.d.ts +1 -1
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_schema.d.ts +18 -84
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/keyring.d.ts +1 -1
- package/dist/auth/keyring.d.ts.map +1 -1
- package/dist/auth/keyring.js +1 -1
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/name_schema.d.ts.map +1 -1
- package/dist/auth/password.d.ts +2 -2
- package/dist/auth/password.d.ts.map +1 -1
- package/dist/auth/password_argon2.d.ts.map +1 -1
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.d.ts +318 -2134
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.d.ts +202 -1284
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_schema.d.ts +17 -81
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_sql.d.ts.map +1 -1
- package/dist/auth/role_schema.d.ts +1 -1
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema.d.ts +1 -1
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.d.ts +16 -58
- package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.d.ts +11 -57
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/standard_action_specs.d.ts.map +1 -1
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/token_lifetime.d.ts +6 -29
- package/dist/auth/token_lifetime.d.ts.map +1 -1
- package/dist/auth/token_scope.d.ts +16 -78
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/crypto.d.ts.map +1 -1
- package/dist/db/CLAUDE.md +9 -0
- package/dist/db/assert_row.d.ts.map +1 -1
- package/dist/db/cell_audit_queries.d.ts.map +1 -1
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_field_queries.d.ts.map +1 -1
- package/dist/db/cell_grant_queries.d.ts.map +1 -1
- package/dist/db/cell_item_queries.d.ts.map +1 -1
- package/dist/db/cell_moderation.d.ts.map +1 -1
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_view_sql.d.ts.map +1 -1
- package/dist/db/create_db.d.ts.map +1 -1
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db_checkout_error.d.ts.map +1 -1
- package/dist/db/db_pg.d.ts.map +1 -1
- package/dist/db/db_pglet.d.ts.map +1 -1
- package/dist/db/db_pglite.d.ts.map +1 -1
- package/dist/db/fact_ddl.d.ts.map +1 -1
- package/dist/db/fact_disk_storage.d.ts +3 -2
- package/dist/db/fact_disk_storage.d.ts.map +1 -1
- package/dist/db/fact_disk_storage.js +2 -1
- package/dist/db/fact_holder_queries.d.ts.map +1 -1
- package/dist/db/fact_queries.d.ts.map +1 -1
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/fact_store_errors.d.ts.map +1 -1
- package/dist/db/file_fact_url.d.ts +1 -6
- package/dist/db/file_fact_url.d.ts.map +1 -1
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/pg_error.d.ts.map +1 -1
- package/dist/db/postgres_url.d.ts +95 -0
- package/dist/db/postgres_url.d.ts.map +1 -0
- package/dist/db/postgres_url.js +167 -0
- package/dist/db/query_deps.d.ts.map +1 -1
- package/dist/db/schema_ready.d.ts.map +1 -1
- package/dist/db/sql_columns.d.ts.map +1 -1
- package/dist/db/sql_identifier.d.ts.map +1 -1
- package/dist/db/status.d.ts.map +1 -1
- package/dist/dev/setup.d.ts +101 -33
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +174 -71
- package/dist/env/dotenv.d.ts +1 -1
- package/dist/env/dotenv.d.ts.map +1 -1
- package/dist/env/dotenv.js +2 -3
- package/dist/env/env_schemas.d.ts.map +1 -1
- package/dist/env/load.d.ts.map +1 -1
- package/dist/env/mask.d.ts.map +1 -1
- package/dist/env/update_env_variable.d.ts.map +1 -1
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/http/CLAUDE.md +1 -1
- package/dist/http/auth_shape.d.ts +1 -1
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/body_limit.d.ts +10 -16
- package/dist/http/body_limit.d.ts.map +1 -1
- package/dist/http/body_limit.js +10 -16
- package/dist/http/body_limit_schema.d.ts.map +1 -1
- package/dist/http/client_ip.d.ts.map +1 -1
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/dev_route_error_check.d.ts.map +1 -1
- package/dist/http/error_schemas.d.ts +31 -151
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/health_schema.d.ts +2 -6
- package/dist/http/health_schema.d.ts.map +1 -1
- package/dist/http/host.d.ts.map +1 -1
- package/dist/http/ip_canonical.d.ts.map +1 -1
- package/dist/http/json_text.d.ts.map +1 -1
- package/dist/http/jsonrpc.d.ts +42 -181
- package/dist/http/jsonrpc.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
- package/dist/http/middleware_spec.d.ts.map +1 -1
- package/dist/http/origin.d.ts +2 -2
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin_wildcard.d.ts.map +1 -1
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/route_error_check.d.ts.map +1 -1
- package/dist/http/route_errors.d.ts.map +1 -1
- package/dist/http/route_result.d.ts.map +1 -1
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/simple_request.d.ts.map +1 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/periodic.d.ts.map +1 -1
- package/dist/primitive_schemas.d.ts +10 -30
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/rate_limiter.d.ts +1 -1
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/realtime/audit_log_sse.d.ts.map +1 -1
- package/dist/realtime/outbound_budget.d.ts.map +1 -1
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse_constants.d.ts.map +1 -1
- package/dist/realtime/sse_registry.d.ts.map +1 -1
- package/dist/runtime/deps.d.ts +81 -45
- package/dist/runtime/deps.d.ts.map +1 -1
- package/dist/runtime/deps.js +7 -2
- package/dist/runtime/fs.d.ts.map +1 -1
- package/dist/runtime/mock.d.ts +63 -16
- package/dist/runtime/mock.d.ts.map +1 -1
- package/dist/runtime/mock.js +75 -35
- package/dist/runtime/node.d.ts +3 -2
- package/dist/runtime/node.d.ts.map +1 -1
- package/dist/runtime/node.js +20 -72
- package/dist/runtime/process_id.d.ts +24 -0
- package/dist/runtime/process_id.d.ts.map +1 -0
- package/dist/runtime/process_id.js +27 -0
- package/dist/runtime/secure_file.d.ts +8 -30
- package/dist/runtime/secure_file.d.ts.map +1 -1
- package/dist/runtime/secure_file.js +23 -51
- package/dist/schema_issues.d.ts +6 -18
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_error_handler.d.ts.map +1 -1
- package/dist/server/app_server.d.ts +2 -2
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.d.ts +11 -33
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/fact_security_headers.d.ts.map +1 -1
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/startup.d.ts.map +1 -1
- package/dist/server/static.d.ts +1 -1
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/surface_route.d.ts.map +1 -1
- package/dist/server/x_accel.d.ts +3 -7
- package/dist/server/x_accel.d.ts.map +1 -1
- package/dist/testing/CLAUDE.md +28 -27
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/assert_dev_env.d.ts.map +1 -1
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/connection_closer_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.d.ts +19 -95
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -1
- package/dist/testing/cross_backend/app_settings.d.ts.map +1 -1
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/backend_config.d.ts +7 -7
- package/dist/testing/cross_backend/backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/bench_report.d.ts +2 -2
- package/dist/testing/cross_backend/bench/bench_report.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/bench_report.js +2 -2
- package/dist/testing/cross_backend/bench/run_cross_impl_bench.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/scenario.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size_smuggling.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size_smuggling.js +1 -4
- package/dist/testing/cross_backend/bootstrap_backend.d.ts +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.d.ts +2 -2
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/cargo_binary.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_grant_role.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_grant_steward.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_moderate.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_ref_admission.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_rpc_auth.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts +2 -2
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_cross_backend_global_setup.js +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +2 -2
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
- package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.d.ts +1 -1
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +4 -4
- package/dist/testing/cross_backend/default_secrets.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.d.ts +2 -2
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +6 -6
- package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +1 -1
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/make_cross_backend_project.d.ts +2 -2
- package/dist/testing/cross_backend/make_cross_backend_project.d.ts.map +1 -1
- package/dist/testing/cross_backend/make_cross_backend_project.js +1 -1
- package/dist/testing/cross_backend/method_coverage.d.ts.map +1 -1
- package/dist/testing/cross_backend/narrowed_api_token.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_conformance.d.ts +44 -294
- package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_conformance.json +1 -1
- package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/postgres_database.d.ts +7 -21
- package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -1
- package/dist/testing/cross_backend/postgres_database.js +24 -35
- package/dist/testing/cross_backend/provided_context.d.ts.map +1 -1
- package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
- package/dist/testing/cross_backend/ready.d.ts.map +1 -1
- package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_enumeration.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_participation.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_role_grammar.d.ts.map +1 -1
- package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
- package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +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.map +1 -1
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cookie_codec.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
- package/dist/testing/cross_backend/spawn_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts.map +1 -1
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.d.ts +24 -136
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +92 -627
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.js +10 -12
- package/dist/testing/cross_backend/testing_server_core.d.ts +13 -17
- 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/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_scope_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +7 -17
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +0 -51
- package/dist/testing/cross_backend/wire_shapes.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_envelope.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.js +2 -2
- package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/xfail.d.ts.map +1 -1
- package/dist/testing/daemon_info.d.ts +17 -24
- package/dist/testing/daemon_info.d.ts.map +1 -1
- package/dist/testing/daemon_info.js +11 -8
- package/dist/testing/daemon_token_rotation.d.ts.map +1 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/entities.d.ts.map +1 -1
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware_gate_probes.d.ts.map +1 -1
- package/dist/testing/middleware_gate_probes.js +2 -2
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/resolved_auth.d.ts.map +1 -1
- package/dist/testing/role_grant_helpers.d.ts.map +1 -1
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_introspect.d.ts +52 -380
- package/dist/testing/schema_introspect.d.ts.map +1 -1
- package/dist/testing/schema_parity.d.ts.map +1 -1
- package/dist/testing/schema_ready_fixture.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/test_credentials.d.ts.map +1 -1
- package/dist/testing/test_origin.d.ts.map +1 -1
- package/dist/testing/token_scope_fixtures.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.d.ts.map +1 -1
- package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/sse_frame_reader.d.ts.map +1 -1
- package/dist/testing/transports/sse_transport.d.ts.map +1 -1
- package/dist/testing/transports/ws_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_transport.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/timestamp.d.ts.map +1 -1
- package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAccounts.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
- package/dist/ui/AdminInvites.svelte.d.ts.map +1 -1
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
- package/dist/ui/AdminRoleGrantHistory.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSettings.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSurface.svelte.d.ts.map +1 -1
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +3 -195
- package/dist/ui/ConfirmButton.svelte.d.ts.map +1 -1
- package/dist/ui/Datatable.svelte.d.ts.map +1 -1
- package/dist/ui/LoginForm.svelte.d.ts.map +1 -1
- package/dist/ui/LogoutButton.svelte.d.ts.map +1 -1
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
- package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferForm.svelte +1 -1
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferHistory.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferInbox.svelte +4 -4
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +5 -5
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
- package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
- package/dist/ui/async_slot.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/backend_probe.svelte.d.ts.map +1 -1
- package/dist/ui/datatable.d.ts.map +1 -1
- package/dist/ui/form_state.svelte.d.ts.map +1 -1
- package/dist/ui/format_scope.d.ts.map +1 -1
- package/dist/ui/keyed_async_slot.svelte.d.ts.map +1 -1
- package/dist/ui/popover.svelte.d.ts +1 -1
- package/dist/ui/popover.svelte.d.ts.map +1 -1
- package/dist/ui/popover.svelte.js +1 -1
- package/dist/ui/position_helpers.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.d.ts +5 -5
- package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -1
- package/dist/ui/table_state.svelte.d.ts.map +1 -1
- package/dist/ui/ui_fetch.d.ts.map +1 -1
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/package.json +10 -15
- package/dist/runtime/deno.d.ts +0 -21
- package/dist/runtime/deno.d.ts.map +0 -1
- package/dist/runtime/deno.js +0 -191
- package/dist/testing/cross_backend/testing_server_deno.d.ts +0 -5
- package/dist/testing/cross_backend/testing_server_deno.d.ts.map +0 -1
- package/dist/testing/cross_backend/testing_server_deno.js +0 -38
- package/dist/ui/AppShell.svelte +0 -448
- package/dist/ui/AppShell.svelte.d.ts +0 -135
- package/dist/ui/AppShell.svelte.d.ts.map +0 -1
- package/dist/ui/ColumnLayout.svelte +0 -185
- package/dist/ui/ColumnLayout.svelte.d.ts +0 -60
- package/dist/ui/ColumnLayout.svelte.d.ts.map +0 -1
- package/dist/ui/MenuLink.svelte +0 -45
- package/dist/ui/MenuLink.svelte.d.ts +0 -30
- package/dist/ui/MenuLink.svelte.d.ts.map +0 -1
- package/dist/ui/sidebar_state.svelte.d.ts +0 -113
- package/dist/ui/sidebar_state.svelte.d.ts.map +0 -1
- package/dist/ui/sidebar_state.svelte.js +0 -125
package/dist/dev/setup.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dev workflow helpers for setup, reset, and database management.
|
|
3
3
|
*
|
|
4
|
-
* Composable functions that consumer projects
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Composable functions that consumer projects use in their dev setup and
|
|
5
|
+
* reset tasks. File and env access come through narrow `*Deps` interfaces
|
|
6
|
+
* from `runtime/deps.ts`, which a `RuntimeDeps` from `create_node_runtime()`
|
|
7
|
+
* satisfies. The Postgres client programs the database helpers run come
|
|
8
|
+
* through `PostgresProgramDeps`, each a factory the task root writes over its
|
|
9
|
+
* spawn (with gro, `(env) => spawn.find('createdb', {pass_env: ['PG*'], env})`),
|
|
10
|
+
* so the root decides which binary runs and which environment it sees.
|
|
8
11
|
*
|
|
9
12
|
* @module
|
|
10
13
|
*/
|
|
11
14
|
import { to_hex } from '@fuzdev/fuz_util/hex.ts';
|
|
15
|
+
import { is_pg_database_url } from '../db/create_db.js';
|
|
16
|
+
import { is_createdb_already_exists, parse_db_name, to_createdb_args, to_dropdb_args, to_postgres_password_env } from '../db/postgres_url.js';
|
|
12
17
|
import { load_env_file, parse_dotenv } from '../env/dotenv.js';
|
|
13
18
|
import { update_env_content } from '../env/update_env_variable.js';
|
|
14
19
|
import { write_file_atomic } from '../runtime/fs.js';
|
|
@@ -21,20 +26,49 @@ export const default_setup_logger = {
|
|
|
21
26
|
error: (msg) => console.error(` [error] ${msg}`)
|
|
22
27
|
};
|
|
23
28
|
// === Pure utilities ===
|
|
29
|
+
/** What kind of database `database_url` names, by `create_db`'s schemes. */
|
|
30
|
+
const to_setup_db_type = (database_url) => {
|
|
31
|
+
if (is_pg_database_url(database_url))
|
|
32
|
+
return 'postgres';
|
|
33
|
+
if (database_url.startsWith('file://'))
|
|
34
|
+
return 'pglite';
|
|
35
|
+
if (database_url.startsWith('memory://'))
|
|
36
|
+
return 'memory';
|
|
37
|
+
return 'none';
|
|
38
|
+
};
|
|
39
|
+
/** A program output's failure, as text: its stderr, or how it ended. */
|
|
40
|
+
const describe_program_failure = (output) => {
|
|
41
|
+
const stderr = output.stderr.trim();
|
|
42
|
+
if (stderr)
|
|
43
|
+
return stderr;
|
|
44
|
+
switch (output.kind) {
|
|
45
|
+
case 'exited':
|
|
46
|
+
return `exited with code ${output.code}`;
|
|
47
|
+
case 'signaled':
|
|
48
|
+
return `ended by ${output.signal}`;
|
|
49
|
+
default:
|
|
50
|
+
return output.kind === 'timed_out' ? 'timed out' : 'aborted';
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
/** Whether a program output is a clean exit. */
|
|
54
|
+
const is_program_success = (output) => output.kind === 'exited' && output.code === 0;
|
|
24
55
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @returns the database name, or `null` if the URL is invalid or has no path
|
|
56
|
+
* The hint a failed Postgres client gets when the server wanted a password
|
|
57
|
+
* `DATABASE_URL` doesn't carry: where else the program can read one.
|
|
28
58
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
59
|
+
const password_hint = (output, password_env) => output.stderr.includes('password') && password_env.PGPASSWORD === undefined
|
|
60
|
+
? ' (DATABASE_URL has no password: put it in the URL, or give the program PGPASSWORD ' +
|
|
61
|
+
'in its environment or a ~/.pgpass entry)'
|
|
62
|
+
: '';
|
|
63
|
+
/**
|
|
64
|
+
* The URL's password as program environment, or a failure message when its
|
|
65
|
+
* percent-escape is malformed — never naming the password.
|
|
66
|
+
*/
|
|
67
|
+
const read_password_env = (database_url) => {
|
|
68
|
+
const env = to_postgres_password_env(database_url);
|
|
69
|
+
return env === null
|
|
70
|
+
? { ok: false, message: "DATABASE_URL's password has a malformed percent-escape" }
|
|
71
|
+
: { ok: true, env };
|
|
38
72
|
};
|
|
39
73
|
/**
|
|
40
74
|
* Mint an operator-facing secret: 32 random bytes as lowercase hex, the shape
|
|
@@ -66,7 +100,7 @@ export const generate_cookie_key = () => generate_secret_hex();
|
|
|
66
100
|
* @param env_path - path to the .env file
|
|
67
101
|
* @param name - the variable name to read
|
|
68
102
|
* @returns the value, or `undefined` if the file or variable doesn't exist
|
|
69
|
-
* @throws Error if reading fails for any reason other than `ENOENT`
|
|
103
|
+
* @throws Error if reading fails for any reason other than `ENOENT`
|
|
70
104
|
*/
|
|
71
105
|
export const read_env_var = async (deps, env_path, name) => {
|
|
72
106
|
const env = await load_env_file(deps, env_path);
|
|
@@ -135,13 +169,24 @@ export const setup_env_file = async (deps, env_path, example_path, options) => {
|
|
|
135
169
|
log.ok(`Created ${env_path} with generated secrets`);
|
|
136
170
|
return { created: true, updated: true, path: env_path };
|
|
137
171
|
};
|
|
172
|
+
/**
|
|
173
|
+
* The bootstrap token's state directory: `state_dir` when given, else
|
|
174
|
+
* `~/.{app_name}`, or `null` when neither is available.
|
|
175
|
+
*/
|
|
176
|
+
const to_token_state_dir = (deps, app_name, state_dir) => {
|
|
177
|
+
if (state_dir !== undefined)
|
|
178
|
+
return state_dir;
|
|
179
|
+
const home = deps.env_get('HOME');
|
|
180
|
+
return home ? `${home}/.${app_name}` : null;
|
|
181
|
+
};
|
|
138
182
|
/**
|
|
139
183
|
* Create a bootstrap token file if it doesn't exist.
|
|
140
184
|
*
|
|
141
185
|
* The token is a one-shot secret used to create the first admin account:
|
|
142
186
|
* 32 random bytes as 64 lowercase hex characters plus one LF, the file
|
|
143
|
-
* `openssl rand -hex 32` writes. Stored at
|
|
144
|
-
* `~/.{app_name}
|
|
187
|
+
* `openssl rand -hex 32` writes. Stored at `{state_dir}/secret_bootstrap_token`,
|
|
188
|
+
* `state_dir` defaulting to `~/.{app_name}`; skipped only when no `state_dir`
|
|
189
|
+
* is given and `$HOME` is unset.
|
|
145
190
|
*
|
|
146
191
|
* @param deps - file and env capabilities
|
|
147
192
|
* @param app_name - application name (used for default state directory)
|
|
@@ -151,16 +196,15 @@ export const setup_env_file = async (deps, env_path, example_path, options) => {
|
|
|
151
196
|
*/
|
|
152
197
|
export const setup_bootstrap_token = async (deps, app_name, options) => {
|
|
153
198
|
const log = options?.log ?? default_setup_logger;
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
log.skip('$HOME not set, skipping bootstrap token');
|
|
199
|
+
const state_dir = to_token_state_dir(deps, app_name, options?.state_dir);
|
|
200
|
+
if (state_dir === null) {
|
|
201
|
+
log.skip('$HOME not set and no state_dir given, skipping bootstrap token');
|
|
157
202
|
return { created: false, token_path: '' };
|
|
158
203
|
}
|
|
159
|
-
const state_dir = options?.state_dir ?? `${home}/.${app_name}`;
|
|
160
204
|
const token_path = `${state_dir}/secret_bootstrap_token`;
|
|
161
205
|
const stat = await deps.stat(token_path);
|
|
162
206
|
if (stat?.is_file) {
|
|
163
|
-
log.skip(
|
|
207
|
+
log.skip(`${token_path} already exists`);
|
|
164
208
|
return { created: false, token_path };
|
|
165
209
|
}
|
|
166
210
|
// Modes apply at creation — an already-existing state dir keeps its mode.
|
|
@@ -170,11 +214,12 @@ export const setup_bootstrap_token = async (deps, app_name, options) => {
|
|
|
170
214
|
await deps.mkdir(state_dir, { recursive: true, mode: 0o700 });
|
|
171
215
|
const token = generate_secret_hex();
|
|
172
216
|
await write_file_atomic(deps, token_path, token + '\n', { mode: 0o600 });
|
|
173
|
-
log.ok(`Created
|
|
217
|
+
log.ok(`Created ${token_path} (one-shot, deleted after first use)`);
|
|
174
218
|
return { created: true, token_path };
|
|
175
219
|
};
|
|
176
220
|
/**
|
|
177
|
-
* Remove an existing bootstrap token and create a new one
|
|
221
|
+
* Remove an existing bootstrap token and create a new one, in the state
|
|
222
|
+
* directory `setup_bootstrap_token` uses.
|
|
178
223
|
*
|
|
179
224
|
* @param deps - file, env, and remove capabilities
|
|
180
225
|
* @param app_name - application name
|
|
@@ -184,62 +229,99 @@ export const setup_bootstrap_token = async (deps, app_name, options) => {
|
|
|
184
229
|
*/
|
|
185
230
|
export const reset_bootstrap_token = async (deps, app_name, options) => {
|
|
186
231
|
const log = options?.log ?? default_setup_logger;
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
log.skip('$HOME not set');
|
|
232
|
+
const state_dir = to_token_state_dir(deps, app_name, options?.state_dir);
|
|
233
|
+
if (state_dir === null) {
|
|
234
|
+
log.skip('$HOME not set and no state_dir given, skipping bootstrap token');
|
|
190
235
|
return { created: false, token_path: '' };
|
|
191
236
|
}
|
|
192
|
-
const state_dir = options?.state_dir ?? `${home}/.${app_name}`;
|
|
193
237
|
const token_path = `${state_dir}/secret_bootstrap_token`;
|
|
194
238
|
const stat = await deps.stat(token_path);
|
|
195
239
|
if (stat?.is_file) {
|
|
196
240
|
await deps.remove(token_path);
|
|
197
|
-
log.ok(
|
|
241
|
+
log.ok(`Removed existing ${token_path}`);
|
|
198
242
|
}
|
|
199
243
|
return setup_bootstrap_token(deps, app_name, { state_dir, log });
|
|
200
244
|
};
|
|
201
245
|
// === Database helpers ===
|
|
202
246
|
/**
|
|
203
|
-
* Create
|
|
247
|
+
* Create the PostgreSQL database `database_url` names, on the server it
|
|
248
|
+
* names, when it's missing.
|
|
249
|
+
*
|
|
250
|
+
* Runs `createdb --no-password --maintenance-db=<maintenance URL> -- <name>`
|
|
251
|
+
* (`to_createdb_args`) through the program `deps.createdb` makes, with the
|
|
252
|
+
* URL's password in its environment (see `PostgresProgramDeps`). A URL that
|
|
253
|
+
* isn't Postgres (`file://`, `memory://`) has nothing to create and is
|
|
254
|
+
* skipped, as is a missing `createdb`. Does not throw on a failed `createdb` —
|
|
255
|
+
* the result says what happened, and the log says why; a `createdb` that
|
|
256
|
+
* can't start throws.
|
|
204
257
|
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
258
|
+
* On a server whose `lc_messages` isn't English, an existing database is
|
|
259
|
+
* reported as `failed`, since only Postgres's English refusal is recognized.
|
|
260
|
+
* A capped (truncated) output is read as it came: a clean exit is still
|
|
261
|
+
* success, and a cut stderr is still searched for the refusal.
|
|
207
262
|
*
|
|
208
|
-
* @param deps -
|
|
209
|
-
* @param
|
|
263
|
+
* @param deps - the `createdb` factory
|
|
264
|
+
* @param database_url - the `DATABASE_URL` value
|
|
210
265
|
* @param options - logger
|
|
211
|
-
* @returns
|
|
212
|
-
* @mutates external database -
|
|
266
|
+
* @returns what happened
|
|
267
|
+
* @mutates external database - creates the database on the server `database_url` names
|
|
213
268
|
*/
|
|
214
|
-
export const create_database = async (deps,
|
|
269
|
+
export const create_database = async (deps, database_url, options) => {
|
|
215
270
|
const log = options?.log ?? default_setup_logger;
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
|
|
271
|
+
const db_type = to_setup_db_type(database_url);
|
|
272
|
+
if (db_type !== 'postgres') {
|
|
273
|
+
const message = db_type === 'none'
|
|
274
|
+
? 'No Postgres DATABASE_URL, skipping database creation'
|
|
275
|
+
: `A ${db_type} DATABASE_URL needs no createdb`;
|
|
276
|
+
log.skip(message);
|
|
277
|
+
return { kind: 'skipped', db_type, message };
|
|
278
|
+
}
|
|
279
|
+
const database = parse_db_name(database_url);
|
|
280
|
+
if (database === null) {
|
|
281
|
+
const message = 'Could not parse database name from DATABASE_URL';
|
|
282
|
+
log.error(message);
|
|
283
|
+
return { kind: 'failed', message };
|
|
284
|
+
}
|
|
285
|
+
const password = read_password_env(database_url);
|
|
286
|
+
if (!password.ok) {
|
|
287
|
+
log.error(password.message);
|
|
288
|
+
return { kind: 'failed', message: password.message };
|
|
220
289
|
}
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
|
|
290
|
+
const createdb = deps.createdb(password.env);
|
|
291
|
+
if (createdb === null) {
|
|
292
|
+
const message = 'createdb not found — install PostgreSQL, or use a file:// (PGlite) or memory:// DATABASE_URL';
|
|
293
|
+
log.skip(message);
|
|
294
|
+
return { kind: 'skipped', db_type, message };
|
|
224
295
|
}
|
|
225
|
-
|
|
226
|
-
|
|
296
|
+
const output = await createdb.out(to_createdb_args(database, database_url));
|
|
297
|
+
if (is_program_success(output)) {
|
|
298
|
+
log.ok(`Created ${database} database`);
|
|
299
|
+
return { kind: 'created', database };
|
|
227
300
|
}
|
|
228
|
-
|
|
301
|
+
if (is_createdb_already_exists(output.stderr, database)) {
|
|
302
|
+
log.skip(`${database} database already exists`);
|
|
303
|
+
return { kind: 'exists', database };
|
|
304
|
+
}
|
|
305
|
+
const message = `Failed to create database ${database}: ${describe_program_failure(output)}${password_hint(output, password.env)}`;
|
|
306
|
+
log.error(message);
|
|
307
|
+
return { kind: 'failed', message };
|
|
229
308
|
};
|
|
230
309
|
/**
|
|
231
310
|
* Reset a database to a clean slate.
|
|
232
311
|
*
|
|
233
|
-
* For PostgreSQL: drops and recreates the database
|
|
234
|
-
*
|
|
235
|
-
*
|
|
312
|
+
* For PostgreSQL: drops and recreates the database `database_url` names, on
|
|
313
|
+
* the server it names, through the programs `deps.dropdb` and `deps.createdb`
|
|
314
|
+
* make (see `PostgresProgramDeps`; argv from `to_dropdb_args` /
|
|
315
|
+
* `to_createdb_args`). For PGlite (`file://`): removes
|
|
316
|
+
* `options.pglite_data_dir` when given. For an in-memory (`memory://`), empty,
|
|
317
|
+
* or missing URL: skips. An unsupported URL is an error, never dropped.
|
|
236
318
|
*
|
|
237
|
-
* @param deps -
|
|
319
|
+
* @param deps - the Postgres program factories and file capabilities
|
|
238
320
|
* @param database_url - the `DATABASE_URL` value
|
|
239
321
|
* @param options - `pglite_data_dir`, logger
|
|
240
322
|
* @returns result describing what happened
|
|
241
|
-
* @mutates external database - drops and recreates the PostgreSQL database
|
|
242
|
-
* @mutates filesystem - removes `options.pglite_data_dir` recursively for
|
|
323
|
+
* @mutates external database - drops and recreates the PostgreSQL database on the server `database_url` names
|
|
324
|
+
* @mutates filesystem - removes `options.pglite_data_dir` recursively for `file://` URLs
|
|
243
325
|
*/
|
|
244
326
|
export const reset_database = async (deps, database_url, options) => {
|
|
245
327
|
const log = options?.log ?? default_setup_logger;
|
|
@@ -248,39 +330,60 @@ export const reset_database = async (deps, database_url, options) => {
|
|
|
248
330
|
log.skip('No DATABASE_URL, skipping database reset');
|
|
249
331
|
return { reset: false, skipped: true, db_type: 'none' };
|
|
250
332
|
}
|
|
251
|
-
|
|
252
|
-
if (
|
|
333
|
+
const db_type = to_setup_db_type(database_url);
|
|
334
|
+
if (db_type === 'none') {
|
|
335
|
+
log.error('Unsupported DATABASE_URL scheme — expected postgres://, file://, or memory://');
|
|
336
|
+
return { reset: false, skipped: false, db_type };
|
|
337
|
+
}
|
|
338
|
+
if (db_type === 'memory') {
|
|
339
|
+
log.skip('An in-memory database has nothing to reset');
|
|
340
|
+
return { reset: false, skipped: true, db_type };
|
|
341
|
+
}
|
|
342
|
+
if (db_type === 'pglite') {
|
|
253
343
|
const pglite_dir = options?.pglite_data_dir;
|
|
254
344
|
if (pglite_dir) {
|
|
255
345
|
const stat = await deps.stat(pglite_dir);
|
|
256
346
|
if (stat?.is_directory) {
|
|
257
347
|
await deps.remove(pglite_dir, { recursive: true });
|
|
258
348
|
log.ok(`Removed pglite directory: ${pglite_dir}`);
|
|
259
|
-
return { reset: true, skipped: false, db_type
|
|
349
|
+
return { reset: true, skipped: false, db_type };
|
|
260
350
|
}
|
|
261
351
|
}
|
|
262
352
|
log.skip('No pglite directory to remove');
|
|
263
|
-
return { reset: false, skipped: true, db_type
|
|
353
|
+
return { reset: false, skipped: true, db_type };
|
|
264
354
|
}
|
|
265
|
-
// PostgreSQL
|
|
266
355
|
const db_name = parse_db_name(database_url);
|
|
267
356
|
if (!db_name) {
|
|
268
357
|
log.error('Could not parse database name from DATABASE_URL');
|
|
269
|
-
return { reset: false, skipped:
|
|
358
|
+
return { reset: false, skipped: false, db_type };
|
|
359
|
+
}
|
|
360
|
+
const password = read_password_env(database_url);
|
|
361
|
+
if (!password.ok) {
|
|
362
|
+
log.error(password.message);
|
|
363
|
+
return { reset: false, skipped: false, db_type };
|
|
364
|
+
}
|
|
365
|
+
const dropdb = deps.dropdb(password.env);
|
|
366
|
+
const createdb = deps.createdb(password.env);
|
|
367
|
+
if (dropdb === null || createdb === null) {
|
|
368
|
+
const missing = [dropdb === null && 'dropdb', createdb === null && 'createdb']
|
|
369
|
+
.filter(Boolean)
|
|
370
|
+
.join(' and ');
|
|
371
|
+
log.error(`${missing} not found — install PostgreSQL to reset a Postgres database`);
|
|
372
|
+
return { reset: false, skipped: false, db_type };
|
|
270
373
|
}
|
|
271
|
-
const drop = await
|
|
272
|
-
if (!drop
|
|
273
|
-
log.error(`Failed to drop database: ${drop.
|
|
274
|
-
return { reset: false, skipped: false, db_type
|
|
374
|
+
const drop = await dropdb.out(to_dropdb_args(db_name, database_url));
|
|
375
|
+
if (!is_program_success(drop)) {
|
|
376
|
+
log.error(`Failed to drop database: ${describe_program_failure(drop)}${password_hint(drop, password.env)}`);
|
|
377
|
+
return { reset: false, skipped: false, db_type };
|
|
275
378
|
}
|
|
276
379
|
log.ok(`Dropped database: ${db_name}`);
|
|
277
|
-
const create = await
|
|
278
|
-
if (!create
|
|
279
|
-
log.error(`Failed to create database: ${create.
|
|
280
|
-
return { reset: false, skipped: false, db_type
|
|
380
|
+
const create = await createdb.out(to_createdb_args(db_name, database_url));
|
|
381
|
+
if (!is_program_success(create)) {
|
|
382
|
+
log.error(`Failed to create database: ${describe_program_failure(create)}${password_hint(create, password.env)}`);
|
|
383
|
+
return { reset: false, skipped: false, db_type };
|
|
281
384
|
}
|
|
282
385
|
log.ok(`Created database: ${db_name}`);
|
|
283
|
-
return { reset: true, skipped: false, db_type
|
|
386
|
+
return { reset: true, skipped: false, db_type };
|
|
284
387
|
};
|
|
285
388
|
/**
|
|
286
389
|
* Seed a development test account, bypassing the username and password
|
|
@@ -293,7 +396,7 @@ export const reset_database = async (deps, database_url, options) => {
|
|
|
293
396
|
* requested role grants. Never updates an existing password (rerun would
|
|
294
397
|
* silently rotate it).
|
|
295
398
|
*
|
|
296
|
-
* Intended for
|
|
399
|
+
* Intended for a dev setup task — do not call in production.
|
|
297
400
|
*
|
|
298
401
|
* @mutates database - inserts an account/actor pair when missing and grants any requested role role_grants
|
|
299
402
|
* @throws Error if an existing account is found without an associated actor row
|
package/dist/env/dotenv.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare const parse_dotenv: (content: string) => Record<string, string>;
|
|
|
40
40
|
* @param runtime - runtime with `read_text_file` capability
|
|
41
41
|
* @param path - path to env file
|
|
42
42
|
* @returns parsed env record, or `null` if file doesn't exist
|
|
43
|
-
* @throws Error if reading fails for any reason other than `ENOENT`
|
|
43
|
+
* @throws Error if reading fails for any reason other than `ENOENT`
|
|
44
44
|
*/
|
|
45
45
|
export declare const load_env_file: (runtime: Pick<FsReadDeps, "read_text_file">, path: string) => Promise<Record<string, string> | null>;
|
|
46
46
|
//# sourceMappingURL=dotenv.d.ts.map
|
package/dist/env/dotenv.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotenv.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"dotenv.d.ts","sourceRoot":"","sources":["../../src/lib/env/dotenv.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAqCnE,CAAC;AAiEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GACzB,SAAS,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAC3C,MAAM,MAAM,KACV,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAQvC,CAAC"}
|
package/dist/env/dotenv.js
CHANGED
|
@@ -143,7 +143,7 @@ const unescape_double_quoted = (s) => {
|
|
|
143
143
|
* @param runtime - runtime with `read_text_file` capability
|
|
144
144
|
* @param path - path to env file
|
|
145
145
|
* @returns parsed env record, or `null` if file doesn't exist
|
|
146
|
-
* @throws Error if reading fails for any reason other than `ENOENT`
|
|
146
|
+
* @throws Error if reading fails for any reason other than `ENOENT`
|
|
147
147
|
*/
|
|
148
148
|
export const load_env_file = async (runtime, path) => {
|
|
149
149
|
try {
|
|
@@ -151,8 +151,7 @@ export const load_env_file = async (runtime, path) => {
|
|
|
151
151
|
return parse_dotenv(content);
|
|
152
152
|
}
|
|
153
153
|
catch (error) {
|
|
154
|
-
|
|
155
|
-
if (error?.code === 'ENOENT' || error?.name === 'NotFound')
|
|
154
|
+
if (error?.code === 'ENOENT')
|
|
156
155
|
return null;
|
|
157
156
|
throw error;
|
|
158
157
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env_schemas.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"env_schemas.d.ts","sourceRoot":"","sources":["../../src/lib/env/env_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAON,MAAM,EAEN,KAAK,UAAU,EACf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,mBAAmB,CAAC;AAE3B,gCAAgC;AAChC,MAAM,WAAW,iBAAiB;IACjC,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAeD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,iBAAiB,KAAG,UAAU,CAAC,MAAM,EAAE,OAAO,MAAM,CAMxF,CAAC;AAmBH;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,MAAM,CAO5D,CAAC"}
|
package/dist/env/load.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/lib/env/load.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAGN,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,MAAM,8BAA8B,CAAC;AAEtC;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,6FAA6F;IAC7F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACjD,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACpC,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;gBAEpB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC;IAO/E;;;;OAIG;IACH,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC;CAG9B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,kBAAkB,EAAE,QAAQ,MAAM,KAAG,IAUpF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EACtE,QAAQ,CAAC,EACT,SAAS,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,KAC1C,KAAK,CAAC,CAAC,CAkBT,CAAC"}
|
package/dist/env/mask.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../src/lib/env/mask.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,uDAAuD;AACvD,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,EAAE,QAAQ,OAAO,KAAG,MAK1E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update_env_variable.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"update_env_variable.d.ts","sourceRoot":"","sources":["../../src/lib/env/update_env_variable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGhF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,EAAE,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,MAmChF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,GAC/B,MAAM,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,EACtD,UAAU,MAAM,EAChB,KAAK,MAAM,EACX,OAAO,MAAM,KACX,OAAO,CAAC,IAAI,CAId,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hono_context.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"hono_context.d.ts","sourceRoot":"","sources":["../src/lib/hono_context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,mCAAmC,CAAC;AAE9E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,MAAsC,CAAC;AAEhF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,GAAG,OAAO,KAAG,OACE,CAAC;AAExD,OAAO,QAAQ,MAAM,CAAC;IACrB,UAAU,kBAAkB;QAC3B,+DAA+D;QAC/D,SAAS,EAAE,MAAM,CAAC;QAClB,8EAA8E;QAC9E,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,eAAe,EAAE,cAAc,GAAG,IAAI,CAAC;QACvC,eAAe,EAAE,OAAO,CAAC;QACzB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,eAAe,EAAE,OAAO,CAAC;QACzB;;;;WAIG;QACH,aAAa,EAAE,YAAY,GAAG,IAAI,CAAC;QACnC,2FAA2F;QAC3F,8BAA8B,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9C;;;;;;;WAOG;QACH,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACtC;;;;;;;;;;;;WAYG;QACH,mBAAmB,EAAE,KAAK,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD;;;;;WAKG;QACH,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;KAChD;CACD"}
|
package/dist/http/CLAUDE.md
CHANGED
|
@@ -24,7 +24,7 @@ effects, see ../../../docs/architecture.md.
|
|
|
24
24
|
- `http/schema_helpers.ts` — shared schema introspection (null/void/strict/surface/middleware-applies), and `to_void_params` / `to_input_params` / `scan_json_value` / `safe_parse_dropping_unknown_keys`.
|
|
25
25
|
- `http/json_text.ts` — `parse_json_text`: JSON text read as the Rust spine's `serde_json` reads it, refusing what `JSON.parse` accepts and serde refuses (an escaped lone surrogate in a string or key, a number out of `f64` range, nesting `JSON_DEPTH_LIMIT` (128) deep); one linear scan of the text after `JSON.parse` accepts it (`is_serde_json_text`), so a refused value under a duplicated key is seen and the cost stays a few milliseconds a MiB. `read_json_body(c.req)` reads a request body through it once per request (the authorization phase's `acting` read and input validation share it), as text, never `c.req.json()`. Every body and frame parse runs it: route input, the RPC POST body and `GET` `params`, WS frames. Hono-free, imports nothing.
|
|
26
26
|
- `http/middleware_spec.ts` — `MiddlewareSpec` interface.
|
|
27
|
-
- `http/body_limit.ts` — `create_body_limit_middleware(max_size)`: the `413` body cap `create_app_server` mounts, as `create_body_limit_middleware_spec(max_size)`, a `MiddlewareSpec` at `'*'` ahead of the other middleware, absent with `max_body_size: null`. Its hono-free shape, `body_limit_middleware_shape` (`http/body_limit_schema.ts`), declares its `413` `payload_too_large` and `400` `invalid_content_length`, so every route's error map carries both; `create_test_app_surface_spec` lists the same shape with a stub handler. Refuses on `Content-Length` without reading `c.req.raw.body` and answers `Connection: close` — `413` past the cap, `400` `ERROR_INVALID_CONTENT_LENGTH` when the value is not a plain run of ASCII digits (a length the cap cannot read, which Hono's `bodyLimit` would pass uncounted) — else falls through to Hono's `bodyLimit` (no `Content-Length`, or one beside `Transfer-Encoding`), which reads the body into memory up to the cap before the next middleware runs, so its `413` — no `Connection: close` — also precedes origin and auth. After the header `413` Node and Bun close at once (the header is what makes them — Bun 1.4.3 is the tested floor, an older Bun kept the connection and served the next request)
|
|
27
|
+
- `http/body_limit.ts` — `create_body_limit_middleware(max_size)`: the `413` body cap `create_app_server` mounts, as `create_body_limit_middleware_spec(max_size)`, a `MiddlewareSpec` at `'*'` ahead of the other middleware, absent with `max_body_size: null`. Its hono-free shape, `body_limit_middleware_shape` (`http/body_limit_schema.ts`), declares its `413` `payload_too_large` and `400` `invalid_content_length`, so every route's error map carries both; `create_test_app_surface_spec` lists the same shape with a stub handler. Refuses on `Content-Length` without reading `c.req.raw.body` and answers `Connection: close` — `413` past the cap, `400` `ERROR_INVALID_CONTENT_LENGTH` when the value is not a plain run of ASCII digits (a length the cap cannot read, which Hono's `bodyLimit` would pass uncounted) — else falls through to Hono's `bodyLimit` (no `Content-Length`, or one beside `Transfer-Encoding`), which reads the body into memory up to the cap before the next middleware runs, so its `413` — no `Connection: close` — also precedes origin and auth. After the header `413` Node and Bun close at once (the header is what makes them — Bun 1.4.3 is the tested floor, an older Bun kept the connection and served the next request) (../../../docs/security.md §Body Size Limiting).
|
|
28
28
|
- `http/surface.ts` — `AppSurface`, `AppSurfaceSpec`, `generate_app_surface`, diagnostics.
|
|
29
29
|
- `http/surface_query.ts` — pure filters/groupings over `AppSurface`.
|
|
30
30
|
- `http/proxy.ts` — trusted-proxy middleware, CIDR parsing, rightmost-first XFF resolution. Pulls `hono/utils/ipaddr` for CIDR matching.
|
|
@@ -78,7 +78,7 @@ export declare const parse_acting: (value: unknown) => string | undefined;
|
|
|
78
78
|
* credential; the authorization phase 4xx for `actor === 'required'`
|
|
79
79
|
* without an actor binding).
|
|
80
80
|
*/
|
|
81
|
-
export declare const AuthAxisState: import("@fuzdev/fuz_schema/schema.ts").
|
|
81
|
+
export declare const AuthAxisState: import("@fuzdev/fuz_schema/schema.ts").OneOfSchema<readonly ["none", "optional", "required"]>;
|
|
82
82
|
export type AuthAxisState = Infer<typeof AuthAxisState>;
|
|
83
83
|
/**
|
|
84
84
|
* The canonical auth shape used by both `ActionSpec.auth` and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_shape.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"auth_shape.d.ts","sourceRoot":"","sources":["../../src/lib/http/auth_shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAKzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAGtD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,+FAA2C,CAAC;AACtE,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAuDxD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,SAAS;IACzB,OAAO,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC1C,gBAAgB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAUD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,SAAS,KAAG,OACA,CAAC;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,SAAS,KAAG,OAAgC,CAAC;AAE/E,wEAAwE;AACxE,eAAO,MAAM,YAAY,GAAI,MAAM,SAAS,KAAG,OAA+B,CAAC;AAE/E,8FAA8F;AAC9F,eAAO,MAAM,wBAAwB,GAAI,MAAM,SAAS,KAAG,OAC3B,CAAC;AAEjC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,SAAS,KAAG,OACQ,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,GAAI,MAAM,SAAS,KAAG,OACwB,CAAC;AAEvF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,GAAI,MAAM,SAAS,EAAE,SAAS,MAAM,KAAG,IAM/E,CAAC;AAYF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GAAI,QAAQ,SAAS,KAAG,OACd,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sCAAsC,GAClD,MAAM,SAAS,EACf,OAAO,WAAW,EAClB,SAAS,MAAM,KACb,IAmBF,CAAC"}
|
|
@@ -11,20 +11,18 @@
|
|
|
11
11
|
* The runtimes' HTTP parsers answer their own bodiless `400` to most of
|
|
12
12
|
* these before the application sees them, so this branch is defense in
|
|
13
13
|
* depth where they do and the refusal where they do not: Node's refuses
|
|
14
|
-
* them all;
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* value.
|
|
14
|
+
* them all; Bun hands over a repeated equal header as one combined value
|
|
15
|
+
* (`50, 50`) and refuses the rest (observed on Node 24.14.1, Bun 1.4.3).
|
|
16
|
+
* The Rust spine's parser (hyper) refuses a malformed value and differing
|
|
17
|
+
* repeats, and accepts an equal repeat as the one value.
|
|
19
18
|
* - A request whose `Content-Length` exceeds the cap is refused with `413`
|
|
20
19
|
* `{error: 'payload_too_large'}`, whatever its method. A digit run of any
|
|
21
20
|
* length compares as a number, so one too long to represent exactly is over
|
|
22
|
-
* the cap, never unreadable. Over a socket that branch is reached on Node
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* Deno 2.8.3, Bun 1.4.3).
|
|
21
|
+
* the cap, never unreadable. Over a socket that branch is reached on Node,
|
|
22
|
+
* whose parser hands over any length below 2^64 and refuses a longer one
|
|
23
|
+
* with its own `400`. `Bun.serve` hands none over: with its default options
|
|
24
|
+
* it answers a length past 128 MiB with its own `413`, and one of 2^63 - 1
|
|
25
|
+
* or more with its own `400` (observed on Node 24.14.1, Bun 1.4.3).
|
|
28
26
|
* - Both refusals answer on the header alone — without touching
|
|
29
27
|
* `c.req.raw.body` — and carry `Connection: close`.
|
|
30
28
|
* - A request with a well-formed `Content-Length` beside `Transfer-Encoding`,
|
|
@@ -38,7 +36,7 @@
|
|
|
38
36
|
* the headers answers first; which status an over-cap body with no declared
|
|
39
37
|
* length gets when another refusal also applies is implementation-defined
|
|
40
38
|
* across the two (`docs/security.md` §"Body Size Limiting").
|
|
41
|
-
* The Node
|
|
39
|
+
* The Node and Bun parsers refuse a request carrying both headers
|
|
42
40
|
* with their own `400`; hyper accepts one, drops its `Content-Length`,
|
|
43
41
|
* frames the body as chunked, and closes the connection after the response.
|
|
44
42
|
* - A well-formed `Content-Length` within the cap is trusted to frame the
|
|
@@ -52,10 +50,6 @@
|
|
|
52
50
|
* holds the connection for a drain window and then closes or, the body
|
|
53
51
|
* untouched and arriving within the window, reads it off and serves the
|
|
54
52
|
* next request.
|
|
55
|
-
* - **Deno** closes once the whole declared body has arrived and holds the
|
|
56
|
-
* connection open while a client withholds it; a request pipelined behind
|
|
57
|
-
* the body is not served. Neither the header nor what the handler does with
|
|
58
|
-
* the body changes that (observed on Deno 2.8.3).
|
|
59
53
|
* - **Bun** closes at once, the body unread, honouring the header. Bun 1.4.3
|
|
60
54
|
* is the tested floor: an older Bun kept the connection after the `413` and
|
|
61
55
|
* served the next request (correctly framed), so run Bun at the floor or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body_limit.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"body_limit.d.ts","sourceRoot":"","sources":["../../src/lib/http/body_limit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAI9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAM3D;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GAAI,UAAU,MAAM,KAAG,iBA6B/D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iCAAiC,GAAI,UAAU,MAAM,KAAG,cAGnE,CAAC"}
|
package/dist/http/body_limit.js
CHANGED
|
@@ -11,20 +11,18 @@
|
|
|
11
11
|
* The runtimes' HTTP parsers answer their own bodiless `400` to most of
|
|
12
12
|
* these before the application sees them, so this branch is defense in
|
|
13
13
|
* depth where they do and the refusal where they do not: Node's refuses
|
|
14
|
-
* them all;
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* value.
|
|
14
|
+
* them all; Bun hands over a repeated equal header as one combined value
|
|
15
|
+
* (`50, 50`) and refuses the rest (observed on Node 24.14.1, Bun 1.4.3).
|
|
16
|
+
* The Rust spine's parser (hyper) refuses a malformed value and differing
|
|
17
|
+
* repeats, and accepts an equal repeat as the one value.
|
|
19
18
|
* - A request whose `Content-Length` exceeds the cap is refused with `413`
|
|
20
19
|
* `{error: 'payload_too_large'}`, whatever its method. A digit run of any
|
|
21
20
|
* length compares as a number, so one too long to represent exactly is over
|
|
22
|
-
* the cap, never unreadable. Over a socket that branch is reached on Node
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* Deno 2.8.3, Bun 1.4.3).
|
|
21
|
+
* the cap, never unreadable. Over a socket that branch is reached on Node,
|
|
22
|
+
* whose parser hands over any length below 2^64 and refuses a longer one
|
|
23
|
+
* with its own `400`. `Bun.serve` hands none over: with its default options
|
|
24
|
+
* it answers a length past 128 MiB with its own `413`, and one of 2^63 - 1
|
|
25
|
+
* or more with its own `400` (observed on Node 24.14.1, Bun 1.4.3).
|
|
28
26
|
* - Both refusals answer on the header alone — without touching
|
|
29
27
|
* `c.req.raw.body` — and carry `Connection: close`.
|
|
30
28
|
* - A request with a well-formed `Content-Length` beside `Transfer-Encoding`,
|
|
@@ -38,7 +36,7 @@
|
|
|
38
36
|
* the headers answers first; which status an over-cap body with no declared
|
|
39
37
|
* length gets when another refusal also applies is implementation-defined
|
|
40
38
|
* across the two (`docs/security.md` §"Body Size Limiting").
|
|
41
|
-
* The Node
|
|
39
|
+
* The Node and Bun parsers refuse a request carrying both headers
|
|
42
40
|
* with their own `400`; hyper accepts one, drops its `Content-Length`,
|
|
43
41
|
* frames the body as chunked, and closes the connection after the response.
|
|
44
42
|
* - A well-formed `Content-Length` within the cap is trusted to frame the
|
|
@@ -52,10 +50,6 @@
|
|
|
52
50
|
* holds the connection for a drain window and then closes or, the body
|
|
53
51
|
* untouched and arriving within the window, reads it off and serves the
|
|
54
52
|
* next request.
|
|
55
|
-
* - **Deno** closes once the whole declared body has arrived and holds the
|
|
56
|
-
* connection open while a client withholds it; a request pipelined behind
|
|
57
|
-
* the body is not served. Neither the header nor what the handler does with
|
|
58
|
-
* the body changes that (observed on Deno 2.8.3).
|
|
59
53
|
* - **Bun** closes at once, the body unread, honouring the header. Bun 1.4.3
|
|
60
54
|
* is the tested floor: an older Bun kept the connection after the `413` and
|
|
61
55
|
* served the next request (correctly framed), so run Bun at the floor or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body_limit_schema.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"body_limit_schema.d.ts","sourceRoot":"","sources":["../../src/lib/http/body_limit_schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;CAIY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_ip.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"client_ip.d.ts","sourceRoot":"","sources":["../../src/lib/http/client_ip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,mFAAmF;AACnF,eAAO,MAAM,aAAa,GAAI,GAAG,OAAO,KAAG,MAAyC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common_routes.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"common_routes.d.ts","sourceRoot":"","sources":["../../src/lib/http/common_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI/D,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,uBAAuB,CAAC;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,QAAO,SASzC,CAAC;AAKJ;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,GAAG,GAAG,MAAM,KAAG,cAkBxD,CAAC;AAEF,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IACjC;;;;OAIG;IACH,QAAQ,EAAE,cAAc,CAAC;IACzB,gFAAgF;IAChF,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,iBAAiB,KAAG,SAgCpE,CAAC;AAEF,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IACnC,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,aAAa,EAAE,MAAM,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,GAAI,SAAS,mBAAmB,KAAG,SAS5E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db_routes.d.ts","sourceRoot":"
|
|
1
|
+
{"version":3,"file":"db_routes.d.ts","sourceRoot":"","sources":["../../src/lib/http/db_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAsBtD,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAmD,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAelG;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AAwCD,sDAAsD;AACtD,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,sDAAsD;AACtD,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAElD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,MAAM,CAKrD,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,MAAM,CAKrD,CAAC;AAEH;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC3B;;;;;;OAMG;IACH,KAAK,EAAE;QACN,SAAS,EAAE,CAAC,KAAK,EAAE;YAClB,UAAU,EAAE,qBAAqB,CAAC;YAClC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;YACxB,EAAE,EAAE,MAAM,CAAC;YACX,QAAQ,EAAE;gBAAE,KAAK,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAC;gBAAC,EAAE,EAAE,MAAM,CAAA;aAAE,CAAC;SAC3D,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACxC,8EAA8E;IAC9E,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,oBAAoB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC7C;AA2CD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GACjC,MAAM,WAAW,EACjB,SAAS,cAAc,KACrB,KAAK,CAAC,SAAS,CA8VjB,CAAC"}
|