mirror of
https://github.com/project-zot/zot.git
synced 2026-06-18 05:28:07 +08:00
Fix remaining review comments
- Standardize terminology: use 'OIDC claims' consistently - Clarify audience verification comment - Improve error handling when no bearer method is configured - Fix Authorization header case in documentation (Bearer not bearer) Co-authored-by: rchincha <45800463+rchincha@users.noreply.github.com>
This commit is contained in:
+8
-1
@@ -624,7 +624,14 @@ func bearerAuthHandler(ctlr *Controller) mux.MiddlewareFunc {
|
||||
}
|
||||
|
||||
// No authentication succeeded
|
||||
ctlr.Log.Error().Msg("bearer authentication failed")
|
||||
if isAuthorizationHeaderEmpty(request) {
|
||||
// No bearer token provided and no authentication method configured
|
||||
ctlr.Log.Debug().Msg("no bearer token provided")
|
||||
} else {
|
||||
// Bearer token provided but authentication failed
|
||||
ctlr.Log.Error().Msg("bearer authentication failed")
|
||||
}
|
||||
|
||||
response.Header().Set("Content-Type", "application/json")
|
||||
zcommon.WriteJSON(response, http.StatusUnauthorized, apiErr.NewError(apiErr.UNAUTHORIZED))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user