mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
flatten out audit tags, do not send as free-form (#20256)
move away from map[string]interface{} to map[string]string
to simplify the audit, and also provide concise information.
avoids large allocations under load(), reduces the amount
of audit information generated, as the current implementation
was a bit free-form. instead all datastructures must be
flattened.
This commit is contained in:
@@ -910,7 +910,7 @@ type AuditLogOptions struct {
|
||||
Object string
|
||||
VersionID string
|
||||
Error string
|
||||
Tags map[string]interface{}
|
||||
Tags map[string]string
|
||||
}
|
||||
|
||||
// sends audit logs for internal subsystem activity
|
||||
@@ -935,7 +935,7 @@ func auditLogInternal(ctx context.Context, opts AuditLogOptions) {
|
||||
// Merge tag information if found - this is currently needed for tags
|
||||
// set during decommissioning.
|
||||
if reqInfo := logger.GetReqInfo(ctx); reqInfo != nil {
|
||||
reqInfo.PopulateTagsMap(entry.Tags)
|
||||
reqInfo.PopulateTagsMap(opts.Tags)
|
||||
}
|
||||
ctx = logger.SetAuditEntry(ctx, &entry)
|
||||
logger.AuditLog(ctx, nil, nil, nil)
|
||||
|
||||
Reference in New Issue
Block a user