Conversation
7857173 to 70024d8 Compare
chris-crone left a comment
There was a problem hiding this comment.
Some minor changes but exciting to see this!
caeae29 to 563cc64 Compare ae61aef to 77884c5 Compare
chris-crone left a comment
There was a problem hiding this comment.
Only fix needed before LGTM is the annon typo.
| cmd := &cobra.Command{ | ||
| Use: loginName + " USERNAME", | ||
| Short: "Login to the Hub", | ||
| Args: cli.ExactArgs(1), |
There was a problem hiding this comment.
In a followup if the user doesn't specify their user name we can prompt them for it
There was a problem hiding this comment.
Why would they do that? The doc is explicit enough ![]()
0cb970c to 31c6a68 Compare c113a0c to 8fa904f Compare | return err | ||
| } | ||
| if ac.TokenExpired() { | ||
| return login.RunLogin(streams, hubClient, store, ac.Username) |
There was a problem hiding this comment.
Question: I think we shouldn't run a full login here, but just use stored credentials (username and password) to silently renew the token. Maybe in a follow-up?
| ac, err := store.GetAuth() | ||
| if err != nil || ac.Username == "" { | ||
| fmt.Println(ansi.Error(`You need to be logged in to Docker Hub to use this tool. | ||
| Please login to Docker Hub using the "hub-tool login" command.`)) |
There was a problem hiding this comment.
Question: Regarding what we do for "sudo" commands, maybe we could run the login command here, then execute the command, instead of erroring out ?
There was a problem hiding this comment.
Yes, I'll open a ticket, we'll do it in a followup because it's not a simple change and it's the end of the day
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com> Use credentials helper to store auth configuration Signed-off-by: Djordje Lukic <djordje.lukic@docker.com> Remove useless auth resolver Signed-off-by: Djordje Lukic <djordje.lukic@docker.com> Use docker.Streams instead of the cli Signed-off-by: Djordje Lukic <djordje.lukic@docker.com> Make account info and all PAT commands sudo (require login) Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
| Thanks for the hard work @rumpl 🤗 |
- What I did
Implemented
hub-tool loginthat handles 2FA.- How I did it
@silvin-lubecki did the 2FA part, I added the saving of the authentication and the token in the keystore.
- How to verify it
Login:
Use
hub-tool:- Description for the changelog
- A picture of a cute animal (not mandatory)
