@@ -34,34 +34,6 @@ const (
3434// [registry.IndexServer]: https://pkg.go.dev/github.com/docker/[email protected] +incompatible/registry#IndexServer 3535const authConfigKey = "https://index.docker.io/v1/"
3636
37- // RegistryAuthenticationPrivilegedFunc returns a RequestPrivilegeFunc from the specified registry index info
38- // for the given command to prompt the user for username and password.
39- //
40- // Deprecated: this function is no longer used and will be removed in the next release.
41- func RegistryAuthenticationPrivilegedFunc (cli Cli , index * registrytypes.IndexInfo , cmdName string ) registrytypes.RequestAuthConfig {
42- configKey := getAuthConfigKey (index .Name )
43- isDefaultRegistry := configKey == authConfigKey || index .Official
44- return func (ctx context.Context ) (string , error ) {
45- _ , _ = fmt .Fprintf (cli .Out (), "\n Login prior to %s:\n " , cmdName )
46- authConfig , err := GetDefaultAuthConfig (cli .ConfigFile (), true , configKey , isDefaultRegistry )
47- if err != nil {
48- _ , _ = fmt .Fprintf (cli .Err (), "Unable to retrieve stored credentials for %s, error: %s.\n " , configKey , err )
49- }
50-
51- select {
52- case <- ctx .Done ():
53- return "" , ctx .Err ()
54- default :
55- }
56-
57- authConfig , err = PromptUserForCredentials (ctx , cli , "" , "" , authConfig .Username , configKey )
58- if err != nil {
59- return "" , err
60- }
61- return registrytypes .EncodeAuthConfig (authConfig )
62- }
63- }
64-
6537// ResolveAuthConfig returns auth-config for the given registry from the
6638// credential-store. It returns an empty AuthConfig if no credentials were
6739// found.
0 commit comments