Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions registry/handlers/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,10 @@ func (app *App) authorized(w http.ResponseWriter, r *http.Request, context *Cont
if err := errcode.ServeJSON(w, errcode.ErrorCodeUnauthorized.WithDetail(accessRecords)); err != nil {
dcontext.GetLogger(context).Errorf("error serving error json: %v (from %v)", err, context.Errors)
}
case errcode.Error:
if err := errcode.ServeJSON(w, err); err != nil {
dcontext.GetLogger(context).Errorf("error serving error json: %v (from %v)", err, context.Errors)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information

[Sensitive data returned by an access to password](1) flows to a logging call.
}
default:
// This condition is a potential security problem either in
// the configuration or whatever is backing the access
Expand Down
8 changes: 7 additions & 1 deletion registry/handlers/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,13 @@ func (imh *manifestHandler) PutManifest(w http.ResponseWriter, r *http.Request)
tags := imh.Repository.Tags(imh)
err = tags.Tag(imh, imh.Tag, desc)
if err != nil {
imh.Errors = append(imh.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
switch err := err.(type) {
case errcode.Error:
imh.Errors = append(imh.Errors, err)
default:
imh.Errors = append(imh.Errors, errcode.ErrorCodeUnknown.WithDetail(err))
}

return
}

Expand Down