@@ -28,7 +28,7 @@ import (
28
28
"github.com/docker/distribution/registry/api/errcode"
29
29
"github.com/docker/distribution/registry/client/auth"
30
30
"github.com/docker/distribution/registry/client/transport"
31
- "github.com/docker/docker/api/types"
31
+ apiregistry "github.com/docker/docker/api/types/registry "
32
32
"github.com/docker/docker/errdefs"
33
33
"github.com/docker/docker/registry"
34
34
"github.com/docker/go-connections/tlsconfig"
@@ -41,7 +41,7 @@ import (
41
41
// They are not exposed in the docker/registry package that's why they are copied here
42
42
43
43
type loginCredentialStore struct {
44
- authConfig * types .AuthConfig
44
+ authConfig * apiregistry .AuthConfig
45
45
}
46
46
47
47
func (lcs loginCredentialStore ) Basic (* url.URL ) (string , string ) {
@@ -59,7 +59,7 @@ func (lcs loginCredentialStore) SetRefreshToken(u *url.URL, service, token strin
59
59
// loginWithTLS tries to login to the v2 registry server.
60
60
// A custom tls.Config is used to override the default TLS configuration of the different registry endpoints.
61
61
// The tls.Config is created using the provided certificate, certificate key and certificate authority.
62
- func (c * Client ) loginWithTLS (ctx context.Context , service * registry.Service , certFile , keyFile , caFile string , authConfig * types .AuthConfig , userAgent string ) (string , string , error ) {
62
+ func (c * Client ) loginWithTLS (ctx context.Context , service * registry.Service , certFile , keyFile , caFile string , authConfig * apiregistry .AuthConfig , userAgent string ) (string , string , error ) {
63
63
tlsConfig , err := tlsconfig .Client (tlsconfig.Options {CAFile : caFile , CertFile : certFile , KeyFile : keyFile })
64
64
if err != nil {
65
65
return "" , "" , err
@@ -119,7 +119,7 @@ func (c *Client) getEndpoints(address string, service *registry.Service) ([]regi
119
119
// loginV2 tries to login to the v2 registry server. The given registry
120
120
// endpoint will be pinged to get authorization challenges. These challenges
121
121
// will be used to authenticate against the registry to validate credentials.
122
- func loginV2 (authConfig * types .AuthConfig , endpoint registry.APIEndpoint , userAgent string ) (string , string , error ) {
122
+ func loginV2 (authConfig * apiregistry .AuthConfig , endpoint registry.APIEndpoint , userAgent string ) (string , string , error ) {
123
123
var (
124
124
endpointStr = strings .TrimRight (endpoint .URL .String (), "/" ) + "/v2/"
125
125
modifiers = registry .Headers (userAgent , nil )
0 commit comments