Skip to content

Commit b4f28e8

Browse files
author
noah
authored
fix: add basic authentication handler (#281)
fixes #276
1 parent 4b13043 commit b4f28e8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/registry/client.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,15 @@ func (clt *registryClient) NewRepository(nameInRepository string) error {
9999
return err
100100
}
101101

102-
var transport http.RoundTripper = transport.NewTransport(
102+
authTransport := transport.NewTransport(
103103
clt.endpoint.GetTransport(), auth.NewAuthorizer(
104104
challengeManager1,
105-
auth.NewTokenHandler(nil, clt.creds, nameInRepository, "pull")))
105+
auth.NewTokenHandler(nil, clt.creds, nameInRepository, "pull"),
106+
auth.NewBasicHandler(clt.creds)))
106107

107108
rlt := &rateLimitTransport{
108109
limiter: clt.endpoint.Limiter,
109-
transport: transport,
110+
transport: authTransport,
110111
endpoint: clt.endpoint,
111112
}
112113

0 commit comments

Comments
 (0)