@fuzdev/fuz_app 0.150.0 → 0.152.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/actions/CLAUDE.md +324 -299
- package/dist/actions/action_bridge.d.ts +5 -86
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +4 -84
- package/dist/actions/action_codegen.d.ts +8 -166
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +19 -95
- package/dist/actions/action_dispatcher.d.ts +10 -0
- package/dist/actions/action_dispatcher.d.ts.map +1 -1
- package/dist/actions/action_dispatcher.js +9 -6
- package/dist/actions/action_event.d.ts +1 -2
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +7 -13
- package/dist/actions/action_event_helpers.d.ts +1 -40
- package/dist/actions/action_event_helpers.d.ts.map +1 -1
- package/dist/actions/action_event_helpers.js +1 -25
- package/dist/actions/action_rpc.d.ts +10 -215
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +56 -111
- package/dist/actions/action_spec.d.ts +2 -2
- package/dist/actions/action_spec.js +2 -2
- package/dist/actions/action_types.d.ts +229 -8
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +56 -5
- package/dist/actions/broadcast_api.d.ts +22 -17
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/broadcast_api.js +16 -27
- package/dist/actions/cancel.d.ts +4 -13
- package/dist/actions/cancel.d.ts.map +1 -1
- package/dist/actions/cancel.js +5 -17
- package/dist/actions/compile_action_registry.d.ts +1 -2
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/connection_closer.d.ts +120 -50
- package/dist/actions/connection_closer.d.ts.map +1 -1
- package/dist/actions/connection_closer.js +139 -31
- package/dist/actions/{transports_ws_backend.d.ts → connection_registry.d.ts} +120 -132
- package/dist/actions/connection_registry.d.ts.map +1 -0
- package/dist/actions/{transports_ws_backend.js → connection_registry.js} +149 -152
- package/dist/actions/frontend_rpc_client.d.ts +52 -2
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +42 -4
- package/dist/actions/peer_ping.d.ts +7 -9
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_ping.js +6 -8
- package/dist/actions/peer_request.d.ts +6 -5
- package/dist/actions/peer_request.d.ts.map +1 -1
- package/dist/actions/peer_request.js +6 -5
- package/dist/actions/perform_action.d.ts +36 -28
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +60 -34
- package/dist/actions/protocol.d.ts +14 -0
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +18 -0
- package/dist/actions/register_action_ws.d.ts +137 -298
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +155 -923
- package/dist/actions/socket.svelte.d.ts +9 -0
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/socket.svelte.js +16 -5
- package/dist/actions/transports.d.ts +88 -34
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +76 -76
- package/dist/actions/transports_http.d.ts +48 -12
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_http.js +75 -44
- package/dist/actions/transports_ws.d.ts +29 -0
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/transports_ws.js +34 -8
- package/dist/actions/ws_endpoint_spec.d.ts +52 -75
- package/dist/actions/ws_endpoint_spec.d.ts.map +1 -1
- package/dist/actions/ws_endpoint_spec.js +27 -10
- package/dist/actions/ws_outbound_writer.d.ts +3 -3
- package/dist/actions/ws_outbound_writer.js +3 -3
- package/dist/actions/ws_socket_session.d.ts +321 -0
- package/dist/actions/ws_socket_session.d.ts.map +1 -0
- package/dist/actions/ws_socket_session.js +783 -0
- package/dist/auth/CLAUDE.md +70 -44
- package/dist/auth/account_action_specs.d.ts +2 -0
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_actions.d.ts +1 -1
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +9 -3
- package/dist/auth/account_queries.d.ts +10 -0
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +27 -17
- package/dist/auth/account_routes.d.ts +2 -1
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +14 -17
- package/dist/auth/account_schema.d.ts +5 -5
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +5 -2
- package/dist/auth/actor_lookup_actions.d.ts +1 -1
- package/dist/auth/actor_lookup_actions.d.ts.map +1 -1
- package/dist/auth/actor_lookup_actions.js +1 -1
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.js +2 -1
- package/dist/auth/actor_search_actions.d.ts +1 -1
- package/dist/auth/actor_search_actions.d.ts.map +1 -1
- package/dist/auth/actor_search_actions.js +1 -1
- package/dist/auth/actor_search_queries.d.ts +5 -5
- package/dist/auth/actor_search_queries.d.ts.map +1 -1
- package/dist/auth/actor_search_queries.js +7 -7
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +3 -1
- package/dist/auth/admin_actions.d.ts +1 -1
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +12 -42
- package/dist/auth/all_cell_actions.d.ts +6 -4
- package/dist/auth/all_cell_actions.d.ts.map +1 -1
- package/dist/auth/all_cell_actions.js +1 -1
- package/dist/auth/api_token_queries.d.ts +1 -0
- package/dist/auth/api_token_queries.d.ts.map +1 -1
- package/dist/auth/api_token_queries.js +1 -0
- package/dist/auth/audit_emitter.d.ts +3 -3
- package/dist/auth/audit_emitter.js +2 -2
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +3 -2
- package/dist/auth/audit_log_routes.d.ts +20 -11
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +49 -29
- package/dist/auth/audit_log_schema.d.ts +13 -21
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +10 -18
- package/dist/auth/bearer_auth.d.ts +7 -4
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +21 -15
- package/dist/auth/cell_action_helpers.d.ts +89 -0
- package/dist/auth/cell_action_helpers.d.ts.map +1 -0
- package/dist/auth/cell_action_helpers.js +113 -0
- package/dist/auth/cell_actions.d.ts +22 -13
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +105 -167
- package/dist/auth/cell_audit_actions.d.ts +1 -1
- package/dist/auth/cell_audit_actions.d.ts.map +1 -1
- package/dist/auth/cell_audit_actions.js +3 -12
- package/dist/auth/cell_audit_metadata.d.ts +1 -1
- package/dist/auth/cell_audit_metadata.js +1 -1
- package/dist/auth/cell_field_actions.d.ts +1 -1
- package/dist/auth/cell_field_actions.d.ts.map +1 -1
- package/dist/auth/cell_field_actions.js +16 -66
- package/dist/auth/cell_grant_action_specs.d.ts +2 -2
- package/dist/auth/cell_grant_action_specs.js +3 -3
- package/dist/auth/cell_grant_actions.d.ts +73 -11
- package/dist/auth/cell_grant_actions.d.ts.map +1 -1
- package/dist/auth/cell_grant_actions.js +63 -55
- package/dist/auth/cell_grant_audit_metadata.d.ts +6 -3
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_grant_audit_metadata.js +7 -4
- package/dist/auth/cell_item_actions.d.ts +1 -1
- package/dist/auth/cell_item_actions.d.ts.map +1 -1
- package/dist/auth/cell_item_actions.js +21 -82
- package/dist/auth/cleanup.d.ts +1 -1
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +6 -3
- package/dist/auth/credential_deadline.d.ts +3 -3
- package/dist/auth/credential_deadline.js +3 -3
- package/dist/auth/credential_type_schema.d.ts +5 -5
- package/dist/auth/credential_type_schema.js +5 -5
- package/dist/auth/daemon_token_middleware.d.ts +12 -6
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +28 -17
- package/dist/auth/deps.d.ts +4 -4
- package/dist/auth/fail_floor.d.ts +55 -0
- package/dist/auth/fail_floor.d.ts.map +1 -0
- package/dist/auth/fail_floor.js +63 -0
- package/dist/auth/invite_queries.d.ts +3 -15
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +3 -21
- package/dist/auth/middleware.d.ts +12 -7
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +42 -29
- package/dist/auth/migrations.d.ts +5 -33
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +9 -16
- package/dist/auth/request_context.d.ts +101 -71
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +137 -140
- package/dist/auth/resolved_auth.d.ts +122 -36
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +89 -38
- package/dist/auth/role_grant_offer_action_specs.d.ts +99 -14
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +26 -13
- package/dist/auth/role_grant_offer_actions.d.ts +13 -7
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +14 -12
- package/dist/auth/role_grant_offer_notifications.d.ts +3 -3
- package/dist/auth/role_grant_offer_notifications.js +1 -1
- package/dist/auth/role_grant_offer_queries.d.ts +0 -5
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +9 -41
- package/dist/auth/role_grant_queries.d.ts +17 -67
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +34 -106
- package/dist/auth/role_grant_sql.d.ts +42 -0
- package/dist/auth/role_grant_sql.d.ts.map +1 -0
- package/dist/auth/role_grant_sql.js +54 -0
- package/dist/auth/scope_kind_schema.d.ts +1 -1
- package/dist/auth/scope_kind_schema.js +1 -1
- package/dist/auth/self_service_role_actions.d.ts +1 -1
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +1 -1
- package/dist/auth/session_queries.d.ts +2 -1
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +2 -1
- package/dist/auth/signup_routes.d.ts +2 -1
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +14 -13
- package/dist/auth/standard_rpc_actions.d.ts +1 -1
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/token_scope.d.ts +19 -46
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +23 -41
- package/dist/db/CLAUDE.md +9 -4
- package/dist/db/cell_ddl.d.ts +5 -142
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +17 -16
- package/dist/db/cell_field_queries.d.ts +0 -13
- package/dist/db/cell_field_queries.d.ts.map +1 -1
- package/dist/db/cell_field_queries.js +0 -16
- package/dist/db/cell_grant_queries.d.ts +10 -5
- package/dist/db/cell_grant_queries.d.ts.map +1 -1
- package/dist/db/cell_grant_queries.js +13 -7
- package/dist/db/cell_item_queries.d.ts +0 -7
- package/dist/db/cell_item_queries.d.ts.map +1 -1
- package/dist/db/cell_item_queries.js +0 -10
- package/dist/db/cell_queries.d.ts +12 -48
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +24 -55
- package/dist/db/cell_view_sql.d.ts +1 -6
- package/dist/db/cell_view_sql.d.ts.map +1 -1
- package/dist/db/cell_view_sql.js +1 -2
- package/dist/db/fact_ddl.d.ts +5 -30
- package/dist/db/fact_ddl.d.ts.map +1 -1
- package/dist/db/fact_ddl.js +14 -13
- package/dist/db/fact_store.d.ts +11 -0
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/fact_store.js +4 -1
- package/dist/db/migrate.d.ts +44 -6
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +63 -4
- package/dist/dev/setup.d.ts +18 -14
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +42 -39
- package/dist/env/dotenv.d.ts +2 -2
- package/dist/env/dotenv.js +2 -2
- package/dist/env/update_env_variable.d.ts +33 -21
- package/dist/env/update_env_variable.d.ts.map +1 -1
- package/dist/env/update_env_variable.js +54 -35
- package/dist/hono_context.d.ts +15 -90
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +9 -56
- package/dist/http/CLAUDE.md +35 -20
- package/dist/http/auth_shape.d.ts +1 -8
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +6 -12
- package/dist/http/common_routes.d.ts.map +1 -1
- package/dist/http/common_routes.js +3 -2
- package/dist/http/db_routes.d.ts +3 -3
- package/dist/http/db_routes.js +3 -3
- package/dist/http/error_schemas.d.ts +1 -2
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +1 -2
- package/dist/http/health_schema.d.ts +16 -0
- package/dist/http/health_schema.d.ts.map +1 -0
- package/dist/http/health_schema.js +12 -0
- package/dist/http/jsonrpc_errors.d.ts +22 -2
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +41 -3
- package/dist/http/jsonrpc_helpers.d.ts +60 -17
- package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
- package/dist/http/jsonrpc_helpers.js +67 -25
- package/dist/http/origin.d.ts +30 -1
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +46 -9
- package/dist/http/origin_wildcard.d.ts +97 -0
- package/dist/http/origin_wildcard.d.ts.map +1 -0
- package/dist/http/origin_wildcard.js +142 -0
- package/dist/http/pending_effects.d.ts +28 -0
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +32 -1
- package/dist/http/route_spec.d.ts +4 -3
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +54 -45
- package/dist/http/surface.d.ts +1 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface_query.d.ts +9 -50
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +48 -94
- package/dist/realtime/audit_log_sse.d.ts +180 -0
- package/dist/realtime/audit_log_sse.d.ts.map +1 -0
- package/dist/realtime/audit_log_sse.js +154 -0
- package/dist/realtime/sse.d.ts +21 -6
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +33 -10
- package/dist/realtime/sse_constants.d.ts +29 -2
- package/dist/realtime/sse_constants.d.ts.map +1 -1
- package/dist/realtime/sse_constants.js +35 -2
- package/dist/realtime/{subscriber_registry.d.ts → sse_registry.d.ts} +12 -12
- package/dist/realtime/sse_registry.d.ts.map +1 -0
- package/dist/realtime/{subscriber_registry.js → sse_registry.js} +4 -4
- package/dist/schema_meta.d.ts +30 -10
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +85 -21
- package/dist/sensitivity.d.ts +9 -3
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/sensitivity.js +3 -2
- package/dist/server/app_backend.d.ts +8 -5
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +6 -12
- package/dist/server/app_server.d.ts +62 -51
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +84 -71
- package/dist/server/app_server_context.d.ts +1 -1
- package/dist/server/app_server_context.d.ts.map +1 -1
- package/dist/server/env.d.ts +24 -20
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +24 -34
- package/dist/server/serve_fact_route.d.ts +12 -16
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +59 -34
- package/dist/server/static.d.ts.map +1 -1
- package/dist/server/static.js +2 -2
- package/dist/testing/CLAUDE.md +179 -158
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +10 -19
- package/dist/testing/adversarial_headers.d.ts.map +1 -1
- package/dist/testing/adversarial_headers.js +8 -0
- package/dist/testing/app_server.d.ts +9 -77
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +31 -112
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +3 -4
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +4 -5
- package/dist/testing/auth_apps.d.ts +3 -3
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +9 -6
- package/dist/testing/connection_closer_helpers.d.ts +8 -16
- package/dist/testing/connection_closer_helpers.d.ts.map +1 -1
- package/dist/testing/connection_closer_helpers.js +7 -20
- package/dist/testing/cross_backend/action_manifest.d.ts +15 -4
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +13 -3
- package/dist/testing/cross_backend/action_manifest_parity.d.ts +15 -7
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest_parity.js +8 -1
- package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
- package/dist/testing/cross_backend/body_size.js +25 -22
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts +22 -3
- package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
- package/dist/testing/cross_backend/build_test_backend_paths.js +34 -11
- package/dist/testing/cross_backend/capabilities.d.ts +13 -7
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_grant_role.js +2 -2
- package/dist/testing/cross_backend/cell_grant_steward.d.ts +4 -0
- package/dist/testing/cross_backend/cell_grant_steward.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_grant_steward.js +120 -0
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +21 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.d.ts +18 -4
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +29 -9
- package/dist/testing/cross_backend/default_spine_surface.d.ts +7 -7
- package/dist/testing/cross_backend/default_spine_surface.js +2 -2
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +48 -0
- package/dist/testing/cross_backend/full_spine_mount.d.ts +3 -4
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +9 -2
- package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
- package/dist/testing/cross_backend/origin_scope.js +5 -13
- package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +29 -4
- package/dist/testing/cross_backend/postgres_database.d.ts +32 -0
- package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -1
- package/dist/testing/cross_backend/postgres_database.js +56 -1
- package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
- package/dist/testing/cross_backend/query_shape.js +18 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +23 -1
- package/dist/testing/cross_backend/rpc_success_fixtures.js +2 -2
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts +17 -5
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +5 -4
- package/dist/testing/cross_backend/session_cap.d.ts +8 -0
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +66 -2
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +5 -4
- package/dist/testing/cross_backend/spine_suites.d.ts +4 -1
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +21 -0
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +22 -7
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +22 -7
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +4 -3
- package/dist/testing/cross_backend/standard.d.ts +6 -12
- package/dist/testing/cross_backend/standard.d.ts.map +1 -1
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts +8 -0
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts.map +1 -0
- package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.js +22 -0
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +4 -6
- package/dist/testing/cross_backend/testing_origin_check.d.ts +1 -1
- package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_origin_check.js +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +10 -5
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +7 -6
- package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_bun.js +5 -4
- package/dist/testing/cross_backend/testing_server_core.d.ts +6 -7
- package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_core.js +1 -1
- package/dist/testing/cross_backend/testing_server_node.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_server_node.js +13 -2
- package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
- package/dist/testing/cross_backend/token_lifetime.js +68 -0
- package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +45 -3
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +16 -2
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +11 -8
- package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_action_rate_limit.js +30 -12
- package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_connection_cap.js +5 -7
- package/dist/testing/cross_backend/ws_endpoint.d.ts +2 -3
- package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_envelope.d.ts +17 -0
- package/dist/testing/cross_backend/ws_envelope.d.ts.map +1 -0
- package/dist/testing/cross_backend/ws_envelope.js +172 -0
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts +16 -0
- package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_inbound_dispatch.js +8 -4
- package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.js +5 -8
- package/dist/testing/cross_backend/ws_role_gated.js +2 -2
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +6 -4
- package/dist/{cli/daemon.d.ts → testing/daemon_info.d.ts} +15 -47
- package/dist/testing/daemon_info.d.ts.map +1 -0
- package/dist/testing/daemon_info.js +108 -0
- package/dist/testing/daemon_token_rotation.js +1 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +3 -4
- package/dist/testing/db.js +2 -2
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +35 -65
- package/dist/testing/integration_helpers.d.ts +0 -15
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +2 -42
- package/dist/testing/middleware.d.ts +20 -12
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +49 -40
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +13 -22
- package/dist/testing/resolved_auth.d.ts +30 -0
- package/dist/testing/resolved_auth.d.ts.map +1 -0
- package/dist/testing/resolved_auth.js +41 -0
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +3 -0
- package/dist/testing/rpc_helpers.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +2 -1
- package/dist/testing/sse_round_trip.d.ts +5 -4
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/stubs.d.ts +2 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +24 -21
- package/dist/testing/test_origin.d.ts +25 -0
- package/dist/testing/test_origin.d.ts.map +1 -0
- package/dist/testing/test_origin.js +28 -0
- package/dist/testing/transports/raw_http.d.ts +54 -0
- package/dist/testing/transports/raw_http.d.ts.map +1 -1
- package/dist/testing/transports/raw_http.js +58 -0
- package/dist/testing/transports/ws_raw_client.d.ts +8 -0
- package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
- package/dist/testing/transports/ws_raw_client.js +13 -0
- package/dist/testing/transports/ws_transport.d.ts +15 -2
- package/dist/testing/transports/ws_transport.d.ts.map +1 -1
- package/dist/testing/transports/ws_transport.js +4 -2
- package/dist/testing/ws_round_trip.d.ts +27 -25
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +34 -26
- package/dist/ui/AccountSessions.svelte +48 -19
- package/dist/ui/AccountSessions.svelte.d.ts +2 -17
- package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAccounts.svelte +6 -1
- package/dist/ui/AdminAuditLog.svelte +61 -22
- package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
- package/dist/ui/AdminInvites.svelte +1 -1
- package/dist/ui/AdminOverview.svelte +76 -37
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
- package/dist/ui/AdminRoleGrantHistory.svelte +6 -1
- package/dist/ui/AdminSessions.svelte +1 -1
- package/dist/ui/AppShell.svelte +3 -2
- package/dist/ui/AppShell.svelte.d.ts +3 -2
- package/dist/ui/AppShell.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +121 -35
- package/dist/ui/Datatable.svelte +33 -18
- package/dist/ui/Datatable.svelte.d.ts +2 -14
- package/dist/ui/Datatable.svelte.d.ts.map +1 -1
- package/dist/ui/OpenSignupToggle.svelte +10 -1
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
- package/dist/ui/PopoverButton.svelte +13 -8
- package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferForm.svelte +3 -2
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts +3 -2
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferHistory.svelte +3 -3
- package/dist/ui/RoleGrantOfferInbox.svelte +19 -15
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
- package/dist/ui/SurfaceExplorer.svelte +66 -27
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts +7 -14
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +14 -9
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +6 -4
- package/dist/ui/admin_invites_state.svelte.d.ts +2 -2
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.d.ts +9 -9
- package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.js +9 -9
- package/dist/ui/app_settings_state.svelte.d.ts +2 -2
- package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.d.ts +70 -13
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +239 -47
- package/dist/ui/backend_probe.svelte.d.ts +93 -0
- package/dist/ui/backend_probe.svelte.d.ts.map +1 -0
- package/dist/ui/backend_probe.svelte.js +140 -0
- package/dist/ui/format_scope.d.ts +7 -7
- package/dist/ui/format_scope.d.ts.map +1 -1
- package/dist/ui/format_scope.js +4 -4
- package/dist/ui/keyed_async_slot.svelte.d.ts +2 -2
- package/dist/ui/keyed_async_slot.svelte.js +2 -2
- package/dist/ui/popover.svelte.d.ts +18 -19
- package/dist/ui/popover.svelte.d.ts.map +1 -1
- package/dist/ui/popover.svelte.js +103 -16
- package/dist/ui/role_grant_offers_state.svelte.d.ts +41 -46
- package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.js +37 -19
- package/dist/ui/ui_format.d.ts +17 -0
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/dist/ui/ui_format.js +20 -0
- package/package.json +9 -8
- package/dist/actions/register_ws_endpoint.d.ts +0 -79
- package/dist/actions/register_ws_endpoint.d.ts.map +0 -1
- package/dist/actions/register_ws_endpoint.js +0 -109
- package/dist/actions/transports_ws_auth_guard.d.ts +0 -96
- package/dist/actions/transports_ws_auth_guard.d.ts.map +0 -1
- package/dist/actions/transports_ws_auth_guard.js +0 -141
- package/dist/actions/transports_ws_backend.d.ts.map +0 -1
- package/dist/cli/args.d.ts +0 -55
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -100
- package/dist/cli/config.d.ts +0 -47
- package/dist/cli/config.d.ts.map +0 -1
- package/dist/cli/config.js +0 -77
- package/dist/cli/daemon.d.ts.map +0 -1
- package/dist/cli/daemon.js +0 -181
- package/dist/cli/help.d.ts +0 -124
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -215
- package/dist/cli/logger.d.ts +0 -46
- package/dist/cli/logger.d.ts.map +0 -1
- package/dist/cli/logger.js +0 -48
- package/dist/cli/util.d.ts +0 -36
- package/dist/cli/util.d.ts.map +0 -1
- package/dist/cli/util.js +0 -50
- package/dist/realtime/sse_auth_guard.d.ts +0 -197
- package/dist/realtime/sse_auth_guard.d.ts.map +0 -1
- package/dist/realtime/sse_auth_guard.js +0 -239
- package/dist/realtime/subscriber_registry.d.ts.map +0 -1
- package/dist/testing/bootstrap_success.d.ts +0 -29
- package/dist/testing/bootstrap_success.d.ts.map +0 -1
- package/dist/testing/bootstrap_success.js +0 -144
- package/dist/testing/mock_fs.d.ts +0 -20
- package/dist/testing/mock_fs.d.ts.map +0 -1
- package/dist/testing/mock_fs.js +0 -28
- package/dist/testing/standard.d.ts +0 -122
- package/dist/testing/standard.d.ts.map +0 -1
- package/dist/testing/standard.js +0 -73
- package/dist/testing/testing_rate_limiter.d.ts +0 -65
- package/dist/testing/testing_rate_limiter.d.ts.map +0 -1
- package/dist/testing/testing_rate_limiter.js +0 -80
|
@@ -25,14 +25,12 @@
|
|
|
25
25
|
*
|
|
26
26
|
* @module
|
|
27
27
|
*/
|
|
28
|
-
import { rpc_action } from '../actions/
|
|
28
|
+
import { rpc_action } from '../actions/action_types.js';
|
|
29
29
|
import { jsonrpc_errors } from '../http/jsonrpc_errors.js';
|
|
30
30
|
import { cell_field_set_action_spec, cell_field_delete_action_spec, cell_field_list_action_spec, ERROR_CELL_FIELD_LIST_REQUIRES_SOURCE_OR_TARGET } from './cell_field_action_specs.js';
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
31
|
+
import { cell_viewer_from_auth } from './cell_authorize.js';
|
|
32
|
+
import { emit_cell_audit, require_editable_cell, require_viewable_cell } from './cell_action_helpers.js';
|
|
33
33
|
import { CELL_RELATION_LIST_LIMIT_DEFAULT } from './cell_relation_list_limit.js';
|
|
34
|
-
import { query_cell_get } from '../db/cell_queries.js';
|
|
35
|
-
import { query_cell_grant_list_for_cell } from '../db/cell_grant_queries.js';
|
|
36
34
|
import { query_cell_field_set, query_cell_field_delete, query_cell_field_list_for_source, query_cell_field_list_for_target } from '../db/cell_field_queries.js';
|
|
37
35
|
export const to_field_json = (row) => ({
|
|
38
36
|
source_id: row.source_id,
|
|
@@ -44,66 +42,32 @@ export const to_field_json = (row) => ({
|
|
|
44
42
|
export const create_cell_field_actions = (deps) => {
|
|
45
43
|
const set_handler = async (input, ctx) => {
|
|
46
44
|
const auth = ctx.auth;
|
|
47
|
-
|
|
48
|
-
if (!source) {
|
|
49
|
-
// IDOR mask: same code as cell_get's miss/unviewable.
|
|
50
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
51
|
-
}
|
|
52
|
-
const source_grants = await query_cell_grant_list_for_cell(ctx, source.id);
|
|
53
|
-
if (!can_edit_cell(auth, source, source_grants)) {
|
|
54
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
55
|
-
}
|
|
56
|
-
const target = await query_cell_get(ctx, input.target_id);
|
|
57
|
-
if (!target) {
|
|
58
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
59
|
-
}
|
|
45
|
+
await require_editable_cell(ctx, auth, input.source_id);
|
|
60
46
|
// Target must be view-admitted — otherwise a caller could probe for
|
|
61
47
|
// the existence of private cells by trying to point a field at them
|
|
62
48
|
// (and observe whether the call 404s vs. succeeds).
|
|
63
|
-
|
|
64
|
-
if (!can_view_cell(auth, target, target_grants)) {
|
|
65
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
66
|
-
}
|
|
49
|
+
await require_viewable_cell(ctx, auth, input.target_id);
|
|
67
50
|
const row = await query_cell_field_set(ctx, {
|
|
68
51
|
source_id: input.source_id,
|
|
69
52
|
name: input.name,
|
|
70
53
|
target_id: input.target_id
|
|
71
54
|
});
|
|
72
|
-
deps.audit
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
ip: ctx.client_ip,
|
|
77
|
-
metadata: {
|
|
78
|
-
source_id: row.source_id,
|
|
79
|
-
name: row.name,
|
|
80
|
-
target_id: row.target_id
|
|
81
|
-
}
|
|
55
|
+
emit_cell_audit(ctx, deps.audit, auth, 'cell_field_set', {
|
|
56
|
+
source_id: row.source_id,
|
|
57
|
+
name: row.name,
|
|
58
|
+
target_id: row.target_id
|
|
82
59
|
});
|
|
83
60
|
return { field: to_field_json(row) };
|
|
84
61
|
};
|
|
85
62
|
const delete_handler = async (input, ctx) => {
|
|
86
63
|
const auth = ctx.auth;
|
|
87
|
-
|
|
88
|
-
if (!source) {
|
|
89
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
90
|
-
}
|
|
91
|
-
const source_grants = await query_cell_grant_list_for_cell(ctx, source.id);
|
|
92
|
-
if (!can_edit_cell(auth, source, source_grants)) {
|
|
93
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
94
|
-
}
|
|
64
|
+
await require_editable_cell(ctx, auth, input.source_id);
|
|
95
65
|
const deleted = await query_cell_field_delete(ctx, input.source_id, input.name);
|
|
96
66
|
if (deleted) {
|
|
97
|
-
deps.audit
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
ip: ctx.client_ip,
|
|
102
|
-
metadata: {
|
|
103
|
-
source_id: deleted.source_id,
|
|
104
|
-
name: deleted.name,
|
|
105
|
-
target_id: deleted.target_id
|
|
106
|
-
}
|
|
67
|
+
emit_cell_audit(ctx, deps.audit, auth, 'cell_field_delete', {
|
|
68
|
+
source_id: deleted.source_id,
|
|
69
|
+
name: deleted.name,
|
|
70
|
+
target_id: deleted.target_id
|
|
107
71
|
});
|
|
108
72
|
}
|
|
109
73
|
return { ok: true, deleted: deleted !== null };
|
|
@@ -123,28 +87,14 @@ export const create_cell_field_actions = (deps) => {
|
|
|
123
87
|
// whose target the caller may view (strict target-visibility, in SQL
|
|
124
88
|
// before the limit).
|
|
125
89
|
if (input.source_id !== undefined) {
|
|
126
|
-
const source = await
|
|
127
|
-
if (!source) {
|
|
128
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
129
|
-
}
|
|
130
|
-
const source_grants = auth ? await query_cell_grant_list_for_cell(ctx, source.id) : null;
|
|
131
|
-
if (!can_view_cell(auth, source, source_grants)) {
|
|
132
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
133
|
-
}
|
|
90
|
+
const source = await require_viewable_cell(ctx, auth, input.source_id);
|
|
134
91
|
const rows = await query_cell_field_list_for_source(ctx, cell_viewer_from_auth(auth), source.id, { limit, name_after: input.name_after });
|
|
135
92
|
return { fields: rows.map(to_field_json) };
|
|
136
93
|
}
|
|
137
94
|
// Reverse listing: 2-layer authz. First, can_view_cell(target).
|
|
138
95
|
// Without this, the count of returned rows leaks "at least N
|
|
139
96
|
// viewable cells link to this private target."
|
|
140
|
-
const target = await
|
|
141
|
-
if (!target) {
|
|
142
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
143
|
-
}
|
|
144
|
-
const target_grants = auth ? await query_cell_grant_list_for_cell(ctx, target.id) : null;
|
|
145
|
-
if (!can_view_cell(auth, target, target_grants)) {
|
|
146
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
147
|
-
}
|
|
97
|
+
const target = await require_viewable_cell(ctx, auth, input.target_id);
|
|
148
98
|
// Then page the fields whose source the caller may view — filtered in
|
|
149
99
|
// SQL before the limit, so hidden sources never crowd out visible ones,
|
|
150
100
|
// and bounded so a heavily inbound-linked target can't force an
|
|
@@ -127,8 +127,8 @@ export type CellGrantRevokeInput = z.infer<typeof CellGrantRevokeInput>;
|
|
|
127
127
|
/**
|
|
128
128
|
* Output for `cell_grant_revoke`. `still_admitted` is `true` when the
|
|
129
129
|
* caller retains some admit path on the cell after the revoke (other
|
|
130
|
-
* grant, ownership, admin). Always `true` for
|
|
131
|
-
*
|
|
130
|
+
* grant, ownership, admin). Always `true` for a manager's revoke; a
|
|
131
|
+
* self-revoker or a scope steward may hold no other path.
|
|
132
132
|
*/
|
|
133
133
|
export declare const CellGrantRevokeOutput: z.ZodObject<{
|
|
134
134
|
ok: z.ZodLiteral<true>;
|
|
@@ -104,8 +104,8 @@ export const CellGrantRevokeInput = z.strictObject({
|
|
|
104
104
|
/**
|
|
105
105
|
* Output for `cell_grant_revoke`. `still_admitted` is `true` when the
|
|
106
106
|
* caller retains some admit path on the cell after the revoke (other
|
|
107
|
-
* grant, ownership, admin). Always `true` for
|
|
108
|
-
*
|
|
107
|
+
* grant, ownership, admin). Always `true` for a manager's revoke; a
|
|
108
|
+
* self-revoker or a scope steward may hold no other path.
|
|
109
109
|
*/
|
|
110
110
|
export const CellGrantRevokeOutput = z.strictObject({
|
|
111
111
|
ok: z.literal(true),
|
|
@@ -140,7 +140,7 @@ export const cell_grant_revoke_action_spec = {
|
|
|
140
140
|
input: CellGrantRevokeInput,
|
|
141
141
|
output: CellGrantRevokeOutput,
|
|
142
142
|
async: true,
|
|
143
|
-
description: 'Revoke a grant. Manage-tier only (admin / owner), plus self for actor-shaped grants ("leave shared cell"). Returns `still_admitted` so the UI can tell the recipient whether other admit paths remain.'
|
|
143
|
+
description: 'Revoke a grant. Manage-tier only (admin / owner), plus self for actor-shaped grants ("leave shared cell"), plus the steward of a scoped role-shaped grant\'s scope when the consumer mounts a revoke authorizer. Returns `still_admitted` so the UI can tell the recipient whether other admit paths remain.'
|
|
144
144
|
};
|
|
145
145
|
export const cell_grant_list_action_spec = {
|
|
146
146
|
method: 'cell_grant_list',
|
|
@@ -19,26 +19,30 @@
|
|
|
19
19
|
* after the spine's own gates, before the owner check and the write (403
|
|
20
20
|
* `cell_grant_not_authorized` on refusal).
|
|
21
21
|
* - `cell_grant_revoke` — admin / owner, plus self for actor-shaped grants
|
|
22
|
-
* ("leave shared cell")
|
|
23
|
-
*
|
|
22
|
+
* ("leave shared cell"), plus — when `authorize_grant_revoke` is mounted —
|
|
23
|
+
* the steward of a scoped role-shaped grant's scope. Returns
|
|
24
|
+
* `still_admitted` computed by re-running `can_view_cell` against the
|
|
25
|
+
* remaining grants.
|
|
24
26
|
* - `cell_grant_list` — admin / owner only. Viewers and editors alike get
|
|
25
27
|
* the IDOR-mask 404 (the share list is the manager's to curate).
|
|
26
28
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
29
|
+
* Every miss and every authority denial is a 404 mask, as in
|
|
30
|
+
* `auth/cell_actions.ts`: `cell_grant_create` and `cell_grant_list` answer
|
|
31
|
+
* `cell_not_found` for a missing cell and a non-manager alike;
|
|
32
|
+
* `cell_grant_revoke` answers `cell_grant_not_found` for a missing grant, a
|
|
33
|
+
* grant whose cell is gone, and a caller with no authority to revoke it.
|
|
30
34
|
*
|
|
31
35
|
* Audit events `cell_grant_create` / `cell_grant_revoke` carry IDs only
|
|
32
36
|
* (no display-name snapshots); see `auth/cell_grant_audit_metadata.ts`.
|
|
33
37
|
*
|
|
34
38
|
* @module
|
|
35
39
|
*/
|
|
36
|
-
import { type RpcAction } from '../actions/
|
|
40
|
+
import { type ActionContext, type RpcAction } from '../actions/action_types.js';
|
|
37
41
|
import type { RoleSchemaResult } from './role_schema.js';
|
|
38
42
|
import type { ActionFactoryDeps } from './deps.js';
|
|
39
43
|
import type { RequestActorContext } from './request_context.js';
|
|
40
44
|
import type { Uuid } from '../primitive_schemas.js';
|
|
41
|
-
import { type CellGrantCreateInput, type GrantJson } from './cell_grant_action_specs.js';
|
|
45
|
+
import { type CellGrantCreateInput, type CellGrantLevel, type GrantJson } from './cell_grant_action_specs.js';
|
|
42
46
|
import { type CellGrantRow, type CellGrantPrincipalQueryInput } from '../db/cell_grant_queries.js';
|
|
43
47
|
/**
|
|
44
48
|
* Input to a `CellGrantCreateAuthorize` callback — the twin of the Rust
|
|
@@ -51,7 +55,7 @@ export interface CellGrantCreateAuthorizeInput {
|
|
|
51
55
|
cell_created_by: Uuid | null;
|
|
52
56
|
/** The level the grant confers — on an upsert, the new level. */
|
|
53
57
|
level: CellGrantCreateInput['level'];
|
|
54
|
-
/** Who the grant admits,
|
|
58
|
+
/** Who the grant admits: an actor, or a role at an optional scope. */
|
|
55
59
|
principal: CellGrantPrincipalQueryInput;
|
|
56
60
|
}
|
|
57
61
|
/**
|
|
@@ -64,19 +68,77 @@ export interface CellGrantCreateAuthorizeInput {
|
|
|
64
68
|
* audit row. A consumer narrows sharing with it (say, role-shaped grants only
|
|
65
69
|
* to roles of the cell's own space); it can't widen it, as every caller it
|
|
66
70
|
* sees already manages the cell. Omitted = no gate past the spine's.
|
|
71
|
+
*
|
|
72
|
+
* `ctx` is the request's: `cell_grant_create` has side effects, so `ctx.db` is
|
|
73
|
+
* the request transaction, and a callback needing the database (a
|
|
74
|
+
* scope-existence check, say) reads through it. **Read-only** — the callback
|
|
75
|
+
* decides, it never writes; a write would commit or roll back with the grant,
|
|
76
|
+
* and nothing enforces this but the callback.
|
|
77
|
+
*/
|
|
78
|
+
export type CellGrantCreateAuthorize = (auth: RequestActorContext, input: CellGrantCreateAuthorizeInput, ctx: ActionContext) => boolean | Promise<boolean>;
|
|
79
|
+
/**
|
|
80
|
+
* Input to a `CellGrantRevokeAuthorize` callback — the twin of the Rust
|
|
81
|
+
* `CellGrantRevokeAuthorizeInput`. Only a role-shaped grant with a scope
|
|
82
|
+
* reaches the callback, so `role` and `scope_id` are always present.
|
|
83
|
+
*/
|
|
84
|
+
export interface CellGrantRevokeAuthorizeInput {
|
|
85
|
+
/** The grant being revoked. */
|
|
86
|
+
grant_id: Uuid;
|
|
87
|
+
/** The cell the grant names. */
|
|
88
|
+
cell_id: Uuid;
|
|
89
|
+
/** The cell's owner (`null` = a system cell). */
|
|
90
|
+
cell_created_by: Uuid | null;
|
|
91
|
+
/** The role the grant admits. */
|
|
92
|
+
role: string;
|
|
93
|
+
/** The scope the grant is bound to — the scope whose steward the callback decides on. */
|
|
94
|
+
scope_id: Uuid;
|
|
95
|
+
/** The level the grant confers. */
|
|
96
|
+
level: CellGrantLevel;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Opt-in widening of `cell_grant_revoke` to a scope's steward — the TS twin of
|
|
100
|
+
* the Rust `CellGrantRevokeAuthorize` trait.
|
|
101
|
+
*
|
|
102
|
+
* The role-shaped twin of self-revoke: an actor-shaped grant's grantee may
|
|
103
|
+
* leave a cell, and for a role-shaped grant the grantee is the scope, so the
|
|
104
|
+
* scope's steward speaks for it (say, a teacher removing a cell shared into
|
|
105
|
+
* their classroom). The consumer decides what stewards a scope. The input
|
|
106
|
+
* carries the grant's role so a consumer whose scopes are stewarded only for
|
|
107
|
+
* certain roles can refuse the rest.
|
|
108
|
+
*
|
|
109
|
+
* Deliberately fenced. The spine asks it only when the caller neither manages
|
|
110
|
+
* the cell nor holds the grant (self-revoke), and only for a role-shaped grant
|
|
111
|
+
* with a non-null `scope_id` — an actor-shaped grant or a scopeless role grant
|
|
112
|
+
* never reaches it, and a soft-deleted cell 404s first. `true` revokes as a
|
|
113
|
+
* manager would — same delete, `still_admitted`, and `cell_grant_revoke` audit
|
|
114
|
+
* row, its metadata stamped `steward: true`; `false` answers the same 404
|
|
115
|
+
* `ERROR_CELL_GRANT_NOT_FOUND` mask as every other non-qualifying caller (not a
|
|
116
|
+
* 403 — the caller mustn't learn the grant exists); a throw is a hard error —
|
|
117
|
+
* it is not masked, so refuse with `false`, never a throw.
|
|
118
|
+
* Omitted = revoke is the manager's and the self-revoker's alone.
|
|
119
|
+
*
|
|
120
|
+
* The grant it decides on is the grant revoked: the delete matches the grant's
|
|
121
|
+
* `level` as the callback saw it, so a level change landing between the read
|
|
122
|
+
* and the delete answers the 404 mask rather than revoking a grant the
|
|
123
|
+
* callback never judged. `ctx.db` is the request transaction
|
|
124
|
+
* (`cell_grant_revoke` has side effects), read through like
|
|
125
|
+
* `CellGrantCreateAuthorize`'s, and read-only like it.
|
|
67
126
|
*/
|
|
68
|
-
export type
|
|
127
|
+
export type CellGrantRevokeAuthorize = (auth: RequestActorContext, input: CellGrantRevokeAuthorizeInput, ctx: ActionContext) => boolean | Promise<boolean>;
|
|
69
128
|
/**
|
|
70
129
|
* Dependencies for `create_cell_grant_actions`.
|
|
71
130
|
*
|
|
72
131
|
* `roles` is the role schema — read for the role-validity gate on
|
|
73
132
|
* `cell_grant_create`; `authorize_grant_create` is the optional consumer gate
|
|
74
|
-
* (`CellGrantCreateAuthorize`)
|
|
75
|
-
*
|
|
133
|
+
* (`CellGrantCreateAuthorize`) and `authorize_grant_revoke` the optional
|
|
134
|
+
* steward widening of `cell_grant_revoke` (`CellGrantRevokeAuthorize`). The
|
|
135
|
+
* other slots match `CellActionDeps` so audit-log emit goes through the same
|
|
136
|
+
* fire-and-forget plumbing.
|
|
76
137
|
*/
|
|
77
138
|
export type CellGrantActionDeps = ActionFactoryDeps & {
|
|
78
139
|
roles: RoleSchemaResult;
|
|
79
140
|
authorize_grant_create?: CellGrantCreateAuthorize;
|
|
141
|
+
authorize_grant_revoke?: CellGrantRevokeAuthorize;
|
|
80
142
|
};
|
|
81
143
|
export declare const to_grant_json: (row: CellGrantRow) => GrantJson;
|
|
82
144
|
/** Create the three `cell_grant_*` RPC actions. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_grant_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_grant_actions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cell_grant_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_grant_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EASN,KAAK,oBAAoB,EAMzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAKN,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,MAAM,6BAA6B,CAAC;AAOrC;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C,gCAAgC;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,iDAAiD;IACjD,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,iEAAiE;IACjE,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACrC,sEAAsE;IACtE,SAAS,EAAE,4BAA4B,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACtC,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C,+BAA+B;IAC/B,QAAQ,EAAE,IAAI,CAAC;IACf,gCAAgC;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,iDAAiD;IACjD,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,QAAQ,EAAE,IAAI,CAAC;IACf,mCAAmC;IACnC,KAAK,EAAE,cAAc,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACtC,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,6BAA6B,EACpC,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG;IACrD,KAAK,EAAE,gBAAgB,CAAC;IACxB,sBAAsB,CAAC,EAAE,wBAAwB,CAAC;IAClD,sBAAsB,CAAC,EAAE,wBAAwB,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,KAAK,YAAY,KAAG,SAShD,CAAC;AA4EH,mDAAmD;AACnD,eAAO,MAAM,yBAAyB,GAAI,MAAM,mBAAmB,KAAG,KAAK,CAAC,SAAS,CAwJpF,CAAC"}
|
|
@@ -19,24 +19,28 @@
|
|
|
19
19
|
* after the spine's own gates, before the owner check and the write (403
|
|
20
20
|
* `cell_grant_not_authorized` on refusal).
|
|
21
21
|
* - `cell_grant_revoke` — admin / owner, plus self for actor-shaped grants
|
|
22
|
-
* ("leave shared cell")
|
|
23
|
-
*
|
|
22
|
+
* ("leave shared cell"), plus — when `authorize_grant_revoke` is mounted —
|
|
23
|
+
* the steward of a scoped role-shaped grant's scope. Returns
|
|
24
|
+
* `still_admitted` computed by re-running `can_view_cell` against the
|
|
25
|
+
* remaining grants.
|
|
24
26
|
* - `cell_grant_list` — admin / owner only. Viewers and editors alike get
|
|
25
27
|
* the IDOR-mask 404 (the share list is the manager's to curate).
|
|
26
28
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
29
|
+
* Every miss and every authority denial is a 404 mask, as in
|
|
30
|
+
* `auth/cell_actions.ts`: `cell_grant_create` and `cell_grant_list` answer
|
|
31
|
+
* `cell_not_found` for a missing cell and a non-manager alike;
|
|
32
|
+
* `cell_grant_revoke` answers `cell_grant_not_found` for a missing grant, a
|
|
33
|
+
* grant whose cell is gone, and a caller with no authority to revoke it.
|
|
30
34
|
*
|
|
31
35
|
* Audit events `cell_grant_create` / `cell_grant_revoke` carry IDs only
|
|
32
36
|
* (no display-name snapshots); see `auth/cell_grant_audit_metadata.ts`.
|
|
33
37
|
*
|
|
34
38
|
* @module
|
|
35
39
|
*/
|
|
36
|
-
import { rpc_action } from '../actions/
|
|
40
|
+
import { rpc_action } from '../actions/action_types.js';
|
|
37
41
|
import { jsonrpc_errors } from '../http/jsonrpc_errors.js';
|
|
38
42
|
import { cell_grant_create_action_spec, cell_grant_revoke_action_spec, cell_grant_list_action_spec, ERROR_CELL_GRANT_NOT_AUTHORIZED, ERROR_CELL_GRANT_NOT_FOUND, ERROR_CELL_GRANT_PRINCIPAL_IS_OWNER, ERROR_CELL_GRANT_UNAPPROVED, ERROR_CELL_GRANT_UNKNOWN_ROLE } from './cell_grant_action_specs.js';
|
|
39
|
-
import {
|
|
43
|
+
import { emit_cell_audit, require_manageable_cell } from './cell_action_helpers.js';
|
|
40
44
|
import { can_view_cell, can_manage_cell } from './cell_authorize.js';
|
|
41
45
|
import { query_cell_get } from '../db/cell_queries.js';
|
|
42
46
|
import { cell_moderation_admits_audience } from '../db/cell_moderation.js';
|
|
@@ -90,26 +94,38 @@ const assert_principal_is_not_owner = (cell, principal) => {
|
|
|
90
94
|
});
|
|
91
95
|
}
|
|
92
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* Whether the mounted `CellGrantRevokeAuthorize` admits `auth` as the steward
|
|
99
|
+
* of `grant`'s scope — `false` with no callback, for an actor-shaped grant,
|
|
100
|
+
* and for a scopeless role grant, none of which reach it.
|
|
101
|
+
*/
|
|
102
|
+
const steward_admits_revoke = async (auth, grant, cell, authorize, ctx) => {
|
|
103
|
+
if (!authorize)
|
|
104
|
+
return false;
|
|
105
|
+
if (grant.actor_id !== null || grant.role === null || grant.scope_id === null)
|
|
106
|
+
return false;
|
|
107
|
+
return authorize(auth, {
|
|
108
|
+
grant_id: grant.id,
|
|
109
|
+
cell_id: grant.cell_id,
|
|
110
|
+
cell_created_by: cell.created_by,
|
|
111
|
+
role: grant.role,
|
|
112
|
+
scope_id: grant.scope_id,
|
|
113
|
+
level: grant.level
|
|
114
|
+
}, ctx);
|
|
115
|
+
};
|
|
93
116
|
/** Create the three `cell_grant_*` RPC actions. */
|
|
94
117
|
export const create_cell_grant_actions = (deps) => {
|
|
95
|
-
const { roles, authorize_grant_create } = deps;
|
|
118
|
+
const { roles, authorize_grant_create, authorize_grant_revoke } = deps;
|
|
96
119
|
const create_handler = async (input, ctx) => {
|
|
97
120
|
const auth = ctx.auth;
|
|
98
|
-
const cell = await query_cell_get(ctx, input.cell_id);
|
|
99
|
-
if (!cell) {
|
|
100
|
-
// IDOR mask: same code as cell_get's miss/unviewable so probing
|
|
101
|
-
// for cells via the share endpoint is no easier than via cell_get.
|
|
102
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
103
|
-
}
|
|
104
121
|
// Grant management is manage-tier only (admin / owner). Editor-grant
|
|
105
122
|
// holders may edit the cell's content + relations but cannot mint
|
|
106
123
|
// grants of any level — delegating the share list would let editors
|
|
107
124
|
// widen access (or mint peer editors) and escape the manager's
|
|
108
|
-
// authority.
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
125
|
+
// authority. A miss and a non-manager both get the IDOR-mask 404, so
|
|
126
|
+
// probing for cells via the share endpoint is no easier than via
|
|
127
|
+
// cell_get.
|
|
128
|
+
const cell = await require_manageable_cell(ctx, auth, input.cell_id);
|
|
113
129
|
// A grant extends a cell's audience, and a contribution whose moderation
|
|
114
130
|
// doesn't admit one (pending, rejected, or an unknown marker) has none past
|
|
115
131
|
// its author and admins — `can_view_cell`'s grant arm wouldn't admit on it —
|
|
@@ -137,7 +153,7 @@ export const create_cell_grant_actions = (deps) => {
|
|
|
137
153
|
cell_created_by: cell.created_by,
|
|
138
154
|
level: input.level,
|
|
139
155
|
principal
|
|
140
|
-
});
|
|
156
|
+
}, ctx);
|
|
141
157
|
if (!allowed) {
|
|
142
158
|
throw jsonrpc_errors.forbidden('cell grant is not permitted here', {
|
|
143
159
|
reason: ERROR_CELL_GRANT_NOT_AUTHORIZED
|
|
@@ -151,17 +167,11 @@ export const create_cell_grant_actions = (deps) => {
|
|
|
151
167
|
principal,
|
|
152
168
|
granted_by: auth.actor.id
|
|
153
169
|
});
|
|
154
|
-
deps.audit
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
metadata: {
|
|
160
|
-
cell_id: row.cell_id,
|
|
161
|
-
grant_id: row.id,
|
|
162
|
-
level: row.level,
|
|
163
|
-
principal: principal_from_row(row)
|
|
164
|
-
}
|
|
170
|
+
emit_cell_audit(ctx, deps.audit, auth, 'cell_grant_create', {
|
|
171
|
+
cell_id: row.cell_id,
|
|
172
|
+
grant_id: row.id,
|
|
173
|
+
level: row.level,
|
|
174
|
+
principal: principal_from_row(row)
|
|
165
175
|
});
|
|
166
176
|
return { grant: to_grant_json(row) };
|
|
167
177
|
};
|
|
@@ -183,21 +193,30 @@ export const create_cell_grant_actions = (deps) => {
|
|
|
183
193
|
// authority path. Owner-with-self-grant can't happen
|
|
184
194
|
// (`assert_principal_is_not_owner` blocks it at create time).
|
|
185
195
|
const is_self_actor_grant = grant.actor_id !== null && grant.actor_id === auth.actor.id;
|
|
196
|
+
// The steward of a scoped role grant's scope, asked only of a caller with
|
|
197
|
+
// neither of the above — so a manager or self-revoker never consults it.
|
|
198
|
+
const is_steward = !is_manager &&
|
|
199
|
+
!is_self_actor_grant &&
|
|
200
|
+
(await steward_admits_revoke(auth, grant, cell, authorize_grant_revoke, ctx));
|
|
186
201
|
// Grant management is manage-tier only (admin / owner); editor-grant
|
|
187
|
-
// holders cannot revoke grants (mirrors the create gate). The
|
|
188
|
-
//
|
|
189
|
-
|
|
202
|
+
// holders cannot revoke grants (mirrors the create gate). The
|
|
203
|
+
// exceptions are self-revoke and a scope's steward. Non-qualifying
|
|
204
|
+
// callers get the IDOR mask.
|
|
205
|
+
if (!is_manager && !is_self_actor_grant && !is_steward) {
|
|
190
206
|
throw jsonrpc_errors.not_found('cell grant', { reason: ERROR_CELL_GRANT_NOT_FOUND });
|
|
191
207
|
}
|
|
192
|
-
|
|
208
|
+
// A steward's admission was decided on the grant's level, so its delete
|
|
209
|
+
// matches that level: a level change landing in between deletes nothing.
|
|
210
|
+
const deleted = await query_cell_grant_delete(ctx, grant.id, is_steward ? grant.level : undefined);
|
|
193
211
|
if (!deleted) {
|
|
194
|
-
// Raced with another revoker
|
|
195
|
-
// 404 covers the gap.
|
|
212
|
+
// Raced with another revoker, or (a steward's) with a level change.
|
|
213
|
+
// Same shape as cell_actions.ts — 404 covers the gap.
|
|
196
214
|
throw jsonrpc_errors.not_found('cell grant', { reason: ERROR_CELL_GRANT_NOT_FOUND });
|
|
197
215
|
}
|
|
198
|
-
// Recompute admit state against the remaining grants. Always true
|
|
199
|
-
//
|
|
200
|
-
// recompute is uniform shape — let
|
|
216
|
+
// Recompute admit state against the remaining grants. Always true for
|
|
217
|
+
// a manager's revoke; a self-revoker or a steward may have admitted
|
|
218
|
+
// through nothing else, so the recompute is uniform shape — let
|
|
219
|
+
// `can_view_cell` decide.
|
|
201
220
|
const remaining = await query_cell_grant_list_for_cell(ctx, cell.id);
|
|
202
221
|
const still_admitted = can_view_cell(auth, cell, remaining);
|
|
203
222
|
const audit_metadata = {
|
|
@@ -205,29 +224,18 @@ export const create_cell_grant_actions = (deps) => {
|
|
|
205
224
|
grant_id: deleted.id,
|
|
206
225
|
level: deleted.level,
|
|
207
226
|
principal: principal_from_row(deleted),
|
|
208
|
-
...(is_self_actor_grant ? { self: true } : {})
|
|
227
|
+
...(is_self_actor_grant ? { self: true } : {}),
|
|
228
|
+
...(is_steward ? { steward: true } : {})
|
|
209
229
|
};
|
|
210
|
-
deps.audit
|
|
211
|
-
event_type: 'cell_grant_revoke',
|
|
212
|
-
actor_id: auth.actor.id,
|
|
213
|
-
account_id: auth.account.id,
|
|
214
|
-
ip: ctx.client_ip,
|
|
215
|
-
metadata: audit_metadata
|
|
216
|
-
});
|
|
230
|
+
emit_cell_audit(ctx, deps.audit, auth, 'cell_grant_revoke', audit_metadata);
|
|
217
231
|
return { ok: true, still_admitted };
|
|
218
232
|
};
|
|
219
233
|
const list_handler = async (input, ctx) => {
|
|
220
234
|
const auth = ctx.auth;
|
|
221
|
-
const cell = await query_cell_get(ctx, input.cell_id);
|
|
222
|
-
if (!cell) {
|
|
223
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
224
|
-
}
|
|
225
235
|
// Same authz gate as create — manage tier only (admin / owner). The
|
|
226
236
|
// share list is the manager's to curate; viewers and editors alike
|
|
227
237
|
// fall through to the IDOR-mask 404.
|
|
228
|
-
|
|
229
|
-
throw jsonrpc_errors.not_found('cell', { reason: ERROR_CELL_NOT_FOUND });
|
|
230
|
-
}
|
|
238
|
+
const cell = await require_manageable_cell(ctx, auth, input.cell_id);
|
|
231
239
|
const grants = await query_cell_grant_list_for_cell(ctx, cell.id);
|
|
232
240
|
return { grants: grants.map(to_grant_json) };
|
|
233
241
|
};
|
|
@@ -52,9 +52,11 @@ export type CellGrantCreateAuditMetadata = z.infer<typeof CellGrantCreateAuditMe
|
|
|
52
52
|
*
|
|
53
53
|
* `self: true` distinguishes the recipient-side "leave shared cell"
|
|
54
54
|
* path (actor-shaped grant where the principal actor === caller
|
|
55
|
-
* actor) from a delegator-side revoke
|
|
56
|
-
*
|
|
57
|
-
*
|
|
55
|
+
* actor) from a delegator-side revoke, and `steward: true` a scope
|
|
56
|
+
* steward's revoke of a scoped role-shaped grant, admitted by the
|
|
57
|
+
* consumer's `CellGrantRevokeAuthorize`. Single event type for all
|
|
58
|
+
* three — the boolean is enough for forensic review and avoids
|
|
59
|
+
* surface-doubling with parallel events.
|
|
58
60
|
*/
|
|
59
61
|
export declare const CellGrantRevokeAuditMetadata: z.ZodObject<{
|
|
60
62
|
cell_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
@@ -70,6 +72,7 @@ export declare const CellGrantRevokeAuditMetadata: z.ZodObject<{
|
|
|
70
72
|
scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
71
73
|
}, z.core.$loose>]>;
|
|
72
74
|
self: z.ZodOptional<z.ZodLiteral<true>>;
|
|
75
|
+
steward: z.ZodOptional<z.ZodLiteral<true>>;
|
|
73
76
|
}, z.core.$loose>;
|
|
74
77
|
export type CellGrantRevokeAuditMetadata = z.infer<typeof CellGrantRevokeAuditMetadata>;
|
|
75
78
|
//# sourceMappingURL=cell_grant_audit_metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_grant_audit_metadata.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_grant_audit_metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B;;;;;mBAG1C,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAE9F;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;iBAKvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF
|
|
1
|
+
{"version":3,"file":"cell_grant_audit_metadata.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_grant_audit_metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B;;;;;mBAG1C,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAE9F;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;iBAKvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAExF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;iBAOvC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
|
@@ -41,14 +41,17 @@ export const CellGrantCreateAuditMetadata = z.looseObject({
|
|
|
41
41
|
*
|
|
42
42
|
* `self: true` distinguishes the recipient-side "leave shared cell"
|
|
43
43
|
* path (actor-shaped grant where the principal actor === caller
|
|
44
|
-
* actor) from a delegator-side revoke
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* actor) from a delegator-side revoke, and `steward: true` a scope
|
|
45
|
+
* steward's revoke of a scoped role-shaped grant, admitted by the
|
|
46
|
+
* consumer's `CellGrantRevokeAuthorize`. Single event type for all
|
|
47
|
+
* three — the boolean is enough for forensic review and avoids
|
|
48
|
+
* surface-doubling with parallel events.
|
|
47
49
|
*/
|
|
48
50
|
export const CellGrantRevokeAuditMetadata = z.looseObject({
|
|
49
51
|
cell_id: Uuid,
|
|
50
52
|
grant_id: Uuid,
|
|
51
53
|
level: z.enum(['viewer', 'editor']),
|
|
52
54
|
principal: CellGrantPrincipalAuditMetadata,
|
|
53
|
-
self: z.literal(true).optional()
|
|
55
|
+
self: z.literal(true).optional(),
|
|
56
|
+
steward: z.literal(true).optional()
|
|
54
57
|
});
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
*
|
|
28
28
|
* @module
|
|
29
29
|
*/
|
|
30
|
-
import { type RpcAction } from '../actions/
|
|
30
|
+
import { type RpcAction } from '../actions/action_types.js';
|
|
31
31
|
import type { ActionFactoryDeps } from './deps.js';
|
|
32
32
|
import { type ItemJson } from './cell_item_action_specs.js';
|
|
33
33
|
import { type CellItemRow } from '../db/cell_item_queries.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell_item_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_item_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,
|
|
1
|
+
{"version":3,"file":"cell_item_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/cell_item_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAgBN,KAAK,QAAQ,EACb,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAMN,KAAK,WAAW,EAChB,MAAM,4BAA4B,CAAC;AAOpC,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAEnD,eAAO,MAAM,YAAY,GAAI,KAAK,WAAW,KAAG,QAS9C,CAAC;AAOH,iDAAiD;AACjD,eAAO,MAAM,wBAAwB,GAAI,MAAM,kBAAkB,KAAG,KAAK,CAAC,SAAS,CAmHlF,CAAC"}
|