(ctx context.Context, options client.RegistryLoginOptions)
| 351 | } |
| 352 | |
| 353 | func loginClientSide(ctx context.Context, options client.RegistryLoginOptions) (client.RegistryLoginResult, error) { |
| 354 | svc, err := registry.NewService(registry.ServiceOptions{}) |
| 355 | if err != nil { |
| 356 | return client.RegistryLoginResult{}, err |
| 357 | } |
| 358 | |
| 359 | auth := registrytypes.AuthConfig{ |
| 360 | Username: options.Username, |
| 361 | Password: options.Password, |
| 362 | ServerAddress: options.ServerAddress, |
| 363 | IdentityToken: options.IdentityToken, |
| 364 | RegistryToken: options.RegistryToken, |
| 365 | } |
| 366 | |
| 367 | token, err := svc.Auth(ctx, &auth, command.UserAgent()) |
| 368 | if err != nil { |
| 369 | return client.RegistryLoginResult{}, err |
| 370 | } |
| 371 | |
| 372 | return client.RegistryLoginResult{ |
| 373 | Auth: registrytypes.AuthResponse{ |
| 374 | Status: "Login Succeeded", |
| 375 | IdentityToken: token, |
| 376 | }, |
| 377 | }, nil |
| 378 | } |
no test coverage detected
searching dependent graphs…