@@ -10,7 +10,6 @@ import (
1010 "time"
1111
1212 "github.com/creack/pty"
13- configtypes "github.com/docker/cli/cli/config/types"
1413 "github.com/docker/cli/cli/streams"
1514 "github.com/docker/cli/internal/prompt"
1615 "github.com/docker/cli/internal/registry"
@@ -90,14 +89,14 @@ func TestLoginWithCredStoreCreds(t *testing.T) {
9089func TestRunLogin (t * testing.T ) {
9190 testCases := []struct {
9291 doc string
93- priorCredentials map [string ]configtypes .AuthConfig
92+ priorCredentials map [string ]registrytypes .AuthConfig
9493 input loginOptions
95- expectedCredentials map [string ]configtypes .AuthConfig
94+ expectedCredentials map [string ]registrytypes .AuthConfig
9695 expectedErr string
9796 }{
9897 {
9998 doc : "valid auth from store" ,
100- priorCredentials : map [string ]configtypes .AuthConfig {
99+ priorCredentials : map [string ]registrytypes .AuthConfig {
101100 "reg1" : {
102101 Username : "my-username" ,
103102 Password : "a-password" ,
@@ -107,7 +106,7 @@ func TestRunLogin(t *testing.T) {
107106 input : loginOptions {
108107 serverAddress : "reg1" ,
109108 },
110- expectedCredentials : map [string ]configtypes .AuthConfig {
109+ expectedCredentials : map [string ]registrytypes .AuthConfig {
111110 "reg1" : {
112111 Username : "my-username" ,
113112 Password : "a-password" ,
@@ -117,7 +116,7 @@ func TestRunLogin(t *testing.T) {
117116 },
118117 {
119118 doc : "expired auth from store" ,
120- priorCredentials : map [string ]configtypes .AuthConfig {
119+ priorCredentials : map [string ]registrytypes .AuthConfig {
121120 "reg1" : {
122121 Username : "my-username" ,
123122 Password : expiredPassword ,
@@ -131,13 +130,13 @@ func TestRunLogin(t *testing.T) {
131130 },
132131 {
133132 doc : "store valid username and password" ,
134- priorCredentials : map [string ]configtypes .AuthConfig {},
133+ priorCredentials : map [string ]registrytypes .AuthConfig {},
135134 input : loginOptions {
136135 serverAddress : "reg1" ,
137136 user : "my-username" ,
138137 password : "p2" ,
139138 },
140- expectedCredentials : map [string ]configtypes .AuthConfig {
139+ expectedCredentials : map [string ]registrytypes .AuthConfig {
141140 "reg1" : {
142141 Username : "my-username" ,
143142 Password : "p2" ,
@@ -147,7 +146,7 @@ func TestRunLogin(t *testing.T) {
147146 },
148147 {
149148 doc : "unknown user w/ prior credentials" ,
150- priorCredentials : map [string ]configtypes .AuthConfig {
149+ priorCredentials : map [string ]registrytypes .AuthConfig {
151150 "reg1" : {
152151 Username : "my-username" ,
153152 Password : "a-password" ,
@@ -160,7 +159,7 @@ func TestRunLogin(t *testing.T) {
160159 password : "a-password" ,
161160 },
162161 expectedErr : errUnknownUser ,
163- expectedCredentials : map [string ]configtypes .AuthConfig {
162+ expectedCredentials : map [string ]registrytypes .AuthConfig {
164163 "reg1" : {
165164 Username : "a-password" ,
166165 Password : "a-password" ,
@@ -170,24 +169,24 @@ func TestRunLogin(t *testing.T) {
170169 },
171170 {
172171 doc : "unknown user w/o prior credentials" ,
173- priorCredentials : map [string ]configtypes .AuthConfig {},
172+ priorCredentials : map [string ]registrytypes .AuthConfig {},
174173 input : loginOptions {
175174 serverAddress : "reg1" ,
176175 user : unknownUser ,
177176 password : "a-password" ,
178177 },
179178 expectedErr : errUnknownUser ,
180- expectedCredentials : map [string ]configtypes .AuthConfig {},
179+ expectedCredentials : map [string ]registrytypes .AuthConfig {},
181180 },
182181 {
183182 doc : "store valid token" ,
184- priorCredentials : map [string ]configtypes .AuthConfig {},
183+ priorCredentials : map [string ]registrytypes .AuthConfig {},
185184 input : loginOptions {
186185 serverAddress : "reg1" ,
187186 user : "my-username" ,
188187 password : useToken ,
189188 },
190- expectedCredentials : map [string ]configtypes .AuthConfig {
189+ expectedCredentials : map [string ]registrytypes .AuthConfig {
191190 "reg1" : {
192191 Username : "my-username" ,
193192 IdentityToken : useToken ,
@@ -197,7 +196,7 @@ func TestRunLogin(t *testing.T) {
197196 },
198197 {
199198 doc : "valid token from store" ,
200- priorCredentials : map [string ]configtypes .AuthConfig {
199+ priorCredentials : map [string ]registrytypes .AuthConfig {
201200 "reg1" : {
202201 Username : "my-username" ,
203202 Password : useToken ,
@@ -207,7 +206,7 @@ func TestRunLogin(t *testing.T) {
207206 input : loginOptions {
208207 serverAddress : "reg1" ,
209208 },
210- expectedCredentials : map [string ]configtypes .AuthConfig {
209+ expectedCredentials : map [string ]registrytypes .AuthConfig {
211210 "reg1" : {
212211 Username : "my-username" ,
213212 IdentityToken : useToken ,
@@ -217,12 +216,12 @@ func TestRunLogin(t *testing.T) {
217216 },
218217 {
219218 doc : "no registry specified defaults to index server" ,
220- priorCredentials : map [string ]configtypes .AuthConfig {},
219+ priorCredentials : map [string ]registrytypes .AuthConfig {},
221220 input : loginOptions {
222221 user : "my-username" ,
223222 password : "my-password" ,
224223 },
225- expectedCredentials : map [string ]configtypes .AuthConfig {
224+ expectedCredentials : map [string ]registrytypes .AuthConfig {
226225 registry .IndexServer : {
227226 Username : "my-username" ,
228227 Password : "my-password" ,
@@ -232,13 +231,13 @@ func TestRunLogin(t *testing.T) {
232231 },
233232 {
234233 doc : "registry-1.docker.io" ,
235- priorCredentials : map [string ]configtypes .AuthConfig {},
234+ priorCredentials : map [string ]registrytypes .AuthConfig {},
236235 input : loginOptions {
237236 serverAddress : "registry-1.docker.io" ,
238237 user : "my-username" ,
239238 password : "my-password" ,
240239 },
241- expectedCredentials : map [string ]configtypes .AuthConfig {
240+ expectedCredentials : map [string ]registrytypes .AuthConfig {
242241 "registry-1.docker.io" : {
243242 Username : "my-username" ,
244243 Password : "my-password" ,
@@ -249,13 +248,13 @@ func TestRunLogin(t *testing.T) {
249248 // Regression test for https://github.com/docker/cli/issues/5382
250249 {
251250 doc : "sanitizes server address to remove repo" ,
252- priorCredentials : map [string ]configtypes .AuthConfig {},
251+ priorCredentials : map [string ]registrytypes .AuthConfig {},
253252 input : loginOptions {
254253 serverAddress : "registry-1.docker.io/bork/test" ,
255254 user : "my-username" ,
256255 password : "a-password" ,
257256 },
258- expectedCredentials : map [string ]configtypes .AuthConfig {
257+ expectedCredentials : map [string ]registrytypes .AuthConfig {
259258 "registry-1.docker.io" : {
260259 Username : "my-username" ,
261260 Password : "a-password" ,
@@ -266,7 +265,7 @@ func TestRunLogin(t *testing.T) {
266265 // Regression test for https://github.com/docker/cli/issues/5382
267266 {
268267 doc : "updates credential if server address includes repo" ,
269- priorCredentials : map [string ]configtypes .AuthConfig {
268+ priorCredentials : map [string ]registrytypes .AuthConfig {
270269 "registry-1.docker.io" : {
271270 Username : "my-username" ,
272271 Password : "a-password" ,
@@ -278,7 +277,7 @@ func TestRunLogin(t *testing.T) {
278277 user : "my-username" ,
279278 password : "new-password" ,
280279 },
281- expectedCredentials : map [string ]configtypes .AuthConfig {
280+ expectedCredentials : map [string ]registrytypes .AuthConfig {
282281 "registry-1.docker.io" : {
283282 Username : "my-username" ,
284283 Password : "new-password" ,
@@ -428,7 +427,7 @@ func TestLoginNonInteractive(t *testing.T) {
428427 if serverAddress == "" {
429428 serverAddress = "https://index.docker.io/v1/"
430429 }
431- assert .NilError (t , cfg .GetCredentialsStore (serverAddress ).Store (configtypes .AuthConfig {
430+ assert .NilError (t , cfg .GetCredentialsStore (serverAddress ).Store (registrytypes .AuthConfig {
432431 Username : "my-username" ,
433432 Password : "my-password" ,
434433 ServerAddress : serverAddress ,
0 commit comments