forked from baron/baron-sso
golangci lint 적용
This commit is contained in:
@@ -99,7 +99,7 @@ func AuditMiddleware(config AuditConfig) fiber.Handler {
|
||||
// 4. Gather Metrics & Context
|
||||
latency := time.Since(start)
|
||||
status := c.Response().StatusCode()
|
||||
|
||||
|
||||
// If Fiber handler returned an error, status might default to 500 or be in the error
|
||||
if err != nil {
|
||||
if fiberErr, ok := err.(*fiber.Error); ok {
|
||||
@@ -120,7 +120,7 @@ func AuditMiddleware(config AuditConfig) fiber.Handler {
|
||||
tenantID, _ := c.Locals("tenant_id").(string)
|
||||
sessionID, _ := c.Locals("session_id").(string)
|
||||
clientIP := extractClientIP(c)
|
||||
|
||||
|
||||
// 6. Capture & Mask Body
|
||||
var maskedBody string
|
||||
if config.BodyDump {
|
||||
@@ -187,7 +187,7 @@ func AuditMiddleware(config AuditConfig) fiber.Handler {
|
||||
|
||||
// 9. Store Log (Policy Enforcement)
|
||||
_, isWrite := writeMethods[c.Method()]
|
||||
|
||||
|
||||
if isNil(config.Repo) {
|
||||
if isWrite {
|
||||
slog.Error("Audit repository missing for command", "req_id", reqID)
|
||||
|
||||
Reference in New Issue
Block a user