@fuzdev/fuz_app 0.104.0 → 0.106.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/dist/actions/CLAUDE.md +2 -2
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +2 -2
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +3 -3
- package/dist/actions/action_dispatcher.d.ts.map +1 -1
- package/dist/actions/action_dispatcher.js +3 -3
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +11 -11
- package/dist/actions/action_event_data.d.ts.map +1 -1
- package/dist/actions/action_event_data.js +2 -2
- package/dist/actions/action_event_helpers.d.ts.map +1 -1
- package/dist/actions/action_event_helpers.js +2 -2
- package/dist/actions/action_event_types.d.ts.map +1 -1
- package/dist/actions/action_event_types.js +4 -4
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +14 -13
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +6 -6
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/broadcast_api.js +1 -1
- package/dist/actions/cancel.d.ts.map +1 -1
- package/dist/actions/cancel.js +3 -3
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +3 -3
- package/dist/actions/heartbeat.d.ts.map +1 -1
- package/dist/actions/heartbeat.js +2 -2
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_ping.js +6 -6
- package/dist/actions/peer_request.d.ts.map +1 -1
- package/dist/actions/perform_action.d.ts +8 -0
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +41 -23
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +1 -1
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +39 -12
- package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
- package/dist/actions/register_ws_endpoint.js +3 -3
- package/dist/actions/request_tracker.svelte.d.ts.map +1 -1
- package/dist/actions/request_tracker.svelte.js +2 -2
- package/dist/actions/rpc_client.d.ts.map +1 -1
- package/dist/actions/rpc_client.js +7 -7
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/socket.svelte.js +4 -3
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_http.js +7 -7
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/transports_ws.js +3 -3
- package/dist/actions/transports_ws_auth_guard.d.ts +4 -4
- package/dist/actions/transports_ws_auth_guard.d.ts.map +1 -1
- package/dist/actions/transports_ws_auth_guard.js +5 -5
- package/dist/actions/transports_ws_backend.d.ts.map +1 -1
- package/dist/actions/transports_ws_backend.js +2 -2
- package/dist/actions/ws_endpoint_spec.d.ts +2 -2
- package/dist/actions/ws_endpoint_spec.d.ts.map +1 -1
- package/dist/auth/CLAUDE.md +11 -7
- package/dist/auth/account_action_specs.d.ts +32 -9
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +35 -23
- package/dist/auth/account_actions.d.ts +3 -3
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +25 -12
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +6 -6
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +19 -19
- package/dist/auth/account_routes.d.ts +2 -2
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +27 -27
- package/dist/auth/account_schema.d.ts +26 -2
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +28 -10
- package/dist/auth/actor_lookup_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_lookup_action_specs.js +5 -5
- package/dist/auth/actor_lookup_actions.d.ts +4 -2
- package/dist/auth/actor_lookup_actions.d.ts.map +1 -1
- package/dist/auth/actor_lookup_actions.js +3 -3
- package/dist/auth/actor_lookup_queries.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.js +6 -6
- package/dist/auth/actor_search_actions.d.ts +4 -2
- package/dist/auth/actor_search_actions.d.ts.map +1 -1
- package/dist/auth/actor_search_actions.js +5 -5
- package/dist/auth/actor_search_queries.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.d.ts +2 -2
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +55 -55
- package/dist/auth/admin_actions.d.ts +5 -5
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +45 -44
- package/dist/auth/all_action_spec_registries.d.ts.map +1 -1
- package/dist/auth/all_action_spec_registries.js +1 -1
- 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.d.ts.map +1 -1
- package/dist/auth/api_token_queries.d.ts +9 -3
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +29 -8
- package/dist/auth/app_settings_queries.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.js +3 -3
- package/dist/auth/audit_emitter.d.ts +28 -20
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +37 -19
- package/dist/auth/audit_log_ddl.js +1 -1
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +2 -2
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +1 -1
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +12 -4
- package/dist/auth/audit_log_schema.d.ts +2 -2
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +69 -68
- package/dist/auth/auth_ddl.js +3 -3
- package/dist/auth/auth_guard_resolver.d.ts.map +1 -1
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +6 -1
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +5 -5
- package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
- package/dist/auth/bootstrap_route_schema.js +6 -6
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +7 -7
- package/dist/auth/cell_action_specs.d.ts +1 -1
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.js +47 -47
- package/dist/auth/cell_actions.d.ts +2 -2
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +37 -37
- package/dist/auth/cell_audit_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_audit_action_specs.js +4 -4
- package/dist/auth/cell_audit_actions.d.ts.map +1 -1
- package/dist/auth/cell_audit_actions.js +3 -3
- package/dist/auth/cell_audit_events.d.ts.map +1 -1
- package/dist/auth/cell_audit_events.js +5 -5
- package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.js +3 -3
- package/dist/auth/cell_authorize.d.ts.map +1 -1
- package/dist/auth/cell_data_schema.d.ts.map +1 -1
- package/dist/auth/cell_data_schema.js +1 -1
- package/dist/auth/cell_field_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_field_action_specs.js +16 -16
- package/dist/auth/cell_field_actions.d.ts +2 -2
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.js +11 -11
- package/dist/auth/cell_field_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_field_audit_metadata.js +2 -2
- package/dist/auth/cell_grant_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_grant_action_specs.js +15 -15
- package/dist/auth/cell_grant_actions.d.ts +2 -2
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +12 -12
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_grant_audit_metadata.js +3 -3
- package/dist/auth/cell_item_action_specs.d.ts +6 -2
- package/dist/auth/cell_item_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_item_action_specs.js +25 -21
- package/dist/auth/cell_item_actions.d.ts +2 -2
- package/dist/auth/cell_item_actions.d.ts.map +1 -1
- package/dist/auth/cell_item_actions.js +14 -14
- package/dist/auth/cell_item_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_item_audit_metadata.js +3 -3
- package/dist/auth/cell_relation_visibility.d.ts.map +1 -1
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +2 -2
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +5 -5
- package/dist/auth/daemon_token.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +7 -3
- package/dist/auth/deps.d.ts +20 -5
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.js +8 -8
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/invite_schema.js +2 -2
- 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/middleware.js +7 -7
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +54 -19
- package/dist/auth/password.d.ts.map +1 -1
- package/dist/auth/password_argon2.d.ts.map +1 -1
- package/dist/auth/password_argon2.js +2 -2
- package/dist/auth/request_context.d.ts +18 -0
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +33 -7
- package/dist/auth/role_grant_offer_action_specs.d.ts +12 -0
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +47 -36
- package/dist/auth/role_grant_offer_actions.d.ts +7 -4
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +43 -43
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +13 -13
- package/dist/auth/role_grant_offer_queries.d.ts +1 -1
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +11 -11
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_schema.js +7 -7
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +3 -3
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +7 -7
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.d.ts +7 -0
- package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.js +12 -6
- package/dist/auth/self_service_role_actions.d.ts +3 -3
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +9 -9
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +3 -3
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +4 -4
- package/dist/auth/session_queries.d.ts +14 -4
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +13 -3
- package/dist/auth/signup_route_schema.d.ts.map +1 -1
- package/dist/auth/signup_route_schema.js +6 -6
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +11 -11
- package/dist/auth/standard_action_specs.d.ts.map +1 -1
- package/dist/auth/standard_action_specs.js +1 -1
- package/dist/auth/standard_rpc_actions.d.ts +4 -4
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/standard_rpc_actions.js +3 -3
- package/dist/auth/token_scope.d.ts +155 -0
- package/dist/auth/token_scope.d.ts.map +1 -0
- package/dist/auth/token_scope.js +190 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/daemon.d.ts.map +1 -1
- package/dist/cli/daemon.js +3 -3
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli/logger.d.ts.map +1 -1
- package/dist/cli/logger.js +1 -1
- package/dist/cli/util.d.ts.map +1 -1
- package/dist/cli/util.js +1 -1
- package/dist/db/CLAUDE.md +1 -1
- package/dist/db/cell_audit_queries.d.ts.map +1 -1
- package/dist/db/cell_audit_queries.js +1 -1
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +7 -7
- 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_grant_queries.js +1 -1
- package/dist/db/cell_history_ddl.d.ts.map +1 -1
- package/dist/db/cell_history_ddl.js +4 -4
- package/dist/db/cell_item_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.d.ts +1 -1
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +3 -3
- package/dist/db/create_db.d.ts.map +1 -1
- package/dist/db/create_db.js +1 -1
- package/dist/db/db.d.ts.map +1 -1
- package/dist/db/db_pg.d.ts.map +1 -1
- package/dist/db/db_pg.js +1 -1
- package/dist/db/db_pglite.d.ts.map +1 -1
- package/dist/db/db_pglite.js +1 -1
- package/dist/db/fact_ddl.d.ts.map +1 -1
- package/dist/db/fact_ddl.js +3 -3
- package/dist/db/fact_disk_storage.d.ts +1 -1
- package/dist/db/fact_disk_storage.d.ts.map +1 -1
- package/dist/db/fact_disk_storage.js +6 -6
- package/dist/db/fact_queries.d.ts +1 -1
- package/dist/db/fact_queries.d.ts.map +1 -1
- package/dist/db/fact_queries.js +2 -2
- package/dist/db/fact_store.d.ts +1 -1
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/fact_store.js +9 -9
- package/dist/db/fact_store_errors.d.ts.map +1 -1
- package/dist/db/file_fact_url.d.ts +1 -1
- package/dist/db/file_fact_url.d.ts.map +1 -1
- package/dist/db/file_fact_url.js +1 -1
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/pg_error.d.ts.map +1 -1
- package/dist/db/query_deps.d.ts.map +1 -1
- package/dist/db/schema_ready.d.ts.map +1 -1
- package/dist/db/schema_ready.js +2 -2
- package/dist/db/status.d.ts.map +1 -1
- package/dist/db/status.js +6 -6
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +6 -6
- package/dist/env/dotenv.d.ts.map +1 -1
- package/dist/env/load.d.ts.map +1 -1
- package/dist/env/resolve.d.ts.map +1 -1
- package/dist/hono_context.d.ts +23 -0
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +16 -2
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +6 -6
- package/dist/http/client_ip.d.ts.map +1 -1
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +8 -8
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +27 -23
- package/dist/http/error_schemas.d.ts +13 -1
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +25 -13
- package/dist/http/jsonrpc.d.ts.map +1 -1
- package/dist/http/jsonrpc.js +9 -9
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +21 -21
- package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
- package/dist/http/jsonrpc_helpers.js +7 -7
- package/dist/http/middleware_spec.d.ts.map +1 -1
- package/dist/http/origin.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/proxy.js +1 -1
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +6 -6
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +1 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +11 -11
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +1 -1
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +1 -1
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +4 -4
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +2 -2
- package/dist/realtime/sse_auth_guard.d.ts +4 -4
- package/dist/realtime/sse_auth_guard.d.ts.map +1 -1
- package/dist/realtime/sse_auth_guard.js +8 -8
- package/dist/realtime/subscriber_registry.d.ts.map +1 -1
- package/dist/runtime/deno.d.ts.map +1 -1
- package/dist/runtime/deno.js +7 -7
- package/dist/runtime/deps.d.ts.map +1 -1
- package/dist/runtime/fs.d.ts.map +1 -1
- package/dist/runtime/mock.d.ts.map +1 -1
- package/dist/runtime/mock.js +3 -3
- package/dist/runtime/node.d.ts.map +1 -1
- package/dist/runtime/node.js +7 -7
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/server/app_backend.d.ts +3 -3
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +3 -3
- package/dist/server/app_server.d.ts +6 -6
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +32 -32
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +9 -9
- package/dist/server/file_fact_fetcher.d.ts.map +1 -1
- package/dist/server/file_fact_fetcher.js +1 -1
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +23 -13
- package/dist/server/startup.d.ts.map +1 -1
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/x_accel.d.ts +2 -4
- package/dist/server/x_accel.d.ts.map +1 -1
- package/dist/server/x_accel.js +3 -5
- package/dist/testing/CLAUDE.md +2 -2
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +64 -64
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +1 -1
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +15 -15
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +22 -22
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +34 -33
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +12 -12
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +42 -42
- package/dist/testing/audit_drift_guard.d.ts +3 -1
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.js +12 -6
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +4 -4
- package/dist/testing/bootstrap_success.d.ts.map +1 -1
- package/dist/testing/bootstrap_success.js +11 -11
- package/dist/testing/connection_closer_helpers.d.ts.map +1 -1
- package/dist/testing/connection_closer_helpers.js +1 -1
- package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/account_lifecycle.js +1 -1
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +4 -4
- 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/actor_lookup.js +3 -3
- package/dist/testing/cross_backend/actor_search.d.ts.map +1 -1
- package/dist/testing/cross_backend/actor_search.js +5 -5
- package/dist/testing/cross_backend/app_settings.d.ts.map +1 -1
- package/dist/testing/cross_backend/app_settings.js +6 -6
- package/dist/testing/cross_backend/backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/bench_report.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/bench_report.js +5 -5
- package/dist/testing/cross_backend/bench/run_cross_impl_bench.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/run_cross_impl_bench.js +2 -2
- package/dist/testing/cross_backend/bench/scenario.d.ts.map +1 -1
- package/dist/testing/cross_backend/bench/scenario.js +1 -1
- package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size.js +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.js +2 -2
- package/dist/testing/cross_backend/build_test_backend_paths.js +1 -1
- package/dist/testing/cross_backend/capabilities.js +2 -2
- package/dist/testing/cross_backend/cell_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +5 -2
- package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_gated_create.js +8 -7
- package/dist/testing/cross_backend/cell_grant_role.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_grant_role.js +2 -2
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +13 -13
- package/dist/testing/cross_backend/conformance_case.d.ts +23 -0
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.js +32 -11
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +68 -15
- package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -1
- package/dist/testing/cross_backend/cookie_attributes.js +4 -4
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts +1 -1
- 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 +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.js +1 -1
- package/dist/testing/cross_backend/credential_header_robustness.js +1 -1
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +12 -12
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +9 -9
- package/dist/testing/cross_backend/expected_schema.json +1 -0
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +2 -2
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +4 -4
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +28 -24
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +9 -9
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +2 -2
- package/dist/testing/cross_backend/make_cross_backend_project.d.ts +1 -1
- package/dist/testing/cross_backend/make_cross_backend_project.d.ts.map +1 -1
- package/dist/testing/cross_backend/make_cross_backend_project.js +3 -3
- package/dist/testing/cross_backend/method_coverage.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin.js +4 -4
- package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +6 -6
- package/dist/testing/cross_backend/ready.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_enumeration.js +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +1 -1
- package/dist/testing/cross_backend/role_grant_participation.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/rust_spine_stub_backend_config.js +5 -5
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +41 -37
- package/dist/testing/cross_backend/spawn_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/spawn_backend.js +1 -1
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +10 -7
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/standard.js +5 -5
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +7 -7
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +24 -23
- package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.js +3 -3
- 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_deno.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_deno.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 +3 -3
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +13 -13
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +2 -2
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +8 -8
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +3 -3
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/db_entities.js +1 -1
- package/dist/testing/entities.d.ts.map +1 -1
- package/dist/testing/entities.js +5 -5
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +109 -109
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +3 -3
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +11 -11
- package/dist/testing/mock_fs.js +1 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +23 -23
- package/dist/testing/role_grant_helpers.d.ts.map +1 -1
- package/dist/testing/role_grant_helpers.js +3 -3
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +6 -6
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +12 -12
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +11 -11
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +3 -3
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +3 -3
- package/dist/testing/schema_introspect.d.ts.map +1 -1
- package/dist/testing/schema_introspect.js +12 -12
- package/dist/testing/schema_parity.d.ts.map +1 -1
- package/dist/testing/schema_parity.js +7 -7
- 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/sse_round_trip.js +8 -8
- package/dist/testing/standard.d.ts.map +1 -1
- package/dist/testing/standard.js +8 -8
- package/dist/testing/stubs.d.ts +6 -6
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +26 -23
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/surface_invariants.js +5 -5
- package/dist/testing/testing_rate_limiter.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.js +4 -4
- package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
- package/dist/testing/transports/sse_frame_reader.d.ts.map +1 -1
- package/dist/testing/transports/sse_transport.js +1 -1
- package/dist/testing/transports/ws_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_client.js +1 -1
- package/dist/testing/transports/ws_transport.js +4 -4
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +21 -21
- package/dist/ui/AccountSessions.svelte +11 -11
- package/dist/ui/AdminAccounts.svelte +10 -10
- package/dist/ui/AdminAuditLog.svelte +14 -14
- package/dist/ui/AdminInvites.svelte +13 -13
- package/dist/ui/AdminOverview.svelte +22 -22
- package/dist/ui/AdminRoleGrantHistory.svelte +11 -11
- package/dist/ui/AdminSessions.svelte +12 -12
- package/dist/ui/AdminSettings.svelte +1 -1
- package/dist/ui/AdminSurface.svelte +3 -3
- package/dist/ui/AppShell.svelte +8 -8
- package/dist/ui/AppShell.svelte.d.ts.map +1 -1
- package/dist/ui/BootstrapForm.svelte +9 -9
- package/dist/ui/CLAUDE.md +1 -1
- package/dist/ui/ColumnLayout.svelte +2 -2
- package/dist/ui/ColumnLayout.svelte.d.ts.map +1 -1
- package/dist/ui/ConfirmButton.svelte +8 -8
- package/dist/ui/ConfirmButton.svelte.d.ts.map +1 -1
- package/dist/ui/Datatable.svelte +6 -6
- package/dist/ui/Datatable.svelte.d.ts.map +1 -1
- package/dist/ui/LoginForm.svelte +6 -6
- package/dist/ui/LogoutButton.svelte +2 -2
- package/dist/ui/LogoutButton.svelte.d.ts.map +1 -1
- package/dist/ui/MenuLink.svelte +5 -5
- package/dist/ui/MenuLink.svelte.d.ts.map +1 -1
- package/dist/ui/OpenSignupToggle.svelte +2 -2
- package/dist/ui/PopoverButton.svelte +10 -10
- package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferForm.svelte +8 -11
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferHistory.svelte +11 -11
- package/dist/ui/RoleGrantOfferHistory.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferInbox.svelte +6 -6
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
- package/dist/ui/SignupForm.svelte +9 -9
- package/dist/ui/SurfaceExplorer.svelte +11 -11
- 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.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +2 -2
- 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_rpc_adapters.js +5 -5
- 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/audit_log_state.svelte.js +1 -1
- package/dist/ui/auth_state.svelte.js +4 -4
- 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.map +1 -1
- package/dist/ui/popover.svelte.js +1 -1
- package/dist/ui/position_helpers.js +1 -1
- package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.js +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.js +2 -2
- package/package.json +13 -12
- package/dist/server/fact_write.d.ts +0 -32
- package/dist/server/fact_write.d.ts.map +0 -1
- package/dist/server/fact_write.js +0 -56
- package/dist/server/validate_nginx.d.ts +0 -34
- package/dist/server/validate_nginx.d.ts.map +0 -1
- package/dist/server/validate_nginx.js +0 -169
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bound audit-emit capability.
|
|
3
3
|
*
|
|
4
|
-
* `AuditEmitter` closes over the pool-level `Db`,
|
|
5
|
-
*
|
|
4
|
+
* `AuditEmitter` closes over the pool-level `Db`, its registered
|
|
5
|
+
* listeners, and the optional `AuditLogConfig`. Built by the
|
|
6
6
|
* consumer's `audit_factory` callback on `CreateAppBackendOptions` —
|
|
7
7
|
* `create_app_backend` invokes the factory once with its constructed
|
|
8
8
|
* `{db, log}` and lands the result on `AppDeps.audit`. Consumers reach
|
|
@@ -26,21 +26,21 @@
|
|
|
26
26
|
* Same write-then-notify semantics as `emit`, just synchronous-with-await.
|
|
27
27
|
* - `notify(event)` — fan out an already-written audit row (e.g. rows
|
|
28
28
|
* returned by `query_accept_offer` that were inserted in-transaction by
|
|
29
|
-
* the query layer). Runs every listener
|
|
29
|
+
* the query layer). Runs every registered listener; per-listener throws
|
|
30
30
|
* are isolated.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
* additional listeners after the backend is
|
|
34
|
-
* audit-log SSE, per-endpoint WS auth guards and
|
|
35
|
-
* `extra_audit_handlers` on a `WsEndpointSpec`) before
|
|
36
|
-
* runs. Consumers can also
|
|
37
|
-
* they return from `audit_factory` for setups that don't pass
|
|
38
|
-
* `create_app_server`.
|
|
32
|
+
* Listeners are a documented registration seam — `create_app_server`
|
|
33
|
+
* registers additional listeners via `add_listener` after the backend is
|
|
34
|
+
* built (the factory-managed audit-log SSE, per-endpoint WS auth guards and
|
|
35
|
+
* logout closers, any `extra_audit_handlers` on a `WsEndpointSpec`) before
|
|
36
|
+
* the first request runs. Consumers can also register listeners directly on
|
|
37
|
+
* the emitter they return from `audit_factory` for setups that don't pass
|
|
38
|
+
* through `create_app_server`.
|
|
39
39
|
*
|
|
40
40
|
* @module
|
|
41
41
|
*/
|
|
42
42
|
import { query_audit_log } from './audit_log_queries.js';
|
|
43
|
-
import { builtin_audit_log_config
|
|
43
|
+
import { builtin_audit_log_config } from './audit_log_schema.js';
|
|
44
44
|
/**
|
|
45
45
|
* Build a bound `AuditEmitter`. Typical caller is the consumer's
|
|
46
46
|
* `audit_factory` callback on `CreateAppBackendOptions` —
|
|
@@ -52,11 +52,17 @@ import { builtin_audit_log_config, } from './audit_log_schema.js';
|
|
|
52
52
|
*/
|
|
53
53
|
export const create_audit_emitter = (options) => {
|
|
54
54
|
const { db, log, audit_log_config = builtin_audit_log_config, emit_decorator } = options;
|
|
55
|
-
|
|
55
|
+
// Closure-private listener list — no mutable array is exposed on the
|
|
56
|
+
// returned (frozen) emitter; registration goes through `add_listener`.
|
|
57
|
+
const listeners = [];
|
|
56
58
|
if (options.on_audit_event)
|
|
57
|
-
|
|
59
|
+
listeners.push(options.on_audit_event);
|
|
58
60
|
const notify = (event) => {
|
|
59
|
-
|
|
61
|
+
// Snapshot-at-notify: iterate a copy so a listener that registers
|
|
62
|
+
// another listener mid-fan-out doesn't have the newcomer fire for the
|
|
63
|
+
// in-flight event (it fires on the next `notify`). Converges with the
|
|
64
|
+
// Rust twin, which clones the listener vec before iterating.
|
|
65
|
+
for (const listener of [...listeners]) {
|
|
60
66
|
try {
|
|
61
67
|
listener(event);
|
|
62
68
|
}
|
|
@@ -91,9 +97,13 @@ export const create_audit_emitter = (options) => {
|
|
|
91
97
|
target_account_id: input.target_account_id,
|
|
92
98
|
target_actor_id: input.target_actor_id,
|
|
93
99
|
ip: ctx.client_ip,
|
|
94
|
-
metadata: input.metadata
|
|
100
|
+
metadata: input.metadata
|
|
95
101
|
});
|
|
96
102
|
};
|
|
103
|
+
const add_listener = (listener) => {
|
|
104
|
+
listeners.push(listener);
|
|
105
|
+
};
|
|
106
|
+
const listener_count = () => listeners.length;
|
|
97
107
|
// Freeze the slot layout so consumers cannot hot-patch `emit` /
|
|
98
108
|
// `emit_role_grant_target` / `emit_pool` / `notify` after construction.
|
|
99
109
|
// The previous test helper `patch_audit_emit_capture` did exactly this
|
|
@@ -102,8 +112,16 @@ export const create_audit_emitter = (options) => {
|
|
|
102
112
|
// `this.emit`, so the patch silently bypassed role-grant-shape emits.
|
|
103
113
|
// Tests that need instrumentation pass `emit_decorator` so the wrap
|
|
104
114
|
// is captured by the closure before the freeze (see
|
|
105
|
-
// `create_emit_ordering_audit_factory`).
|
|
106
|
-
//
|
|
107
|
-
// `create_app_server`
|
|
108
|
-
|
|
115
|
+
// `create_emit_ordering_audit_factory`). The listener list stays
|
|
116
|
+
// closure-private; registration is append-only via `add_listener`
|
|
117
|
+
// (`create_app_server` registers its SSE + WS listeners post-assembly,
|
|
118
|
+
// by design).
|
|
119
|
+
return Object.freeze({
|
|
120
|
+
emit,
|
|
121
|
+
emit_role_grant_target,
|
|
122
|
+
emit_pool,
|
|
123
|
+
notify,
|
|
124
|
+
add_listener,
|
|
125
|
+
listener_count
|
|
126
|
+
});
|
|
109
127
|
};
|
|
@@ -47,5 +47,5 @@ export const AUDIT_LOG_INDEXES = [
|
|
|
47
47
|
`CREATE INDEX IF NOT EXISTS idx_audit_log_account ON audit_log(account_id)`,
|
|
48
48
|
`CREATE INDEX IF NOT EXISTS idx_audit_log_event_type ON audit_log(event_type)`,
|
|
49
49
|
`CREATE INDEX IF NOT EXISTS idx_audit_log_target_account ON audit_log(target_account_id)`,
|
|
50
|
-
`CREATE INDEX IF NOT EXISTS idx_audit_log_target_actor ON audit_log(target_actor_id)
|
|
50
|
+
`CREATE INDEX IF NOT EXISTS idx_audit_log_target_actor ON audit_log(target_actor_id)`
|
|
51
51
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_queries.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"audit_log_queries.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,MAAM,uBAAuB,CAAC;AAa/B,iFAAiF;AACjF,eAAO,MAAM,sCAAsC,QAAO,MACvB,CAAC;AAEpC,0CAA0C;AAC1C,eAAO,MAAM,wCAAwC,QAAO,IAE3D,CAAC;AAYF,gFAAgF;AAChF,eAAO,MAAM,qCAAqC,QAAO,MACvB,CAAC;AAEnC,0CAA0C;AAC1C,eAAO,MAAM,uCAAuC,QAAO,IAE1D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,eAAe,GAAU,CAAC,SAAS,MAAM,EACrD,MAAM,SAAS,EACf,OAAO,aAAa,CAAC,CAAC,CAAC,EACvB,SAAQ,cAAyC,KAC/C,OAAO,CAAC,aAAa,CAsCvB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAChC,MAAM,SAAS,EACf,UAAU,mBAAmB,KAC3B,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CA0C9B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC,GAC/C,MAAM,SAAS,EACf,UAAU,mBAAmB,KAC3B,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAwD/C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC,GACnD,MAAM,SAAS,EACf,cAA+B,EAC/B,eAAU,KACR,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAmB1C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,GAC1C,MAAM,SAAS,EACf,QAAQ,IAAI,KACV,OAAO,CAAC,MAAM,CAMhB,CAAC"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
14
|
import { assert_row } from '../db/assert_row.js';
|
|
15
|
-
import { AUDIT_LOG_DEFAULT_LIMIT, builtin_audit_log_config
|
|
15
|
+
import { AUDIT_LOG_DEFAULT_LIMIT, builtin_audit_log_config } from './audit_log_schema.js';
|
|
16
16
|
/**
|
|
17
17
|
* Process-wide counter for audit metadata validation failures. `query_audit_log`
|
|
18
18
|
* increments on `safeParse` mismatch and writes the row anyway (fail-open —
|
|
@@ -91,7 +91,7 @@ export const query_audit_log = async (deps, input, config = builtin_audit_log_co
|
|
|
91
91
|
input.target_account_id ?? null,
|
|
92
92
|
input.target_actor_id ?? null,
|
|
93
93
|
input.ip ?? null,
|
|
94
|
-
input.metadata ? JSON.stringify(input.metadata) : null
|
|
94
|
+
input.metadata ? JSON.stringify(input.metadata) : null
|
|
95
95
|
]);
|
|
96
96
|
return assert_row(rows[0], 'INSERT INTO audit_log');
|
|
97
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_route_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"audit_log_route_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB;;kBAA0C,CAAC;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACxC,gBAAe,MAAkC,KAC/C,IAAI,CAAC,SAAS,EAAE,SAAS,CAQ1B,CAAC"}
|
|
@@ -32,5 +32,5 @@ export const create_audit_log_route_shape = (required_role = DEFAULT_AUDIT_STREA
|
|
|
32
32
|
description: 'Subscribe to realtime audit log events',
|
|
33
33
|
query: AuditStreamQuery,
|
|
34
34
|
input: z.null(),
|
|
35
|
-
output: z.null()
|
|
35
|
+
output: z.null() // SSE — no JSON response
|
|
36
36
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"audit_log_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAuB,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAQ3E,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACpC,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,MAAM,CAAC,EAAE;QACR,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,MAAM,IAAI,CAAC;QAC1F,GAAG,EAAE,MAAM,CAAC;KACZ,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GAAI,UAAU,oBAAoB,KAAG,KAAK,CAAC,SAAS,CAiC5F,CAAC"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { create_audit_log_route_shape } from './audit_log_route_schema.js';
|
|
15
15
|
import { create_sse_response } from '../realtime/sse.js';
|
|
16
|
-
import { AUTH_SESSION_TOKEN_HASH_KEY, require_request_context } from './request_context.js';
|
|
16
|
+
import { AUTH_SESSION_TOKEN_HASH_KEY, require_request_context, token_scope_surface_denial } from './request_context.js';
|
|
17
17
|
import { AUDIT_LOG_CHANNEL } from '../realtime/sse_auth_guard.js';
|
|
18
18
|
/**
|
|
19
19
|
* Create the optional audit-log SSE route spec.
|
|
@@ -32,6 +32,14 @@ export const create_audit_log_route_specs = (options) => {
|
|
|
32
32
|
{
|
|
33
33
|
...create_audit_log_route_shape(options.required_role),
|
|
34
34
|
handler: (c) => {
|
|
35
|
+
// Rule 3 — a narrowed token holds no audit feed. Same reasoning as
|
|
36
|
+
// the WS upgrade: this is a long-lived server→client stream whose
|
|
37
|
+
// contents are decided by the account's role, not by any
|
|
38
|
+
// per-message scope check, so there is no point after open at
|
|
39
|
+
// which a narrowing could apply.
|
|
40
|
+
const denied = token_scope_surface_denial(c, 'audit_stream');
|
|
41
|
+
if (denied)
|
|
42
|
+
return denied;
|
|
35
43
|
const ctx = require_request_context(c);
|
|
36
44
|
// scope = session hash (capped → tabs-per-session limit and
|
|
37
45
|
// session-specific `session_revoke` close). groups = [account_id]
|
|
@@ -42,11 +50,11 @@ export const create_audit_log_route_specs = (options) => {
|
|
|
42
50
|
const unsubscribe = subscribe(stream, {
|
|
43
51
|
channels: [AUDIT_LOG_CHANNEL],
|
|
44
52
|
scope: token_hash ?? undefined,
|
|
45
|
-
groups: [ctx.account.id]
|
|
53
|
+
groups: [ctx.account.id]
|
|
46
54
|
});
|
|
47
55
|
stream.on_close(unsubscribe);
|
|
48
56
|
return response;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
51
59
|
];
|
|
52
60
|
};
|
|
@@ -98,7 +98,7 @@ export declare const audit_metadata_schemas: Readonly<{
|
|
|
98
98
|
}>>;
|
|
99
99
|
}, z.core.$loose>>;
|
|
100
100
|
session_revoke: z.ZodObject<{
|
|
101
|
-
session_id: z.ZodString
|
|
101
|
+
session_id: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
|
|
102
102
|
credential_type: z.ZodOptional<z.ZodEnum<{
|
|
103
103
|
daemon_token: "daemon_token";
|
|
104
104
|
session: "session";
|
|
@@ -465,7 +465,7 @@ export declare const RoleGrantHistoryEventJson: z.ZodObject<{
|
|
|
465
465
|
export type RoleGrantHistoryEventJson = z.infer<typeof RoleGrantHistoryEventJson>;
|
|
466
466
|
/** Zod schema for admin session listing (session + username). */
|
|
467
467
|
export declare const AdminSessionJson: z.ZodObject<{
|
|
468
|
-
id: z.ZodString
|
|
468
|
+
id: z.core.$ZodBranded<z.ZodString, "SessionId", "out">;
|
|
469
469
|
account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
470
470
|
created_at: z.ZodString;
|
|
471
471
|
expires_at: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"audit_log_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_schema.ts"],"names":[],"mappings":"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"}
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
13
|
-
import {
|
|
14
|
-
import { AuthSessionJson } from './account_schema.js';
|
|
13
|
+
import { AuthSessionJson, SessionId } from './account_schema.js';
|
|
15
14
|
import { Email } from '../primitive_schemas.js';
|
|
16
15
|
import { ApiTokenId } from './api_token.js';
|
|
17
16
|
import { BuiltinCredentialType } from './credential_type_schema.js';
|
|
@@ -23,7 +22,7 @@ import { BuiltinCredentialType } from './credential_type_schema.js';
|
|
|
23
22
|
* See `docs/security.md` §Credential-channel gating.
|
|
24
23
|
*/
|
|
25
24
|
const credential_type_meta = BuiltinCredentialType.optional().meta({
|
|
26
|
-
description: 'Credential channel the request arrived on. Defense in depth — the spec gate restricts to `session`, but the row preserves what actually authenticated the request in case the gate is loosened or bypassed in a future refactor.'
|
|
25
|
+
description: 'Credential channel the request arrived on. Defense in depth — the spec gate restricts to `session`, but the row preserves what actually authenticated the request in case the gate is loosened or bypassed in a future refactor.'
|
|
27
26
|
});
|
|
28
27
|
/**
|
|
29
28
|
* All tracked auth event types. Frozen to convert accidental in-process
|
|
@@ -58,7 +57,7 @@ export const AUDIT_EVENT_TYPES = Object.freeze([
|
|
|
58
57
|
'actor_delete',
|
|
59
58
|
'actor_purge',
|
|
60
59
|
'actor_undelete',
|
|
61
|
-
'app_settings_update'
|
|
60
|
+
'app_settings_update'
|
|
62
61
|
]);
|
|
63
62
|
/** Zod schema for audit event types. */
|
|
64
63
|
export const AuditEventType = z.enum(AUDIT_EVENT_TYPES);
|
|
@@ -70,7 +69,7 @@ export const AuditEventType = z.enum(AUDIT_EVENT_TYPES);
|
|
|
70
69
|
export const AUDIT_EVENT_TYPE_NAME_REGEX = /^[A-Za-z][A-Za-z0-9_./-]*$/;
|
|
71
70
|
/** Zod schema for valid audit event-type name strings. */
|
|
72
71
|
export const AuditEventTypeName = z.string().regex(AUDIT_EVENT_TYPE_NAME_REGEX, {
|
|
73
|
-
message: 'must start with a letter; only letters, digits, _ . / - allowed'
|
|
72
|
+
message: 'must start with a letter; only letters, digits, _ . / - allowed'
|
|
74
73
|
});
|
|
75
74
|
/** Zod schema for audit event outcomes. */
|
|
76
75
|
export const AuditOutcome = z.enum(['success', 'failure']);
|
|
@@ -84,47 +83,49 @@ export const AuditOutcome = z.enum(['success', 'failure']);
|
|
|
84
83
|
export const audit_metadata_schemas = Object.freeze({
|
|
85
84
|
login: z
|
|
86
85
|
.looseObject({
|
|
87
|
-
username: z.string().meta({ description: 'Username submitted with the login attempt.' })
|
|
86
|
+
username: z.string().meta({ description: 'Username submitted with the login attempt.' })
|
|
88
87
|
})
|
|
89
88
|
.nullable(),
|
|
90
89
|
logout: z.null(),
|
|
91
90
|
bootstrap: z
|
|
92
91
|
.looseObject({
|
|
93
|
-
error: z.string().meta({ description: 'Error message for a failed bootstrap attempt.' })
|
|
92
|
+
error: z.string().meta({ description: 'Error message for a failed bootstrap attempt.' })
|
|
94
93
|
})
|
|
95
94
|
.nullable(),
|
|
96
95
|
signup: z.looseObject({
|
|
97
96
|
username: z.string().meta({ description: 'Username submitted at signup.' }),
|
|
98
97
|
invite_id: Uuid.optional().meta({
|
|
99
|
-
description: 'Invite consumed by this signup. Set on success and on `signup_conflict` failure rows when an invite was matched at attempt time.'
|
|
98
|
+
description: 'Invite consumed by this signup. Set on success and on `signup_conflict` failure rows when an invite was matched at attempt time.'
|
|
100
99
|
}),
|
|
101
100
|
open_signup: z.boolean().optional().meta({
|
|
102
|
-
description: 'True when the signup occurred via the `open_signup` setting (no invite required). Set on success rows under `open_signup` and on failure rows when the attempt was made under `open_signup`.'
|
|
101
|
+
description: 'True when the signup occurred via the `open_signup` setting (no invite required). Set on success rows under `open_signup` and on failure rows when the attempt was made under `open_signup`.'
|
|
103
102
|
}),
|
|
104
103
|
reason: z.string().optional().meta({
|
|
105
|
-
description: 'Failure category: `no_match` (no unclaimed invite matched), `signup_conflict` (username/email already exists, raised by the DB unique constraint), `internal_error` (catch-all for non-classified tx failures — Argon2 fault, session create error, DB outage mid-tx). Set only on `outcome=failure`.'
|
|
104
|
+
description: 'Failure category: `no_match` (no unclaimed invite matched), `signup_conflict` (username/email already exists, raised by the DB unique constraint), `internal_error` (catch-all for non-classified tx failures — Argon2 fault, session create error, DB outage mid-tx). Set only on `outcome=failure`.'
|
|
106
105
|
}),
|
|
107
106
|
email: Email.optional().meta({
|
|
108
|
-
description: 'Email submitted at signup — recorded on failure rows for forensic correlation. Omitted on success rows because the email is already tied to the resulting account.'
|
|
109
|
-
})
|
|
107
|
+
description: 'Email submitted at signup — recorded on failure rows for forensic correlation. Omitted on success rows because the email is already tied to the resulting account.'
|
|
108
|
+
})
|
|
110
109
|
}),
|
|
111
110
|
password_change: z
|
|
112
111
|
.looseObject({
|
|
113
112
|
sessions_revoked: z.number().optional().meta({
|
|
114
|
-
description: 'Number of sessions revoked as a side effect of the password change. Present on `outcome=success`.'
|
|
113
|
+
description: 'Number of sessions revoked as a side effect of the password change. Present on `outcome=success`.'
|
|
115
114
|
}),
|
|
116
115
|
tokens_revoked: z.number().optional().meta({
|
|
117
|
-
description: 'Number of API tokens revoked as a side effect of the password change. Present on `outcome=success`.'
|
|
116
|
+
description: 'Number of API tokens revoked as a side effect of the password change. Present on `outcome=success`.'
|
|
118
117
|
}),
|
|
119
118
|
reason: z.enum(['concurrent_change']).optional().meta({
|
|
120
|
-
description: 'Failure category. `concurrent_change` indicates another password change committed first against the same starting hash (verify-write race loser). Absent for typed-wrong-password failures.'
|
|
119
|
+
description: 'Failure category. `concurrent_change` indicates another password change committed first against the same starting hash (verify-write race loser). Absent for typed-wrong-password failures.'
|
|
121
120
|
}),
|
|
122
|
-
credential_type: credential_type_meta
|
|
121
|
+
credential_type: credential_type_meta
|
|
123
122
|
})
|
|
124
123
|
.nullable(),
|
|
125
124
|
session_revoke: z.looseObject({
|
|
126
|
-
session_id:
|
|
127
|
-
|
|
125
|
+
session_id: SessionId.meta({
|
|
126
|
+
description: 'Blake3 hash identifying the revoked session row.'
|
|
127
|
+
}),
|
|
128
|
+
credential_type: credential_type_meta
|
|
128
129
|
}),
|
|
129
130
|
session_revoke_all: z.looseObject({
|
|
130
131
|
// Omitted on `outcome='failure'` (no revocation attempted — e.g. target
|
|
@@ -132,38 +133,38 @@ export const audit_metadata_schemas = Object.freeze({
|
|
|
132
133
|
// `attempted_account_id` preserves the probed id (the `target_account_id`
|
|
133
134
|
// column is null in that case because it's a FK to `account`).
|
|
134
135
|
count: z.number().optional().meta({
|
|
135
|
-
description: 'Number of sessions revoked. Omitted on `outcome=failure` because no revocation was attempted.'
|
|
136
|
+
description: 'Number of sessions revoked. Omitted on `outcome=failure` because no revocation was attempted.'
|
|
136
137
|
}),
|
|
137
138
|
reason: z
|
|
138
139
|
.string()
|
|
139
140
|
.optional()
|
|
140
141
|
.meta({ description: 'Failure category. Set only on `outcome=failure`.' }),
|
|
141
142
|
attempted_account_id: Uuid.optional().meta({
|
|
142
|
-
description: 'Probed account id when the target lookup missed (FK constraint forces `target_account_id` to null).'
|
|
143
|
+
description: 'Probed account id when the target lookup missed (FK constraint forces `target_account_id` to null).'
|
|
143
144
|
}),
|
|
144
|
-
credential_type: credential_type_meta
|
|
145
|
+
credential_type: credential_type_meta
|
|
145
146
|
}),
|
|
146
147
|
token_create: z.looseObject({
|
|
147
148
|
token_id: ApiTokenId.meta({ description: 'Public id of the created API token (`tok_…`).' }),
|
|
148
149
|
name: z.string().meta({ description: 'Operator-supplied label for the token.' }),
|
|
149
|
-
credential_type: credential_type_meta
|
|
150
|
+
credential_type: credential_type_meta
|
|
150
151
|
}),
|
|
151
152
|
token_revoke: z.looseObject({
|
|
152
153
|
token_id: ApiTokenId.meta({ description: 'Public id of the revoked API token (`tok_…`).' }),
|
|
153
|
-
credential_type: credential_type_meta
|
|
154
|
+
credential_type: credential_type_meta
|
|
154
155
|
}),
|
|
155
156
|
token_revoke_all: z.looseObject({
|
|
156
157
|
// Same shape as `session_revoke_all` for failures.
|
|
157
158
|
count: z.number().optional().meta({
|
|
158
|
-
description: 'Number of tokens revoked. Omitted on `outcome=failure` because no revocation was attempted.'
|
|
159
|
+
description: 'Number of tokens revoked. Omitted on `outcome=failure` because no revocation was attempted.'
|
|
159
160
|
}),
|
|
160
161
|
reason: z
|
|
161
162
|
.string()
|
|
162
163
|
.optional()
|
|
163
164
|
.meta({ description: 'Failure category. Set only on `outcome=failure`.' }),
|
|
164
165
|
attempted_account_id: Uuid.optional().meta({
|
|
165
|
-
description: 'Probed account id when the target lookup missed (FK constraint forces `target_account_id` to null).'
|
|
166
|
-
})
|
|
166
|
+
description: 'Probed account id when the target lookup missed (FK constraint forces `target_account_id` to null).'
|
|
167
|
+
})
|
|
167
168
|
}),
|
|
168
169
|
// `role_grant_id` is optional on `role_grant_create` because failed grants
|
|
169
170
|
// (e.g. admin-grant-path denied) never produce a role_grant row.
|
|
@@ -174,43 +175,43 @@ export const audit_metadata_schemas = Object.freeze({
|
|
|
174
175
|
role_grant_create: z.looseObject({
|
|
175
176
|
role: z.string().meta({ description: 'Role being granted.' }),
|
|
176
177
|
role_grant_id: Uuid.optional().meta({
|
|
177
|
-
description: 'Id of the resulting role_grant row. Omitted when the grant failed (e.g. admin-grant-path denial).'
|
|
178
|
+
description: 'Id of the resulting role_grant row. Omitted when the grant failed (e.g. admin-grant-path denial).'
|
|
178
179
|
}),
|
|
179
180
|
scope_id: Uuid.nullish().meta({
|
|
180
|
-
description: 'Scope of the granted role_grant; null for global role_grants.'
|
|
181
|
+
description: 'Scope of the granted role_grant; null for global role_grants.'
|
|
181
182
|
}),
|
|
182
183
|
source_offer_id: Uuid.optional().meta({
|
|
183
|
-
description: 'Offer this grant resolved, when the grant originated from an accepted offer.'
|
|
184
|
+
description: 'Offer this grant resolved, when the grant originated from an accepted offer.'
|
|
184
185
|
}),
|
|
185
186
|
self_service: z.boolean().optional().meta({
|
|
186
|
-
description: 'True when the grant came from the self-service role toggle.'
|
|
187
|
-
})
|
|
187
|
+
description: 'True when the grant came from the self-service role toggle.'
|
|
188
|
+
})
|
|
188
189
|
}),
|
|
189
190
|
role_grant_revoke: z.looseObject({
|
|
190
191
|
role: z.string().meta({ description: 'Role being revoked.' }),
|
|
191
192
|
role_grant_id: Uuid.meta({ description: 'Id of the revoked role_grant row.' }),
|
|
192
193
|
scope_id: Uuid.nullish().meta({
|
|
193
|
-
description: 'Scope of the revoked role_grant; null for global role_grants.'
|
|
194
|
+
description: 'Scope of the revoked role_grant; null for global role_grants.'
|
|
194
195
|
}),
|
|
195
196
|
reason: z
|
|
196
197
|
.string()
|
|
197
198
|
.optional()
|
|
198
199
|
.meta({ description: 'Optional admin-supplied or self-service reason text.' }),
|
|
199
200
|
self_service: z.boolean().optional().meta({
|
|
200
|
-
description: 'True when the revoke came from the self-service role toggle.'
|
|
201
|
-
})
|
|
201
|
+
description: 'True when the revoke came from the self-service role toggle.'
|
|
202
|
+
})
|
|
202
203
|
}),
|
|
203
204
|
// `offer_id` is optional because failed creates (e.g. admin-grant-path
|
|
204
205
|
// denied, `authorize` callback denied) never produce an offer row.
|
|
205
206
|
role_grant_offer_create: z.looseObject({
|
|
206
207
|
offer_id: Uuid.optional().meta({
|
|
207
|
-
description: 'Id of the created offer row. Omitted when the create failed before insert.'
|
|
208
|
+
description: 'Id of the created offer row. Omitted when the create failed before insert.'
|
|
208
209
|
}),
|
|
209
210
|
role: z.string().meta({ description: 'Role being offered.' }),
|
|
210
211
|
scope_id: Uuid.nullish().meta({
|
|
211
|
-
description: 'Scope of the offered role; null for global offers.'
|
|
212
|
+
description: 'Scope of the offered role; null for global offers.'
|
|
212
213
|
}),
|
|
213
|
-
to_account_id: Uuid.meta({ description: 'Account the offer is directed to.' })
|
|
214
|
+
to_account_id: Uuid.meta({ description: 'Account the offer is directed to.' })
|
|
214
215
|
}),
|
|
215
216
|
// `role_grant_create` is emitted alongside on accept — two events per accept by
|
|
216
217
|
// design: offer-lifecycle audit + role-grant-lifecycle audit.
|
|
@@ -219,33 +220,33 @@ export const audit_metadata_schemas = Object.freeze({
|
|
|
219
220
|
role_grant_id: Uuid.meta({ description: 'Id of the resulting role_grant row.' }),
|
|
220
221
|
role: z.string().meta({ description: 'Role granted by the offer.' }),
|
|
221
222
|
scope_id: Uuid.nullish().meta({
|
|
222
|
-
description: 'Scope of the resulting role_grant; null for global role_grants.'
|
|
223
|
-
})
|
|
223
|
+
description: 'Scope of the resulting role_grant; null for global role_grants.'
|
|
224
|
+
})
|
|
224
225
|
}),
|
|
225
226
|
role_grant_offer_decline: z.looseObject({
|
|
226
227
|
offer_id: Uuid.meta({ description: 'Id of the declined offer.' }),
|
|
227
228
|
role: z.string().meta({ description: 'Role that was offered.' }),
|
|
228
229
|
scope_id: Uuid.nullish().meta({
|
|
229
|
-
description: 'Scope of the offered role; null for global offers.'
|
|
230
|
+
description: 'Scope of the offered role; null for global offers.'
|
|
230
231
|
}),
|
|
231
232
|
reason: z
|
|
232
233
|
.string()
|
|
233
234
|
.optional()
|
|
234
|
-
.meta({ description: 'Optional decline reason text from the recipient.' })
|
|
235
|
+
.meta({ description: 'Optional decline reason text from the recipient.' })
|
|
235
236
|
}),
|
|
236
237
|
role_grant_offer_retract: z.looseObject({
|
|
237
238
|
offer_id: Uuid.meta({ description: 'Id of the retracted offer.' }),
|
|
238
239
|
role: z.string().meta({ description: 'Role that was offered.' }),
|
|
239
240
|
scope_id: Uuid.nullish().meta({
|
|
240
|
-
description: 'Scope of the offered role; null for global offers.'
|
|
241
|
-
})
|
|
241
|
+
description: 'Scope of the offered role; null for global offers.'
|
|
242
|
+
})
|
|
242
243
|
}),
|
|
243
244
|
role_grant_offer_expire: z.looseObject({
|
|
244
245
|
offer_id: Uuid.meta({ description: 'Id of the expired offer.' }),
|
|
245
246
|
role: z.string().meta({ description: 'Role that was offered.' }),
|
|
246
247
|
scope_id: Uuid.nullish().meta({
|
|
247
|
-
description: 'Scope of the offered role; null for global offers.'
|
|
248
|
-
})
|
|
248
|
+
description: 'Scope of the offered role; null for global offers.'
|
|
249
|
+
})
|
|
249
250
|
}),
|
|
250
251
|
// Emitted when an offer is obsoleted by an external event. `reason`
|
|
251
252
|
// distinguishes the trigger; `cause_id` points to the accepted offer
|
|
@@ -255,22 +256,22 @@ export const audit_metadata_schemas = Object.freeze({
|
|
|
255
256
|
offer_id: Uuid.meta({ description: 'Id of the superseded offer.' }),
|
|
256
257
|
role: z.string().meta({ description: 'Role that was offered.' }),
|
|
257
258
|
scope_id: Uuid.nullish().meta({
|
|
258
|
-
description: 'Scope of the offered role; null for global offers.'
|
|
259
|
+
description: 'Scope of the offered role; null for global offers.'
|
|
259
260
|
}),
|
|
260
261
|
reason: z.enum(['sibling_accepted', 'role_grant_revoked', 'scope_destroyed']).meta({
|
|
261
|
-
description: 'Trigger that obsoleted the offer: a sibling offer was accepted, the resulting role_grant was revoked, or the parent scope row was destroyed.'
|
|
262
|
+
description: 'Trigger that obsoleted the offer: a sibling offer was accepted, the resulting role_grant was revoked, or the parent scope row was destroyed.'
|
|
262
263
|
}),
|
|
263
264
|
cause_id: Uuid.meta({
|
|
264
|
-
description: 'Row that caused the supersede: accepted offer (`sibling_accepted`), revoked role_grant (`role_grant_revoked`), or destroyed parent scope row (`scope_destroyed`).'
|
|
265
|
-
})
|
|
265
|
+
description: 'Row that caused the supersede: accepted offer (`sibling_accepted`), revoked role_grant (`role_grant_revoked`), or destroyed parent scope row (`scope_destroyed`).'
|
|
266
|
+
})
|
|
266
267
|
}),
|
|
267
268
|
invite_create: z.looseObject({
|
|
268
269
|
invite_id: Uuid.meta({ description: 'Id of the created invite.' }),
|
|
269
270
|
email: z.string().nullable().meta({ description: 'Invited email address; null when not set.' }),
|
|
270
|
-
username: z.string().nullable().meta({ description: 'Invited username; null when not set.' })
|
|
271
|
+
username: z.string().nullable().meta({ description: 'Invited username; null when not set.' })
|
|
271
272
|
}),
|
|
272
273
|
invite_delete: z.looseObject({
|
|
273
|
-
invite_id: Uuid.meta({ description: 'Id of the deleted invite.' })
|
|
274
|
+
invite_id: Uuid.meta({ description: 'Id of the deleted invite.' })
|
|
274
275
|
}),
|
|
275
276
|
// Account/actor deletion snapshots identity into metadata so the
|
|
276
277
|
// identity behind a now-orphaned audit id survives a purge (the
|
|
@@ -292,8 +293,8 @@ export const audit_metadata_schemas = Object.freeze({
|
|
|
292
293
|
.optional()
|
|
293
294
|
.meta({ description: 'Failure category. Set only on `outcome=failure`.' }),
|
|
294
295
|
attempted_account_id: Uuid.optional().meta({
|
|
295
|
-
description: 'Probed account id when the target was missing (`outcome=failure`).'
|
|
296
|
-
})
|
|
296
|
+
description: 'Probed account id when the target was missing (`outcome=failure`).'
|
|
297
|
+
})
|
|
297
298
|
}),
|
|
298
299
|
account_purge: z.looseObject({
|
|
299
300
|
username: z.string().optional().meta({ description: 'Username at purge time.' }),
|
|
@@ -307,8 +308,8 @@ export const audit_metadata_schemas = Object.freeze({
|
|
|
307
308
|
.optional()
|
|
308
309
|
.meta({ description: 'Failure category. Set only on `outcome=failure`.' }),
|
|
309
310
|
attempted_account_id: Uuid.optional().meta({
|
|
310
|
-
description: 'Probed account id when the target was missing (`outcome=failure`).'
|
|
311
|
-
})
|
|
311
|
+
description: 'Probed account id when the target was missing (`outcome=failure`).'
|
|
312
|
+
})
|
|
312
313
|
}),
|
|
313
314
|
// `account_undelete` / `actor_undelete` are the reactivation events
|
|
314
315
|
// (clearing the soft-delete tombstone). Same identity-snapshot shape as
|
|
@@ -327,23 +328,23 @@ export const audit_metadata_schemas = Object.freeze({
|
|
|
327
328
|
.optional()
|
|
328
329
|
.meta({ description: 'Failure category. Set only on `outcome=failure`.' }),
|
|
329
330
|
attempted_account_id: Uuid.optional().meta({
|
|
330
|
-
description: 'Probed account id when the target was missing/not-deleted (`outcome=failure`).'
|
|
331
|
-
})
|
|
331
|
+
description: 'Probed account id when the target was missing/not-deleted (`outcome=failure`).'
|
|
332
|
+
})
|
|
332
333
|
}),
|
|
333
334
|
actor_delete: z.looseObject({
|
|
334
|
-
name: z.string().optional().meta({ description: 'Actor display name at soft-delete time.' })
|
|
335
|
+
name: z.string().optional().meta({ description: 'Actor display name at soft-delete time.' })
|
|
335
336
|
}),
|
|
336
337
|
actor_purge: z.looseObject({
|
|
337
|
-
name: z.string().optional().meta({ description: 'Actor display name at purge time.' })
|
|
338
|
+
name: z.string().optional().meta({ description: 'Actor display name at purge time.' })
|
|
338
339
|
}),
|
|
339
340
|
actor_undelete: z.looseObject({
|
|
340
|
-
name: z.string().optional().meta({ description: 'Actor display name at reactivation time.' })
|
|
341
|
+
name: z.string().optional().meta({ description: 'Actor display name at reactivation time.' })
|
|
341
342
|
}),
|
|
342
343
|
app_settings_update: z.looseObject({
|
|
343
344
|
setting: z.string().meta({ description: 'Name of the setting that changed.' }),
|
|
344
345
|
old_value: z.unknown().meta({ description: 'Setting value before the update.' }),
|
|
345
|
-
new_value: z.unknown().meta({ description: 'Setting value after the update.' })
|
|
346
|
-
})
|
|
346
|
+
new_value: z.unknown().meta({ description: 'Setting value after the update.' })
|
|
347
|
+
})
|
|
347
348
|
});
|
|
348
349
|
/**
|
|
349
350
|
* Narrow metadata type for a known event type.
|
|
@@ -356,7 +357,7 @@ export const get_audit_metadata = (event) => {
|
|
|
356
357
|
/** Builtin fuz_app audit-log config — every existing event type and its metadata schema. */
|
|
357
358
|
export const builtin_audit_log_config = Object.freeze({
|
|
358
359
|
event_types: AUDIT_EVENT_TYPES,
|
|
359
|
-
metadata_schemas: audit_metadata_schemas
|
|
360
|
+
metadata_schemas: audit_metadata_schemas
|
|
360
361
|
});
|
|
361
362
|
/**
|
|
362
363
|
* Build an `AuditLogConfig` by merging fuz_app builtins with consumer extras.
|
|
@@ -396,7 +397,7 @@ export const create_audit_log_config = (options) => {
|
|
|
396
397
|
}
|
|
397
398
|
return Object.freeze({
|
|
398
399
|
event_types: Object.freeze([...AUDIT_EVENT_TYPES, ...extra_keys]),
|
|
399
|
-
metadata_schemas: Object.freeze(metadata_schemas)
|
|
400
|
+
metadata_schemas: Object.freeze(metadata_schemas)
|
|
400
401
|
});
|
|
401
402
|
};
|
|
402
403
|
/** Default page size for audit log listings. */
|
|
@@ -422,19 +423,19 @@ export const AuditLogEventJson = z.strictObject({
|
|
|
422
423
|
target_actor_id: Uuid.nullable(),
|
|
423
424
|
ip: z.string().nullable(),
|
|
424
425
|
created_at: z.string(),
|
|
425
|
-
metadata: z.record(z.string(), z.unknown()).nullable()
|
|
426
|
+
metadata: z.record(z.string(), z.unknown()).nullable()
|
|
426
427
|
});
|
|
427
428
|
/** Zod schema for audit log events with resolved usernames. */
|
|
428
429
|
export const AuditLogEventWithUsernamesJson = AuditLogEventJson.extend({
|
|
429
430
|
username: z.string().nullable(),
|
|
430
|
-
target_username: z.string().nullable()
|
|
431
|
+
target_username: z.string().nullable()
|
|
431
432
|
});
|
|
432
433
|
/** Zod schema for role_grant history events with resolved usernames. */
|
|
433
434
|
export const RoleGrantHistoryEventJson = AuditLogEventJson.extend({
|
|
434
435
|
username: z.string().nullable(),
|
|
435
|
-
target_username: z.string().nullable()
|
|
436
|
+
target_username: z.string().nullable()
|
|
436
437
|
});
|
|
437
438
|
/** Zod schema for admin session listing (session + username). */
|
|
438
439
|
export const AdminSessionJson = AuthSessionJson.extend({
|
|
439
|
-
username: z.string()
|
|
440
|
+
username: z.string()
|
|
440
441
|
});
|
package/dist/auth/auth_ddl.js
CHANGED
|
@@ -62,7 +62,7 @@ CREATE TABLE IF NOT EXISTS role_grant (
|
|
|
62
62
|
export const ROLE_GRANT_INDEXES = [
|
|
63
63
|
`CREATE INDEX IF NOT EXISTS idx_role_grant_actor ON role_grant(actor_id)`,
|
|
64
64
|
`CREATE UNIQUE INDEX IF NOT EXISTS role_grant_actor_role_active_unique
|
|
65
|
-
ON role_grant (actor_id, role) WHERE revoked_at IS NULL
|
|
65
|
+
ON role_grant (actor_id, role) WHERE revoked_at IS NULL`
|
|
66
66
|
];
|
|
67
67
|
export const AUTH_SESSION_SCHEMA = `
|
|
68
68
|
CREATE TABLE IF NOT EXISTS auth_session (
|
|
@@ -74,7 +74,7 @@ CREATE TABLE IF NOT EXISTS auth_session (
|
|
|
74
74
|
)`;
|
|
75
75
|
export const AUTH_SESSION_INDEXES = [
|
|
76
76
|
`CREATE INDEX IF NOT EXISTS idx_auth_session_account ON auth_session(account_id)`,
|
|
77
|
-
`CREATE INDEX IF NOT EXISTS idx_auth_session_expires ON auth_session(expires_at)
|
|
77
|
+
`CREATE INDEX IF NOT EXISTS idx_auth_session_expires ON auth_session(expires_at)`
|
|
78
78
|
];
|
|
79
79
|
export const API_TOKEN_SCHEMA = `
|
|
80
80
|
CREATE TABLE IF NOT EXISTS api_token (
|
|
@@ -117,7 +117,7 @@ CREATE TABLE IF NOT EXISTS invite (
|
|
|
117
117
|
export const INVITE_INDEXES = [
|
|
118
118
|
`CREATE UNIQUE INDEX IF NOT EXISTS idx_invite_email_unclaimed ON invite (LOWER(email)) WHERE email IS NOT NULL AND claimed_at IS NULL`,
|
|
119
119
|
`CREATE UNIQUE INDEX IF NOT EXISTS idx_invite_username_unclaimed ON invite (LOWER(username)) WHERE username IS NOT NULL AND claimed_at IS NULL`,
|
|
120
|
-
`CREATE INDEX IF NOT EXISTS idx_invite_claimed ON invite (claimed_at)
|
|
120
|
+
`CREATE INDEX IF NOT EXISTS idx_invite_claimed ON invite (claimed_at)`
|
|
121
121
|
];
|
|
122
122
|
export const APP_SETTINGS_SCHEMA = `
|
|
123
123
|
CREATE TABLE IF NOT EXISTS app_settings (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_guard_resolver.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/auth_guard_resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"auth_guard_resolver.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/auth_guard_resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,EAAE,iBAerC,CAAC"}
|