diff --git a/remotes/docker/authorizer.go b/remotes/docker/authorizer.go index eaa0e5dbd..57479ef63 100644 --- a/remotes/docker/authorizer.go +++ b/remotes/docker/authorizer.go @@ -45,13 +45,6 @@ type dockerAuthorizer struct { onFetchRefreshToken OnFetchRefreshToken } -// NewAuthorizer creates a Docker authorizer using the provided function to -// get credentials for the token server or basic auth. -// Deprecated: Use NewDockerAuthorizer -func NewAuthorizer(client *http.Client, f func(string) (string, string, error)) Authorizer { - return NewDockerAuthorizer(WithAuthClient(client), WithAuthCreds(f)) -} - type authorizerConfig struct { credentials func(string) (string, string, error) client *http.Client diff --git a/remotes/docker/resolver_test.go b/remotes/docker/resolver_test.go index c1311ac0d..4719e75fb 100644 --- a/remotes/docker/resolver_test.go +++ b/remotes/docker/resolver_test.go @@ -68,11 +68,15 @@ func TestBasicResolver(t *testing.T) { }) base, options, close := tlsServer(wrapped) + authorizer := NewDockerAuthorizer( + WithAuthClient(options.Client), + WithAuthCreds(func(host string) (string, string, error) { + return "user1", "password1", nil + }), + ) options.Hosts = ConfigureDefaultRegistries( WithClient(options.Client), - WithAuthorizer(NewAuthorizer(options.Client, func(string) (string, string, error) { - return "user1", "password1", nil - })), + WithAuthorizer(authorizer), ) return base, options, close }