mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-16 08:57:30 +02:00
Add files via upload
This commit is contained in:
@@ -31,6 +31,19 @@ func TestBuildAuditLogsWhere_timeFilterSQL(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildAuditLogsWhere_relatedUserID(t *testing.T) {
|
||||
where, args := buildAuditLogsWhere(ListAuditLogsFilter{Category: "rbac", RelatedUserID: "user-123"})
|
||||
if !strings.Contains(where, "resource_id = ?") || !strings.Contains(where, "detail_json LIKE ?") {
|
||||
t.Fatalf("expected related-user predicates, got %q", where)
|
||||
}
|
||||
if len(args) != 4 {
|
||||
t.Fatalf("expected category plus 3 related-user args, got %#v", args)
|
||||
}
|
||||
if args[1] != "user-123" || args[2] != `%"user_id":"user-123"%` || args[3] != `%"userId":"user-123"%` {
|
||||
t.Fatalf("unexpected related-user args: %#v", args)
|
||||
}
|
||||
}
|
||||
|
||||
func TestListAuditLogs_timeFilterMixedStorageFormats(t *testing.T) {
|
||||
root, err := os.Getwd()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user