From 1b78145302e71ecd9682ad44676d0939a2b2bc09 Mon Sep 17 00:00:00 2001 From: HugoCasa Date: Thu, 4 Jul 2024 21:04:35 +0200 Subject: [PATCH] feat(backend): better filtering for audit logs API (#4023) * feat: better filtering for audit logs * chore: update ee ref * fix: use csv instead of query array * chore: update ee ref --- backend/Cargo.toml | 2 +- backend/ee-repo-ref.txt | 2 +- backend/windmill-api/openapi.yaml | 10 ++++++++++ backend/windmill-audit/src/lib.rs | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 8566c1287c..6a6aaf20e8 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -114,7 +114,7 @@ windmill-parser-graphql = { path = "./parsers/windmill-parser-graphql" } windmill-parser-php = { path = "./parsers/windmill-parser-php" } windmill-api-client = { path = "./windmill-api-client" } -axum = { version = "^0.7", features = ["multipart"] } +axum = { version = "^0.7", features = ["multipart"] } headers = "^0" hyper = { version = "^1", features = ["full"] } tokio = { version = "^1", features = ["full", "tracing"] } diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 1fd91cf9b4..e638406882 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -ffc6e57d99f19adda60fa4baa8623413c44bb4dd \ No newline at end of file +d414242f92cfaf9f364e9aeb321a511c3ad46fa7 \ No newline at end of file diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 174c059bb8..dee6037b1b 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -114,6 +114,16 @@ paths: - $ref: "#/components/parameters/After" - $ref: "#/components/parameters/Username" - $ref: "#/components/parameters/Operation" + - name: operations + in: query + description: comma separated list of exact operations to include + schema: + type: string + - name: exclude_operations + in: query + description: comma separated list of operations to exclude + schema: + type: string - $ref: "#/components/parameters/ResourceName" - $ref: "#/components/parameters/ActionKind" diff --git a/backend/windmill-audit/src/lib.rs b/backend/windmill-audit/src/lib.rs index 103fe591ad..b6522186ca 100644 --- a/backend/windmill-audit/src/lib.rs +++ b/backend/windmill-audit/src/lib.rs @@ -28,6 +28,8 @@ pub struct AuditLog { pub struct ListAuditLogQuery { pub username: Option, pub operation: Option, + pub operations: Option, + pub exclude_operations: Option, pub action_kind: Option, pub resource: Option, pub before: Option>,