ContainerRegistry - removed Basic Auth header (#19735)

* Removed Basic Auth header.

* Fixed test.
tokarchuk/v1.17
KN4CK3R 3 years ago committed by GitHub
parent 6d54799bbc
commit 9ea9206406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      integrations/api_packages_container_test.go
  2. 1
      routers/api/packages/container/container.go

@ -66,10 +66,7 @@ func TestPackageContainer(t *testing.T) {
Token string `json:"token"` Token string `json:"token"`
} }
authenticate := []string{ authenticate := []string{`Bearer realm="` + setting.AppURL + `v2/token"`}
`Bearer realm="` + setting.AppURL + `v2/token"`,
`Basic`,
}
t.Run("Anonymous", func(t *testing.T) { t.Run("Anonymous", func(t *testing.T) {
defer PrintCurrentTest(t)() defer PrintCurrentTest(t)()

@ -113,7 +113,6 @@ func apiErrorDefined(ctx *context.Context, err *namedError) {
func ReqContainerAccess(ctx *context.Context) { func ReqContainerAccess(ctx *context.Context) {
if ctx.Doer == nil { if ctx.Doer == nil {
ctx.Resp.Header().Add("WWW-Authenticate", `Bearer realm="`+setting.AppURL+`v2/token"`) ctx.Resp.Header().Add("WWW-Authenticate", `Bearer realm="`+setting.AppURL+`v2/token"`)
ctx.Resp.Header().Add("WWW-Authenticate", `Basic`)
apiErrorDefined(ctx, errUnauthorized) apiErrorDefined(ctx, errUnauthorized)
} }
} }

Loading…
Cancel
Save