diff options
| author | noah <noah@hackedu.io> | 2021-10-26 01:51:27 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-25 14:51:27 +0200 |
| commit | b4f28e8f48d38559b23453e1e913f6bb3361fc25 (patch) | |
| tree | 642ab37726593d209dab112eef61e813fa5f3fcd | |
| parent | 4b130437536e3e321b4ad1ca9dc725f771f3d697 (diff) | |
fix: add basic authentication handler (#281)
fixes #276
| -rw-r--r-- | pkg/registry/client.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/registry/client.go b/pkg/registry/client.go index 816eda2..5ec434c 100644 --- a/pkg/registry/client.go +++ b/pkg/registry/client.go @@ -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, } |
