move audit and logger message structure to minio/pkg (#16655)

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2023-02-21 21:21:17 -08:00
committed by GitHub
parent 6b65ba1551
commit fb17f97cf3
15 changed files with 25 additions and 151 deletions
+5 -3
View File
@@ -24,10 +24,12 @@ import (
"strconv"
"time"
internalAudit "github.com/minio/minio/internal/logger/message/audit"
"github.com/minio/pkg/logger/message/audit"
"github.com/klauspost/compress/gzhttp"
"github.com/minio/madmin-go/v2"
xhttp "github.com/minio/minio/internal/http"
"github.com/minio/minio/internal/logger/message/audit"
)
const contextAuditKey = contextKeyType("audit-entry")
@@ -49,7 +51,7 @@ func GetAuditEntry(ctx context.Context) *audit.Entry {
return r
}
r = &audit.Entry{
Version: audit.Version,
Version: internalAudit.Version,
DeploymentID: xhttp.GlobalDeploymentID,
Time: time.Now().UTC(),
}
@@ -74,7 +76,7 @@ func AuditLog(ctx context.Context, w http.ResponseWriter, r *http.Request, reqCl
reqInfo.RLock()
defer reqInfo.RUnlock()
entry = audit.ToEntry(w, r, reqClaims, xhttp.GlobalDeploymentID)
entry = internalAudit.ToEntry(w, r, reqClaims, xhttp.GlobalDeploymentID)
// indicates all requests for this API call are inbound
entry.Trigger = "incoming"