Skip to content

Commit

Permalink
fix: add basic authentication handler (#281)
Browse files Browse the repository at this point in the history
fixes #276
  • Loading branch information
iamnoah authored Oct 25, 2021
1 parent 4b13043 commit b4f28e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@ func (clt *registryClient) NewRepository(nameInRepository string) error {
return err
}

var transport http.RoundTripper = transport.NewTransport(
authTransport := transport.NewTransport(
clt.endpoint.GetTransport(), auth.NewAuthorizer(
challengeManager1,
auth.NewTokenHandler(nil, clt.creds, nameInRepository, "pull")))
auth.NewTokenHandler(nil, clt.creds, nameInRepository, "pull"),
auth.NewBasicHandler(clt.creds)))

rlt := &rateLimitTransport{
limiter: clt.endpoint.Limiter,
transport: transport,
transport: authTransport,
endpoint: clt.endpoint,
}

Expand Down

1 comment on commit b4f28e8

@tuananh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL I was about to open a PR :))

Please sign in to comment.