@@ -18,17 +18,6 @@ import (
18
18
"github.com/spf13/cobra"
19
19
)
20
20
21
- // unencryptedWarning warns the user when using an insecure credential storage.
22
- // After a deprecation period, user will get prompted if stdin and stderr are a terminal.
23
- // Otherwise, we'll assume they want it (sadly), because people may have been scripting
24
- // insecure logins and we don't want to break them. Maybe they'll see the warning in their
25
- // logs and fix things.
26
- const unencryptedWarning = `
27
- WARNING! Your credentials are stored unencrypted in '%s'.
28
- Configure a credential helper to remove this warning. See
29
- https://docs.docker.com/go/credential-store/
30
- `
31
-
32
21
type loginOptions struct {
33
22
serverAddress string
34
23
user string
@@ -66,11 +55,6 @@ func NewLoginCommand(dockerCli command.Cli) *cobra.Command {
66
55
return cmd
67
56
}
68
57
69
- type isFileStore interface {
70
- IsFileStore () bool
71
- GetFilename () string
72
- }
73
-
74
58
func verifyloginOptions (dockerCli command.Cli , opts * loginOptions ) error {
75
59
if opts .password != "" {
76
60
fmt .Fprintln (dockerCli .Err (), "WARNING! Using --password via the CLI is insecure. Use --password-stdin." )
@@ -137,16 +121,10 @@ func runLogin(ctx context.Context, dockerCli command.Cli, opts loginOptions) err
137
121
}
138
122
139
123
creds := dockerCli .ConfigFile ().GetCredentialsStore (serverAddress )
140
-
141
124
if err := creds .Store (configtypes .AuthConfig (authConfig )); err != nil {
142
125
return errors .Errorf ("Error saving credentials: %v" , err )
143
126
}
144
127
145
- if store , isDefault := creds .(isFileStore ); isDefault && authConfig .Password != "" {
146
- // Display a warning if we're storing the users password (not a token)
147
- _ , _ = fmt .Fprintln (dockerCli .Err (), fmt .Sprintf (unencryptedWarning , store .GetFilename ()))
148
- }
149
-
150
128
if response .Status != "" {
151
129
fmt .Fprintln (dockerCli .Out (), response .Status )
152
130
}
0 commit comments