@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
|
@@ -23,7 +23,7 @@ import { z } from 'zod';
|
|
|
23
23
|
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
24
24
|
import { ERROR_ROLE_GRANT_NOT_FOUND, ERROR_ROLE_NOT_WEB_GRANTABLE } from '../http/error_schemas.js';
|
|
25
25
|
import { RoleName } from './role_schema.js';
|
|
26
|
-
import { ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX, RoleGrantOfferJson
|
|
26
|
+
import { ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX, RoleGrantOfferJson } from './role_grant_offer_schema.js';
|
|
27
27
|
import { ROLE_GRANT_REVOKED_REASON_LENGTH_MAX } from './account_schema.js';
|
|
28
28
|
import { ActingActor } from '../http/auth_shape.js';
|
|
29
29
|
/** Error reason — caller tried to offer themselves a role_grant. */
|
|
@@ -57,26 +57,26 @@ export const ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH = 'role_grant_offer_a
|
|
|
57
57
|
export const RoleGrantOfferCreateInput = z.strictObject({
|
|
58
58
|
to_account_id: Uuid.meta({ description: 'Account id of the recipient.' }),
|
|
59
59
|
to_actor_id: Uuid.nullish().meta({
|
|
60
|
-
description: 'Optional actor-grain target on the recipient account. When set, only this actor may accept and the audit envelope carries it on offer-shape events. Must belong to `to_account_id`.'
|
|
60
|
+
description: 'Optional actor-grain target on the recipient account. When set, only this actor may accept and the audit envelope carries it on offer-shape events. Must belong to `to_account_id`.'
|
|
61
61
|
}),
|
|
62
62
|
role: RoleName.meta({ description: 'Role being offered.' }),
|
|
63
63
|
scope_kind: z.string().nullish().meta({
|
|
64
|
-
description: 'Machine-readable kind tag for `scope_id` — paired-null with `scope_id` (both null for global, both non-null for scoped). Required iff `scope_id` is set.'
|
|
64
|
+
description: 'Machine-readable kind tag for `scope_id` — paired-null with `scope_id` (both null for global, both non-null for scoped). Required iff `scope_id` is set.'
|
|
65
65
|
}),
|
|
66
66
|
scope_id: Uuid.nullish().meta({
|
|
67
|
-
description: 'Scope id for resource-scoped grants (e.g. classroom id). `null` for global.'
|
|
67
|
+
description: 'Scope id for resource-scoped grants (e.g. classroom id). `null` for global.'
|
|
68
68
|
}),
|
|
69
69
|
message: z
|
|
70
70
|
.string()
|
|
71
71
|
.max(ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX)
|
|
72
72
|
.nullish()
|
|
73
73
|
.meta({ description: 'Optional free-form note from the grantor.' }),
|
|
74
|
-
acting: ActingActor
|
|
74
|
+
acting: ActingActor
|
|
75
75
|
});
|
|
76
76
|
/** Input for `role_grant_offer_accept`. */
|
|
77
77
|
export const RoleGrantOfferAcceptInput = z.strictObject({
|
|
78
78
|
offer_id: Uuid.meta({ description: 'The offer to accept.' }),
|
|
79
|
-
acting: ActingActor
|
|
79
|
+
acting: ActingActor
|
|
80
80
|
});
|
|
81
81
|
/** Input for `role_grant_offer_decline`. */
|
|
82
82
|
export const RoleGrantOfferDeclineInput = z.strictObject({
|
|
@@ -86,20 +86,20 @@ export const RoleGrantOfferDeclineInput = z.strictObject({
|
|
|
86
86
|
.max(ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX)
|
|
87
87
|
.nullish()
|
|
88
88
|
.meta({ description: 'Optional free-form reason given on decline.' }),
|
|
89
|
-
acting: ActingActor
|
|
89
|
+
acting: ActingActor
|
|
90
90
|
});
|
|
91
91
|
/** Input for `role_grant_offer_retract`. */
|
|
92
92
|
export const RoleGrantOfferRetractInput = z.strictObject({
|
|
93
93
|
offer_id: Uuid.meta({ description: 'The offer to retract.' }),
|
|
94
|
-
acting: ActingActor
|
|
94
|
+
acting: ActingActor
|
|
95
95
|
});
|
|
96
96
|
/** Input for `role_grant_offer_list`. `account_id` is admin-only (inspect another account's inbox). */
|
|
97
97
|
export const RoleGrantOfferListInput = z
|
|
98
98
|
.strictObject({
|
|
99
99
|
account_id: Uuid.nullish().meta({
|
|
100
|
-
description: 'Admin-only — list offers for another account. Defaults to the caller.'
|
|
100
|
+
description: 'Admin-only — list offers for another account. Defaults to the caller.'
|
|
101
101
|
}),
|
|
102
|
-
acting: ActingActor
|
|
102
|
+
acting: ActingActor
|
|
103
103
|
})
|
|
104
104
|
.default({});
|
|
105
105
|
/**
|
|
@@ -113,9 +113,9 @@ export const RoleGrantRevokeInput = z.strictObject({
|
|
|
113
113
|
actor_id: Uuid.meta({ description: 'Actor whose role_grant to revoke.' }),
|
|
114
114
|
role_grant_id: Uuid.meta({ description: 'The role_grant to revoke.' }),
|
|
115
115
|
reason: z.string().max(ROLE_GRANT_REVOKED_REASON_LENGTH_MAX).nullish().meta({
|
|
116
|
-
description: 'Optional free-form reason; stamped on `role_grant.revoked_reason` and surfaced on the revokee WS notification.'
|
|
116
|
+
description: 'Optional free-form reason; stamped on `role_grant.revoked_reason` and surfaced on the revokee WS notification.'
|
|
117
117
|
}),
|
|
118
|
-
acting: ActingActor
|
|
118
|
+
acting: ActingActor
|
|
119
119
|
});
|
|
120
120
|
/**
|
|
121
121
|
* Input for `role_grant_offer_history`. Returns every offer involving the account
|
|
@@ -125,26 +125,26 @@ export const RoleGrantRevokeInput = z.strictObject({
|
|
|
125
125
|
export const RoleGrantOfferHistoryInput = z
|
|
126
126
|
.strictObject({
|
|
127
127
|
account_id: Uuid.nullish().meta({
|
|
128
|
-
description: 'Admin-only — history for another account. Defaults to the caller.'
|
|
128
|
+
description: 'Admin-only — history for another account. Defaults to the caller.'
|
|
129
129
|
}),
|
|
130
130
|
limit: z.number().int().min(1).max(500).nullish().meta({
|
|
131
|
-
description: 'Max rows to return (default 100).'
|
|
131
|
+
description: 'Max rows to return (default 100).'
|
|
132
132
|
}),
|
|
133
133
|
offset: z.number().int().min(0).nullish().meta({
|
|
134
|
-
description: 'Pagination offset (default 0).'
|
|
134
|
+
description: 'Pagination offset (default 0).'
|
|
135
135
|
}),
|
|
136
|
-
acting: ActingActor
|
|
136
|
+
acting: ActingActor
|
|
137
137
|
})
|
|
138
138
|
.default({});
|
|
139
139
|
/** Output for `role_grant_offer_create`. */
|
|
140
140
|
export const RoleGrantOfferCreateOutput = z.strictObject({
|
|
141
|
-
offer: RoleGrantOfferJson
|
|
141
|
+
offer: RoleGrantOfferJson
|
|
142
142
|
});
|
|
143
143
|
/** Output for `role_grant_offer_accept`. */
|
|
144
144
|
export const RoleGrantOfferAcceptOutput = z.strictObject({
|
|
145
145
|
role_grant_id: Uuid,
|
|
146
146
|
offer: RoleGrantOfferJson,
|
|
147
|
-
superseded_offer_ids: z.array(Uuid)
|
|
147
|
+
superseded_offer_ids: z.array(Uuid)
|
|
148
148
|
});
|
|
149
149
|
/** Output for `role_grant_offer_decline` / `role_grant_offer_retract`. */
|
|
150
150
|
export const RoleGrantOfferOkOutput = z.strictObject({ ok: z.literal(true) });
|
|
@@ -155,7 +155,7 @@ export const RoleGrantOfferHistoryOutput = z.strictObject({ offers: z.array(Role
|
|
|
155
155
|
/** Output for `role_grant_revoke`. */
|
|
156
156
|
export const RoleGrantRevokeOutput = z.strictObject({
|
|
157
157
|
ok: z.literal(true),
|
|
158
|
-
revoked: z.literal(true)
|
|
158
|
+
revoked: z.literal(true)
|
|
159
159
|
});
|
|
160
160
|
/**
|
|
161
161
|
* Input for `role_grant_assign` — the immediate admin-only conferral path, the
|
|
@@ -167,20 +167,20 @@ export const RoleGrantRevokeOutput = z.strictObject({
|
|
|
167
167
|
export const RoleGrantAssignInput = z.strictObject({
|
|
168
168
|
to_account_id: Uuid.meta({ description: 'Account id of the grantee.' }),
|
|
169
169
|
to_actor_id: Uuid.nullish().meta({
|
|
170
|
-
description: "Optional actor-grain target on the grantee account. When set, must belong to `to_account_id`. Omit to resolve the account's sole active actor — a multi-actor account must name one."
|
|
170
|
+
description: "Optional actor-grain target on the grantee account. When set, must belong to `to_account_id`. Omit to resolve the account's sole active actor — a multi-actor account must name one."
|
|
171
171
|
}),
|
|
172
172
|
role: RoleName.meta({
|
|
173
|
-
description: "Role to assign. Must be admin-grantable (its `grant_paths` includes `'admin'`)."
|
|
173
|
+
description: "Role to assign. Must be admin-grantable (its `grant_paths` includes `'admin'`)."
|
|
174
174
|
}),
|
|
175
175
|
scope_id: Uuid.nullish().meta({
|
|
176
|
-
description: 'Scope id for resource-scoped grants. `null` for a global role_grant.'
|
|
176
|
+
description: 'Scope id for resource-scoped grants. `null` for a global role_grant.'
|
|
177
177
|
}),
|
|
178
|
-
acting: ActingActor
|
|
178
|
+
acting: ActingActor
|
|
179
179
|
});
|
|
180
180
|
/** Output for `role_grant_assign`. */
|
|
181
181
|
export const RoleGrantAssignOutput = z.strictObject({
|
|
182
182
|
ok: z.literal(true),
|
|
183
|
-
role_grant_id: Uuid
|
|
183
|
+
role_grant_id: Uuid
|
|
184
184
|
});
|
|
185
185
|
// -- Action specs -----------------------------------------------------------
|
|
186
186
|
/**
|
|
@@ -207,15 +207,26 @@ export const role_grant_offer_create_action_spec = {
|
|
|
207
207
|
ERROR_ROLE_GRANT_OFFER_SELF_TARGET,
|
|
208
208
|
ERROR_ROLE_GRANT_OFFER_ROLE_NOT_GRANTABLE,
|
|
209
209
|
ERROR_ROLE_GRANT_OFFER_NOT_AUTHORIZED,
|
|
210
|
-
ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH
|
|
210
|
+
ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH
|
|
211
211
|
],
|
|
212
|
-
rate_limit: 'account'
|
|
212
|
+
rate_limit: 'account'
|
|
213
213
|
};
|
|
214
|
+
/**
|
|
215
|
+
* `credential_types: ['session']` — see `docs/security.md` §Credential-channel
|
|
216
|
+
* gating. The only offer verb that moves the *caller's own* authority:
|
|
217
|
+
* accepting a pending admin offer over a leaked API token is a privilege pivot
|
|
218
|
+
* in the same family the credential-lifecycle mutations are gated to prevent
|
|
219
|
+
* (the token is account-wide and non-expiring, and the resulting role_grant
|
|
220
|
+
* outlives revoking it). Consent inherently belongs to a human at a browser,
|
|
221
|
+
* and no automation accepts an offer on its own behalf. The sibling verbs stay
|
|
222
|
+
* ungated deliberately — `_create` is the offering side, and `_decline` /
|
|
223
|
+
* `_retract` destroy a pending offer and confer nothing.
|
|
224
|
+
*/
|
|
214
225
|
export const role_grant_offer_accept_action_spec = {
|
|
215
226
|
method: 'role_grant_offer_accept',
|
|
216
227
|
kind: 'request_response',
|
|
217
228
|
initiator: 'frontend',
|
|
218
|
-
auth: { account: 'required', actor: 'required' },
|
|
229
|
+
auth: { account: 'required', actor: 'required', credential_types: ['session'] },
|
|
219
230
|
side_effects: true,
|
|
220
231
|
input: RoleGrantOfferAcceptInput,
|
|
221
232
|
output: RoleGrantOfferAcceptOutput,
|
|
@@ -225,8 +236,8 @@ export const role_grant_offer_accept_action_spec = {
|
|
|
225
236
|
ERROR_ROLE_GRANT_OFFER_NOT_FOUND,
|
|
226
237
|
ERROR_ROLE_GRANT_OFFER_TERMINAL,
|
|
227
238
|
ERROR_ROLE_GRANT_OFFER_EXPIRED,
|
|
228
|
-
ERROR_ROLE_GRANT_OFFER_ACTOR_MISMATCH
|
|
229
|
-
]
|
|
239
|
+
ERROR_ROLE_GRANT_OFFER_ACTOR_MISMATCH
|
|
240
|
+
]
|
|
230
241
|
};
|
|
231
242
|
export const role_grant_offer_decline_action_spec = {
|
|
232
243
|
method: 'role_grant_offer_decline',
|
|
@@ -238,7 +249,7 @@ export const role_grant_offer_decline_action_spec = {
|
|
|
238
249
|
output: RoleGrantOfferOkOutput,
|
|
239
250
|
async: true,
|
|
240
251
|
description: 'Decline an offer. Recipient-only.',
|
|
241
|
-
error_reasons: [ERROR_ROLE_GRANT_OFFER_NOT_FOUND, ERROR_ROLE_GRANT_OFFER_TERMINAL]
|
|
252
|
+
error_reasons: [ERROR_ROLE_GRANT_OFFER_NOT_FOUND, ERROR_ROLE_GRANT_OFFER_TERMINAL]
|
|
242
253
|
};
|
|
243
254
|
export const role_grant_offer_retract_action_spec = {
|
|
244
255
|
method: 'role_grant_offer_retract',
|
|
@@ -250,7 +261,7 @@ export const role_grant_offer_retract_action_spec = {
|
|
|
250
261
|
output: RoleGrantOfferOkOutput,
|
|
251
262
|
async: true,
|
|
252
263
|
description: 'Retract an offer. Grantor-only, pre-decision.',
|
|
253
|
-
error_reasons: [ERROR_ROLE_GRANT_OFFER_NOT_FOUND, ERROR_ROLE_GRANT_OFFER_TERMINAL]
|
|
264
|
+
error_reasons: [ERROR_ROLE_GRANT_OFFER_NOT_FOUND, ERROR_ROLE_GRANT_OFFER_TERMINAL]
|
|
254
265
|
};
|
|
255
266
|
export const role_grant_offer_list_action_spec = {
|
|
256
267
|
method: 'role_grant_offer_list',
|
|
@@ -261,7 +272,7 @@ export const role_grant_offer_list_action_spec = {
|
|
|
261
272
|
input: RoleGrantOfferListInput,
|
|
262
273
|
output: RoleGrantOfferListOutput,
|
|
263
274
|
async: true,
|
|
264
|
-
description: 'List pending, non-expired offers for the caller. Admins may pass `account_id` to inspect another account.'
|
|
275
|
+
description: 'List pending, non-expired offers for the caller. Admins may pass `account_id` to inspect another account.'
|
|
265
276
|
};
|
|
266
277
|
export const role_grant_offer_history_action_spec = {
|
|
267
278
|
method: 'role_grant_offer_history',
|
|
@@ -272,7 +283,7 @@ export const role_grant_offer_history_action_spec = {
|
|
|
272
283
|
input: RoleGrantOfferHistoryInput,
|
|
273
284
|
output: RoleGrantOfferHistoryOutput,
|
|
274
285
|
async: true,
|
|
275
|
-
description: 'List every offer involving the caller (either direction), including terminal rows, newest first. Admins may pass `account_id` to inspect another account.'
|
|
286
|
+
description: 'List every offer involving the caller (either direction), including terminal rows, newest first. Admins may pass `account_id` to inspect another account.'
|
|
276
287
|
};
|
|
277
288
|
/**
|
|
278
289
|
* `rate_limit: 'account'` bounds admin-side burn of `role_grant_revoke` —
|
|
@@ -291,7 +302,7 @@ export const role_grant_revoke_action_spec = {
|
|
|
291
302
|
async: true,
|
|
292
303
|
description: 'Revoke an active role_grant on a target actor. Admin-only. Supersedes any pending offers for the same (account, role, scope). Fires role_grant_revoke + role_grant_offer_supersede notifications.',
|
|
293
304
|
error_reasons: [ERROR_ROLE_GRANT_NOT_FOUND, ERROR_ROLE_NOT_WEB_GRANTABLE],
|
|
294
|
-
rate_limit: 'account'
|
|
305
|
+
rate_limit: 'account'
|
|
295
306
|
};
|
|
296
307
|
/**
|
|
297
308
|
* `rate_limit: 'account'` bounds admin-side burn of `role_grant_assign` — the
|
|
@@ -309,7 +320,7 @@ export const role_grant_assign_action_spec = {
|
|
|
309
320
|
async: true,
|
|
310
321
|
description: "Immediately assign a role_grant to a target account — admin-only, no consent step (the capability-unlock UX). The role's `grant_paths` must include `'admin'`. Idempotent: re-assigning an active grant returns it. Emits a role_grant_create audit event.",
|
|
311
322
|
error_reasons: [ERROR_ROLE_NOT_WEB_GRANTABLE, ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH],
|
|
312
|
-
rate_limit: 'account'
|
|
323
|
+
rate_limit: 'account'
|
|
313
324
|
};
|
|
314
325
|
/**
|
|
315
326
|
* All role-grant-offer action specs — a codegen-ready registry. Consumers spread
|
|
@@ -324,5 +335,5 @@ export const all_role_grant_offer_action_specs = [
|
|
|
324
335
|
role_grant_offer_list_action_spec,
|
|
325
336
|
role_grant_offer_history_action_spec,
|
|
326
337
|
role_grant_revoke_action_spec,
|
|
327
|
-
role_grant_assign_action_spec
|
|
338
|
+
role_grant_assign_action_spec
|
|
328
339
|
];
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
*
|
|
43
43
|
* @module
|
|
44
44
|
*/
|
|
45
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
45
46
|
import { type ActionContext, type RpcAction } from '../actions/action_rpc.js';
|
|
46
47
|
import { type RoleSchemaResult } from './role_schema.js';
|
|
47
48
|
import { type RequestContext } from './request_context.js';
|
|
48
|
-
import type {
|
|
49
|
+
import type { ActionFactoryDeps } from './deps.js';
|
|
49
50
|
import { type NotificationSender } from './role_grant_offer_notifications.js';
|
|
50
51
|
/**
|
|
51
52
|
* Authorization callback for `role_grant_offer_create`. Returns `true` to allow,
|
|
@@ -60,7 +61,9 @@ export type RoleGrantOfferCreateAuthorize = (auth: RequestContext, input: {
|
|
|
60
61
|
to_account_id: string;
|
|
61
62
|
role: string;
|
|
62
63
|
scope_id: string | null;
|
|
63
|
-
}, deps:
|
|
64
|
+
}, deps: {
|
|
65
|
+
log: Logger;
|
|
66
|
+
}, ctx: ActionContext) => boolean | Promise<boolean>;
|
|
64
67
|
/** Options for `create_role_grant_offer_actions`. */
|
|
65
68
|
export interface RoleGrantOfferActionOptions {
|
|
66
69
|
/**
|
|
@@ -84,11 +87,11 @@ export interface RoleGrantOfferActionOptions {
|
|
|
84
87
|
* Create the eight role-grant-offer RPC actions (six offer-lifecycle methods
|
|
85
88
|
* plus `role_grant_revoke` and the immediate `role_grant_assign`).
|
|
86
89
|
*
|
|
87
|
-
* @param deps - `
|
|
90
|
+
* @param deps - `ActionFactoryDeps` (`log`, `audit`) plus optional `notification_sender` for WS fan-out — when absent, WS fan-out is silently skipped (DB-only side effects still happen). Consumers wiring `BackendWebsocketTransport` assign its instance directly (the transport's `send_to_account` signature accepts the broader `JsonrpcMessageFromServerToClient`, which is contravariantly compatible)
|
|
88
91
|
* @param options - role schema, default TTL, authorization override
|
|
89
92
|
* @returns the `RpcAction` array to spread into a `create_rpc_endpoint` call
|
|
90
93
|
*/
|
|
91
|
-
export declare const create_role_grant_offer_actions: (deps:
|
|
94
|
+
export declare const create_role_grant_offer_actions: (deps: ActionFactoryDeps & {
|
|
92
95
|
notification_sender?: NotificationSender | null;
|
|
93
96
|
}, options?: RoleGrantOfferActionOptions) => Array<RpcAction>;
|
|
94
97
|
//# sourceMappingURL=role_grant_offer_actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role_grant_offer_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;
|
|
1
|
+
{"version":3,"file":"role_grant_offer_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAIN,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AA2B1B,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAON,KAAK,kBAAkB,EACvB,MAAM,qCAAqC,CAAC;AAoC7C;;;;;;;;GAQG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC3C,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACvE,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EACrB,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC3C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,6BAA6B,CAAC;CAC1C;AAgCD;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC3C,MAAM,iBAAiB,GAAG;IACzB,mBAAmB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAChD,EACD,UAAS,2BAAgC,KACvC,KAAK,CAAC,SAAS,CAkiBjB,CAAC"}
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
*
|
|
43
43
|
* @module
|
|
44
44
|
*/
|
|
45
|
-
import { rpc_action
|
|
45
|
+
import { rpc_action } from '../actions/action_rpc.js';
|
|
46
46
|
import { jsonrpc_errors } from '../http/jsonrpc_errors.js';
|
|
47
47
|
import { emit_after_commit } from '../http/pending_effects.js';
|
|
48
|
-
import { builtin_role_specs_by_name, ROLE_ADMIN, role_has_grant_path
|
|
48
|
+
import { builtin_role_specs_by_name, ROLE_ADMIN, role_has_grant_path } from './role_schema.js';
|
|
49
49
|
import { GRANT_PATH_ADMIN } from './grant_path_schema.js';
|
|
50
|
-
import { ROLE_GRANT_OFFER_DEFAULT_TTL_MS, to_role_grant_offer_json
|
|
51
|
-
import { query_role_grant_offer_create, query_role_grant_offer_decline, query_role_grant_offer_retract, query_role_grant_offer_list, query_role_grant_offer_history_for_account, query_accept_offer, RoleGrantOfferActorAccountMismatchError, RoleGrantOfferActorMismatchError, RoleGrantOfferAlreadyTerminalError, RoleGrantOfferExpiredError, RoleGrantOfferNotFoundError, RoleGrantOfferSelfTargetError
|
|
52
|
-
import { query_create_role_grant, query_role_grant_find_active_role_for_actor, query_revoke_role_grant
|
|
50
|
+
import { ROLE_GRANT_OFFER_DEFAULT_TTL_MS, to_role_grant_offer_json } from './role_grant_offer_schema.js';
|
|
51
|
+
import { query_role_grant_offer_create, query_role_grant_offer_decline, query_role_grant_offer_retract, query_role_grant_offer_list, query_role_grant_offer_history_for_account, query_accept_offer, RoleGrantOfferActorAccountMismatchError, RoleGrantOfferActorMismatchError, RoleGrantOfferAlreadyTerminalError, RoleGrantOfferExpiredError, RoleGrantOfferNotFoundError, RoleGrantOfferSelfTargetError } from './role_grant_offer_queries.js';
|
|
52
|
+
import { query_create_role_grant, query_role_grant_find_active_role_for_actor, query_revoke_role_grant } from './role_grant_queries.js';
|
|
53
53
|
import { query_actor_by_id, query_active_actors_by_account } from './account_queries.js';
|
|
54
54
|
import { has_scoped_role } from './request_context.js';
|
|
55
|
-
import { build_role_grant_offer_accepted_notification, build_role_grant_offer_declined_notification, build_role_grant_offer_received_notification, build_role_grant_offer_retracted_notification, build_role_grant_offer_supersede_notification, build_role_grant_revoke_notification
|
|
55
|
+
import { build_role_grant_offer_accepted_notification, build_role_grant_offer_declined_notification, build_role_grant_offer_received_notification, build_role_grant_offer_retracted_notification, build_role_grant_offer_supersede_notification, build_role_grant_revoke_notification } from './role_grant_offer_notifications.js';
|
|
56
56
|
import { ERROR_ROLE_GRANT_NOT_FOUND, ERROR_ROLE_NOT_WEB_GRANTABLE } from '../http/error_schemas.js';
|
|
57
|
-
import { ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH, ERROR_ROLE_GRANT_OFFER_ACTOR_MISMATCH, ERROR_ROLE_GRANT_OFFER_EXPIRED, ERROR_ROLE_GRANT_OFFER_NOT_AUTHORIZED, ERROR_ROLE_GRANT_OFFER_NOT_FOUND, ERROR_ROLE_GRANT_OFFER_ROLE_NOT_GRANTABLE, ERROR_ROLE_GRANT_OFFER_SELF_TARGET, ERROR_ROLE_GRANT_OFFER_TERMINAL, role_grant_offer_create_action_spec, role_grant_offer_accept_action_spec, role_grant_offer_decline_action_spec, role_grant_offer_retract_action_spec, role_grant_offer_list_action_spec, role_grant_offer_history_action_spec, role_grant_revoke_action_spec, role_grant_assign_action_spec
|
|
57
|
+
import { ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH, ERROR_ROLE_GRANT_OFFER_ACTOR_MISMATCH, ERROR_ROLE_GRANT_OFFER_EXPIRED, ERROR_ROLE_GRANT_OFFER_NOT_AUTHORIZED, ERROR_ROLE_GRANT_OFFER_NOT_FOUND, ERROR_ROLE_GRANT_OFFER_ROLE_NOT_GRANTABLE, ERROR_ROLE_GRANT_OFFER_SELF_TARGET, ERROR_ROLE_GRANT_OFFER_TERMINAL, role_grant_offer_create_action_spec, role_grant_offer_accept_action_spec, role_grant_offer_decline_action_spec, role_grant_offer_retract_action_spec, role_grant_offer_list_action_spec, role_grant_offer_history_action_spec, role_grant_revoke_action_spec, role_grant_assign_action_spec } from './role_grant_offer_action_specs.js';
|
|
58
58
|
// -- Helpers ----------------------------------------------------------------
|
|
59
59
|
/**
|
|
60
60
|
* Fan out a batch of pre-written audit rows to the bound emitter's
|
|
@@ -85,7 +85,7 @@ const default_authorize = async (auth, _input, _deps, _ctx) => {
|
|
|
85
85
|
* Create the eight role-grant-offer RPC actions (six offer-lifecycle methods
|
|
86
86
|
* plus `role_grant_revoke` and the immediate `role_grant_assign`).
|
|
87
87
|
*
|
|
88
|
-
* @param deps - `
|
|
88
|
+
* @param deps - `ActionFactoryDeps` (`log`, `audit`) plus optional `notification_sender` for WS fan-out — when absent, WS fan-out is silently skipped (DB-only side effects still happen). Consumers wiring `BackendWebsocketTransport` assign its instance directly (the transport's `send_to_account` signature accepts the broader `JsonrpcMessageFromServerToClient`, which is contravariantly compatible)
|
|
89
89
|
* @param options - role schema, default TTL, authorization override
|
|
90
90
|
* @returns the `RpcAction` array to spread into a `create_rpc_endpoint` call
|
|
91
91
|
*/
|
|
@@ -108,8 +108,8 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
108
108
|
metadata: {
|
|
109
109
|
role: input.role,
|
|
110
110
|
scope_id: input.scope_id ?? null,
|
|
111
|
-
to_account_id: input.to_account_id
|
|
112
|
-
}
|
|
111
|
+
to_account_id: input.to_account_id
|
|
112
|
+
}
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
115
|
// Returns {offer} only — no auto-accept. Recipient must call
|
|
@@ -123,18 +123,18 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
123
123
|
if (!role_has_grant_path(role_specs, input.role, GRANT_PATH_ADMIN)) {
|
|
124
124
|
emit_create_failure_audit(ctx, auth, input);
|
|
125
125
|
throw jsonrpc_errors.forbidden('role not grantable', {
|
|
126
|
-
reason: ERROR_ROLE_GRANT_OFFER_ROLE_NOT_GRANTABLE
|
|
126
|
+
reason: ERROR_ROLE_GRANT_OFFER_ROLE_NOT_GRANTABLE
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
const authorized = await authorize(auth, {
|
|
130
130
|
to_account_id: input.to_account_id,
|
|
131
131
|
role: input.role,
|
|
132
|
-
scope_id: input.scope_id ?? null
|
|
132
|
+
scope_id: input.scope_id ?? null
|
|
133
133
|
}, { log }, ctx);
|
|
134
134
|
if (!authorized) {
|
|
135
135
|
emit_create_failure_audit(ctx, auth, input);
|
|
136
136
|
throw jsonrpc_errors.forbidden('not authorized to offer this role', {
|
|
137
|
-
reason: ERROR_ROLE_GRANT_OFFER_NOT_AUTHORIZED
|
|
137
|
+
reason: ERROR_ROLE_GRANT_OFFER_NOT_AUTHORIZED
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
let offer;
|
|
@@ -147,20 +147,20 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
147
147
|
scope_kind: input.scope_kind ?? null,
|
|
148
148
|
scope_id: input.scope_id ?? null,
|
|
149
149
|
message: input.message ?? null,
|
|
150
|
-
expires_at: new Date(Date.now() + default_ttl_ms)
|
|
150
|
+
expires_at: new Date(Date.now() + default_ttl_ms)
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
catch (err) {
|
|
154
154
|
if (err instanceof RoleGrantOfferSelfTargetError) {
|
|
155
155
|
emit_create_failure_audit(ctx, auth, input);
|
|
156
156
|
throw jsonrpc_errors.invalid_params('cannot offer to self', {
|
|
157
|
-
reason: ERROR_ROLE_GRANT_OFFER_SELF_TARGET
|
|
157
|
+
reason: ERROR_ROLE_GRANT_OFFER_SELF_TARGET
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
if (err instanceof RoleGrantOfferActorAccountMismatchError) {
|
|
161
161
|
emit_create_failure_audit(ctx, auth, input);
|
|
162
162
|
throw jsonrpc_errors.invalid_params('to_actor_id does not belong to to_account_id', {
|
|
163
|
-
reason: ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH
|
|
163
|
+
reason: ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
166
|
throw err;
|
|
@@ -177,8 +177,8 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
177
177
|
offer_id: offer.id,
|
|
178
178
|
role: offer.role,
|
|
179
179
|
scope_id: offer.scope_id,
|
|
180
|
-
to_account_id: offer.to_account_id
|
|
181
|
-
}
|
|
180
|
+
to_account_id: offer.to_account_id
|
|
181
|
+
}
|
|
182
182
|
});
|
|
183
183
|
const offer_json = to_role_grant_offer_json(offer);
|
|
184
184
|
if (notification_sender) {
|
|
@@ -196,7 +196,7 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
196
196
|
offer_id: input.offer_id,
|
|
197
197
|
to_account_id: auth.account.id,
|
|
198
198
|
actor_id: auth.actor.id,
|
|
199
|
-
ip: ctx.client_ip
|
|
199
|
+
ip: ctx.client_ip
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
catch (err) {
|
|
@@ -211,7 +211,7 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
211
211
|
}
|
|
212
212
|
if (err instanceof RoleGrantOfferActorMismatchError) {
|
|
213
213
|
throw jsonrpc_errors.forbidden('offer is targeted to a different actor', {
|
|
214
|
-
reason: ERROR_ROLE_GRANT_OFFER_ACTOR_MISMATCH
|
|
214
|
+
reason: ERROR_ROLE_GRANT_OFFER_ACTOR_MISMATCH
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
217
|
throw err;
|
|
@@ -227,7 +227,7 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
227
227
|
const offer_json = to_role_grant_offer_json(result.offer);
|
|
228
228
|
const supersede_payloads = result.superseded_offers.map((sib) => ({
|
|
229
229
|
offer: to_role_grant_offer_json(sib),
|
|
230
|
-
from_account_id: sib.from_account_id
|
|
230
|
+
from_account_id: sib.from_account_id
|
|
231
231
|
}));
|
|
232
232
|
// Audit events are written in-transaction by query_accept_offer; wire
|
|
233
233
|
// them through `audit.notify` post-commit so SSE/WS broadcasts fire.
|
|
@@ -245,7 +245,7 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
245
245
|
notification_sender.send_to_account(sib.from_account_id, build_role_grant_offer_supersede_notification({
|
|
246
246
|
offer: sib.offer,
|
|
247
247
|
reason: 'sibling_accepted',
|
|
248
|
-
cause_id: result.offer.id
|
|
248
|
+
cause_id: result.offer.id
|
|
249
249
|
}));
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -253,7 +253,7 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
253
253
|
return {
|
|
254
254
|
role_grant_id: result.role_grant.id,
|
|
255
255
|
offer: offer_json,
|
|
256
|
-
superseded_offer_ids: result.superseded_offers.map((o) => o.id)
|
|
256
|
+
superseded_offer_ids: result.superseded_offers.map((o) => o.id)
|
|
257
257
|
};
|
|
258
258
|
};
|
|
259
259
|
const decline_handler = async (input, ctx) => {
|
|
@@ -284,8 +284,8 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
284
284
|
offer_id: declined.id,
|
|
285
285
|
role: declined.role,
|
|
286
286
|
scope_id: declined.scope_id,
|
|
287
|
-
reason: input.reason ?? undefined
|
|
288
|
-
}
|
|
287
|
+
reason: input.reason ?? undefined
|
|
288
|
+
}
|
|
289
289
|
});
|
|
290
290
|
if (notification_sender) {
|
|
291
291
|
// Grantor's account_id rides on `declined.from_account_id` from
|
|
@@ -325,8 +325,8 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
325
325
|
metadata: {
|
|
326
326
|
offer_id: retracted.id,
|
|
327
327
|
role: retracted.role,
|
|
328
|
-
scope_id: retracted.scope_id
|
|
329
|
-
}
|
|
328
|
+
scope_id: retracted.scope_id
|
|
329
|
+
}
|
|
330
330
|
});
|
|
331
331
|
if (notification_sender) {
|
|
332
332
|
const offer_json = to_role_grant_offer_json(retracted);
|
|
@@ -381,10 +381,10 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
381
381
|
outcome: 'failure',
|
|
382
382
|
target_account_id,
|
|
383
383
|
target_actor_id,
|
|
384
|
-
metadata: { role: role_grant_row.role, role_grant_id: input.role_grant_id }
|
|
384
|
+
metadata: { role: role_grant_row.role, role_grant_id: input.role_grant_id }
|
|
385
385
|
});
|
|
386
386
|
throw jsonrpc_errors.forbidden('role not web-grantable', {
|
|
387
|
-
reason: ERROR_ROLE_NOT_WEB_GRANTABLE
|
|
387
|
+
reason: ERROR_ROLE_NOT_WEB_GRANTABLE
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
390
|
const result = await query_revoke_role_grant(ctx, input.role_grant_id, input.actor_id, auth.actor.id, input.reason ?? null);
|
|
@@ -401,8 +401,8 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
401
401
|
role: result.role,
|
|
402
402
|
role_grant_id: result.id,
|
|
403
403
|
scope_id: result.scope_id,
|
|
404
|
-
reason: input.reason ?? undefined
|
|
405
|
-
}
|
|
404
|
+
reason: input.reason ?? undefined
|
|
405
|
+
}
|
|
406
406
|
});
|
|
407
407
|
// Supersede cascade — the recipient is known (`offer.to_account_id`),
|
|
408
408
|
// so populate `target_account_id` rather than leaving it null;
|
|
@@ -418,14 +418,14 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
418
418
|
role: offer.role,
|
|
419
419
|
scope_id: offer.scope_id,
|
|
420
420
|
reason: 'role_grant_revoked',
|
|
421
|
-
cause_id: result.id
|
|
422
|
-
}
|
|
421
|
+
cause_id: result.id
|
|
422
|
+
}
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
425
|
if (notification_sender) {
|
|
426
426
|
const superseded = result.superseded_offers.map((o) => ({
|
|
427
427
|
offer: to_role_grant_offer_json(o),
|
|
428
|
-
from_account_id: o.from_account_id
|
|
428
|
+
from_account_id: o.from_account_id
|
|
429
429
|
}));
|
|
430
430
|
const cause_id = result.id;
|
|
431
431
|
const reason = input.reason ?? null;
|
|
@@ -434,13 +434,13 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
434
434
|
role_grant_id: result.id,
|
|
435
435
|
role: result.role,
|
|
436
436
|
scope_id: result.scope_id,
|
|
437
|
-
reason
|
|
437
|
+
reason
|
|
438
438
|
}));
|
|
439
439
|
for (const sib of superseded) {
|
|
440
440
|
notification_sender.send_to_account(sib.from_account_id, build_role_grant_offer_supersede_notification({
|
|
441
441
|
offer: sib.offer,
|
|
442
442
|
reason: 'role_grant_revoked',
|
|
443
|
-
cause_id
|
|
443
|
+
cause_id
|
|
444
444
|
}));
|
|
445
445
|
}
|
|
446
446
|
});
|
|
@@ -465,10 +465,10 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
465
465
|
outcome: 'failure',
|
|
466
466
|
target_account_id: input.to_account_id,
|
|
467
467
|
target_actor_id: input.to_actor_id ?? null,
|
|
468
|
-
metadata: { role: input.role, scope_id: input.scope_id ?? null }
|
|
468
|
+
metadata: { role: input.role, scope_id: input.scope_id ?? null }
|
|
469
469
|
});
|
|
470
470
|
throw jsonrpc_errors.forbidden('role not web-grantable', {
|
|
471
|
-
reason: ERROR_ROLE_NOT_WEB_GRANTABLE
|
|
471
|
+
reason: ERROR_ROLE_NOT_WEB_GRANTABLE
|
|
472
472
|
});
|
|
473
473
|
}
|
|
474
474
|
// Resolve the grant's target actor. A supplied `to_actor_id` must be an
|
|
@@ -482,7 +482,7 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
482
482
|
if (input.to_actor_id != null) {
|
|
483
483
|
if (!actors.some((a) => a.id === input.to_actor_id)) {
|
|
484
484
|
throw jsonrpc_errors.invalid_params('to_actor_id does not belong to to_account_id', {
|
|
485
|
-
reason: ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH
|
|
485
|
+
reason: ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
488
|
target_actor_id = input.to_actor_id;
|
|
@@ -504,7 +504,7 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
504
504
|
role: input.role,
|
|
505
505
|
scope_kind: null,
|
|
506
506
|
scope_id: input.scope_id ?? null,
|
|
507
|
-
granted_by: auth.actor.id
|
|
507
|
+
granted_by: auth.actor.id
|
|
508
508
|
});
|
|
509
509
|
audit.emit_role_grant_target(ctx, auth, {
|
|
510
510
|
event_type: 'role_grant_create',
|
|
@@ -513,8 +513,8 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
513
513
|
metadata: {
|
|
514
514
|
role: grant.role,
|
|
515
515
|
role_grant_id: grant.id,
|
|
516
|
-
scope_id: grant.scope_id
|
|
517
|
-
}
|
|
516
|
+
scope_id: grant.scope_id
|
|
517
|
+
}
|
|
518
518
|
});
|
|
519
519
|
return { ok: true, role_grant_id: grant.id };
|
|
520
520
|
};
|
|
@@ -526,6 +526,6 @@ export const create_role_grant_offer_actions = (deps, options = {}) => {
|
|
|
526
526
|
rpc_action(role_grant_offer_list_action_spec, list_handler),
|
|
527
527
|
rpc_action(role_grant_offer_history_action_spec, history_handler),
|
|
528
528
|
rpc_action(role_grant_revoke_action_spec, revoke_handler),
|
|
529
|
-
rpc_action(role_grant_assign_action_spec, assign_handler)
|
|
529
|
+
rpc_action(role_grant_assign_action_spec, assign_handler)
|
|
530
530
|
];
|
|
531
531
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role_grant_offer_notifications.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"role_grant_offer_notifications.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsB,KAAK,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAIvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAM9D;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,kBAAkB;IAClC,eAAe,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,KAAK,MAAM,CAAC;CAC5E;AAID,eAAO,MAAM,6CAA6C,8BAA8B,CAAC;AACzF,eAAO,MAAM,8CAA8C,+BAA+B,CAAC;AAC3F,eAAO,MAAM,6CAA6C,8BAA8B,CAAC;AACzF,eAAO,MAAM,6CAA6C,8BAA8B,CAAC;AACzF,eAAO,MAAM,8CAA8C,+BAA+B,CAAC;AAC3F,eAAO,MAAM,qCAAqC,sBAAsB,CAAC;AAIzE,iFAAiF;AACjF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;kBAEvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF,yEAAyE;AACzE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;kBAExC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE1F,6EAA6E;AAC7E,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;kBAEvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;kBAEvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;kBAIxC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE1F;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;kBAKhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAI1E,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUhB,CAAC;AAEzC,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUjB,CAAC;AAEzC,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUhB,CAAC;AAEzC,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUhB,CAAC;AAEzC,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWjB,CAAC;AAEzC,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;CAUR,CAAC;AAIzC;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,EAAE,KAAK,CAAC,SAAS,CAOhE,CAAC;AAIF,eAAO,MAAM,4CAA4C,GACxD,QAAQ,4BAA4B,KAClC,mBACgF,CAAC;AAEpF,eAAO,MAAM,6CAA6C,GACzD,QAAQ,6BAA6B,KACnC,mBACiF,CAAC;AAErF,eAAO,MAAM,4CAA4C,GACxD,QAAQ,4BAA4B,KAClC,mBACgF,CAAC;AAEpF,eAAO,MAAM,4CAA4C,GACxD,QAAQ,4BAA4B,KAClC,mBACgF,CAAC;AAEpF,eAAO,MAAM,6CAA6C,GACzD,QAAQ,6BAA6B,KACnC,mBACiF,CAAC;AAErF,eAAO,MAAM,oCAAoC,GAChD,QAAQ,qBAAqB,KAC3B,mBACwE,CAAC"}
|