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

Protocol should not be stripped out of the registry URL on login #190

Open
n4ss opened this issue Jun 14, 2017 · 2 comments
Open

Protocol should not be stripped out of the registry URL on login #190

n4ss opened this issue Jun 14, 2017 · 2 comments

Comments

@n4ss
Copy link
Contributor

n4ss commented Jun 14, 2017

When a user provides a registry URL to authenticate through docker login, we currently strip the protocol:
https://github.com/docker/cli/blob/master/cli/command/registry.go#L85

Change has been introduced in: moby/moby@67d752a but I can't see the purpose.

Implementation of ConvertToHostname is here: https://github.com/moby/moby/blob/8874f80e67c560f44322233bfc22ecd86b85e9e2/registry/auth.go#L212

All these commands are treated the same way on the credentials-storing level:
> docker login https://foo.bar
> docker login http://foo.bar
> docker login foo.bar

And docker currently appends an "http" after stripping the protocol, which is not okay at all.

Decisions to store them as HTTP or HTTPS should not be done by the underlying docker-credential-helpers API.

This needs to be fixed very soon as we made the decision to default to HTTPS when no protocol is present and that happens when you specify docker login http://foo.bar too..

@thaJeztah
Copy link
Member

ping @runcom perhaps you recall the reason for this change

@runcom
Copy link
Contributor

runcom commented Jun 14, 2017

The whole conversation on why we needed this starts here moby/moby#23100 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants