Merge pull request #7525 from thaJeztah/remove_deprecated_stubs

remove some (aliases for) deprecated functions
This commit is contained in:
Phil Estes
2022-12-06 11:49:18 -05:00
committed by GitHub
7 changed files with 7 additions and 220 deletions

View File

@@ -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

View File

@@ -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
}