docker-credential-helpers icon indicating copy to clipboard operation
docker-credential-helpers copied to clipboard

docker-credential-pass does not work with username containing forward-slash

Open plakdawa opened this issue 6 years ago • 2 comments

On some docker registries the username is to be supplied as a chain of names each separated by forward-slash. For example oracle cloud registry uses the format <tenancy>/<identityservice>/<username>.

Instead of encrypting this string as base64 and storing it as a single key in the password store, docker-credential-pass stores it as chain of sub-keys. Even though docker login is successful, all subsequent interactions like docker pull fail.

plakdawa avatar Jul 25 '19 19:07 plakdawa

I ran into the same problem - docker-credential-pass breaks when a / is in the username. I see these solutions:

  • base64-encode the username, as it is already done with the server url
  • replace / with a placeholder, e.g. -SLASH-
  • do proper escaping (e.g. replace / with -, but also escape the escape character, - with --)

I have implemented base64-encoding of the username for me to get it working, but this breaks backwards compability. We could ignore backwards compability. We could also reencode everything that is non-base64 into base64. Still, it might not be the way to go.

The proper-escaping solution is less likely to break backwards compability, but still might, depending upon the escape character.

Just replacing with / with something like -SLASH- would work as long as the replacement never appears in a docker username. -SLASH- is an unlikely candidate, but still not impossible.

Thoughts?

sebageek avatar Sep 23 '20 15:09 sebageek

@plakdawa @sebageek any update on this? I'm facing this issue. Login success. But push/pull failing.

nasr18 avatar Jan 02 '23 15:01 nasr18