diff --git a/management/internals/modules/reverseproxy/accesslogs/filter.go b/management/internals/modules/reverseproxy/accesslogs/filter.go index a0f32215e..1b07386d4 100644 --- a/management/internals/modules/reverseproxy/accesslogs/filter.go +++ b/management/internals/modules/reverseproxy/accesslogs/filter.go @@ -27,6 +27,9 @@ var validSortFields = map[string]string{ "status_code": "status_code", "duration": "duration", "source_ip": "location_connection_ip", + "user_id": "user_id", + "auth_method": "auth_method_used", + "reason": "reason", } // AccessLogFilter holds pagination, filtering, and sorting parameters for access logs @@ -37,7 +40,7 @@ type AccessLogFilter struct { PageSize int // Sorting parameters - SortBy string // Field to sort by: timestamp, host, path, method, status_code, duration, source_ip + SortBy string // Field to sort by: timestamp, host, path, method, status_code, duration, source_ip, user_id, auth_method, reason SortOrder string // Sort order: asc or desc (default: desc) // Filtering parameters diff --git a/management/internals/modules/reverseproxy/accesslogs/filter_test.go b/management/internals/modules/reverseproxy/accesslogs/filter_test.go index 92d59ce95..10024c248 100644 --- a/management/internals/modules/reverseproxy/accesslogs/filter_test.go +++ b/management/internals/modules/reverseproxy/accesslogs/filter_test.go @@ -387,6 +387,9 @@ func TestAccessLogFilter_ValidSortFields(t *testing.T) { {"status_code", "status_code", "status_code", "status_code"}, {"duration", "duration", "duration", "duration"}, {"source_ip", "source_ip", "location_connection_ip", "source_ip"}, + {"user_id", "user_id", "user_id", "user_id"}, + {"auth_method", "auth_method", "auth_method_used", "auth_method"}, + {"reason", "reason", "reason", "reason"}, } for _, tt := range tests { diff --git a/shared/management/http/api/openapi.yml b/shared/management/http/api/openapi.yml index 42d3c9ff6..d2a56bed0 100644 --- a/shared/management/http/api/openapi.yml +++ b/shared/management/http/api/openapi.yml @@ -7413,7 +7413,7 @@ paths: name: sort_by schema: type: string - enum: [timestamp, host, path, method, status_code, duration, source_ip] + enum: [timestamp, host, path, method, status_code, duration, source_ip, user_id, auth_method, reason] default: timestamp description: Field to sort by - in: query