mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
simplify audit logging for replication and ILM (#12610)
auditLog should be attempted right before the return of the function and not multiple times per function, this ensures that we only trigger it once per function call.
This commit is contained in:
@@ -142,7 +142,11 @@ func GetAuditEntry(ctx context.Context) *audit.Entry {
|
||||
if ok {
|
||||
return r
|
||||
}
|
||||
r = &audit.Entry{}
|
||||
r = &audit.Entry{
|
||||
Version: audit.Version,
|
||||
DeploymentID: globalDeploymentID,
|
||||
Time: time.Now().UTC().Format(time.RFC3339Nano),
|
||||
}
|
||||
SetAuditEntry(ctx, r)
|
||||
return r
|
||||
}
|
||||
@@ -165,7 +169,8 @@ func AuditLog(ctx context.Context, w http.ResponseWriter, r *http.Request, reqCl
|
||||
}
|
||||
|
||||
entry = audit.ToEntry(w, r, reqClaims, globalDeploymentID)
|
||||
entry.Trigger = "external-request"
|
||||
// indicates all requests for this API call are inbound
|
||||
entry.Trigger = "incoming"
|
||||
|
||||
for _, filterKey := range filterKeys {
|
||||
delete(entry.ReqClaims, filterKey)
|
||||
|
||||
Reference in New Issue
Block a user