Navigation Menu

Skip to content
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

ORMB login should work with docker token #188

Closed
mishraprafful opened this issue Sep 20, 2021 · 8 comments · Fixed by #191
Closed

ORMB login should work with docker token #188

mishraprafful opened this issue Sep 20, 2021 · 8 comments · Fixed by #191
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@mishraprafful
Copy link
Contributor

mishraprafful commented Sep 20, 2021

Is this a BUG REPORT or FEATURE REQUEST?:
FEATURE REQUEST

Uncomment only one, leave it on its own line:
/kind feature

What happened:
Not able to login using docker token or docker base config.

What you expected to happen:
Should be able to login using docker token or docker base config.

How to reproduce it (as minimally and precisely as possible):
None

Anything else we need to know?:
Login using password and usernme is available but there is a need to be able to login using the docker login token or .docker/.base_dockerconfig

@gaocegege
Copy link
Member

SGTM, it should work. But I am not sure if it is safe to read the docker auth config.

@mishraprafful
Copy link
Contributor Author

mishraprafful commented Sep 21, 2021

I might be short-sighted here, but could you point me to why do you think it might not be safe.

The use-case is that I have containers that are authenticated to push and pull to my docker registry using docker tokens and config. I wish to authenticate for ORMB as well using the same, rather than having to use a USERNAME and PASSWORD using a robot account.
Let me know your thoughts.

@gaocegege
Copy link
Member

Docker config may have more than one user/pwd. If you are an administrator and you logged in many registries locally, I am not sure if you want to share the information with ormb client. But we can add a command or argument to support such case. I think.

Maybe a command ormb auth-from-docker or something else.

@mishraprafful
Copy link
Contributor Author

Thanks, I understand the concern now. Do you think it is possible for me to contribute to this, but I would need some help to understand a few things.

@gaocegege
Copy link
Member

Thanks!

Your contribution is welcome!
🎉 👍

@gaocegege
Copy link
Member

As you know, we are using path.Join(client.rootPath, "config.json")

credentialsFile := path.Join(client.rootPath, credentialsFileBasename)
to store the credentials. The file config.json is similar to docker config.json. What we should do is to copy the credentials from docker config.json to ormb config.json. Maybe we can just get all credentials and call ormbclient.Login for every one. This func call writes the info to the config.json.

@mishraprafful
Copy link
Contributor Author

Thanks for pointing it out, I think I can start from here soon. Will ping back if I have any more questions 🙂

@gaocegege
Copy link
Member

Sure, thanks.

@gaocegege gaocegege added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 21, 2021
gaocegege pushed a commit that referenced this issue Oct 15, 2021
* Add docker as root path for credentials file, if exists

* Updated print statements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants