[BUG] Special characters not working with hauler login
Closed this issue · 3 comments
Environmental Info:
Debian12
Hauler Version:
1.0.7
Describe the Bug:
When I login using hauler login myprivaterepo.org -u 'test' -p 'te$t
command to a private registry with credentials containing special characters (like $), I can't pull images from this private registry.
When I use the exact same command but with docker login myprivaterepo.org -u 'test' -p 'te$t'
, It works and I can pull docker images.
Steps to Reproduce:
hauler login privaterepo.org -u 'user' -p 'p@$$sw0rd'
then docker pull privaterepo.org/test/test:0.1.2
-> Bad credentials
docker login privaterepo.org -u 'user' -p 'p@$$sw0rd'
then docker pull privaterepo.org/test/test:0.1.2
-> Ok
Expected Behavior:
Expected to work, as it should writes the credential the same way docker login does in $HOME/.docker/config.json
Actual Behavior:
Doesn't work
Additional Context:
As a workaround, I had to change my password from something that use '$' to one that use '-'. Maybe an escaping is missing in the process ? 🤷♂️
hmm, this seems to be working correctly:
$ hauler login registry.example.com -u 'u$er' -p 'p@$$w0rd!' -l debug
2024-11-07 13:51:07 DBG running cli command [hauler login]
2024-11-07 13:51:07 INF auth.go:274: logged in via /home/dweomer/.docker/config.json
$ echo "$(jq -r '.auths["registry.example.com"].auth' < ~/.docker/config.json | base64 -d)"
u$er:p@$$w0rd!
$ hauler version
__ __ ___ __ __ __ _______ .______
| | | | / \ | | | | | | | ____|| _ \
| |__| | / ^ \ | | | | | | | |__ | |_) |
| __ | / /_\ \ | | | | | | | __| | /
| | | | / _____ \ | `--' | | `----.| |____ | |\ \----.
|__| |__| /__/ \__\ \______/ |_______||_______|| _| `._____|
hauler: Airgap Swiss Army Knife
GitVersion: 1.1.0
GitCommit: 3406d54
GitTreeState: clean
BuildDate: 2024-10-04T22:33:32Z
GoVersion: go1.23.2 X:boringcrypto
Compiler: gc
Platform: linux/amd64
can you share a fresh, dummy $HOME/.docker/config.json
created by hauler login
with incorrectly stored credentials?
Additional note: I've asserted that with hauler v1.1.0, login (and subsequent docker pulls
+ hauler store image add
) works as expected against a private harbor installation using a password containing both $
and !
As I was trying to reproduce it, I couldn't manage to. I might have omited the single quotes so the $$ have been replaced. But I suggest that in the usage example of hauler login you put single quotes around password and login to avoid errors like mine. I'm pretty sure that was my mistake.