@fuzdev/fuz_app 0.54.0 → 0.56.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 +214 -103
- package/dist/actions/action_bridge.d.ts +8 -5
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_bridge.js +1 -11
- package/dist/actions/action_codegen.d.ts +32 -0
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +35 -15
- package/dist/actions/action_registry.d.ts.map +1 -1
- package/dist/actions/action_registry.js +5 -2
- package/dist/actions/action_rpc.d.ts +141 -22
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +106 -187
- package/dist/actions/action_spec.d.ts +55 -16
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +16 -11
- package/dist/actions/action_types.d.ts +28 -60
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +13 -5
- package/dist/actions/broadcast_api.d.ts +2 -2
- package/dist/actions/broadcast_api.js +2 -2
- package/dist/actions/compile_action_registry.d.ts +50 -0
- package/dist/actions/compile_action_registry.d.ts.map +1 -0
- package/dist/actions/compile_action_registry.js +69 -0
- package/dist/actions/heartbeat.d.ts +8 -4
- package/dist/actions/heartbeat.d.ts.map +1 -1
- package/dist/actions/heartbeat.js +5 -4
- package/dist/actions/perform_action.d.ts +145 -0
- package/dist/actions/perform_action.d.ts.map +1 -0
- package/dist/actions/perform_action.js +258 -0
- package/dist/actions/register_action_ws.d.ts +46 -40
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +101 -159
- package/dist/actions/register_ws_endpoint.d.ts +15 -10
- package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
- package/dist/actions/register_ws_endpoint.js +54 -7
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +0 -4
- package/dist/actions/transports_ws_auth_guard.d.ts +1 -1
- package/dist/actions/transports_ws_auth_guard.js +1 -1
- package/dist/actions/transports_ws_backend.d.ts +1 -1
- package/dist/actions/transports_ws_backend.js +1 -1
- package/dist/auth/CLAUDE.md +794 -410
- package/dist/auth/account_action_specs.d.ts +28 -7
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +7 -7
- package/dist/auth/account_actions.d.ts +7 -13
- package/dist/auth/account_actions.d.ts.map +1 -1
- package/dist/auth/account_actions.js +26 -35
- package/dist/auth/account_queries.d.ts +52 -16
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +87 -38
- package/dist/auth/account_routes.d.ts +9 -11
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +118 -46
- package/dist/auth/account_schema.d.ts +46 -35
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +21 -28
- package/dist/auth/admin_action_specs.d.ts +100 -32
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +64 -33
- package/dist/auth/admin_actions.d.ts +13 -19
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +37 -41
- package/dist/auth/audit_emitter.d.ts +160 -0
- package/dist/auth/audit_emitter.d.ts.map +1 -0
- package/dist/auth/audit_emitter.js +83 -0
- package/dist/auth/audit_log_queries.d.ts +17 -48
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +20 -56
- package/dist/auth/audit_log_routes.d.ts +1 -1
- package/dist/auth/audit_log_routes.d.ts.map +1 -1
- package/dist/auth/audit_log_routes.js +7 -3
- package/dist/auth/audit_log_schema.d.ts +92 -32
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +75 -46
- package/dist/auth/auth_guard_resolver.d.ts +44 -0
- package/dist/auth/auth_guard_resolver.d.ts.map +1 -0
- package/dist/auth/auth_guard_resolver.js +56 -0
- package/dist/auth/bearer_auth.d.ts +9 -7
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +13 -21
- package/dist/auth/bootstrap_account.d.ts +7 -7
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +7 -7
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +11 -10
- package/dist/auth/cleanup.d.ts +20 -26
- package/dist/auth/cleanup.d.ts.map +1 -1
- package/dist/auth/cleanup.js +33 -42
- package/dist/auth/credential_type_schema.d.ts +115 -0
- package/dist/auth/credential_type_schema.d.ts.map +1 -0
- package/dist/auth/credential_type_schema.js +127 -0
- package/dist/auth/daemon_token_middleware.d.ts +23 -11
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +28 -22
- package/dist/auth/ddl.d.ts +2 -2
- package/dist/auth/ddl.d.ts.map +1 -1
- package/dist/auth/ddl.js +6 -6
- package/dist/auth/deps.d.ts +7 -18
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.d.ts +117 -0
- package/dist/auth/grant_path_schema.d.ts.map +1 -0
- package/dist/auth/grant_path_schema.js +137 -0
- package/dist/auth/invite_queries.d.ts +12 -1
- package/dist/auth/invite_queries.d.ts.map +1 -1
- package/dist/auth/invite_queries.js +12 -1
- package/dist/auth/invite_schema.d.ts +1 -1
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/invite_schema.js +1 -1
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +9 -4
- package/dist/auth/migrations.d.ts +37 -14
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +79 -32
- package/dist/auth/request_context.d.ts +331 -61
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +378 -95
- package/dist/auth/{permit_offer_action_specs.d.ts → role_grant_offer_action_specs.d.ts} +163 -94
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -0
- package/dist/auth/role_grant_offer_action_specs.js +262 -0
- package/dist/auth/role_grant_offer_actions.d.ts +104 -0
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -0
- package/dist/auth/role_grant_offer_actions.js +473 -0
- package/dist/auth/{permit_offer_notifications.d.ts → role_grant_offer_notifications.d.ts} +90 -70
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -0
- package/dist/auth/role_grant_offer_notifications.js +182 -0
- package/dist/auth/role_grant_offer_queries.d.ts +242 -0
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -0
- package/dist/auth/role_grant_offer_queries.js +533 -0
- package/dist/auth/role_grant_offer_schema.d.ts +150 -0
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -0
- package/dist/auth/{permit_offer_schema.js → role_grant_offer_schema.js} +60 -36
- package/dist/auth/role_grant_queries.d.ts +231 -0
- package/dist/auth/role_grant_queries.d.ts.map +1 -0
- package/dist/auth/role_grant_queries.js +320 -0
- package/dist/auth/role_schema.d.ts +150 -40
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +144 -45
- package/dist/auth/scope_kind_schema.d.ts +96 -0
- package/dist/auth/scope_kind_schema.d.ts.map +1 -0
- package/dist/auth/scope_kind_schema.js +94 -0
- package/dist/auth/self_service_role_action_specs.d.ts +6 -1
- package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.js +3 -1
- package/dist/auth/self_service_role_actions.d.ts +34 -27
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +68 -48
- package/dist/auth/session_cookie.d.ts +43 -6
- package/dist/auth/session_cookie.d.ts.map +1 -1
- package/dist/auth/session_cookie.js +31 -5
- package/dist/auth/session_middleware.d.ts +37 -3
- package/dist/auth/session_middleware.d.ts.map +1 -1
- package/dist/auth/session_middleware.js +33 -7
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +48 -19
- package/dist/auth/standard_action_specs.d.ts +2 -2
- package/dist/auth/standard_action_specs.js +4 -4
- package/dist/auth/standard_rpc_actions.d.ts +23 -19
- package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
- package/dist/auth/standard_rpc_actions.js +12 -12
- package/dist/db/migrate.d.ts +12 -8
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +10 -7
- package/dist/dev/setup.d.ts +2 -2
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +9 -7
- package/dist/env/load.d.ts +1 -1
- package/dist/env/load.js +1 -1
- package/dist/hono_context.d.ts +64 -5
- package/dist/hono_context.d.ts.map +1 -1
- package/dist/hono_context.js +38 -2
- package/dist/http/CLAUDE.md +264 -87
- package/dist/http/auth_shape.d.ts +191 -0
- package/dist/http/auth_shape.d.ts.map +1 -0
- package/dist/http/auth_shape.js +237 -0
- package/dist/http/common_routes.js +3 -3
- package/dist/http/db_routes.d.ts +4 -0
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +44 -7
- package/dist/http/error_schemas.d.ts +132 -19
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +132 -40
- package/dist/http/jsonrpc_errors.d.ts +27 -2
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +26 -2
- package/dist/http/pending_effects.d.ts +71 -18
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +87 -18
- package/dist/http/proxy.d.ts +52 -5
- package/dist/http/proxy.d.ts.map +1 -1
- package/dist/http/proxy.js +92 -14
- package/dist/http/route_spec.d.ts +113 -41
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +130 -52
- package/dist/http/schema_helpers.d.ts +3 -2
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +9 -2
- package/dist/http/surface.d.ts +2 -1
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +1 -2
- package/dist/http/surface_query.d.ts +39 -35
- package/dist/http/surface_query.d.ts.map +1 -1
- package/dist/http/surface_query.js +79 -36
- package/dist/primitive_schemas.d.ts +39 -0
- package/dist/primitive_schemas.d.ts.map +1 -0
- package/dist/primitive_schemas.js +40 -0
- package/dist/realtime/sse_auth_guard.d.ts +5 -5
- package/dist/realtime/sse_auth_guard.js +9 -9
- package/dist/runtime/mock.d.ts +1 -1
- package/dist/runtime/mock.js +1 -1
- package/dist/server/app_backend.d.ts +14 -11
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_backend.js +12 -8
- package/dist/server/app_server.d.ts +7 -7
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +36 -31
- package/dist/server/validate_nginx.d.ts +1 -1
- package/dist/server/validate_nginx.js +1 -1
- package/dist/testing/CLAUDE.md +73 -55
- package/dist/testing/admin_integration.d.ts +5 -6
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +100 -96
- package/dist/testing/adversarial_headers.js +1 -1
- package/dist/testing/app_server.d.ts +11 -14
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +18 -17
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +2 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/attack_surface.js +15 -9
- package/dist/testing/audit_completeness.d.ts +2 -2
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +53 -39
- package/dist/testing/auth_apps.d.ts +5 -4
- package/dist/testing/auth_apps.d.ts.map +1 -1
- package/dist/testing/auth_apps.js +28 -22
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +5 -5
- package/dist/testing/db.d.ts +1 -1
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +4 -4
- package/dist/testing/db_entities.d.ts +22 -0
- package/dist/testing/db_entities.d.ts.map +1 -0
- package/dist/testing/db_entities.js +28 -0
- package/dist/testing/entities.d.ts +10 -8
- package/dist/testing/entities.d.ts.map +1 -1
- package/dist/testing/entities.js +22 -18
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +13 -14
- package/dist/testing/integration_helpers.d.ts +8 -6
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +29 -23
- package/dist/testing/middleware.d.ts +15 -11
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +75 -32
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +40 -24
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +3 -1
- package/dist/testing/rpc_round_trip.d.ts +1 -1
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +14 -13
- package/dist/testing/sse_round_trip.d.ts +3 -4
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +7 -11
- package/dist/testing/standard.d.ts +1 -1
- package/dist/testing/stubs.d.ts +25 -0
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +43 -2
- package/dist/testing/surface_invariants.d.ts +2 -2
- package/dist/testing/ws_round_trip.d.ts +12 -13
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +24 -12
- package/dist/ui/AdminAccounts.svelte +23 -20
- package/dist/ui/AdminOverview.svelte +15 -13
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
- package/dist/ui/{AdminPermitHistory.svelte → AdminRoleGrantHistory.svelte} +12 -12
- package/dist/ui/AdminRoleGrantHistory.svelte.d.ts +4 -0
- package/dist/ui/AdminRoleGrantHistory.svelte.d.ts.map +1 -0
- package/dist/ui/BootstrapForm.svelte +1 -1
- package/dist/ui/CLAUDE.md +65 -59
- package/dist/ui/{PermitOfferForm.svelte → RoleGrantOfferForm.svelte} +37 -22
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts +20 -0
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -0
- package/dist/ui/{PermitOfferHistory.svelte → RoleGrantOfferHistory.svelte} +12 -12
- package/dist/ui/{PermitOfferHistory.svelte.d.ts → RoleGrantOfferHistory.svelte.d.ts} +4 -4
- package/dist/ui/RoleGrantOfferHistory.svelte.d.ts.map +1 -0
- package/dist/ui/{PermitOfferInbox.svelte → RoleGrantOfferInbox.svelte} +14 -14
- package/dist/ui/{PermitOfferInbox.svelte.d.ts → RoleGrantOfferInbox.svelte.d.ts} +4 -4
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -0
- package/dist/ui/SignupForm.svelte +1 -1
- package/dist/ui/SurfaceExplorer.svelte +35 -15
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts +2 -3
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.js +2 -3
- package/dist/ui/admin_accounts_state.svelte.d.ts +25 -18
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +28 -17
- package/dist/ui/admin_rpc_adapters.d.ts +20 -20
- package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.js +17 -17
- package/dist/ui/admin_sessions_state.svelte.d.ts +2 -2
- package/dist/ui/admin_sessions_state.svelte.js +2 -2
- package/dist/ui/audit_log_state.svelte.d.ts +7 -7
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +6 -6
- package/dist/ui/auth_state.svelte.d.ts +3 -3
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/auth_state.svelte.js +6 -6
- package/dist/ui/format_scope.d.ts +2 -2
- package/dist/ui/format_scope.js +2 -2
- package/dist/ui/{permit_offers_state.svelte.d.ts → role_grant_offers_state.svelte.d.ts} +39 -31
- package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -0
- package/dist/ui/{permit_offers_state.svelte.js → role_grant_offers_state.svelte.js} +25 -19
- package/dist/ui/ui_format.js +2 -2
- package/package.json +3 -3
- package/dist/auth/permit_offer_action_specs.d.ts.map +0 -1
- package/dist/auth/permit_offer_action_specs.js +0 -227
- package/dist/auth/permit_offer_actions.d.ts +0 -110
- package/dist/auth/permit_offer_actions.d.ts.map +0 -1
- package/dist/auth/permit_offer_actions.js +0 -452
- package/dist/auth/permit_offer_notifications.d.ts.map +0 -1
- package/dist/auth/permit_offer_notifications.js +0 -182
- package/dist/auth/permit_offer_queries.d.ts +0 -183
- package/dist/auth/permit_offer_queries.d.ts.map +0 -1
- package/dist/auth/permit_offer_queries.js +0 -408
- package/dist/auth/permit_offer_schema.d.ts +0 -103
- package/dist/auth/permit_offer_schema.d.ts.map +0 -1
- package/dist/auth/permit_queries.d.ts +0 -210
- package/dist/auth/permit_queries.d.ts.map +0 -1
- package/dist/auth/permit_queries.js +0 -294
- package/dist/auth/require_keeper.d.ts +0 -20
- package/dist/auth/require_keeper.d.ts.map +0 -1
- package/dist/auth/require_keeper.js +0 -35
- package/dist/auth/route_guards.d.ts +0 -21
- package/dist/auth/route_guards.d.ts.map +0 -1
- package/dist/auth/route_guards.js +0 -32
- package/dist/auth/session_lifecycle.d.ts +0 -37
- package/dist/auth/session_lifecycle.d.ts.map +0 -1
- package/dist/auth/session_lifecycle.js +0 -29
- package/dist/ui/AdminPermitHistory.svelte.d.ts +0 -4
- package/dist/ui/AdminPermitHistory.svelte.d.ts.map +0 -1
- package/dist/ui/PermitOfferForm.svelte.d.ts +0 -14
- package/dist/ui/PermitOfferForm.svelte.d.ts.map +0 -1
- package/dist/ui/PermitOfferHistory.svelte.d.ts.map +0 -1
- package/dist/ui/PermitOfferInbox.svelte.d.ts.map +0 -1
- package/dist/ui/permit_offers_state.svelte.d.ts.map +0 -1
|
@@ -14,12 +14,12 @@ import { Uuid } from '@fuzdev/fuz_util/id.js';
|
|
|
14
14
|
* Not a security boundary — in-process code has many other paths to subvert
|
|
15
15
|
* audit logging.
|
|
16
16
|
*/
|
|
17
|
-
export declare const AUDIT_EVENT_TYPES: readonly ["login", "logout", "bootstrap", "signup", "password_change", "session_revoke", "session_revoke_all", "token_create", "token_revoke", "token_revoke_all", "
|
|
17
|
+
export declare const AUDIT_EVENT_TYPES: readonly ["login", "logout", "bootstrap", "signup", "password_change", "session_revoke", "session_revoke_all", "token_create", "token_revoke", "token_revoke_all", "role_grant_create", "role_grant_revoke", "role_grant_offer_create", "role_grant_offer_accept", "role_grant_offer_decline", "role_grant_offer_retract", "role_grant_offer_expire", "role_grant_offer_supersede", "invite_create", "invite_delete", "app_settings_update"];
|
|
18
18
|
/** Zod schema for audit event types. */
|
|
19
19
|
export declare const AuditEventType: z.ZodEnum<{
|
|
20
|
+
bootstrap: "bootstrap";
|
|
20
21
|
login: "login";
|
|
21
22
|
logout: "logout";
|
|
22
|
-
bootstrap: "bootstrap";
|
|
23
23
|
signup: "signup";
|
|
24
24
|
password_change: "password_change";
|
|
25
25
|
session_revoke: "session_revoke";
|
|
@@ -27,14 +27,14 @@ export declare const AuditEventType: z.ZodEnum<{
|
|
|
27
27
|
token_create: "token_create";
|
|
28
28
|
token_revoke: "token_revoke";
|
|
29
29
|
token_revoke_all: "token_revoke_all";
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
role_grant_create: "role_grant_create";
|
|
31
|
+
role_grant_revoke: "role_grant_revoke";
|
|
32
|
+
role_grant_offer_create: "role_grant_offer_create";
|
|
33
|
+
role_grant_offer_accept: "role_grant_offer_accept";
|
|
34
|
+
role_grant_offer_decline: "role_grant_offer_decline";
|
|
35
|
+
role_grant_offer_retract: "role_grant_offer_retract";
|
|
36
|
+
role_grant_offer_expire: "role_grant_offer_expire";
|
|
37
|
+
role_grant_offer_supersede: "role_grant_offer_supersede";
|
|
38
38
|
invite_create: "invite_create";
|
|
39
39
|
invite_delete: "invite_delete";
|
|
40
40
|
app_settings_update: "app_settings_update";
|
|
@@ -74,9 +74,15 @@ export declare const AUDIT_METADATA_SCHEMAS: Readonly<{
|
|
|
74
74
|
username: z.ZodString;
|
|
75
75
|
invite_id: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
76
76
|
open_signup: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
78
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
77
79
|
}, z.core.$loose>;
|
|
78
80
|
password_change: z.ZodNullable<z.ZodObject<{
|
|
79
|
-
sessions_revoked: z.ZodNumber
|
|
81
|
+
sessions_revoked: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
tokens_revoked: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
84
|
+
concurrent_change: "concurrent_change";
|
|
85
|
+
}>>;
|
|
80
86
|
}, z.core.$loose>>;
|
|
81
87
|
session_revoke: z.ZodObject<{
|
|
82
88
|
session_id: z.ZodString;
|
|
@@ -98,55 +104,55 @@ export declare const AUDIT_METADATA_SCHEMAS: Readonly<{
|
|
|
98
104
|
reason: z.ZodOptional<z.ZodString>;
|
|
99
105
|
attempted_account_id: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
100
106
|
}, z.core.$loose>;
|
|
101
|
-
|
|
107
|
+
role_grant_create: z.ZodObject<{
|
|
102
108
|
role: z.ZodString;
|
|
103
|
-
|
|
109
|
+
role_grant_id: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
104
110
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
105
111
|
source_offer_id: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
106
112
|
self_service: z.ZodOptional<z.ZodBoolean>;
|
|
107
113
|
}, z.core.$loose>;
|
|
108
|
-
|
|
114
|
+
role_grant_revoke: z.ZodObject<{
|
|
109
115
|
role: z.ZodString;
|
|
110
|
-
|
|
116
|
+
role_grant_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
111
117
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
112
118
|
reason: z.ZodOptional<z.ZodString>;
|
|
113
119
|
self_service: z.ZodOptional<z.ZodBoolean>;
|
|
114
120
|
}, z.core.$loose>;
|
|
115
|
-
|
|
121
|
+
role_grant_offer_create: z.ZodObject<{
|
|
116
122
|
offer_id: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
117
123
|
role: z.ZodString;
|
|
118
124
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
119
125
|
to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
120
126
|
}, z.core.$loose>;
|
|
121
|
-
|
|
127
|
+
role_grant_offer_accept: z.ZodObject<{
|
|
122
128
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
123
|
-
|
|
129
|
+
role_grant_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
124
130
|
role: z.ZodString;
|
|
125
131
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
126
132
|
}, z.core.$loose>;
|
|
127
|
-
|
|
133
|
+
role_grant_offer_decline: z.ZodObject<{
|
|
128
134
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
129
135
|
role: z.ZodString;
|
|
130
136
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
131
137
|
reason: z.ZodOptional<z.ZodString>;
|
|
132
138
|
}, z.core.$loose>;
|
|
133
|
-
|
|
139
|
+
role_grant_offer_retract: z.ZodObject<{
|
|
134
140
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
135
141
|
role: z.ZodString;
|
|
136
142
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
137
143
|
}, z.core.$loose>;
|
|
138
|
-
|
|
144
|
+
role_grant_offer_expire: z.ZodObject<{
|
|
139
145
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
140
146
|
role: z.ZodString;
|
|
141
147
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
142
148
|
}, z.core.$loose>;
|
|
143
|
-
|
|
149
|
+
role_grant_offer_supersede: z.ZodObject<{
|
|
144
150
|
offer_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
145
151
|
role: z.ZodString;
|
|
146
152
|
scope_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
147
153
|
reason: z.ZodEnum<{
|
|
148
154
|
sibling_accepted: "sibling_accepted";
|
|
149
|
-
|
|
155
|
+
role_grant_revoked: "role_grant_revoked";
|
|
150
156
|
scope_destroyed: "scope_destroyed";
|
|
151
157
|
}>;
|
|
152
158
|
cause_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
@@ -175,9 +181,59 @@ export interface AuditLogEvent {
|
|
|
175
181
|
seq: number;
|
|
176
182
|
event_type: AuditEventTypeName;
|
|
177
183
|
outcome: AuditOutcome;
|
|
184
|
+
/**
|
|
185
|
+
* Operator (the actor that initiated the event) — populated when the
|
|
186
|
+
* request resolved an acting actor.
|
|
187
|
+
*
|
|
188
|
+
* Resolution is driven per-request by the route-spec wrapper / RPC
|
|
189
|
+
* dispatcher; a route gets an acting actor when its input schema
|
|
190
|
+
* declares `acting?: ActingActor` or its auth requires role_grants
|
|
191
|
+
* (`role` / `keeper`). Account-grain operations declare neither,
|
|
192
|
+
* so no actor is resolved and `actor_id` is null: login (also
|
|
193
|
+
* pre-credential), logout, signup, bootstrap, password_change,
|
|
194
|
+
* session/token revoke, app_settings_update, invite events.
|
|
195
|
+
* Role grant events, admin actions, and actor-targeted offers
|
|
196
|
+
* populate this with the initiator's actor.
|
|
197
|
+
*/
|
|
178
198
|
actor_id: Uuid | null;
|
|
179
199
|
account_id: Uuid | null;
|
|
180
200
|
target_account_id: Uuid | null;
|
|
201
|
+
/**
|
|
202
|
+
* Actor-grain target — populated when the event subject is bound to
|
|
203
|
+
* a specific actor.
|
|
204
|
+
*
|
|
205
|
+
* Concretely:
|
|
206
|
+
* - Always populated: `role_grant_revoke` and `role_grant_create`
|
|
207
|
+
* (admin direct-grant, self-service toggle, and in-tx
|
|
208
|
+
* `role_grant_offer_accept` all populate both target columns — the
|
|
209
|
+
* role_grant's grantee is the actor-grain subject regardless of who
|
|
210
|
+
* initiated the grant), `role_grant_offer_accept` on accept (the
|
|
211
|
+
* accept binds the actor deterministically), `role_grant_offer_decline`
|
|
212
|
+
* (the grantor actor — decline is *to* the offering actor).
|
|
213
|
+
* - Conditionally populated: offer-shape events
|
|
214
|
+
* (`role_grant_offer_create`, `_expire`, `_retract`, `_supersede`)
|
|
215
|
+
* carry the actor when the offer was actor-targeted at create time
|
|
216
|
+
* (`role_grant_offer.to_actor_id` set), null when the offer was
|
|
217
|
+
* account-grain (any actor on `to_account_id` may accept).
|
|
218
|
+
* - Not populated: admin actions, account-shape events (login,
|
|
219
|
+
* logout, signup, bootstrap, password_change, session/token
|
|
220
|
+
* revoke, app_settings_update, invite events) — subject is the
|
|
221
|
+
* account or no specific resource, not an actor-bound role_grant.
|
|
222
|
+
* - Not populated: events whose principal isn't an actor-bound
|
|
223
|
+
* resource (e.g. consumer events that name a non-actor scope in
|
|
224
|
+
* metadata).
|
|
225
|
+
*
|
|
226
|
+
* Multi-actor invariants this column relies on: when both
|
|
227
|
+
* `target_actor_id` and `target_account_id` are populated they refer
|
|
228
|
+
* to the same account (`actor.account_id`-derivable). The invariant
|
|
229
|
+
* holds uniformly across every populated event including decline
|
|
230
|
+
* (the grantor's account is joined into the decline RETURNING) and
|
|
231
|
+
* the supersede cascade (the recipient account is known on
|
|
232
|
+
* `role_grant_offer.to_account_id`). `target_account_id` stays the
|
|
233
|
+
* SSE/WS socket-close key because sessions remain account-grain
|
|
234
|
+
* after multi-actor lands.
|
|
235
|
+
*/
|
|
236
|
+
target_actor_id: Uuid | null;
|
|
181
237
|
ip: string | null;
|
|
182
238
|
created_at: string;
|
|
183
239
|
metadata: Record<string, unknown> | null;
|
|
@@ -197,6 +253,7 @@ export interface AuditLogInput<T extends string = AuditEventType> {
|
|
|
197
253
|
actor_id?: Uuid | null;
|
|
198
254
|
account_id?: Uuid | null;
|
|
199
255
|
target_account_id?: Uuid | null;
|
|
256
|
+
target_actor_id?: Uuid | null;
|
|
200
257
|
ip?: string | null;
|
|
201
258
|
/**
|
|
202
259
|
* Per-event-type metadata. Builtin `T` narrows to `AuditMetadataMap[T]`;
|
|
@@ -210,8 +267,8 @@ export interface AuditLogInput<T extends string = AuditEventType> {
|
|
|
210
267
|
*
|
|
211
268
|
* Lets consumers extend the closed `AUDIT_EVENT_TYPES` enum with their own
|
|
212
269
|
* event strings (and metadata Zod schemas) without forking. Pass to
|
|
213
|
-
* `
|
|
214
|
-
* argument; both default to `BUILTIN_AUDIT_LOG_CONFIG`.
|
|
270
|
+
* `create_audit_emitter` (or `query_audit_log` for in-tx call sites) as the
|
|
271
|
+
* optional `config` argument; both default to `BUILTIN_AUDIT_LOG_CONFIG`.
|
|
215
272
|
*
|
|
216
273
|
* The DB column is `TEXT NOT NULL` and never enforced an enum, so consumer
|
|
217
274
|
* event types round-trip through `query_audit_log_list` and SSE identically
|
|
@@ -252,9 +309,9 @@ export interface CreateAuditLogConfigOptions {
|
|
|
252
309
|
* Throws when an `extra_events` key collides with a builtin event type, or
|
|
253
310
|
* fails `AuditEventTypeName` format validation.
|
|
254
311
|
*
|
|
255
|
-
* Call once at startup; pass the result to
|
|
256
|
-
* `
|
|
257
|
-
* pick up `BUILTIN_AUDIT_LOG_CONFIG`.
|
|
312
|
+
* Call once at startup; pass the result to `create_app_backend` (which
|
|
313
|
+
* threads it into `AppDeps.audit`). Builtin handlers omit the
|
|
314
|
+
* `audit_log_config` slot and pick up `BUILTIN_AUDIT_LOG_CONFIG`.
|
|
258
315
|
*
|
|
259
316
|
* @throws Error when an `extra_events` key collides with a builtin event type or fails `AuditEventTypeName` format validation
|
|
260
317
|
*/
|
|
@@ -298,6 +355,7 @@ export declare const AuditLogEventJson: z.ZodObject<{
|
|
|
298
355
|
actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
299
356
|
account_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
300
357
|
target_account_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
358
|
+
target_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
301
359
|
ip: z.ZodNullable<z.ZodString>;
|
|
302
360
|
created_at: z.ZodString;
|
|
303
361
|
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -315,6 +373,7 @@ export declare const AuditLogEventWithUsernamesJson: z.ZodObject<{
|
|
|
315
373
|
actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
316
374
|
account_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
317
375
|
target_account_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
376
|
+
target_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
318
377
|
ip: z.ZodNullable<z.ZodString>;
|
|
319
378
|
created_at: z.ZodString;
|
|
320
379
|
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -322,8 +381,8 @@ export declare const AuditLogEventWithUsernamesJson: z.ZodObject<{
|
|
|
322
381
|
target_username: z.ZodNullable<z.ZodString>;
|
|
323
382
|
}, z.core.$strict>;
|
|
324
383
|
export type AuditLogEventWithUsernamesJson = z.infer<typeof AuditLogEventWithUsernamesJson>;
|
|
325
|
-
/** Zod schema for
|
|
326
|
-
export declare const
|
|
384
|
+
/** Zod schema for role_grant history events with resolved usernames. */
|
|
385
|
+
export declare const RoleGrantHistoryEventJson: z.ZodObject<{
|
|
327
386
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
328
387
|
seq: z.ZodNumber;
|
|
329
388
|
event_type: z.ZodString;
|
|
@@ -334,13 +393,14 @@ export declare const PermitHistoryEventJson: z.ZodObject<{
|
|
|
334
393
|
actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
335
394
|
account_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
336
395
|
target_account_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
396
|
+
target_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
337
397
|
ip: z.ZodNullable<z.ZodString>;
|
|
338
398
|
created_at: z.ZodString;
|
|
339
399
|
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
340
400
|
username: z.ZodNullable<z.ZodString>;
|
|
341
401
|
target_username: z.ZodNullable<z.ZodString>;
|
|
342
402
|
}, z.core.$strict>;
|
|
343
|
-
export type
|
|
403
|
+
export type RoleGrantHistoryEventJson = z.infer<typeof RoleGrantHistoryEventJson>;
|
|
344
404
|
/** Zod schema for admin session listing (session + username). */
|
|
345
405
|
export declare const AdminSessionJson: z.ZodObject<{
|
|
346
406
|
id: z.ZodString;
|
|
@@ -351,6 +411,6 @@ export declare const AdminSessionJson: z.ZodObject<{
|
|
|
351
411
|
username: z.ZodString;
|
|
352
412
|
}, z.core.$strict>;
|
|
353
413
|
export type AdminSessionJson = z.infer<typeof AdminSessionJson>;
|
|
354
|
-
export declare const AUDIT_LOG_SCHEMA = "\nCREATE TABLE IF NOT EXISTS audit_log (\n id UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n seq SERIAL NOT NULL,\n event_type TEXT NOT NULL,\n outcome TEXT NOT NULL DEFAULT 'success',\n actor_id UUID REFERENCES actor(id) ON DELETE SET NULL,\n account_id UUID REFERENCES account(id) ON DELETE SET NULL,\n target_account_id UUID REFERENCES account(id) ON DELETE SET NULL,\n ip TEXT,\n created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n metadata JSONB\n)";
|
|
414
|
+
export declare const AUDIT_LOG_SCHEMA = "\nCREATE TABLE IF NOT EXISTS audit_log (\n id UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n seq SERIAL NOT NULL,\n event_type TEXT NOT NULL,\n outcome TEXT NOT NULL DEFAULT 'success',\n actor_id UUID REFERENCES actor(id) ON DELETE SET NULL,\n account_id UUID REFERENCES account(id) ON DELETE SET NULL,\n target_account_id UUID REFERENCES account(id) ON DELETE SET NULL,\n target_actor_id UUID REFERENCES actor(id) ON DELETE SET NULL,\n ip TEXT,\n created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n metadata JSONB\n)";
|
|
355
415
|
export declare const AUDIT_LOG_INDEXES: string[];
|
|
356
416
|
//# sourceMappingURL=audit_log_schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"audit_log_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_schema.ts"],"names":[],"mappings":"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"}
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { Uuid } from '@fuzdev/fuz_util/id.js';
|
|
11
|
+
import { Blake3Hash } from '@fuzdev/fuz_util/hash_blake3.js';
|
|
11
12
|
import { AuthSessionJson } from './account_schema.js';
|
|
13
|
+
import { Email } from '../primitive_schemas.js';
|
|
14
|
+
import { ApiTokenId } from './api_token.js';
|
|
12
15
|
/**
|
|
13
16
|
* All tracked auth event types. Frozen to convert accidental in-process
|
|
14
17
|
* mutation (test cross-contamination, cast escapes) into loud TypeErrors.
|
|
@@ -26,14 +29,14 @@ export const AUDIT_EVENT_TYPES = Object.freeze([
|
|
|
26
29
|
'token_create',
|
|
27
30
|
'token_revoke',
|
|
28
31
|
'token_revoke_all',
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
32
|
+
'role_grant_create',
|
|
33
|
+
'role_grant_revoke',
|
|
34
|
+
'role_grant_offer_create',
|
|
35
|
+
'role_grant_offer_accept',
|
|
36
|
+
'role_grant_offer_decline',
|
|
37
|
+
'role_grant_offer_retract',
|
|
38
|
+
'role_grant_offer_expire',
|
|
39
|
+
'role_grant_offer_supersede',
|
|
37
40
|
'invite_create',
|
|
38
41
|
'invite_delete',
|
|
39
42
|
'app_settings_update',
|
|
@@ -72,23 +75,35 @@ export const AUDIT_METADATA_SCHEMAS = Object.freeze({
|
|
|
72
75
|
})
|
|
73
76
|
.nullable(),
|
|
74
77
|
signup: z.looseObject({
|
|
75
|
-
username: z.string().meta({ description: 'Username
|
|
78
|
+
username: z.string().meta({ description: 'Username submitted at signup.' }),
|
|
76
79
|
invite_id: Uuid.optional().meta({
|
|
77
|
-
description: 'Invite consumed by this signup
|
|
80
|
+
description: 'Invite consumed by this signup. Set on success and on `race_lost` / `signup_conflict` failure rows when an invite was matched at attempt time.',
|
|
78
81
|
}),
|
|
79
82
|
open_signup: z.boolean().optional().meta({
|
|
80
|
-
description: 'True when the signup occurred via the `open_signup` setting (no invite required).',
|
|
83
|
+
description: 'True when the signup occurred via the `open_signup` setting (no invite required). Set on success rows under `open_signup` and on failure rows when the attempt was made under `open_signup`.',
|
|
84
|
+
}),
|
|
85
|
+
reason: z.string().optional().meta({
|
|
86
|
+
description: 'Failure category: `no_match` (no unclaimed invite matched), `race_lost` (invite was claimed between find and claim), `signup_conflict` (username/email already exists). Set only on `outcome=failure`.',
|
|
87
|
+
}),
|
|
88
|
+
email: Email.optional().meta({
|
|
89
|
+
description: 'Email submitted at signup — recorded on failure rows for forensic correlation. Omitted on success rows because the email is already tied to the resulting account.',
|
|
81
90
|
}),
|
|
82
91
|
}),
|
|
83
92
|
password_change: z
|
|
84
93
|
.looseObject({
|
|
85
|
-
sessions_revoked: z
|
|
86
|
-
.
|
|
87
|
-
|
|
94
|
+
sessions_revoked: z.number().optional().meta({
|
|
95
|
+
description: 'Number of sessions revoked as a side effect of the password change. Present on `outcome=success`.',
|
|
96
|
+
}),
|
|
97
|
+
tokens_revoked: z.number().optional().meta({
|
|
98
|
+
description: 'Number of API tokens revoked as a side effect of the password change. Present on `outcome=success`.',
|
|
99
|
+
}),
|
|
100
|
+
reason: z.enum(['concurrent_change']).optional().meta({
|
|
101
|
+
description: 'Failure category. `concurrent_change` indicates another password change committed first against the same starting hash (verify-write race loser). Absent for typed-wrong-password failures.',
|
|
102
|
+
}),
|
|
88
103
|
})
|
|
89
104
|
.nullable(),
|
|
90
105
|
session_revoke: z.looseObject({
|
|
91
|
-
session_id:
|
|
106
|
+
session_id: Blake3Hash.meta({ description: 'Blake3 hash identifying the revoked session row.' }),
|
|
92
107
|
}),
|
|
93
108
|
session_revoke_all: z.looseObject({
|
|
94
109
|
// Omitted on `outcome='failure'` (no revocation attempted — e.g. target
|
|
@@ -107,11 +122,11 @@ export const AUDIT_METADATA_SCHEMAS = Object.freeze({
|
|
|
107
122
|
}),
|
|
108
123
|
}),
|
|
109
124
|
token_create: z.looseObject({
|
|
110
|
-
token_id:
|
|
125
|
+
token_id: ApiTokenId.meta({ description: 'Public id of the created API token (`tok_…`).' }),
|
|
111
126
|
name: z.string().meta({ description: 'Operator-supplied label for the token.' }),
|
|
112
127
|
}),
|
|
113
128
|
token_revoke: z.looseObject({
|
|
114
|
-
token_id:
|
|
129
|
+
token_id: ApiTokenId.meta({ description: 'Public id of the revoked API token (`tok_…`).' }),
|
|
115
130
|
}),
|
|
116
131
|
token_revoke_all: z.looseObject({
|
|
117
132
|
// Same shape as `session_revoke_all` for failures.
|
|
@@ -126,19 +141,19 @@ export const AUDIT_METADATA_SCHEMAS = Object.freeze({
|
|
|
126
141
|
description: 'Probed account id when the target lookup missed (FK constraint forces `target_account_id` to null).',
|
|
127
142
|
}),
|
|
128
143
|
}),
|
|
129
|
-
// `
|
|
130
|
-
// (e.g.
|
|
144
|
+
// `role_grant_id` is optional on `role_grant_create` because failed grants
|
|
145
|
+
// (e.g. admin-grant-path denied) never produce a role_grant row.
|
|
131
146
|
// `self_service: true` is set by the self-service role toggle in
|
|
132
147
|
// `self_service_role_actions.ts` — declared explicitly rather than
|
|
133
148
|
// riding on `z.looseObject` permissiveness so the field is part of
|
|
134
149
|
// the documented schema surface.
|
|
135
|
-
|
|
150
|
+
role_grant_create: z.looseObject({
|
|
136
151
|
role: z.string().meta({ description: 'Role being granted.' }),
|
|
137
|
-
|
|
138
|
-
description: 'Id of the resulting
|
|
152
|
+
role_grant_id: Uuid.optional().meta({
|
|
153
|
+
description: 'Id of the resulting role_grant row. Omitted when the grant failed (e.g. admin-grant-path denial).',
|
|
139
154
|
}),
|
|
140
155
|
scope_id: Uuid.nullish().meta({
|
|
141
|
-
description: 'Scope of the granted
|
|
156
|
+
description: 'Scope of the granted role_grant; null for global role_grants.',
|
|
142
157
|
}),
|
|
143
158
|
source_offer_id: Uuid.optional().meta({
|
|
144
159
|
description: 'Offer this grant resolved, when the grant originated from an accepted offer.',
|
|
@@ -147,11 +162,11 @@ export const AUDIT_METADATA_SCHEMAS = Object.freeze({
|
|
|
147
162
|
description: 'True when the grant came from the self-service role toggle.',
|
|
148
163
|
}),
|
|
149
164
|
}),
|
|
150
|
-
|
|
165
|
+
role_grant_revoke: z.looseObject({
|
|
151
166
|
role: z.string().meta({ description: 'Role being revoked.' }),
|
|
152
|
-
|
|
167
|
+
role_grant_id: Uuid.meta({ description: 'Id of the revoked role_grant row.' }),
|
|
153
168
|
scope_id: Uuid.nullish().meta({
|
|
154
|
-
description: 'Scope of the revoked
|
|
169
|
+
description: 'Scope of the revoked role_grant; null for global role_grants.',
|
|
155
170
|
}),
|
|
156
171
|
reason: z
|
|
157
172
|
.string()
|
|
@@ -161,9 +176,9 @@ export const AUDIT_METADATA_SCHEMAS = Object.freeze({
|
|
|
161
176
|
description: 'True when the revoke came from the self-service role toggle.',
|
|
162
177
|
}),
|
|
163
178
|
}),
|
|
164
|
-
// `offer_id` is optional because failed creates (e.g.
|
|
179
|
+
// `offer_id` is optional because failed creates (e.g. admin-grant-path
|
|
165
180
|
// denied, `authorize` callback denied) never produce an offer row.
|
|
166
|
-
|
|
181
|
+
role_grant_offer_create: z.looseObject({
|
|
167
182
|
offer_id: Uuid.optional().meta({
|
|
168
183
|
description: 'Id of the created offer row. Omitted when the create failed before insert.',
|
|
169
184
|
}),
|
|
@@ -173,17 +188,17 @@ export const AUDIT_METADATA_SCHEMAS = Object.freeze({
|
|
|
173
188
|
}),
|
|
174
189
|
to_account_id: Uuid.meta({ description: 'Account the offer is directed to.' }),
|
|
175
190
|
}),
|
|
176
|
-
// `
|
|
177
|
-
// design: offer-lifecycle audit +
|
|
178
|
-
|
|
191
|
+
// `role_grant_create` is emitted alongside on accept — two events per accept by
|
|
192
|
+
// design: offer-lifecycle audit + role-grant-lifecycle audit.
|
|
193
|
+
role_grant_offer_accept: z.looseObject({
|
|
179
194
|
offer_id: Uuid.meta({ description: 'Id of the accepted offer.' }),
|
|
180
|
-
|
|
195
|
+
role_grant_id: Uuid.meta({ description: 'Id of the resulting role_grant row.' }),
|
|
181
196
|
role: z.string().meta({ description: 'Role granted by the offer.' }),
|
|
182
197
|
scope_id: Uuid.nullish().meta({
|
|
183
|
-
description: 'Scope of the resulting
|
|
198
|
+
description: 'Scope of the resulting role_grant; null for global role_grants.',
|
|
184
199
|
}),
|
|
185
200
|
}),
|
|
186
|
-
|
|
201
|
+
role_grant_offer_decline: z.looseObject({
|
|
187
202
|
offer_id: Uuid.meta({ description: 'Id of the declined offer.' }),
|
|
188
203
|
role: z.string().meta({ description: 'Role that was offered.' }),
|
|
189
204
|
scope_id: Uuid.nullish().meta({
|
|
@@ -194,14 +209,14 @@ export const AUDIT_METADATA_SCHEMAS = Object.freeze({
|
|
|
194
209
|
.optional()
|
|
195
210
|
.meta({ description: 'Optional decline reason text from the recipient.' }),
|
|
196
211
|
}),
|
|
197
|
-
|
|
212
|
+
role_grant_offer_retract: z.looseObject({
|
|
198
213
|
offer_id: Uuid.meta({ description: 'Id of the retracted offer.' }),
|
|
199
214
|
role: z.string().meta({ description: 'Role that was offered.' }),
|
|
200
215
|
scope_id: Uuid.nullish().meta({
|
|
201
216
|
description: 'Scope of the offered role; null for global offers.',
|
|
202
217
|
}),
|
|
203
218
|
}),
|
|
204
|
-
|
|
219
|
+
role_grant_offer_expire: z.looseObject({
|
|
205
220
|
offer_id: Uuid.meta({ description: 'Id of the expired offer.' }),
|
|
206
221
|
role: z.string().meta({ description: 'Role that was offered.' }),
|
|
207
222
|
scope_id: Uuid.nullish().meta({
|
|
@@ -210,19 +225,19 @@ export const AUDIT_METADATA_SCHEMAS = Object.freeze({
|
|
|
210
225
|
}),
|
|
211
226
|
// Emitted when an offer is obsoleted by an external event. `reason`
|
|
212
227
|
// distinguishes the trigger; `cause_id` points to the accepted offer
|
|
213
|
-
// (for `sibling_accepted`), the revoked
|
|
228
|
+
// (for `sibling_accepted`), the revoked role_grant (for `role_grant_revoked`),
|
|
214
229
|
// or the destroyed parent scope row (for `scope_destroyed`).
|
|
215
|
-
|
|
230
|
+
role_grant_offer_supersede: z.looseObject({
|
|
216
231
|
offer_id: Uuid.meta({ description: 'Id of the superseded offer.' }),
|
|
217
232
|
role: z.string().meta({ description: 'Role that was offered.' }),
|
|
218
233
|
scope_id: Uuid.nullish().meta({
|
|
219
234
|
description: 'Scope of the offered role; null for global offers.',
|
|
220
235
|
}),
|
|
221
|
-
reason: z.enum(['sibling_accepted', '
|
|
222
|
-
description: 'Trigger that obsoleted the offer: a sibling offer was accepted, the resulting
|
|
236
|
+
reason: z.enum(['sibling_accepted', 'role_grant_revoked', 'scope_destroyed']).meta({
|
|
237
|
+
description: 'Trigger that obsoleted the offer: a sibling offer was accepted, the resulting role_grant was revoked, or the parent scope row was destroyed.',
|
|
223
238
|
}),
|
|
224
239
|
cause_id: Uuid.meta({
|
|
225
|
-
description: 'Row that caused the supersede: accepted offer (`sibling_accepted`), revoked
|
|
240
|
+
description: 'Row that caused the supersede: accepted offer (`sibling_accepted`), revoked role_grant (`role_grant_revoked`), or destroyed parent scope row (`scope_destroyed`).',
|
|
226
241
|
}),
|
|
227
242
|
}),
|
|
228
243
|
invite_create: z.looseObject({
|
|
@@ -258,9 +273,9 @@ export const BUILTIN_AUDIT_LOG_CONFIG = Object.freeze({
|
|
|
258
273
|
* Throws when an `extra_events` key collides with a builtin event type, or
|
|
259
274
|
* fails `AuditEventTypeName` format validation.
|
|
260
275
|
*
|
|
261
|
-
* Call once at startup; pass the result to
|
|
262
|
-
* `
|
|
263
|
-
* pick up `BUILTIN_AUDIT_LOG_CONFIG`.
|
|
276
|
+
* Call once at startup; pass the result to `create_app_backend` (which
|
|
277
|
+
* threads it into `AppDeps.audit`). Builtin handlers omit the
|
|
278
|
+
* `audit_log_config` slot and pick up `BUILTIN_AUDIT_LOG_CONFIG`.
|
|
264
279
|
*
|
|
265
280
|
* @throws Error when an `extra_events` key collides with a builtin event type or fails `AuditEventTypeName` format validation
|
|
266
281
|
*/
|
|
@@ -311,6 +326,7 @@ export const AuditLogEventJson = z.strictObject({
|
|
|
311
326
|
actor_id: Uuid.nullable(),
|
|
312
327
|
account_id: Uuid.nullable(),
|
|
313
328
|
target_account_id: Uuid.nullable(),
|
|
329
|
+
target_actor_id: Uuid.nullable(),
|
|
314
330
|
ip: z.string().nullable(),
|
|
315
331
|
created_at: z.string(),
|
|
316
332
|
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
@@ -320,8 +336,8 @@ export const AuditLogEventWithUsernamesJson = AuditLogEventJson.extend({
|
|
|
320
336
|
username: z.string().nullable(),
|
|
321
337
|
target_username: z.string().nullable(),
|
|
322
338
|
});
|
|
323
|
-
/** Zod schema for
|
|
324
|
-
export const
|
|
339
|
+
/** Zod schema for role_grant history events with resolved usernames. */
|
|
340
|
+
export const RoleGrantHistoryEventJson = AuditLogEventJson.extend({
|
|
325
341
|
username: z.string().nullable(),
|
|
326
342
|
target_username: z.string().nullable(),
|
|
327
343
|
});
|
|
@@ -330,6 +346,17 @@ export const AdminSessionJson = AuthSessionJson.extend({
|
|
|
330
346
|
username: z.string(),
|
|
331
347
|
});
|
|
332
348
|
// Schema DDL
|
|
349
|
+
//
|
|
350
|
+
// Multi-actor invariants the envelope columns assume:
|
|
351
|
+
// - `actor_id` + `account_id`, when both populated, refer to the same
|
|
352
|
+
// account (derivable via `actor.account_id`). Denormalized for
|
|
353
|
+
// indexed audit queries; do not let them disagree.
|
|
354
|
+
// - `target_actor_id` + `target_account_id`, same rule when both populated.
|
|
355
|
+
// - `target_account_id` is the SSE/WS socket-close key — sessions stay
|
|
356
|
+
// account-grain after multi-actor lands, so this column carries
|
|
357
|
+
// the routing identity even on actor-bound events.
|
|
358
|
+
// - `target_actor_id` is populated iff the event subject is actor-bound
|
|
359
|
+
// (see `AuditLogEvent.target_actor_id` doc-comment for the rule).
|
|
333
360
|
export const AUDIT_LOG_SCHEMA = `
|
|
334
361
|
CREATE TABLE IF NOT EXISTS audit_log (
|
|
335
362
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
@@ -339,6 +366,7 @@ CREATE TABLE IF NOT EXISTS audit_log (
|
|
|
339
366
|
actor_id UUID REFERENCES actor(id) ON DELETE SET NULL,
|
|
340
367
|
account_id UUID REFERENCES account(id) ON DELETE SET NULL,
|
|
341
368
|
target_account_id UUID REFERENCES account(id) ON DELETE SET NULL,
|
|
369
|
+
target_actor_id UUID REFERENCES actor(id) ON DELETE SET NULL,
|
|
342
370
|
ip TEXT,
|
|
343
371
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
344
372
|
metadata JSONB
|
|
@@ -348,4 +376,5 @@ export const AUDIT_LOG_INDEXES = [
|
|
|
348
376
|
`CREATE INDEX IF NOT EXISTS idx_audit_log_account ON audit_log(account_id)`,
|
|
349
377
|
`CREATE INDEX IF NOT EXISTS idx_audit_log_event_type ON audit_log(event_type)`,
|
|
350
378
|
`CREATE INDEX IF NOT EXISTS idx_audit_log_target_account ON audit_log(target_account_id)`,
|
|
379
|
+
`CREATE INDEX IF NOT EXISTS idx_audit_log_target_actor ON audit_log(target_actor_id)`,
|
|
351
380
|
];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth guard resolver for the route spec system.
|
|
3
|
+
*
|
|
4
|
+
* Maps the four-axis `RouteAuth` (`account` / `actor` / `roles` /
|
|
5
|
+
* `credential_types`) to two-phase middleware sets that
|
|
6
|
+
* `apply_route_specs` weaves into the per-route pipeline:
|
|
7
|
+
*
|
|
8
|
+
* - `pre_validation` runs before input validation. `require_auth` lands
|
|
9
|
+
* here whenever `auth.account === 'required'` or `auth.actor ===
|
|
10
|
+
* 'required'` (per registry-time invariant 3, `actor: 'required'`
|
|
11
|
+
* today implies a credential — accountless actors are out of scope
|
|
12
|
+
* for v1). Pre-validation 401 fires before any body parsing so
|
|
13
|
+
* unauthenticated callers never see route-shape information from
|
|
14
|
+
* parse failures.
|
|
15
|
+
* - `post_authorization` runs after the dispatcher's authorization
|
|
16
|
+
* phase has populated `RequestContext`. `require_role(roles)` fires
|
|
17
|
+
* whenever `auth.roles?.length`. `require_credential_types(types)`
|
|
18
|
+
* fires whenever `auth.credential_types?.length`.
|
|
19
|
+
*
|
|
20
|
+
* Public routes (`auth.account === 'none' && auth.actor === 'none'`)
|
|
21
|
+
* yield empty guard arrays. `'optional'` axes contribute no
|
|
22
|
+
* pre-validation 401; the authorization phase sets `RequestContext`
|
|
23
|
+
* to whatever the credential supports and the post-authorization
|
|
24
|
+
* gates decide whether the actor's role_grants / credential type match.
|
|
25
|
+
*
|
|
26
|
+
* @module
|
|
27
|
+
*/
|
|
28
|
+
import type { AuthGuardResolver } from '../http/route_spec.js';
|
|
29
|
+
/**
|
|
30
|
+
* Standard auth guard resolver for fuz_app.
|
|
31
|
+
*
|
|
32
|
+
* Reads each axis of the four-axis `RouteAuth` shape and emits the
|
|
33
|
+
* corresponding middleware:
|
|
34
|
+
*
|
|
35
|
+
* - `account === 'required'` or `actor === 'required'` → pre-validation `require_auth`
|
|
36
|
+
* - `roles?.length` → post-authorization `require_role(roles)` (multi-role any-of)
|
|
37
|
+
* - `credential_types?.length` → post-authorization `require_credential_types(types)`
|
|
38
|
+
*
|
|
39
|
+
* Multiple post-authorization guards run in declaration order: credential
|
|
40
|
+
* type check first (since failing it implies the request can never
|
|
41
|
+
* resolve a usable identity), role check second.
|
|
42
|
+
*/
|
|
43
|
+
export declare const fuz_auth_guard_resolver: AuthGuardResolver;
|
|
44
|
+
//# sourceMappingURL=auth_guard_resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth_guard_resolver.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/auth_guard_resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,uBAAuB,EAAE,iBAerC,CAAC"}
|