@fuzdev/fuz_app 0.169.0 → 0.170.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 +17 -19
- package/dist/actions/action_codegen.d.ts +25 -18
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +83 -67
- package/dist/actions/action_event.d.ts +0 -8
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +7 -6
- package/dist/actions/action_event_data.d.ts +4 -4
- package/dist/actions/action_rpc.d.ts +1 -1
- package/dist/actions/action_rpc.js +1 -1
- package/dist/actions/action_spec.d.ts +8 -10
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +1 -1
- package/dist/actions/action_types.d.ts +4 -4
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +2 -2
- package/dist/actions/broadcast_api.d.ts +2 -2
- package/dist/actions/broadcast_api.js +4 -4
- package/dist/actions/compile_action_registry.d.ts +6 -7
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/compile_action_registry.js +8 -9
- package/dist/actions/perform_action.d.ts +6 -6
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +11 -10
- package/dist/actions/socket.svelte.d.ts +1 -1
- package/dist/actions/socket.svelte.js +2 -2
- package/dist/auth/CLAUDE.md +11 -11
- package/dist/auth/admin_action_specs.d.ts +24 -24
- package/dist/auth/audit_emitter.d.ts +6 -7
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +11 -22
- package/dist/auth/audit_log_ddl.d.ts +1 -1
- package/dist/auth/audit_log_ddl.js +1 -1
- package/dist/auth/audit_log_queries.d.ts +0 -13
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +3 -3
- package/dist/auth/audit_log_schema.d.ts +14 -15
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +1 -1
- package/dist/auth/auth_ddl.d.ts +1 -1
- package/dist/auth/auth_ddl.js +1 -1
- package/dist/auth/cell_action_specs.d.ts +54 -54
- package/dist/auth/cell_actions.d.ts +2 -2
- package/dist/auth/cell_actions.js +5 -5
- package/dist/auth/request_context.js +2 -2
- package/dist/auth/role_grant_offer_action_specs.d.ts +6 -6
- package/dist/auth/role_grant_offer_ddl.d.ts +1 -1
- package/dist/auth/role_grant_offer_ddl.js +1 -1
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +2 -3
- package/dist/auth/self_service_role_actions.d.ts +1 -1
- package/dist/auth/self_service_role_actions.js +1 -1
- package/dist/env/env_schemas.d.ts +1 -2
- package/dist/env/env_schemas.d.ts.map +1 -1
- package/dist/env/env_schemas.js +3 -4
- package/dist/http/CLAUDE.md +29 -31
- package/dist/http/auth_shape.d.ts +14 -32
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +14 -49
- package/dist/http/error_schemas.d.ts +18 -18
- package/dist/http/jsonrpc_helpers.js +1 -1
- package/dist/http/route_error_check.d.ts +2 -2
- package/dist/http/route_error_check.d.ts.map +1 -1
- package/dist/http/route_error_check.js +2 -3
- package/dist/http/route_errors.d.ts +4 -4
- package/dist/http/route_errors.d.ts.map +1 -1
- package/dist/http/route_errors.js +0 -13
- package/dist/http/route_spec.d.ts +33 -36
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +21 -22
- package/dist/http/schema_helpers.d.ts +75 -67
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +54 -77
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +6 -8
- package/dist/primitive_schemas.d.ts +9 -17
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +9 -17
- package/dist/realtime/sse.d.ts +3 -3
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +2 -2
- package/dist/schema_issues.d.ts +39 -147
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +39 -352
- package/dist/schema_meta.d.ts +63 -136
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +37 -184
- package/dist/sensitivity.d.ts +3 -5
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/sensitivity.js +3 -5
- package/dist/testing/CLAUDE.md +20 -22
- package/dist/testing/adversarial_headers.js +2 -2
- package/dist/testing/adversarial_input_cases.d.ts +19 -18
- package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
- package/dist/testing/adversarial_input_cases.js +29 -42
- package/dist/testing/assertions.d.ts +2 -2
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +3 -3
- package/dist/testing/cross_backend/account_lifecycle.js +2 -2
- package/dist/testing/cross_backend/action_manifest.d.ts +10 -9
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +4 -3
- package/dist/testing/cross_backend/cell_crud.js +1 -1
- package/dist/testing/cross_backend/conformance_rpc_auth.d.ts +0 -62
- package/dist/testing/cross_backend/conformance_rpc_auth.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +3 -3
- package/dist/testing/cross_backend/cross_rpc.d.ts +3 -4
- package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
- package/dist/testing/cross_backend/cross_rpc.js +4 -4
- package/dist/testing/cross_backend/differential.js +2 -2
- package/dist/testing/cross_backend/identity_parity.js +9 -9
- package/dist/testing/cross_backend/origin_conformance.d.ts +9 -9
- package/dist/testing/cross_backend/query_shape.js +1 -1
- package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
- package/dist/testing/cross_backend/setup.d.ts +25 -3
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +4 -4
- package/dist/testing/cross_backend/sse_round_trip.js +2 -2
- package/dist/testing/cross_backend/testing_origin_check.d.ts +4 -4
- package/dist/testing/cross_backend/token_lifetime.js +3 -3
- package/dist/testing/cross_backend/wire_shapes.js +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +1 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +1 -1
- package/dist/testing/integration.js +2 -2
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +2 -2
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +2 -2
- package/dist/testing/rpc_attack_surface.js +1 -1
- package/dist/testing/rpc_envelope_cases.d.ts +3 -3
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +1 -1
- package/dist/testing/rpc_helpers.d.ts +12 -14
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +9 -10
- package/dist/testing/schema_generators.d.ts +67 -60
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +150 -145
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/surface_invariants.d.ts +1 -1
- package/dist/testing/surface_invariants.js +1 -1
- package/dist/ui/form_state.svelte.d.ts +1 -1
- package/dist/ui/form_state.svelte.js +1 -1
- package/package.json +5 -7
- package/dist/zod.d.ts +0 -116
- package/dist/zod.d.ts.map +0 -1
- package/dist/zod.js +0 -218
- package/dist/zod_schemas.d.ts +0 -100
- package/dist/zod_schemas.d.ts.map +0 -1
- package/dist/zod_schemas.js +0 -157
|
@@ -673,13 +673,13 @@ export declare const AuditLogListOutput: import("@fuzdev/fuz_schema/schema.ts").
|
|
|
673
673
|
created_at: string;
|
|
674
674
|
username: string | null;
|
|
675
675
|
ip: string | null;
|
|
676
|
-
metadata: Record<string, unknown> | null;
|
|
677
676
|
seq: number;
|
|
678
677
|
event_type: string;
|
|
679
678
|
outcome: "success" | "failure";
|
|
680
679
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
681
680
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
682
681
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
682
|
+
metadata: Record<string, unknown> | null;
|
|
683
683
|
target_username: string | null;
|
|
684
684
|
}[];
|
|
685
685
|
}, {
|
|
@@ -689,13 +689,13 @@ export declare const AuditLogListOutput: import("@fuzdev/fuz_schema/schema.ts").
|
|
|
689
689
|
created_at: string;
|
|
690
690
|
username: string | null;
|
|
691
691
|
ip: string | null;
|
|
692
|
-
metadata: Record<string, unknown> | null;
|
|
693
692
|
seq: number;
|
|
694
693
|
event_type: string;
|
|
695
694
|
outcome: "success" | "failure";
|
|
696
695
|
actor_id: string | null;
|
|
697
696
|
target_account_id: string | null;
|
|
698
697
|
target_actor_id: string | null;
|
|
698
|
+
metadata: Record<string, unknown> | null;
|
|
699
699
|
target_username: string | null;
|
|
700
700
|
}[];
|
|
701
701
|
}, "object", {
|
|
@@ -705,13 +705,13 @@ export declare const AuditLogListOutput: import("@fuzdev/fuz_schema/schema.ts").
|
|
|
705
705
|
created_at: string;
|
|
706
706
|
username: string | null;
|
|
707
707
|
ip: string | null;
|
|
708
|
-
metadata: Record<string, unknown> | null;
|
|
709
708
|
seq: number;
|
|
710
709
|
event_type: string;
|
|
711
710
|
outcome: "success" | "failure";
|
|
712
711
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
713
712
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
714
713
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
714
|
+
metadata: Record<string, unknown> | null;
|
|
715
715
|
target_username: string | null;
|
|
716
716
|
}[], {
|
|
717
717
|
id: string;
|
|
@@ -719,13 +719,13 @@ export declare const AuditLogListOutput: import("@fuzdev/fuz_schema/schema.ts").
|
|
|
719
719
|
created_at: string;
|
|
720
720
|
username: string | null;
|
|
721
721
|
ip: string | null;
|
|
722
|
-
metadata: Record<string, unknown> | null;
|
|
723
722
|
seq: number;
|
|
724
723
|
event_type: string;
|
|
725
724
|
outcome: "success" | "failure";
|
|
726
725
|
actor_id: string | null;
|
|
727
726
|
target_account_id: string | null;
|
|
728
727
|
target_actor_id: string | null;
|
|
728
|
+
metadata: Record<string, unknown> | null;
|
|
729
729
|
target_username: string | null;
|
|
730
730
|
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
731
731
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -733,13 +733,13 @@ export declare const AuditLogListOutput: import("@fuzdev/fuz_schema/schema.ts").
|
|
|
733
733
|
created_at: string;
|
|
734
734
|
username: string | null;
|
|
735
735
|
ip: string | null;
|
|
736
|
-
metadata: Record<string, unknown> | null;
|
|
737
736
|
seq: number;
|
|
738
737
|
event_type: string;
|
|
739
738
|
outcome: "success" | "failure";
|
|
740
739
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
741
740
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
742
741
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
742
|
+
metadata: Record<string, unknown> | null;
|
|
743
743
|
target_username: string | null;
|
|
744
744
|
}, {
|
|
745
745
|
id: string;
|
|
@@ -747,13 +747,13 @@ export declare const AuditLogListOutput: import("@fuzdev/fuz_schema/schema.ts").
|
|
|
747
747
|
created_at: string;
|
|
748
748
|
username: string | null;
|
|
749
749
|
ip: string | null;
|
|
750
|
-
metadata: Record<string, unknown> | null;
|
|
751
750
|
seq: number;
|
|
752
751
|
event_type: string;
|
|
753
752
|
outcome: "success" | "failure";
|
|
754
753
|
actor_id: string | null;
|
|
755
754
|
target_account_id: string | null;
|
|
756
755
|
target_actor_id: string | null;
|
|
756
|
+
metadata: Record<string, unknown> | null;
|
|
757
757
|
target_username: string | null;
|
|
758
758
|
}, "object", {
|
|
759
759
|
username: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
@@ -836,13 +836,13 @@ export declare const AuditLogRoleGrantHistoryOutput: import("@fuzdev/fuz_schema/
|
|
|
836
836
|
created_at: string;
|
|
837
837
|
username: string | null;
|
|
838
838
|
ip: string | null;
|
|
839
|
-
metadata: Record<string, unknown> | null;
|
|
840
839
|
seq: number;
|
|
841
840
|
event_type: string;
|
|
842
841
|
outcome: "success" | "failure";
|
|
843
842
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
844
843
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
845
844
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
845
|
+
metadata: Record<string, unknown> | null;
|
|
846
846
|
target_username: string | null;
|
|
847
847
|
}[];
|
|
848
848
|
}, {
|
|
@@ -852,13 +852,13 @@ export declare const AuditLogRoleGrantHistoryOutput: import("@fuzdev/fuz_schema/
|
|
|
852
852
|
created_at: string;
|
|
853
853
|
username: string | null;
|
|
854
854
|
ip: string | null;
|
|
855
|
-
metadata: Record<string, unknown> | null;
|
|
856
855
|
seq: number;
|
|
857
856
|
event_type: string;
|
|
858
857
|
outcome: "success" | "failure";
|
|
859
858
|
actor_id: string | null;
|
|
860
859
|
target_account_id: string | null;
|
|
861
860
|
target_actor_id: string | null;
|
|
861
|
+
metadata: Record<string, unknown> | null;
|
|
862
862
|
target_username: string | null;
|
|
863
863
|
}[];
|
|
864
864
|
}, "object", {
|
|
@@ -868,13 +868,13 @@ export declare const AuditLogRoleGrantHistoryOutput: import("@fuzdev/fuz_schema/
|
|
|
868
868
|
created_at: string;
|
|
869
869
|
username: string | null;
|
|
870
870
|
ip: string | null;
|
|
871
|
-
metadata: Record<string, unknown> | null;
|
|
872
871
|
seq: number;
|
|
873
872
|
event_type: string;
|
|
874
873
|
outcome: "success" | "failure";
|
|
875
874
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
876
875
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
877
876
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
877
|
+
metadata: Record<string, unknown> | null;
|
|
878
878
|
target_username: string | null;
|
|
879
879
|
}[], {
|
|
880
880
|
id: string;
|
|
@@ -882,13 +882,13 @@ export declare const AuditLogRoleGrantHistoryOutput: import("@fuzdev/fuz_schema/
|
|
|
882
882
|
created_at: string;
|
|
883
883
|
username: string | null;
|
|
884
884
|
ip: string | null;
|
|
885
|
-
metadata: Record<string, unknown> | null;
|
|
886
885
|
seq: number;
|
|
887
886
|
event_type: string;
|
|
888
887
|
outcome: "success" | "failure";
|
|
889
888
|
actor_id: string | null;
|
|
890
889
|
target_account_id: string | null;
|
|
891
890
|
target_actor_id: string | null;
|
|
891
|
+
metadata: Record<string, unknown> | null;
|
|
892
892
|
target_username: string | null;
|
|
893
893
|
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
894
894
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -896,13 +896,13 @@ export declare const AuditLogRoleGrantHistoryOutput: import("@fuzdev/fuz_schema/
|
|
|
896
896
|
created_at: string;
|
|
897
897
|
username: string | null;
|
|
898
898
|
ip: string | null;
|
|
899
|
-
metadata: Record<string, unknown> | null;
|
|
900
899
|
seq: number;
|
|
901
900
|
event_type: string;
|
|
902
901
|
outcome: "success" | "failure";
|
|
903
902
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
904
903
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
905
904
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
905
|
+
metadata: Record<string, unknown> | null;
|
|
906
906
|
target_username: string | null;
|
|
907
907
|
}, {
|
|
908
908
|
id: string;
|
|
@@ -910,13 +910,13 @@ export declare const AuditLogRoleGrantHistoryOutput: import("@fuzdev/fuz_schema/
|
|
|
910
910
|
created_at: string;
|
|
911
911
|
username: string | null;
|
|
912
912
|
ip: string | null;
|
|
913
|
-
metadata: Record<string, unknown> | null;
|
|
914
913
|
seq: number;
|
|
915
914
|
event_type: string;
|
|
916
915
|
outcome: "success" | "failure";
|
|
917
916
|
actor_id: string | null;
|
|
918
917
|
target_account_id: string | null;
|
|
919
918
|
target_actor_id: string | null;
|
|
919
|
+
metadata: Record<string, unknown> | null;
|
|
920
920
|
target_username: string | null;
|
|
921
921
|
}, "object", {
|
|
922
922
|
username: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
@@ -2178,13 +2178,13 @@ export declare const audit_log_list_action_spec: {
|
|
|
2178
2178
|
created_at: string;
|
|
2179
2179
|
username: string | null;
|
|
2180
2180
|
ip: string | null;
|
|
2181
|
-
metadata: Record<string, unknown> | null;
|
|
2182
2181
|
seq: number;
|
|
2183
2182
|
event_type: string;
|
|
2184
2183
|
outcome: "success" | "failure";
|
|
2185
2184
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2186
2185
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2187
2186
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2187
|
+
metadata: Record<string, unknown> | null;
|
|
2188
2188
|
target_username: string | null;
|
|
2189
2189
|
}[];
|
|
2190
2190
|
}, {
|
|
@@ -2194,13 +2194,13 @@ export declare const audit_log_list_action_spec: {
|
|
|
2194
2194
|
created_at: string;
|
|
2195
2195
|
username: string | null;
|
|
2196
2196
|
ip: string | null;
|
|
2197
|
-
metadata: Record<string, unknown> | null;
|
|
2198
2197
|
seq: number;
|
|
2199
2198
|
event_type: string;
|
|
2200
2199
|
outcome: "success" | "failure";
|
|
2201
2200
|
actor_id: string | null;
|
|
2202
2201
|
target_account_id: string | null;
|
|
2203
2202
|
target_actor_id: string | null;
|
|
2203
|
+
metadata: Record<string, unknown> | null;
|
|
2204
2204
|
target_username: string | null;
|
|
2205
2205
|
}[];
|
|
2206
2206
|
}, "object", {
|
|
@@ -2210,13 +2210,13 @@ export declare const audit_log_list_action_spec: {
|
|
|
2210
2210
|
created_at: string;
|
|
2211
2211
|
username: string | null;
|
|
2212
2212
|
ip: string | null;
|
|
2213
|
-
metadata: Record<string, unknown> | null;
|
|
2214
2213
|
seq: number;
|
|
2215
2214
|
event_type: string;
|
|
2216
2215
|
outcome: "success" | "failure";
|
|
2217
2216
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2218
2217
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2219
2218
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2219
|
+
metadata: Record<string, unknown> | null;
|
|
2220
2220
|
target_username: string | null;
|
|
2221
2221
|
}[], {
|
|
2222
2222
|
id: string;
|
|
@@ -2224,13 +2224,13 @@ export declare const audit_log_list_action_spec: {
|
|
|
2224
2224
|
created_at: string;
|
|
2225
2225
|
username: string | null;
|
|
2226
2226
|
ip: string | null;
|
|
2227
|
-
metadata: Record<string, unknown> | null;
|
|
2228
2227
|
seq: number;
|
|
2229
2228
|
event_type: string;
|
|
2230
2229
|
outcome: "success" | "failure";
|
|
2231
2230
|
actor_id: string | null;
|
|
2232
2231
|
target_account_id: string | null;
|
|
2233
2232
|
target_actor_id: string | null;
|
|
2233
|
+
metadata: Record<string, unknown> | null;
|
|
2234
2234
|
target_username: string | null;
|
|
2235
2235
|
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
2236
2236
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -2238,13 +2238,13 @@ export declare const audit_log_list_action_spec: {
|
|
|
2238
2238
|
created_at: string;
|
|
2239
2239
|
username: string | null;
|
|
2240
2240
|
ip: string | null;
|
|
2241
|
-
metadata: Record<string, unknown> | null;
|
|
2242
2241
|
seq: number;
|
|
2243
2242
|
event_type: string;
|
|
2244
2243
|
outcome: "success" | "failure";
|
|
2245
2244
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2246
2245
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2247
2246
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2247
|
+
metadata: Record<string, unknown> | null;
|
|
2248
2248
|
target_username: string | null;
|
|
2249
2249
|
}, {
|
|
2250
2250
|
id: string;
|
|
@@ -2252,13 +2252,13 @@ export declare const audit_log_list_action_spec: {
|
|
|
2252
2252
|
created_at: string;
|
|
2253
2253
|
username: string | null;
|
|
2254
2254
|
ip: string | null;
|
|
2255
|
-
metadata: Record<string, unknown> | null;
|
|
2256
2255
|
seq: number;
|
|
2257
2256
|
event_type: string;
|
|
2258
2257
|
outcome: "success" | "failure";
|
|
2259
2258
|
actor_id: string | null;
|
|
2260
2259
|
target_account_id: string | null;
|
|
2261
2260
|
target_actor_id: string | null;
|
|
2261
|
+
metadata: Record<string, unknown> | null;
|
|
2262
2262
|
target_username: string | null;
|
|
2263
2263
|
}, "object", {
|
|
2264
2264
|
username: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
@@ -2353,13 +2353,13 @@ export declare const audit_log_role_grant_history_action_spec: {
|
|
|
2353
2353
|
created_at: string;
|
|
2354
2354
|
username: string | null;
|
|
2355
2355
|
ip: string | null;
|
|
2356
|
-
metadata: Record<string, unknown> | null;
|
|
2357
2356
|
seq: number;
|
|
2358
2357
|
event_type: string;
|
|
2359
2358
|
outcome: "success" | "failure";
|
|
2360
2359
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2361
2360
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2362
2361
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2362
|
+
metadata: Record<string, unknown> | null;
|
|
2363
2363
|
target_username: string | null;
|
|
2364
2364
|
}[];
|
|
2365
2365
|
}, {
|
|
@@ -2369,13 +2369,13 @@ export declare const audit_log_role_grant_history_action_spec: {
|
|
|
2369
2369
|
created_at: string;
|
|
2370
2370
|
username: string | null;
|
|
2371
2371
|
ip: string | null;
|
|
2372
|
-
metadata: Record<string, unknown> | null;
|
|
2373
2372
|
seq: number;
|
|
2374
2373
|
event_type: string;
|
|
2375
2374
|
outcome: "success" | "failure";
|
|
2376
2375
|
actor_id: string | null;
|
|
2377
2376
|
target_account_id: string | null;
|
|
2378
2377
|
target_actor_id: string | null;
|
|
2378
|
+
metadata: Record<string, unknown> | null;
|
|
2379
2379
|
target_username: string | null;
|
|
2380
2380
|
}[];
|
|
2381
2381
|
}, "object", {
|
|
@@ -2385,13 +2385,13 @@ export declare const audit_log_role_grant_history_action_spec: {
|
|
|
2385
2385
|
created_at: string;
|
|
2386
2386
|
username: string | null;
|
|
2387
2387
|
ip: string | null;
|
|
2388
|
-
metadata: Record<string, unknown> | null;
|
|
2389
2388
|
seq: number;
|
|
2390
2389
|
event_type: string;
|
|
2391
2390
|
outcome: "success" | "failure";
|
|
2392
2391
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2393
2392
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2394
2393
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2394
|
+
metadata: Record<string, unknown> | null;
|
|
2395
2395
|
target_username: string | null;
|
|
2396
2396
|
}[], {
|
|
2397
2397
|
id: string;
|
|
@@ -2399,13 +2399,13 @@ export declare const audit_log_role_grant_history_action_spec: {
|
|
|
2399
2399
|
created_at: string;
|
|
2400
2400
|
username: string | null;
|
|
2401
2401
|
ip: string | null;
|
|
2402
|
-
metadata: Record<string, unknown> | null;
|
|
2403
2402
|
seq: number;
|
|
2404
2403
|
event_type: string;
|
|
2405
2404
|
outcome: "success" | "failure";
|
|
2406
2405
|
actor_id: string | null;
|
|
2407
2406
|
target_account_id: string | null;
|
|
2408
2407
|
target_actor_id: string | null;
|
|
2408
|
+
metadata: Record<string, unknown> | null;
|
|
2409
2409
|
target_username: string | null;
|
|
2410
2410
|
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
2411
2411
|
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
@@ -2413,13 +2413,13 @@ export declare const audit_log_role_grant_history_action_spec: {
|
|
|
2413
2413
|
created_at: string;
|
|
2414
2414
|
username: string | null;
|
|
2415
2415
|
ip: string | null;
|
|
2416
|
-
metadata: Record<string, unknown> | null;
|
|
2417
2416
|
seq: number;
|
|
2418
2417
|
event_type: string;
|
|
2419
2418
|
outcome: "success" | "failure";
|
|
2420
2419
|
actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2421
2420
|
target_account_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2422
2421
|
target_actor_id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
2422
|
+
metadata: Record<string, unknown> | null;
|
|
2423
2423
|
target_username: string | null;
|
|
2424
2424
|
}, {
|
|
2425
2425
|
id: string;
|
|
@@ -2427,13 +2427,13 @@ export declare const audit_log_role_grant_history_action_spec: {
|
|
|
2427
2427
|
created_at: string;
|
|
2428
2428
|
username: string | null;
|
|
2429
2429
|
ip: string | null;
|
|
2430
|
-
metadata: Record<string, unknown> | null;
|
|
2431
2430
|
seq: number;
|
|
2432
2431
|
event_type: string;
|
|
2433
2432
|
outcome: "success" | "failure";
|
|
2434
2433
|
actor_id: string | null;
|
|
2435
2434
|
target_account_id: string | null;
|
|
2436
2435
|
target_actor_id: string | null;
|
|
2436
|
+
metadata: Record<string, unknown> | null;
|
|
2437
2437
|
target_username: string | null;
|
|
2438
2438
|
}, "object", {
|
|
2439
2439
|
username: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
@@ -341,14 +341,13 @@ export interface CreateAuditEmitterOptions {
|
|
|
341
341
|
* `MASKED_VALUE`. No builtin event declares a secret field, so a builtin row
|
|
342
342
|
* logs whole, as the Rust twin's `fuz_auth::dropped_row_json` does.
|
|
343
343
|
*
|
|
344
|
-
* The masking reads only the entries an object metadata schema declares
|
|
345
|
-
* (`
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* object field, a field of a union or discriminated-union metadata schema, a
|
|
344
|
+
* The masking reads only the entries an object metadata schema declares
|
|
345
|
+
* (`find_schema_sensitivity` over the entries `get_schema_entries` finds
|
|
346
|
+
* under any wrapper), a key matching only an own entry, never a name the
|
|
347
|
+
* entries inherit such as `constructor`. A secret field nested under an
|
|
348
|
+
* object field, a field of a union or variant metadata schema, a
|
|
350
349
|
* `sensitivity: 'secret'` on the object schema itself, and a key only a rest
|
|
351
|
-
*
|
|
350
|
+
* schema covers are logged in clear, and so is every
|
|
352
351
|
* `sensitivity: 'personal'` field. Keep secrets out of audit metadata — they
|
|
353
352
|
* would land in `audit_log` too.
|
|
354
353
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_emitter.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_emitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"audit_emitter.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_emitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CA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AAC;CACzB;AA0BD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,MAAM,EACpD,OAAO,aAAa,CAAC,CAAC,CAAC,EACvB,QAAQ,cAAc,KACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAqBxB,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,QAAO,MAA8B,CAAC;AAE3E,0CAA0C;AAC1C,eAAO,MAAM,0BAA0B,QAAO,IAE7C,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,yBAAyB,KAAG,YA6JzE,CAAC"}
|
|
@@ -98,12 +98,8 @@
|
|
|
98
98
|
*/
|
|
99
99
|
import { to_error_message } from '@fuzdev/fuz_util/error.ts';
|
|
100
100
|
import { MASKED_VALUE } from '../env/mask.js';
|
|
101
|
-
import { is_schema } from '@fuzdev/fuz_schema/schema.ts';
|
|
102
101
|
import { get_schema_entries } from '@fuzdev/fuz_schema/introspect.ts';
|
|
103
|
-
import { schema_sensitivity } from '../schema_meta.js';
|
|
104
102
|
import { find_schema_sensitivity } from '../sensitivity.js';
|
|
105
|
-
import { is_zod_schema } from '../schema_issues.js';
|
|
106
|
-
import { zod_maybe_get_field_schema } from '../zod.js';
|
|
107
103
|
import { emit_after_commit } from '../http/pending_effects.js';
|
|
108
104
|
import { query_audit_log } from './audit_log_queries.js';
|
|
109
105
|
import { builtin_audit_log_config } from './audit_log_schema.js';
|
|
@@ -119,19 +115,13 @@ import { builtin_audit_log_config } from './audit_log_schema.js';
|
|
|
119
115
|
let audit_write_failures = 0;
|
|
120
116
|
/**
|
|
121
117
|
* Whether `key` is a top-level field of the object metadata schema `schema`
|
|
122
|
-
* marked `sensitivity: 'secret'
|
|
118
|
+
* marked `sensitivity: 'secret'`.
|
|
123
119
|
*/
|
|
124
120
|
const is_secret_field = (schema, key) => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
find_schema_sensitivity(entries[key]) === 'secret');
|
|
130
|
-
}
|
|
131
|
-
if (!is_zod_schema(schema))
|
|
132
|
-
return false;
|
|
133
|
-
const field = zod_maybe_get_field_schema(schema, key);
|
|
134
|
-
return field !== undefined && schema_sensitivity(field) === 'secret';
|
|
121
|
+
const entries = get_schema_entries(schema);
|
|
122
|
+
return (entries !== undefined &&
|
|
123
|
+
Object.hasOwn(entries, key) &&
|
|
124
|
+
find_schema_sensitivity(entries[key]) === 'secret');
|
|
135
125
|
};
|
|
136
126
|
/**
|
|
137
127
|
* The whole row a dropped pool write would have inserted, as the one JSON
|
|
@@ -141,14 +131,13 @@ const is_secret_field = (schema, key) => {
|
|
|
141
131
|
* `MASKED_VALUE`. No builtin event declares a secret field, so a builtin row
|
|
142
132
|
* logs whole, as the Rust twin's `fuz_auth::dropped_row_json` does.
|
|
143
133
|
*
|
|
144
|
-
* The masking reads only the entries an object metadata schema declares
|
|
145
|
-
* (`
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* object field, a field of a union or discriminated-union metadata schema, a
|
|
134
|
+
* The masking reads only the entries an object metadata schema declares
|
|
135
|
+
* (`find_schema_sensitivity` over the entries `get_schema_entries` finds
|
|
136
|
+
* under any wrapper), a key matching only an own entry, never a name the
|
|
137
|
+
* entries inherit such as `constructor`. A secret field nested under an
|
|
138
|
+
* object field, a field of a union or variant metadata schema, a
|
|
150
139
|
* `sensitivity: 'secret'` on the object schema itself, and a key only a rest
|
|
151
|
-
*
|
|
140
|
+
* schema covers are logged in clear, and so is every
|
|
152
141
|
* `sensitivity: 'personal'` field. Keep secrets out of audit metadata — they
|
|
153
142
|
* would land in `audit_log` too.
|
|
154
143
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Audit log DDL — `CREATE TABLE` + index statements for the `audit_log` table.
|
|
3
3
|
*
|
|
4
4
|
* Consumed by `auth/migrations.ts`. Separated from `auth/audit_log_schema.ts`
|
|
5
|
-
* so the schema module
|
|
5
|
+
* so the schema module holds schemas only (paired with `auth/auth_ddl.ts` and
|
|
6
6
|
* `auth/role_grant_offer_ddl.ts`).
|
|
7
7
|
*
|
|
8
8
|
* Multi-actor invariants the envelope columns assume:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Audit log DDL — `CREATE TABLE` + index statements for the `audit_log` table.
|
|
3
3
|
*
|
|
4
4
|
* Consumed by `auth/migrations.ts`. Separated from `auth/audit_log_schema.ts`
|
|
5
|
-
* so the schema module
|
|
5
|
+
* so the schema module holds schemas only (paired with `auth/auth_ddl.ts` and
|
|
6
6
|
* `auth/role_grant_offer_ddl.ts`).
|
|
7
7
|
*
|
|
8
8
|
* Multi-actor invariants the envelope columns assume:
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Audit log database queries.
|
|
3
|
-
*
|
|
4
|
-
* Records and retrieves auth mutation events for security monitoring. The
|
|
5
|
-
* request entry point is `AppDeps.audit.emit(ctx, input)` (see
|
|
6
|
-
* `auth/audit_emitter.ts`). It writes a success row in the request
|
|
7
|
-
* transaction and a failure row on the pool it closes over, so an attempt's
|
|
8
|
-
* row persists when the request transaction rolls back. This module only
|
|
9
|
-
* exposes the `query_*` primitives and the drift counters. The bound emitter
|
|
10
|
-
* writes through `query_audit_log`.
|
|
11
|
-
*
|
|
12
|
-
* @module
|
|
13
|
-
*/
|
|
14
1
|
import type { QueryDeps } from '../db/query_deps.js';
|
|
15
2
|
import { type AuditLogConfig, type AuditLogEvent, type AuditLogInput, type AuditLogListOptions, type AuditLogEventWithUsernamesJson, type RoleGrantHistoryEventJson } from './audit_log_schema.js';
|
|
16
3
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_queries.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_queries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"audit_log_queries.d.ts","sourceRoot":"../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CAmB1C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,GAC1C,MAAM,SAAS,EACf,QAAQ,IAAI,KACV,OAAO,CAAC,MAAM,CAMhB,CAAC"}
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
+
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
15
|
import { assert_row } from '../db/assert_row.js';
|
|
15
16
|
import { columns_sql, iso8601_timestamp_expr, qualify_columns } from '../db/sql_columns.js';
|
|
16
|
-
import { parse_any } from '../schema_issues.js';
|
|
17
17
|
import { AUDIT_LOG_DEFAULT_LIMIT, builtin_audit_log_config } from './audit_log_schema.js';
|
|
18
18
|
/**
|
|
19
19
|
* The full `audit_log` column set, named explicitly so a row read fails loud
|
|
@@ -46,7 +46,7 @@ export const AUDIT_LOG_COLUMNS = [
|
|
|
46
46
|
export const audit_log_expr = iso8601_timestamp_expr(AUDIT_LOG_COLUMNS, ['created_at']);
|
|
47
47
|
/**
|
|
48
48
|
* Process-wide counter for audit metadata validation failures. `query_audit_log`
|
|
49
|
-
* increments on `
|
|
49
|
+
* increments on a `parse` mismatch and writes the row anyway (fail-open —
|
|
50
50
|
* schema drift should not break auth flows). Independent of the
|
|
51
51
|
* unknown-event-type counter — `create_audit_log_config` keeps the two in
|
|
52
52
|
* sync, but a hand-rolled `AuditLogConfig` (or a cast escape) can have a
|
|
@@ -105,7 +105,7 @@ export const query_audit_log = async (deps, input, config = builtin_audit_log_co
|
|
|
105
105
|
if (input.metadata != null) {
|
|
106
106
|
const schema = config.metadata_schemas[input.event_type];
|
|
107
107
|
if (schema) {
|
|
108
|
-
const result =
|
|
108
|
+
const result = parse(schema, input.metadata);
|
|
109
109
|
if (!result.ok) {
|
|
110
110
|
audit_metadata_validation_failures++;
|
|
111
111
|
console.error(`[audit_log] metadata mismatch for '${input.event_type}':`, result.issues);
|