fix: exclude search endpoint from audit log
POST /api/v1/search/executions is a read-only query using POST for the request body. Skip it in AuditInterceptor to avoid flooding the audit log with search operations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import java.util.Set;
|
|||||||
public class AuditInterceptor implements HandlerInterceptor {
|
public class AuditInterceptor implements HandlerInterceptor {
|
||||||
|
|
||||||
private static final Set<String> AUDITABLE_METHODS = Set.of("POST", "PUT", "DELETE");
|
private static final Set<String> AUDITABLE_METHODS = Set.of("POST", "PUT", "DELETE");
|
||||||
|
private static final Set<String> EXCLUDED_PATHS = Set.of("/api/v1/search/executions");
|
||||||
|
|
||||||
private final AuditService auditService;
|
private final AuditService auditService;
|
||||||
|
|
||||||
@@ -40,6 +41,9 @@ public class AuditInterceptor implements HandlerInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String path = request.getRequestURI();
|
String path = request.getRequestURI();
|
||||||
|
if (EXCLUDED_PATHS.contains(path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
AuditResult result = response.getStatus() < 400 ? AuditResult.SUCCESS : AuditResult.FAILURE;
|
AuditResult result = response.getStatus() < 400 ? AuditResult.SUCCESS : AuditResult.FAILURE;
|
||||||
|
|
||||||
auditService.log(
|
auditService.log(
|
||||||
|
|||||||
Reference in New Issue
Block a user