@fuzdev/fuz_app 0.150.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 +324 -299
- package/dist/actions/action_bridge.d.ts +5 -86
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +4 -84
- package/dist/actions/action_codegen.d.ts +8 -166
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +19 -95
- package/dist/actions/action_dispatcher.d.ts +10 -0
- package/dist/actions/action_dispatcher.d.ts.map +1 -1
- package/dist/actions/action_dispatcher.js +9 -6
- package/dist/actions/action_event.d.ts +1 -2
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +7 -13
- package/dist/actions/action_event_helpers.d.ts +1 -40
- package/dist/actions/action_event_helpers.d.ts.map +1 -1
- package/dist/actions/action_event_helpers.js +1 -25
- package/dist/actions/action_rpc.d.ts +10 -215
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +56 -111
- package/dist/actions/action_spec.d.ts +2 -2
- package/dist/actions/action_spec.js +2 -2
- package/dist/actions/action_types.d.ts +229 -8
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +56 -5
- package/dist/actions/broadcast_api.d.ts +22 -17
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/broadcast_api.js +16 -27
- package/dist/actions/cancel.d.ts +4 -13
- package/dist/actions/cancel.d.ts.map +1 -1
- package/dist/actions/cancel.js +5 -17
- package/dist/actions/compile_action_registry.d.ts +1 -2
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/connection_closer.d.ts +120 -50
- package/dist/actions/connection_closer.d.ts.map +1 -1
- package/dist/actions/connection_closer.js +139 -31
- package/dist/actions/{transports_ws_backend.d.ts → connection_registry.d.ts} +120 -132
- package/dist/actions/connection_registry.d.ts.map +1 -0
- package/dist/actions/{transports_ws_backend.js → connection_registry.js} +149 -152
- package/dist/actions/frontend_rpc_client.d.ts +52 -2
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +42 -4
- package/dist/actions/peer_ping.d.ts +7 -9
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_ping.js +6 -8
- package/dist/actions/peer_request.d.ts +6 -5
- package/dist/actions/peer_request.d.ts.map +1 -1
- package/dist/actions/peer_request.js +6 -5
- package/dist/actions/perform_action.d.ts +36 -28
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +60 -34
- package/dist/actions/protocol.d.ts +14 -0
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +18 -0
- package/dist/actions/register_action_ws.d.ts +137 -298
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +155 -923
- package/dist/actions/socket.svelte.d.ts +9 -0
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/socket.svelte.js +16 -5
- package/dist/actions/transports.d.ts +88 -34
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +76 -76
- package/dist/actions/transports_http.d.ts +48 -12
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_http.js +75 -44
- package/dist/actions/transports_ws.d.ts +29 -0
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/transports_ws.js +34 -8
- package/dist/actions/ws_endpoint_spec.d.ts +52 -75
- package/dist/actions/ws_endpoint_spec.d.ts.map +1 -1
- package/dist/actions/ws_endpoint_spec.js +27 -10
- package/dist/actions/ws_outbound_writer.d.ts +3 -3
- package/dist/actions/ws_outbound_writer.js +3 -3
- package/dist/actions/ws_socket_session.d.ts +321 -0
- package/dist/actions/ws_socket_session.d.ts.map +1 -0
- package/dist/actions/ws_socket_session.js +783 -0
- package/dist/auth/CLAUDE.md +70 -44
- package/dist/auth/account_action_specs.d.ts +2 -0
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_actions.d.ts +1 -1
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +9 -3
- package/dist/auth/account_queries.d.ts +10 -0
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +27 -17
- package/dist/auth/account_routes.d.ts +2 -1
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +14 -17
- package/dist/auth/account_schema.d.ts +5 -5
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +5 -2
- package/dist/auth/actor_lookup_actions.d.ts +1 -1
- package/dist/auth/actor_lookup_actions.d.ts.map +1 -1
- package/dist/auth/actor_lookup_actions.js +1 -1
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.js +2 -1
- package/dist/auth/actor_search_actions.d.ts +1 -1
- package/dist/auth/actor_search_actions.d.ts.map +1 -1
- package/dist/auth/actor_search_actions.js +1 -1
- package/dist/auth/actor_search_queries.d.ts +5 -5
- package/dist/auth/actor_search_queries.d.ts.map +1 -1
- package/dist/auth/actor_search_queries.js +7 -7
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +3 -1
- package/dist/auth/admin_actions.d.ts +1 -1
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +12 -42
- package/dist/auth/all_cell_actions.d.ts +6 -4
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.js +1 -1
- package/dist/auth/api_token_queries.d.ts +1 -0
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +1 -0
- package/dist/auth/audit_emitter.d.ts +3 -3
- package/dist/auth/audit_emitter.js +2 -2
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +3 -2
- package/dist/auth/audit_log_routes.d.ts +20 -11
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +49 -29
- package/dist/auth/audit_log_schema.d.ts +13 -21
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +10 -18
- package/dist/auth/bearer_auth.d.ts +7 -4
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +21 -15
- package/dist/auth/cell_action_helpers.d.ts +89 -0
- package/dist/auth/cell_action_helpers.d.ts.map +1 -0
- package/dist/auth/cell_action_helpers.js +113 -0
- package/dist/auth/cell_actions.d.ts +22 -13
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +105 -167
- package/dist/auth/cell_audit_actions.d.ts +1 -1
- package/dist/auth/cell_audit_actions.d.ts.map +1 -1
- package/dist/auth/cell_audit_actions.js +3 -12
- package/dist/auth/cell_audit_metadata.d.ts +1 -1
- package/dist/auth/cell_audit_metadata.js +1 -1
- package/dist/auth/cell_field_actions.d.ts +1 -1
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.js +16 -66
- package/dist/auth/cell_grant_action_specs.d.ts +2 -2
- package/dist/auth/cell_grant_action_specs.js +3 -3
- package/dist/auth/cell_grant_actions.d.ts +73 -11
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +63 -55
- package/dist/auth/cell_grant_audit_metadata.d.ts +6 -3
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_grant_audit_metadata.js +7 -4
- package/dist/auth/cell_item_actions.d.ts +1 -1
- package/dist/auth/cell_item_actions.d.ts.map +1 -1
- package/dist/auth/cell_item_actions.js +21 -82
- package/dist/auth/cleanup.d.ts +1 -1
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +6 -3
- package/dist/auth/credential_deadline.d.ts +3 -3
- package/dist/auth/credential_deadline.js +3 -3
- package/dist/auth/credential_type_schema.d.ts +5 -5
- package/dist/auth/credential_type_schema.js +5 -5
- package/dist/auth/daemon_token_middleware.d.ts +12 -6
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +28 -17
- package/dist/auth/deps.d.ts +4 -4
- package/dist/auth/fail_floor.d.ts +55 -0
- package/dist/auth/fail_floor.d.ts.map +1 -0
- package/dist/auth/fail_floor.js +63 -0
- package/dist/auth/invite_queries.d.ts +3 -15
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +3 -21
- package/dist/auth/middleware.d.ts +12 -7
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +42 -29
- package/dist/auth/migrations.d.ts +5 -33
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +9 -16
- package/dist/auth/request_context.d.ts +101 -71
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +137 -140
- package/dist/auth/resolved_auth.d.ts +122 -36
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +89 -38
- package/dist/auth/role_grant_offer_action_specs.d.ts +99 -14
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +26 -13
- package/dist/auth/role_grant_offer_actions.d.ts +13 -7
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +14 -12
- package/dist/auth/role_grant_offer_notifications.d.ts +3 -3
- package/dist/auth/role_grant_offer_notifications.js +1 -1
- package/dist/auth/role_grant_offer_queries.d.ts +0 -5
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +9 -41
- package/dist/auth/role_grant_queries.d.ts +17 -67
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +34 -106
- package/dist/auth/role_grant_sql.d.ts +42 -0
- package/dist/auth/role_grant_sql.d.ts.map +1 -0
- package/dist/auth/role_grant_sql.js +54 -0
- package/dist/auth/scope_kind_schema.d.ts +1 -1
- package/dist/auth/scope_kind_schema.js +1 -1
- package/dist/auth/self_service_role_actions.d.ts +1 -1
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +1 -1
- package/dist/auth/session_queries.d.ts +2 -1
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +2 -1
- package/dist/auth/signup_routes.d.ts +2 -1
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +14 -13
- package/dist/auth/standard_rpc_actions.d.ts +1 -1
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/token_scope.d.ts +19 -46
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +23 -41
- package/dist/db/CLAUDE.md +9 -4
- package/dist/db/cell_ddl.d.ts +5 -142
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +17 -16
- package/dist/db/cell_field_queries.d.ts +0 -13
- package/dist/db/cell_field_queries.d.ts.map +1 -1
- package/dist/db/cell_field_queries.js +0 -16
- package/dist/db/cell_grant_queries.d.ts +10 -5
- package/dist/db/cell_grant_queries.d.ts.map +1 -1
- package/dist/db/cell_grant_queries.js +13 -7
- package/dist/db/cell_item_queries.d.ts +0 -7
- package/dist/db/cell_item_queries.d.ts.map +1 -1
- package/dist/db/cell_item_queries.js +0 -10
- package/dist/db/cell_queries.d.ts +12 -48
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +24 -55
- package/dist/db/cell_view_sql.d.ts +1 -6
- package/dist/db/cell_view_sql.d.ts.map +1 -1
- package/dist/db/cell_view_sql.js +1 -2
- package/dist/db/fact_ddl.d.ts +5 -30
- package/dist/db/fact_ddl.d.ts.map +1 -1
- package/dist/db/fact_ddl.js +14 -13
- package/dist/db/fact_store.d.ts +11 -0
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/fact_store.js +4 -1
- package/dist/db/migrate.d.ts +44 -6
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +63 -4
- package/dist/dev/setup.d.ts +18 -14
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +42 -39
- package/dist/env/dotenv.d.ts +2 -2
- package/dist/env/dotenv.js +2 -2
- package/dist/env/update_env_variable.d.ts +33 -21
- package/dist/env/update_env_variable.d.ts.map +1 -1
- package/dist/env/update_env_variable.js +54 -35
- package/dist/hono_context.d.ts +15 -90
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +9 -56
- package/dist/http/CLAUDE.md +35 -20
- package/dist/http/auth_shape.d.ts +1 -8
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +6 -12
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +3 -2
- package/dist/http/db_routes.d.ts +3 -3
- package/dist/http/db_routes.js +3 -3
- package/dist/http/error_schemas.d.ts +1 -2
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +1 -2
- package/dist/http/health_schema.d.ts +16 -0
- package/dist/http/health_schema.d.ts.map +1 -0
- package/dist/http/health_schema.js +12 -0
- package/dist/http/jsonrpc_errors.d.ts +22 -2
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +41 -3
- package/dist/http/jsonrpc_helpers.d.ts +60 -17
- package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
- package/dist/http/jsonrpc_helpers.js +67 -25
- package/dist/http/origin.d.ts +30 -1
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +46 -9
- package/dist/http/origin_wildcard.d.ts +97 -0
- package/dist/http/origin_wildcard.d.ts.map +1 -0
- package/dist/http/origin_wildcard.js +142 -0
- package/dist/http/pending_effects.d.ts +28 -0
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +32 -1
- package/dist/http/route_spec.d.ts +4 -3
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +54 -45
- package/dist/http/surface.d.ts +1 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface_query.d.ts +9 -50
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +48 -94
- package/dist/realtime/audit_log_sse.d.ts +180 -0
- package/dist/realtime/audit_log_sse.d.ts.map +1 -0
- package/dist/realtime/audit_log_sse.js +154 -0
- package/dist/realtime/sse.d.ts +21 -6
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +33 -10
- package/dist/realtime/sse_constants.d.ts +29 -2
- package/dist/realtime/sse_constants.d.ts.map +1 -1
- package/dist/realtime/sse_constants.js +35 -2
- package/dist/realtime/{subscriber_registry.d.ts → sse_registry.d.ts} +12 -12
- package/dist/realtime/sse_registry.d.ts.map +1 -0
- package/dist/realtime/{subscriber_registry.js → sse_registry.js} +4 -4
- package/dist/schema_meta.d.ts +30 -10
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +85 -21
- package/dist/sensitivity.d.ts +9 -3
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/sensitivity.js +3 -2
- package/dist/server/app_backend.d.ts +8 -5
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +6 -12
- package/dist/server/app_server.d.ts +62 -51
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +84 -71
- package/dist/server/app_server_context.d.ts +1 -1
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.d.ts +24 -20
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +24 -34
- package/dist/server/serve_fact_route.d.ts +12 -16
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +59 -34
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/static.js +2 -2
- package/dist/testing/CLAUDE.md +179 -158
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +10 -19
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +8 -0
- package/dist/testing/app_server.d.ts +9 -77
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +31 -112
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +3 -4
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +4 -5
- package/dist/testing/auth_apps.d.ts +3 -3
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +9 -6
- package/dist/testing/connection_closer_helpers.d.ts +8 -16
- package/dist/testing/connection_closer_helpers.d.ts.map +1 -1
- package/dist/testing/connection_closer_helpers.js +7 -20
- package/dist/testing/cross_backend/action_manifest.d.ts +15 -4
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +13 -3
- package/dist/testing/cross_backend/action_manifest_parity.d.ts +15 -7
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest_parity.js +8 -1
- package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size.js +25 -22
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts +22 -3
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
- package/dist/testing/cross_backend/build_test_backend_paths.js +34 -11
- package/dist/testing/cross_backend/capabilities.d.ts +13 -7
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_grant_role.js +2 -2
- package/dist/testing/cross_backend/cell_grant_steward.d.ts +4 -0
- package/dist/testing/cross_backend/cell_grant_steward.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_grant_steward.js +120 -0
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +21 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.d.ts +18 -4
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +29 -9
- package/dist/testing/cross_backend/default_spine_surface.d.ts +7 -7
- package/dist/testing/cross_backend/default_spine_surface.js +2 -2
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +48 -0
- package/dist/testing/cross_backend/full_spine_mount.d.ts +3 -4
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +9 -2
- package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_scope.js +5 -13
- package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +29 -4
- package/dist/testing/cross_backend/postgres_database.d.ts +32 -0
- package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -1
- package/dist/testing/cross_backend/postgres_database.js +56 -1
- package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
- package/dist/testing/cross_backend/query_shape.js +18 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +23 -1
- package/dist/testing/cross_backend/rpc_success_fixtures.js +2 -2
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts +17 -5
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +5 -4
- package/dist/testing/cross_backend/session_cap.d.ts +8 -0
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +66 -2
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +5 -4
- package/dist/testing/cross_backend/spine_suites.d.ts +4 -1
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +21 -0
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +22 -7
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +22 -7
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +4 -3
- package/dist/testing/cross_backend/standard.d.ts +6 -12
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts +8 -0
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts.map +1 -0
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.js +22 -0
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +4 -6
- package/dist/testing/cross_backend/testing_origin_check.d.ts +1 -1
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.js +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +10 -5
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +7 -6
- package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.js +5 -4
- package/dist/testing/cross_backend/testing_server_core.d.ts +6 -7
- package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_core.js +1 -1
- package/dist/testing/cross_backend/testing_server_node.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_node.js +13 -2
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +68 -0
- package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +45 -3
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +16 -2
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +11 -8
- package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_action_rate_limit.js +30 -12
- package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_connection_cap.js +5 -7
- package/dist/testing/cross_backend/ws_endpoint.d.ts +2 -3
- package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_envelope.d.ts +17 -0
- package/dist/testing/cross_backend/ws_envelope.d.ts.map +1 -0
- package/dist/testing/cross_backend/ws_envelope.js +172 -0
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts +16 -0
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_inbound_dispatch.js +8 -4
- package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.js +5 -8
- package/dist/testing/cross_backend/ws_role_gated.js +2 -2
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +6 -4
- package/dist/{cli/daemon.d.ts → testing/daemon_info.d.ts} +15 -47
- package/dist/testing/daemon_info.d.ts.map +1 -0
- package/dist/testing/daemon_info.js +108 -0
- package/dist/testing/daemon_token_rotation.js +1 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +3 -4
- package/dist/testing/db.js +2 -2
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +35 -65
- package/dist/testing/integration_helpers.d.ts +0 -15
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +2 -42
- package/dist/testing/middleware.d.ts +20 -12
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +49 -40
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +13 -22
- package/dist/testing/resolved_auth.d.ts +30 -0
- package/dist/testing/resolved_auth.d.ts.map +1 -0
- package/dist/testing/resolved_auth.js +41 -0
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +3 -0
- package/dist/testing/rpc_helpers.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +2 -1
- package/dist/testing/sse_round_trip.d.ts +5 -4
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/stubs.d.ts +2 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +24 -21
- package/dist/testing/test_origin.d.ts +25 -0
- package/dist/testing/test_origin.d.ts.map +1 -0
- package/dist/testing/test_origin.js +28 -0
- package/dist/testing/transports/raw_http.d.ts +54 -0
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +58 -0
- package/dist/testing/transports/ws_raw_client.d.ts +8 -0
- package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_raw_client.js +13 -0
- package/dist/testing/transports/ws_transport.d.ts +15 -2
- package/dist/testing/transports/ws_transport.d.ts.map +1 -1
- package/dist/testing/transports/ws_transport.js +4 -2
- package/dist/testing/ws_round_trip.d.ts +27 -25
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +34 -26
- package/dist/ui/AccountSessions.svelte +48 -19
- package/dist/ui/AccountSessions.svelte.d.ts +2 -17
- package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAccounts.svelte +6 -1
- package/dist/ui/AdminAuditLog.svelte +61 -22
- package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
- package/dist/ui/AdminInvites.svelte +1 -1
- package/dist/ui/AdminOverview.svelte +76 -37
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
- package/dist/ui/AdminRoleGrantHistory.svelte +6 -1
- package/dist/ui/AdminSessions.svelte +1 -1
- package/dist/ui/AppShell.svelte +3 -2
- package/dist/ui/AppShell.svelte.d.ts +3 -2
- package/dist/ui/AppShell.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +121 -35
- package/dist/ui/Datatable.svelte +33 -18
- package/dist/ui/Datatable.svelte.d.ts +2 -14
- package/dist/ui/Datatable.svelte.d.ts.map +1 -1
- package/dist/ui/OpenSignupToggle.svelte +10 -1
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
- package/dist/ui/PopoverButton.svelte +13 -8
- package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferForm.svelte +3 -2
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts +3 -2
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferHistory.svelte +3 -3
- package/dist/ui/RoleGrantOfferInbox.svelte +19 -15
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
- package/dist/ui/SurfaceExplorer.svelte +66 -27
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts +7 -14
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +14 -9
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +6 -4
- package/dist/ui/admin_invites_state.svelte.d.ts +2 -2
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.d.ts +9 -9
- package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.js +9 -9
- package/dist/ui/app_settings_state.svelte.d.ts +2 -2
- package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.d.ts +70 -13
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +239 -47
- package/dist/ui/backend_probe.svelte.d.ts +93 -0
- package/dist/ui/backend_probe.svelte.d.ts.map +1 -0
- package/dist/ui/backend_probe.svelte.js +140 -0
- package/dist/ui/format_scope.d.ts +7 -7
- package/dist/ui/format_scope.d.ts.map +1 -1
- package/dist/ui/format_scope.js +4 -4
- package/dist/ui/keyed_async_slot.svelte.d.ts +2 -2
- package/dist/ui/keyed_async_slot.svelte.js +2 -2
- package/dist/ui/popover.svelte.d.ts +18 -19
- package/dist/ui/popover.svelte.d.ts.map +1 -1
- package/dist/ui/popover.svelte.js +103 -16
- package/dist/ui/role_grant_offers_state.svelte.d.ts +41 -46
- package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.js +37 -19
- package/dist/ui/ui_format.d.ts +17 -0
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +20 -0
- package/package.json +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 -96
- package/dist/actions/transports_ws_auth_guard.d.ts.map +0 -1
- package/dist/actions/transports_ws_auth_guard.js +0 -141
- package/dist/actions/transports_ws_backend.d.ts.map +0 -1
- package/dist/cli/args.d.ts +0 -55
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -100
- package/dist/cli/config.d.ts +0 -47
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js +0 -77
- package/dist/cli/daemon.d.ts.map +0 -1
- package/dist/cli/daemon.js +0 -181
- package/dist/cli/help.d.ts +0 -124
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -215
- package/dist/cli/logger.d.ts +0 -46
- package/dist/cli/logger.d.ts.map +0 -1
- package/dist/cli/logger.js +0 -48
- package/dist/cli/util.d.ts +0 -36
- package/dist/cli/util.d.ts.map +0 -1
- package/dist/cli/util.js +0 -50
- package/dist/realtime/sse_auth_guard.d.ts +0 -197
- package/dist/realtime/sse_auth_guard.d.ts.map +0 -1
- package/dist/realtime/sse_auth_guard.js +0 -239
- package/dist/realtime/subscriber_registry.d.ts.map +0 -1
- package/dist/testing/bootstrap_success.d.ts +0 -29
- package/dist/testing/bootstrap_success.d.ts.map +0 -1
- package/dist/testing/bootstrap_success.js +0 -144
- package/dist/testing/mock_fs.d.ts +0 -20
- package/dist/testing/mock_fs.d.ts.map +0 -1
- package/dist/testing/mock_fs.js +0 -28
- package/dist/testing/standard.d.ts +0 -122
- package/dist/testing/standard.d.ts.map +0 -1
- package/dist/testing/standard.js +0 -73
- package/dist/testing/testing_rate_limiter.d.ts +0 -65
- package/dist/testing/testing_rate_limiter.d.ts.map +0 -1
- package/dist/testing/testing_rate_limiter.js +0 -80
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session_queries.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/session_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGlE;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,QAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,SAElD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAO,MAEzC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAChC,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,YAAY,MAAM,EAClB,YAAY,IAAI,KACd,OAAO,CAAC,IAAI,CAMd,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,2DAKoB,CAAC;AAQtD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACpD;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GACnC,MAAM,SAAS,EACf,YAAY,MAAM,KAChB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAKtC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qCAAqC,GACjD,MAAM,SAAS,EACf,YAAY,MAAM,KAChB,OAAO,CAAC,IAAI,CAEd,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gCAAgC,GAC5C,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,YAAY,MAAM,KAChB,OAAO,CAAC,OAAO,CAMjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,GAChD,MAAM,SAAS,EACf,YAAY,MAAM,KAChB,OAAO,CAAC,MAAM,CAMhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,GAC1C,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,cAAU,KACR,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAK5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,2BAA2B,GACvC,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,cAAc,MAAM,KAClB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAYvB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,GACzC,MAAM,SAAS,EACf,cAAW,KACT,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CASnD,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"session_queries.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/session_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGlE;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,QAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,SAElD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAO,MAEzC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAChC,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,YAAY,MAAM,EAClB,YAAY,IAAI,KACd,OAAO,CAAC,IAAI,CAMd,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,2DAKoB,CAAC;AAQtD;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACpD;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GACnC,MAAM,SAAS,EACf,YAAY,MAAM,KAChB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAKtC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qCAAqC,GACjD,MAAM,SAAS,EACf,YAAY,MAAM,KAChB,OAAO,CAAC,IAAI,CAEd,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gCAAgC,GAC5C,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,YAAY,MAAM,KAChB,OAAO,CAAC,OAAO,CAMjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,GAChD,MAAM,SAAS,EACf,YAAY,MAAM,KAChB,OAAO,CAAC,MAAM,CAMhB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,GAC1C,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,cAAU,KACR,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAK5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,2BAA2B,GACvC,MAAM,SAAS,EACf,YAAY,MAAM,EAClB,cAAc,MAAM,KAClB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAYvB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,GACzC,MAAM,SAAS,EACf,cAAW,KACT,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CASnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,6BAA6B,GAAU,MAAM,SAAS,KAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAK1F,CAAC"}
|
|
@@ -214,7 +214,8 @@ export const query_session_list_all_active = async (deps, limit = 200) => {
|
|
|
214
214
|
* Delete every expired session, returning the ids (token hashes) of the rows
|
|
215
215
|
* it deleted.
|
|
216
216
|
*
|
|
217
|
-
* The ids are the
|
|
217
|
+
* The ids are the `session_hash` of the `session` close target
|
|
218
|
+
* (`ConnectionCloser.close_connections`).
|
|
218
219
|
* A row past `expires_at` already fails `query_session_get_valid`, but
|
|
219
220
|
* deleting it does not end the connections it opened: a WebSocket keeps the
|
|
220
221
|
* authority it resolved at upgrade and an SSE stream never rechecks. The row
|
|
@@ -51,7 +51,8 @@ export interface SignupRouteOptions extends AuthSessionRouteOptions {
|
|
|
51
51
|
signup_account_rate_limiter: RateLimiter | null;
|
|
52
52
|
/**
|
|
53
53
|
* Minimum wall-clock time (ms) for signup denial responses (403 / 409).
|
|
54
|
-
* Set to `0` or a negative number to disable (e.g., in tests)
|
|
54
|
+
* Set to `0` or a negative number to disable (e.g., in tests) — announced
|
|
55
|
+
* once on stderr (`SIGNUP_FAIL_FLOOR_DISABLED_BANNER`). Default
|
|
55
56
|
* `DEFAULT_SIGNUP_FAIL_FLOOR_MS`. 429 responses are not floored.
|
|
56
57
|
*/
|
|
57
58
|
signup_fail_floor_ms?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signup_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/signup_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGxE,OAAO,EAGN,KAAK,WAAW,EAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"signup_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/signup_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGxE,OAAO,EAGN,KAAK,WAAW,EAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGlD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAGnE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;IAClE;;;;;;;;;OASG;IACH,sBAAsB,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3C,6FAA6F;IAC7F,2BAA2B,EAAE,WAAW,GAAG,IAAI,CAAC;IAChD;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAID;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACrC,MAAM,gBAAgB,EACtB,SAAS,kBAAkB,KACzB,KAAK,CAAC,SAAS,CAmNjB,CAAC"}
|
|
@@ -18,6 +18,7 @@ import { rate_limit_ip_key } from '../http/ip_canonical.js';
|
|
|
18
18
|
import { rate_limit_exceeded_response, reserve_optional } from '../rate_limiter.js';
|
|
19
19
|
import { ERROR_NO_MATCHING_INVITE, ERROR_SIGNUP_CONFLICT } from '../http/error_schemas.js';
|
|
20
20
|
import { is_pg_unique_violation } from '../db/pg_error.js';
|
|
21
|
+
import { start_fail_floor, warn_if_fail_floor_disabled } from './fail_floor.js';
|
|
21
22
|
/**
|
|
22
23
|
* Default minimum wall-clock time (ms) for a signup denial (403 / 409) response.
|
|
23
24
|
*
|
|
@@ -39,12 +40,6 @@ export const DEFAULT_SIGNUP_FAIL_FLOOR_MS = 250;
|
|
|
39
40
|
* guarantees.
|
|
40
41
|
*/
|
|
41
42
|
export const DEFAULT_SIGNUP_FAIL_JITTER_MS = 25;
|
|
42
|
-
const signup_fail_delay = (floor_ms, jitter_ms) => {
|
|
43
|
-
if (floor_ms <= 0)
|
|
44
|
-
return Promise.resolve();
|
|
45
|
-
const jitter = jitter_ms > 0 ? Math.floor(Math.random() * (jitter_ms * 2 + 1)) - jitter_ms : 0;
|
|
46
|
-
return new Promise((resolve) => setTimeout(resolve, floor_ms + jitter));
|
|
47
|
-
};
|
|
48
43
|
// `create_signup_route_specs` spreads the shape and attaches the live handler
|
|
49
44
|
// below.
|
|
50
45
|
/**
|
|
@@ -57,6 +52,7 @@ const signup_fail_delay = (floor_ms, jitter_ms) => {
|
|
|
57
52
|
export const create_signup_route_specs = (deps, options) => {
|
|
58
53
|
const { keyring, password } = deps;
|
|
59
54
|
const { session_options, signup_ip_rate_limiter, signup_account_rate_limiter, signup_fail_floor_ms = DEFAULT_SIGNUP_FAIL_FLOOR_MS, signup_fail_jitter_ms = DEFAULT_SIGNUP_FAIL_JITTER_MS } = options;
|
|
55
|
+
warn_if_fail_floor_disabled('signup', signup_fail_floor_ms, deps.log);
|
|
60
56
|
return [
|
|
61
57
|
{
|
|
62
58
|
...create_signup_route_shape({
|
|
@@ -102,9 +98,9 @@ export const create_signup_route_specs = (deps, options) => {
|
|
|
102
98
|
// so the cheap `no_match` path (no Argon2, find returns
|
|
103
99
|
// nothing) and the expensive `signup_conflict` path (Argon2
|
|
104
100
|
// + tx + rollback) converge — closes the username-enumeration
|
|
105
|
-
// timing oracle.
|
|
101
|
+
// timing oracle. The same `start_fail_floor` as login. Started
|
|
106
102
|
// after rate-limit checks so 429 stays fast.
|
|
107
|
-
const delay =
|
|
103
|
+
const delay = start_fail_floor(signup_fail_floor_ms, signup_fail_jitter_ms);
|
|
108
104
|
// Hash before the transaction so the connection isn't held
|
|
109
105
|
// across the ~100ms Argon2id. Paid on every attempt that gets
|
|
110
106
|
// here — bounded as described above.
|
|
@@ -151,11 +147,16 @@ export const create_signup_route_specs = (deps, options) => {
|
|
|
151
147
|
email
|
|
152
148
|
});
|
|
153
149
|
if (invite) {
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
|
|
150
|
+
// FOR UPDATE held the row for the duration of the
|
|
151
|
+
// tx, so no concurrent claim could flip `claimed_at`
|
|
152
|
+
// between the find and this UPDATE. A miss means
|
|
153
|
+
// that invariant broke — refuse loudly (the throw
|
|
154
|
+
// rolls the account back) rather than mint an
|
|
155
|
+
// account no invite admitted.
|
|
156
|
+
const claimed = await query_invite_claim_unscoped(tx_deps, invite.id, account.id);
|
|
157
|
+
if (!claimed) {
|
|
158
|
+
throw new Error(`invite ${invite.id} was already claimed despite the FOR UPDATE lock`);
|
|
159
|
+
}
|
|
159
160
|
}
|
|
160
161
|
await create_session_and_set_cookie({
|
|
161
162
|
keyring,
|
|
@@ -23,7 +23,7 @@ import { type RoleGrantOfferActionOptions } from './role_grant_offer_actions.js'
|
|
|
23
23
|
import { type AccountActionOptions } from './account_actions.js';
|
|
24
24
|
import type { RevokingActionFactoryDeps } from './deps.js';
|
|
25
25
|
import type { NotificationSender } from './role_grant_offer_notifications.js';
|
|
26
|
-
import type { RpcAction } from '../actions/
|
|
26
|
+
import type { RpcAction } from '../actions/action_types.js';
|
|
27
27
|
/**
|
|
28
28
|
* Options for `create_standard_rpc_actions`.
|
|
29
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard_rpc_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/standard_rpc_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAwB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAEN,KAAK,2BAA2B,EAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"standard_rpc_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/standard_rpc_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAwB,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAEN,KAAK,2BAA2B,EAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,WAAW,yBAChB,SAAQ,kBAAkB,EAAE,2BAA2B,EAAE,oBAAoB;CAAG;AAEjF;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAuB,SAAQ,yBAAyB;IACxE,mBAAmB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAChD;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,GACvC,MAAM,sBAAsB,EAC5B,UAAS,yBAA8B,KACrC,KAAK,CAAC,SAAS,CAIjB,CAAC"}
|
|
@@ -125,7 +125,7 @@ export declare const token_scope_admits_non_rpc: (scope: TokenScope) => boolean;
|
|
|
125
125
|
* (`auth/account_route_schema.ts`).
|
|
126
126
|
*
|
|
127
127
|
* Not a registry a consumer registers into. `RouteAuth.required_scope` accepts
|
|
128
|
-
* any well-formed `surface:<name>` (see `
|
|
128
|
+
* any well-formed `surface:<name>` (see `is_route_scope_capability`), so a
|
|
129
129
|
* consumer names its own non-RPC surface without an upstream release. This
|
|
130
130
|
* tuple is what the *spine* may declare, and what its surface census iterates
|
|
131
131
|
* — the closure is a check on fuz_app's own routes, not a vocabulary consumers
|
|
@@ -133,15 +133,16 @@ export declare const token_scope_admits_non_rpc: (scope: TokenScope) => boolean;
|
|
|
133
133
|
*
|
|
134
134
|
* A surface name never decides anything: rule 3 is all-or-nothing
|
|
135
135
|
* (`token_scope_admits_non_rpc`), so the name only labels *which* surface
|
|
136
|
-
* refused, in the `required_scope` a denial reports
|
|
137
|
-
*
|
|
136
|
+
* refused, in the `required_scope` a denial reports — the same field whose
|
|
137
|
+
* `rpc:<method>` value, in a dispatcher denial, carries arbitrary consumer
|
|
138
|
+
* method names.
|
|
138
139
|
*/
|
|
139
140
|
export declare const TOKEN_SURFACES: readonly ["db_admin", "fact_bare", "audit_stream", "ws_upgrade", "app_surface", "account_verify"];
|
|
140
141
|
export type TokenSurface = (typeof TOKEN_SURFACES)[number];
|
|
141
142
|
/**
|
|
142
143
|
* Is `value` one of the surfaces the spine mounts?
|
|
143
144
|
*
|
|
144
|
-
* Membership, not well-formedness — `
|
|
145
|
+
* Membership, not well-formedness — `is_route_scope_capability` is the format
|
|
145
146
|
* check the guard resolver runs on a declaration, and it is deliberately looser.
|
|
146
147
|
* Used where the *spine's* own surfaces are the question: the direct-call denial
|
|
147
148
|
* helpers, and the census assertion that fuz_app declares no surface it doesn't
|
|
@@ -154,64 +155,36 @@ export declare const is_token_surface: (value: string) => value is TokenSurface;
|
|
|
154
155
|
*
|
|
155
156
|
* Applied to the `surface:` arm only. The `rpc:` arm's identifier is an action
|
|
156
157
|
* method name, whose vocabulary belongs to `ActionSpec` (and includes shapes
|
|
157
|
-
* like `peer/ping` this regex would refuse)
|
|
158
|
-
*
|
|
158
|
+
* like `peer/ping` this regex would refuse); the dispatcher computes it from the
|
|
159
|
+
* registered method, so nothing parses one.
|
|
159
160
|
*/
|
|
160
161
|
export declare const TOKEN_SURFACE_NAME_REGEX: RegExp;
|
|
161
162
|
/**
|
|
162
163
|
* The capability string an action method is refused under: `rpc:<method>`.
|
|
163
164
|
*
|
|
164
|
-
*
|
|
165
|
-
* and the REST bridge, which must agree — where a `surface:` capability is
|
|
165
|
+
* Computed by the dispatcher's per-method gate, where a `surface:` capability is
|
|
166
166
|
* always written as a literal on a route spec, so nothing computes one.
|
|
167
167
|
*/
|
|
168
168
|
export declare const token_scope_method_capability: (method: string) => string;
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
171
|
-
* credential's `TokenScope`.
|
|
170
|
+
* Is `value` a capability a route spec may declare as `auth.required_scope`?
|
|
172
171
|
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* (`token_scope_admits_non_rpc` never looks at which surface). That is why one
|
|
179
|
-
* half of the vocabulary needs no registry.
|
|
180
|
-
*/
|
|
181
|
-
export type TokenScopeCapability = {
|
|
182
|
-
kind: 'rpc';
|
|
183
|
-
capability: string;
|
|
184
|
-
method: string;
|
|
185
|
-
} | {
|
|
186
|
-
kind: 'surface';
|
|
187
|
-
capability: string;
|
|
188
|
-
};
|
|
189
|
-
/**
|
|
190
|
-
* Parse a capability string into the question it asks, or `null` when it is
|
|
191
|
-
* not a capability at all.
|
|
172
|
+
* Only the `surface:<name>` arm: a route is a non-RPC surface, and rule 3 is
|
|
173
|
+
* all-or-nothing there. The `rpc:<method>` arm is the dispatcher's per-method
|
|
174
|
+
* gate (`perform_action`), which a route never reaches — so a route declaring
|
|
175
|
+
* one would put a method name in front of a REST handler that no method gate
|
|
176
|
+
* guards, and is refused at registration.
|
|
192
177
|
*
|
|
193
|
-
* Callers turn `
|
|
178
|
+
* Callers turn `false` into a registration-time throw: `RouteAuth.required_scope`
|
|
194
179
|
* is typed as a plain string so `http/` needs no `auth/` import, and this is the
|
|
195
180
|
* single point where that string becomes a mounted guard, so it is where the
|
|
196
|
-
* value gets checked.
|
|
197
|
-
*
|
|
198
|
-
* of a surface gate, which would put a method name in front of a whole-surface
|
|
199
|
-
* refusal.
|
|
181
|
+
* value gets checked. The identifier is checked for shape
|
|
182
|
+
* (`TOKEN_SURFACE_NAME_REGEX`), not membership — a consumer names its own surface.
|
|
200
183
|
*
|
|
201
184
|
* @param value - the declared capability string, e.g. `surface:audit_stream`
|
|
202
|
-
* @returns
|
|
203
|
-
*/
|
|
204
|
-
export declare const parse_token_scope_capability: (value: string) => TokenScopeCapability | null;
|
|
205
|
-
/**
|
|
206
|
-
* Does `scope` admit `capability`?
|
|
207
|
-
*
|
|
208
|
-
* The one place the two arms of the vocabulary meet their two predicates, so a
|
|
209
|
-
* `surface:` capability can never be answered by a method-list membership test
|
|
210
|
-
* (which would let a narrowed token onto a surface by listing a method named
|
|
211
|
-
* after it) and an `rpc:` capability can never be answered by rule 3 (which
|
|
212
|
-
* would refuse a token the method it was minted for).
|
|
185
|
+
* @returns whether `value` is a well-formed `surface:<name>` capability
|
|
213
186
|
*/
|
|
214
|
-
export declare const
|
|
187
|
+
export declare const is_route_scope_capability: (value: string) => boolean;
|
|
215
188
|
/**
|
|
216
189
|
* Build the flat denial body a non-RPC route returns when a narrowed token
|
|
217
190
|
* reaches a capability it lacks:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_scope.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/token_scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAW,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU;;;;;;;;;4BAYrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;;;;;4BAG1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,QAAO,UAGlC,CAAC;AAEH,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,GAAI,SAAS,KAAK,CAAC,MAAM,CAAC,KAAG,UAI3D,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,eAAe,KAAG,UAC8B,CAAC;AAE/F;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,UAAU,EAAE,QAAQ,MAAM,KAAG,OACtB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,0BAA0B,GAAI,OAAO,UAAU,KAAG,OAAgC,CAAC;AAEhG
|
|
1
|
+
{"version":3,"file":"token_scope.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/token_scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAW,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU;;;;;;;;;4BAYrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;;;;;4BAG1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,QAAO,UAGlC,CAAC;AAEH,uCAAuC;AACvC,eAAO,MAAM,mBAAmB,GAAI,SAAS,KAAK,CAAC,MAAM,CAAC,KAAG,UAI3D,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,eAAe,KAAG,UAC8B,CAAC;AAE/F;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,UAAU,EAAE,QAAQ,MAAM,KAAG,OACtB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,0BAA0B,GAAI,OAAO,UAAU,KAAG,OAAgC,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,cAAc,mGAOjB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,YACA,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,QAAgC,CAAC;AAQtE;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GAAI,QAAQ,MAAM,KAAG,MAC3B,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,KAAG,OAEmB,CAAC;AAE9E;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,GACnC,YAAY,MAAM,KAChB;IAAE,KAAK,EAAE,sBAAsB,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAGxD,CAAC;AAEH,4CAA4C;AAC5C,eAAO,MAAM,iBAAiB,GAAI,OAAO,UAAU,KAAG,MAGrD,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,UAAU,GAAG,IAU5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,UAAU,KAAG,MAQzD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,UAAU,GAAG,IAQtE,CAAC"}
|
package/dist/auth/token_scope.js
CHANGED
|
@@ -131,7 +131,7 @@ export const token_scope_admits_non_rpc = (scope) => scope.kind === 'full';
|
|
|
131
131
|
* (`auth/account_route_schema.ts`).
|
|
132
132
|
*
|
|
133
133
|
* Not a registry a consumer registers into. `RouteAuth.required_scope` accepts
|
|
134
|
-
* any well-formed `surface:<name>` (see `
|
|
134
|
+
* any well-formed `surface:<name>` (see `is_route_scope_capability`), so a
|
|
135
135
|
* consumer names its own non-RPC surface without an upstream release. This
|
|
136
136
|
* tuple is what the *spine* may declare, and what its surface census iterates
|
|
137
137
|
* — the closure is a check on fuz_app's own routes, not a vocabulary consumers
|
|
@@ -139,8 +139,9 @@ export const token_scope_admits_non_rpc = (scope) => scope.kind === 'full';
|
|
|
139
139
|
*
|
|
140
140
|
* A surface name never decides anything: rule 3 is all-or-nothing
|
|
141
141
|
* (`token_scope_admits_non_rpc`), so the name only labels *which* surface
|
|
142
|
-
* refused, in the `required_scope` a denial reports
|
|
143
|
-
*
|
|
142
|
+
* refused, in the `required_scope` a denial reports — the same field whose
|
|
143
|
+
* `rpc:<method>` value, in a dispatcher denial, carries arbitrary consumer
|
|
144
|
+
* method names.
|
|
144
145
|
*/
|
|
145
146
|
export const TOKEN_SURFACES = [
|
|
146
147
|
'db_admin',
|
|
@@ -153,7 +154,7 @@ export const TOKEN_SURFACES = [
|
|
|
153
154
|
/**
|
|
154
155
|
* Is `value` one of the surfaces the spine mounts?
|
|
155
156
|
*
|
|
156
|
-
* Membership, not well-formedness — `
|
|
157
|
+
* Membership, not well-formedness — `is_route_scope_capability` is the format
|
|
157
158
|
* check the guard resolver runs on a declaration, and it is deliberately looser.
|
|
158
159
|
* Used where the *spine's* own surfaces are the question: the direct-call denial
|
|
159
160
|
* helpers, and the census assertion that fuz_app declares no surface it doesn't
|
|
@@ -166,61 +167,42 @@ export const is_token_surface = (value) => TOKEN_SURFACES.includes(value);
|
|
|
166
167
|
*
|
|
167
168
|
* Applied to the `surface:` arm only. The `rpc:` arm's identifier is an action
|
|
168
169
|
* method name, whose vocabulary belongs to `ActionSpec` (and includes shapes
|
|
169
|
-
* like `peer/ping` this regex would refuse)
|
|
170
|
-
*
|
|
170
|
+
* like `peer/ping` this regex would refuse); the dispatcher computes it from the
|
|
171
|
+
* registered method, so nothing parses one.
|
|
171
172
|
*/
|
|
172
173
|
export const TOKEN_SURFACE_NAME_REGEX = /^[a-z][a-z_]*[a-z]$|^[a-z]$/;
|
|
173
174
|
// Capability-string prefixes. Private: `token_scope_method_capability` builds
|
|
174
|
-
// the one capability anything computes, and `
|
|
175
|
-
// one
|
|
175
|
+
// the one capability anything computes, and `is_route_scope_capability` checks
|
|
176
|
+
// the one a route declares, so nothing outside this module concatenates these.
|
|
176
177
|
const CAPABILITY_RPC_PREFIX = 'rpc:';
|
|
177
178
|
const CAPABILITY_SURFACE_PREFIX = 'surface:';
|
|
178
179
|
/**
|
|
179
180
|
* The capability string an action method is refused under: `rpc:<method>`.
|
|
180
181
|
*
|
|
181
|
-
*
|
|
182
|
-
* and the REST bridge, which must agree — where a `surface:` capability is
|
|
182
|
+
* Computed by the dispatcher's per-method gate, where a `surface:` capability is
|
|
183
183
|
* always written as a literal on a route spec, so nothing computes one.
|
|
184
184
|
*/
|
|
185
185
|
export const token_scope_method_capability = (method) => `${CAPABILITY_RPC_PREFIX}${method}`;
|
|
186
186
|
/**
|
|
187
|
-
*
|
|
188
|
-
* not a capability at all.
|
|
187
|
+
* Is `value` a capability a route spec may declare as `auth.required_scope`?
|
|
189
188
|
*
|
|
190
|
-
*
|
|
189
|
+
* Only the `surface:<name>` arm: a route is a non-RPC surface, and rule 3 is
|
|
190
|
+
* all-or-nothing there. The `rpc:<method>` arm is the dispatcher's per-method
|
|
191
|
+
* gate (`perform_action`), which a route never reaches — so a route declaring
|
|
192
|
+
* one would put a method name in front of a REST handler that no method gate
|
|
193
|
+
* guards, and is refused at registration.
|
|
194
|
+
*
|
|
195
|
+
* Callers turn `false` into a registration-time throw: `RouteAuth.required_scope`
|
|
191
196
|
* is typed as a plain string so `http/` needs no `auth/` import, and this is the
|
|
192
197
|
* single point where that string becomes a mounted guard, so it is where the
|
|
193
|
-
* value gets checked.
|
|
194
|
-
*
|
|
195
|
-
* of a surface gate, which would put a method name in front of a whole-surface
|
|
196
|
-
* refusal.
|
|
198
|
+
* value gets checked. The identifier is checked for shape
|
|
199
|
+
* (`TOKEN_SURFACE_NAME_REGEX`), not membership — a consumer names its own surface.
|
|
197
200
|
*
|
|
198
201
|
* @param value - the declared capability string, e.g. `surface:audit_stream`
|
|
199
|
-
* @returns
|
|
200
|
-
*/
|
|
201
|
-
export const parse_token_scope_capability = (value) => {
|
|
202
|
-
if (value.startsWith(CAPABILITY_RPC_PREFIX)) {
|
|
203
|
-
const method = value.slice(CAPABILITY_RPC_PREFIX.length);
|
|
204
|
-
return method.length > 0 ? { kind: 'rpc', capability: value, method } : null;
|
|
205
|
-
}
|
|
206
|
-
if (value.startsWith(CAPABILITY_SURFACE_PREFIX)) {
|
|
207
|
-
const surface = value.slice(CAPABILITY_SURFACE_PREFIX.length);
|
|
208
|
-
return TOKEN_SURFACE_NAME_REGEX.test(surface) ? { kind: 'surface', capability: value } : null;
|
|
209
|
-
}
|
|
210
|
-
return null;
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* Does `scope` admit `capability`?
|
|
214
|
-
*
|
|
215
|
-
* The one place the two arms of the vocabulary meet their two predicates, so a
|
|
216
|
-
* `surface:` capability can never be answered by a method-list membership test
|
|
217
|
-
* (which would let a narrowed token onto a surface by listing a method named
|
|
218
|
-
* after it) and an `rpc:` capability can never be answered by rule 3 (which
|
|
219
|
-
* would refuse a token the method it was minted for).
|
|
202
|
+
* @returns whether `value` is a well-formed `surface:<name>` capability
|
|
220
203
|
*/
|
|
221
|
-
export const
|
|
222
|
-
|
|
223
|
-
: token_scope_admits_non_rpc(scope);
|
|
204
|
+
export const is_route_scope_capability = (value) => value.startsWith(CAPABILITY_SURFACE_PREFIX) &&
|
|
205
|
+
TOKEN_SURFACE_NAME_REGEX.test(value.slice(CAPABILITY_SURFACE_PREFIX.length));
|
|
224
206
|
/**
|
|
225
207
|
* Build the flat denial body a non-RPC route returns when a narrowed token
|
|
226
208
|
* reaches a capability it lacks:
|
package/dist/db/CLAUDE.md
CHANGED
|
@@ -25,7 +25,11 @@ the code.
|
|
|
25
25
|
`PGLET_COERCION` is pglet's half of the same convention, which every pglet
|
|
26
26
|
instance fuz_app creates is given.
|
|
27
27
|
- `migrate.ts` — advisory-lock migration runner (`run_migrations`,
|
|
28
|
-
`baseline`), `Migration` / `MigrationNamespace` / `MigrationError
|
|
28
|
+
`baseline`), `Migration` / `MigrationNamespace` / `MigrationError`, and the
|
|
29
|
+
reserved spine names (`reserved_migration_namespaces`): both runners refuse
|
|
30
|
+
a namespace under one unless `create_spine_migration_namespace` built it —
|
|
31
|
+
admission by object identity, so this module owns the names without
|
|
32
|
+
importing the auth, cell, or fact chains.
|
|
29
33
|
- `query_deps.ts` — `QueryDeps = {db}`, the first param to every `query_*`.
|
|
30
34
|
- `assert_row.ts` — `assert_row(row, context)` for INSERT … RETURNING.
|
|
31
35
|
- `pg_error.ts` — `pg_error_code` (SQLSTATE extractor for `pg`/PGlite/pglet errors), `is_pg_unique_violation` (Postgres `23505`).
|
|
@@ -103,7 +107,8 @@ The wire schemas + RPC handlers + authz predicates for this layer live in
|
|
|
103
107
|
- **`cell_queries.ts`** — `query_cell_create / get / get_by_path / update /
|
|
104
108
|
delete / set_moderation`, `_list_by_kind / _list_by_creator`, the
|
|
105
109
|
generic `query_cell_list` (filter + SQL-side visibility predicate mirroring
|
|
106
|
-
`can_view_cell`, moderation admission included
|
|
110
|
+
`can_view_cell`, moderation admission included, bound through one
|
|
111
|
+
`viewer: CellViewer`; the `kind` filter narrows
|
|
107
112
|
by the `cell.kind` column, the `ref` filter by `cell.refs`, plus `root_id` /
|
|
108
113
|
`moderation` filters for the per-root feed + mod queue),
|
|
109
114
|
`query_cell_load_many` (bulk id load of full rows, no visibility filter —
|
|
@@ -137,7 +142,7 @@ delete / set_moderation`, `_list_by_kind / _list_by_creator`, the
|
|
|
137
142
|
`_get`, `_delete` (returns deleted row), `_list_for_cell`,
|
|
138
143
|
`_list_for_cells` (bulk, for the relation-read filter), and
|
|
139
144
|
`query_cell_grants_for_caller_in_cells` (caller-matched enrichment for
|
|
140
|
-
`shared_with: 'me'`).
|
|
145
|
+
`shared_with: 'me'`, taking the same `CellViewer` the list bound).
|
|
141
146
|
- **`cell_field_queries.ts`** — named relations (`(source_id, name) →
|
|
142
147
|
target_id`): `query_cell_field_set` (UPSERT), `_get`, `_delete`,
|
|
143
148
|
`_list_for_source` (`{limit, name_after}`), `_list_for_target`. Reads JOIN
|
|
@@ -237,7 +242,7 @@ otherwise immaterial to the `schema_version` rows — `sequence` is assigned
|
|
|
237
242
|
per-namespace):
|
|
238
243
|
|
|
239
244
|
```
|
|
240
|
-
|
|
245
|
+
AUTH_MIGRATION_NS (built-in, fuz_auth)
|
|
241
246
|
→ CELL_MIGRATION_NS (fuz_cell — FKs actor.id)
|
|
242
247
|
→ FACT_MIGRATION_NS (fuz_facts — fact_holder FKs actor.id)
|
|
243
248
|
```
|
package/dist/db/cell_ddl.d.ts
CHANGED
|
@@ -34,149 +34,12 @@
|
|
|
34
34
|
*
|
|
35
35
|
* @module
|
|
36
36
|
*/
|
|
37
|
-
import
|
|
38
|
-
/**
|
|
39
|
-
* `cell_visibility` enum — access-control axis for a cell. Lives as a
|
|
40
|
-
* top-level column (not inside `data`) because visibility is access
|
|
41
|
-
* control, not content metadata. `cell_grant` is the other ACL surface;
|
|
42
|
-
* keeping visibility as a peer column (not a JSON field) co-locates
|
|
43
|
-
* access-control state and lets the planner reason about it directly.
|
|
44
|
-
*
|
|
45
|
-
* Ships with two states (`'private'`, `'public'`); a third (unlisted /
|
|
46
|
-
* public-link) folds in via `ALTER TYPE` when public-link sharing lands.
|
|
47
|
-
*
|
|
48
|
-
* Wrapped in a `DO` block so the migration can replay idempotently —
|
|
49
|
-
* `CREATE TYPE` has no `IF NOT EXISTS` variant in PostgreSQL.
|
|
50
|
-
*/
|
|
51
|
-
export declare const CELL_VISIBILITY_TYPE = "\nDO $$ BEGIN\n\tCREATE TYPE cell_visibility AS ENUM ('private', 'public');\nEXCEPTION WHEN duplicate_object THEN NULL;\nEND $$";
|
|
52
|
-
/**
|
|
53
|
-
* `cell` table — universal content primitive: identity + content only.
|
|
54
|
-
* Parent→child membership lives in `cell_item`; named relations live in
|
|
55
|
-
* `cell_field`. Includes the `created_by` / `updated_by` ownership columns.
|
|
56
|
-
*
|
|
57
|
-
* `visibility` is the access-control axis — `private` (default) is
|
|
58
|
-
* restricted to admin / owner / `cell_grant`-admitted callers; `public`
|
|
59
|
-
* admits everyone, including unauthenticated visitors. Lives as a
|
|
60
|
-
* top-level column so the auth predicate reads off the row directly
|
|
61
|
-
* rather than reaching into `data`.
|
|
62
|
-
*
|
|
63
|
-
* `path` is the global namespace axis (no tenant/hub scoping) — globally
|
|
64
|
-
* unique on active rows via `idx_cell_path_unique`.
|
|
65
|
-
*
|
|
66
|
-
* `kind` is the capability / identity axis — a nullable top-level column
|
|
67
|
-
* (peer to `visibility` / `path`), **not** a field inside `data`. It is the
|
|
68
|
-
* discriminator a creation authorizer gates on (see `auth/cell_actions.ts`
|
|
69
|
-
* `CellCreateAuthorize`) and is **write-once**: set at INSERT and carried on
|
|
70
|
-
* no update path, so a cell's kind is fixed at birth. Content stays
|
|
71
|
-
* duck-typed in `data`; `kind` is a capability tag, not a content-type.
|
|
72
|
-
*
|
|
73
|
-
* `parent_id` / `root_id` are the **directory tree** (containment): `parent_id`
|
|
74
|
-
* is the immediate container (nullable self-FK; `NULL` = a root), `root_id` is
|
|
75
|
-
* the governing root denormalized for flat-subtree queries (`root_id =
|
|
76
|
-
* parent.root_id ?? parent.id`, so a root has `NULL`). Both are set once at
|
|
77
|
-
* create and immutable in v1 (carried on no update path). `moderation`
|
|
78
|
-
* (nullable text — `pending` / `approved` / `rejected`; `NULL` = unmoderated)
|
|
79
|
-
* is the approval-lifecycle marker, peer to `visibility` (a control field with
|
|
80
|
-
* a non-author writer — see `auth/cell_actions.ts`), never inside `data`.
|
|
81
|
-
*
|
|
82
|
-
* `policy` (nullable JSONB) is a root's contribution policy — an object opaque
|
|
83
|
-
* to the spine, read by the consumer's create authorizer (`NULL` = its floor
|
|
84
|
-
* governs). The table CHECK holds it to roots (`parent_id IS NULL`) and to JSON
|
|
85
|
-
* objects (`policy @> '{}'` holds for an object and for nothing else — the
|
|
86
|
-
* object test every driver runs, where `jsonb_typeof` is not on pglet). A
|
|
87
|
-
* manage-tier control field: written at a root's create and by
|
|
88
|
-
* `cell_policy_set`, never through `data`, which an editor grant can write.
|
|
89
|
-
*/
|
|
90
|
-
export declare const CELL_SCHEMA = "\nCREATE TABLE IF NOT EXISTS cell (\n\tid UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n\tdata JSONB NOT NULL,\n\tkind TEXT,\n\tvisibility cell_visibility NOT NULL DEFAULT 'private',\n\tpath TEXT,\n\trefs TEXT[],\n\tparent_id UUID REFERENCES cell(id) ON DELETE SET NULL,\n\troot_id UUID REFERENCES cell(id) ON DELETE SET NULL,\n\tmoderation TEXT,\n\tpolicy JSONB,\n\tcreated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n\tupdated_at TIMESTAMPTZ,\n\tdeleted_at TIMESTAMPTZ,\n\tcreated_by UUID REFERENCES actor(id) ON DELETE SET NULL,\n\tupdated_by UUID REFERENCES actor(id) ON DELETE SET NULL,\n\tCHECK (policy IS NULL OR (parent_id IS NULL AND policy @> '{}'::jsonb))\n)";
|
|
91
|
-
/**
|
|
92
|
-
* Cell indexes — all active-only, partial on `deleted_at IS NULL`.
|
|
93
|
-
*
|
|
94
|
-
* - `idx_cell_active`: active-cell list/scan ordered by creation.
|
|
95
|
-
* - `idx_cell_path_unique`: global `path` uniqueness + read-side path
|
|
96
|
-
* lookup. Partial on path + active so reused paths after soft delete are
|
|
97
|
-
* allowed.
|
|
98
|
-
* - `idx_cell_kind`: the `cell_list` kind filter (`cell.kind = ?`) and
|
|
99
|
-
* kind-scoped scans. Active-only.
|
|
100
|
-
* - `idx_cell_data`: shape-driven queries (`data @> ...`).
|
|
101
|
-
* - `idx_cell_refs`: cells-by-fact discovery (cross-cell reference graph).
|
|
102
|
-
* - `idx_cell_created_by`: "cells this actor created" queries.
|
|
103
|
-
* - `idx_cell_root`: flat-subtree feed/scope queries by governing root
|
|
104
|
-
* (`cell.root_id = ?`). Active-only.
|
|
105
|
-
* - `idx_cell_moderation_pending`: the moderation queue — pending
|
|
106
|
-
* contributions per governing root. Partial on `moderation = 'pending'`.
|
|
107
|
-
*
|
|
108
|
-
* Parent↔child membership and named relations live in sibling tables;
|
|
109
|
-
* see `CELL_ITEM_INDEXES` / `CELL_FIELD_INDEXES` below.
|
|
110
|
-
*/
|
|
111
|
-
export declare const CELL_INDEXES: Array<string>;
|
|
112
|
-
/**
|
|
113
|
-
* `cell_grant` table — resource-side ACL for cells. Each row admits a
|
|
114
|
-
* principal (actor or `(role, scope_id)`) at a `level` (`viewer` or
|
|
115
|
-
* `editor`). Owner is implicit (`cell.created_by`); the table never carries
|
|
116
|
-
* owner rows.
|
|
117
|
-
*
|
|
118
|
-
* The single-principal arm is actor-grain (`actor_id` FK); the other arm is
|
|
119
|
-
* role-shaped (`(role, scope_id)`). The CHECK enforces exactly one arm.
|
|
120
|
-
*/
|
|
121
|
-
export declare const CELL_GRANT_SCHEMA = "\nCREATE TABLE IF NOT EXISTS cell_grant (\n\tid UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n\tcell_id UUID NOT NULL REFERENCES cell(id) ON DELETE CASCADE,\n\tlevel TEXT NOT NULL CHECK (level IN ('viewer', 'editor')),\n\tactor_id UUID REFERENCES actor(id) ON DELETE CASCADE,\n\trole TEXT,\n\tscope_id UUID,\n\tgranted_by UUID REFERENCES actor(id) ON DELETE SET NULL,\n\tcreated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n\tCHECK (\n\t\t(actor_id IS NOT NULL AND role IS NULL AND scope_id IS NULL) OR\n\t\t(actor_id IS NULL AND role IS NOT NULL)\n\t)\n)";
|
|
122
|
-
/**
|
|
123
|
-
* `cell_grant` indexes.
|
|
124
|
-
*
|
|
125
|
-
* - `idx_cell_grant_cell`: forward lookup ("who has access to this cell?").
|
|
126
|
-
* - `idx_cell_grant_actor`: reverse lookup ("which cells does this actor have access to?").
|
|
127
|
-
* - `idx_cell_grant_role_scope`: reverse lookup for role-shaped principals.
|
|
128
|
-
* - `idx_cell_grant_unique_actor`: prevents duplicate actor-shaped grants for the same cell.
|
|
129
|
-
* Re-granting updates `level` via UPSERT on this index.
|
|
130
|
-
* - `idx_cell_grant_unique_role_scope`: same, for role-shaped grants.
|
|
131
|
-
* `NULLS NOT DISTINCT` so two rows with the same `(cell_id, role)` and
|
|
132
|
-
* `scope_id IS NULL` collide — without it, default NULL-distinct
|
|
133
|
-
* semantics would let duplicate null-scope role grants slip past the
|
|
134
|
-
* re-share UPSERT path. Requires PostgreSQL 15+ (pglite tracks PG 16).
|
|
135
|
-
*/
|
|
136
|
-
export declare const CELL_GRANT_INDEXES: Array<string>;
|
|
137
|
-
/**
|
|
138
|
-
* `cell_field` table — named relation (`(source_id, name) → target_id`).
|
|
139
|
-
* One target per name per source — JSON-object keys are unique. Multiplicity
|
|
140
|
-
* is expressed by composition (`foo.tags = collection_cell` whose `items[]`
|
|
141
|
-
* are the tags), not by allowing duplicate `(source_id, name)` rows.
|
|
142
|
-
*/
|
|
143
|
-
export declare const CELL_FIELD_SCHEMA = "\nCREATE TABLE IF NOT EXISTS cell_field (\n\tsource_id UUID NOT NULL REFERENCES cell(id) ON DELETE CASCADE,\n\tname TEXT NOT NULL,\n\ttarget_id UUID NOT NULL REFERENCES cell(id) ON DELETE CASCADE,\n\tcreated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n\tPRIMARY KEY (source_id, name)\n)";
|
|
144
|
-
/**
|
|
145
|
-
* `cell_field` indexes.
|
|
146
|
-
*
|
|
147
|
-
* - PK on `(source_id, name)` covers forward lookup ("what does this cell
|
|
148
|
-
* point to via field X?") and the per-source fields list.
|
|
149
|
-
* - `idx_cell_field_target` covers reverse lookup ("which cells link to
|
|
150
|
-
* this target?").
|
|
151
|
-
*
|
|
152
|
-
* Soft-delete is filtered by JOIN at the read boundary; no partial indexes
|
|
153
|
-
* here on `deleted_at` (would force index churn on cell soft-delete
|
|
154
|
-
* toggles, and the join filter is sufficient).
|
|
155
|
-
*/
|
|
156
|
-
export declare const CELL_FIELD_INDEXES: Array<string>;
|
|
157
|
-
/**
|
|
158
|
-
* `cell_item` table — ordered child membership keyed by an opaque
|
|
159
|
-
* fractional-indexing string. `(parent_id, position)` PK enforces one cell
|
|
160
|
-
* per slot; the same `child_id` may appear at multiple positions (the
|
|
161
|
-
* primitive is JSON-array-shaped — ordered multiset, not set). Domain
|
|
162
|
-
* dedup rules ride on top in helpers.
|
|
163
|
-
*/
|
|
164
|
-
export declare const CELL_ITEM_SCHEMA = "\nCREATE TABLE IF NOT EXISTS cell_item (\n\tparent_id UUID NOT NULL REFERENCES cell(id) ON DELETE CASCADE,\n\tposition TEXT NOT NULL,\n\tchild_id UUID NOT NULL REFERENCES cell(id) ON DELETE CASCADE,\n\tcreated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n\tPRIMARY KEY (parent_id, position)\n)";
|
|
165
|
-
/**
|
|
166
|
-
* `cell_item` indexes.
|
|
167
|
-
*
|
|
168
|
-
* - PK on `(parent_id, position)` covers ordered scans for the per-parent
|
|
169
|
-
* items list (`SELECT ... ORDER BY position`).
|
|
170
|
-
* - `idx_cell_item_child` covers reverse lookup ("which parents contain
|
|
171
|
-
* this child?").
|
|
172
|
-
*/
|
|
173
|
-
export declare const CELL_ITEM_INDEXES: Array<string>;
|
|
37
|
+
import { type MigrationNamespace } from './migrate.js';
|
|
174
38
|
/** Tables created by `CELL_MIGRATION_NS`, in drop order (children first). */
|
|
175
39
|
export declare const CELL_DROP_TABLES: readonly ["cell_field", "cell_item", "cell_grant", "cell"];
|
|
176
|
-
/**
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
/** Migration namespace consumed by `run_migrations`. */
|
|
40
|
+
/**
|
|
41
|
+
* Migration namespace consumed by `run_migrations` — the spine's own, so splice
|
|
42
|
+
* this object itself (a copy is refused under the reserved name).
|
|
43
|
+
*/
|
|
181
44
|
export declare const CELL_MIGRATION_NS: MigrationNamespace;
|
|
182
45
|
//# sourceMappingURL=cell_ddl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_ddl.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/cell_ddl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cell_ddl.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/db/cell_ddl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,cAAc,CAAC;AAuOtB,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,4DAA6D,CAAC;AA+B3F;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,kBAG/B,CAAC"}
|