Skip to content

Commit

Permalink
feat: log invalid credentials on info level instead of error/warning (#…
Browse files Browse the repository at this point in the history
…517)

Closes #505
  • Loading branch information
catper authored Sep 17, 2020
1 parent 4580ab1 commit a372b5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/decision.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (h *DecisionHandler) decisions(w http.ResponseWriter, r *http.Request) {
h.r.Logger().WithError(err).
WithFields(fields).
WithField("granted", false).
Warn("Access request denied")
Info("Access request denied")

h.r.ProxyRequestHandler().HandleError(w, r, rl, err)
return
Expand Down
3 changes: 3 additions & 0 deletions proxy/request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ func (d *RequestHandler) HandleRequest(r *http.Request, rl *rule.Rule) (session
// The authentication handler says that no further authentication/authorization is required, and the request should
// be forwarded to its final destination.
// return nil
case helper.ErrUnauthorized.ErrorField:
d.r.Logger().Info(err)
return nil, err
default:
d.r.Logger().WithError(err).
WithFields(fields).
Expand Down

0 comments on commit a372b5f

Please sign in to comment.