From 29d4d5b3fdee960060c192ecb0577a4c39cccb23 Mon Sep 17 00:00:00 2001 From: Bryon Nevis Date: Thu, 9 Mar 2023 09:43:57 -0800 Subject: [PATCH] fix: Authentication status is now DEBUG, auth failure is WARN (#467) Signed-off-by: Bryon Nevis --- bootstrap/handlers/auth_middleware.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap/handlers/auth_middleware.go b/bootstrap/handlers/auth_middleware.go index 58c7a960..9cea0b23 100644 --- a/bootstrap/handlers/auth_middleware.go +++ b/bootstrap/handlers/auth_middleware.go @@ -47,7 +47,7 @@ func VaultAuthenticationHandlerFunc(secretProvider interfaces.SecretProvider, lc return func(inner http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { authHeader := r.Header.Get("Authorization") - lc.Infof("Authorizing incoming call to '%s' via JWT (Authorization len=%d)", r.URL.Path, len(authHeader)) + lc.Debugf("Authorizing incoming call to '%s' via JWT (Authorization len=%d)", r.URL.Path, len(authHeader)) authParts := strings.Split(authHeader, " ") if len(authParts) >= 2 && strings.EqualFold(authParts[0], "Bearer") { token := authParts[1] @@ -57,11 +57,11 @@ func VaultAuthenticationHandlerFunc(secretProvider interfaces.SecretProvider, lc http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return } else if !validToken { - lc.Infof("Request to '%s' UNAUTHORIZED", r.URL.Path) + lc.Warnf("Request to '%s' UNAUTHORIZED", r.URL.Path) http.Error(w, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized) return } - lc.Infof("Request to '%s' authorized", r.URL.Path) + lc.Debug("Request to '%s' authorized", r.URL.Path) inner(w, r) return }