-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for docker cli login using Username and Email plugin #301
Conversation
Hi @itsCheithanya! 👋🏼 Since it has been a while since the PR was opened, I wanted to reach out and confirm if this PR is nearly ready for review? If it is, could you add a test config file at I'd love to see similar details for the other contributions too:
Happy to take a look soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
I have one question for now, and there are still some open TODOs in your submission. I'd love if you could have a look over them, before the next review round. 😄
Feel free to tag either me or any of my colleagues for another look. Thanks!
plugins/docker/user_login.go
Outdated
)} | ||
} | ||
|
||
var defaultEnvVarMapping = map[string]sdk.FieldName{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not able to find anywhere documentation related to this authentication method for docker against DockerHub (or other platforms).
Can you please provide some documentation on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yess here it is https://docs.docker.com/engine/reference/commandline/login/
One of the promises that shell plugins offer is that they leave no credential on disk, or outside 1Password. I would like to explore alternatives for this workflow, that do not require any credentials to land on disk. For example, I imagine that provisioning a configuration file that contains the credentials in a similar fashion that |
Yess that would be great,I would require guidance for that |
Happy to offer some tips. From what I can see, docker relies on a config-file based authentication, when credential stores are not used. That is, the plugin would need to provision a file with this format:
and add You can do this using our helper provisioner functions, such as:
Have a look at the Let me know if this helps, would love to chat more if you have other questions! |
Heyy yess thankyouu for that ,yes will look into |
From a first round of local testing, I have reasons to believe that our current FIFO approach might not work for the way Docker interacts with this config file. Could be wrong though. |
Yeah so how do think we should take this forward? |
I hopped on a call with Andi to try to figure this out - looks to be a discrepancy between our local setup. |
|
This happens because the So the correct syntax would be
should do the trick. |
@itsCheithanya let us know if you're getting stuck anywhere. We know temp file provisioning has been historically tricky to get working. |
Yeah so I was wondering how to write test case for |
Have a look at the |
@hculea @AndyTitu @arunsathiya changes done and test cases passed |
@techcraver I had a chat with @itsCheithanya and we decided we are going to leave this submission in this state, for the time being. @AndyTitu and I need to do some more research in order to see whether the current way the CLI works fully supports this plugin. We're going to count this towards the hackathon, but I'd love to talk about the blogpost requirement - I think there are a few unknowns that prohibit us from fully documenting this, at this point. |
@itsCheithanya I did some research on the docker plugin and here's what I came up with: Limitations: None of our existing provisioning solutions would fit: docker doesn't offer support for env vars, and after testing the FIFO approach for a while, it was apparent that it won't work 100% of the time. Proposed path forward: I found out that docker uses custom credential helpers as their go-to method to securely fetch credentials (docs here). If you're familiar with the docker credentials helper, wow you're a docker expert, but if you're not this cred helpers are basically just programs that need to respect a contract of returning a {"ServerURL":"%s","Username":"%q","Secret":"%q" json object when a get command is invoked (the full interface is get , store , delete). There exist credential helpers for a lot of various storages such as the mac os keychain. Also each cloud provider created their own docker credentials helper (medium blog that solves the validated problem of having to manage all various cloud providers' docker cred helpers). Anyhow, enough with the background discussion.
|
It looks like unfortunately this is going to be a more involved change than we first anticipated. I'm going to close this PR for the time being. Once we prioritise making the required changes for this plugin, we'll make sure to update here as well. |
Overview
Type of change
Related Issue(s)
How To Test
Install docker cli
run
docker login
to import username and password of user loginsand run other command like
docker search
for searching the Docker Hub for imagesChangelog