Image pull ignores X-Registry-Auth when the JSON has null fields, so Testcontainers (docker-java) pulls from private registries get 401
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- docker, rust
- Ambito
- api, authentication
Direzione di ricerca
Start where the POST /images/create handler reads X-Registry-Auth and the AuthConfig struct that decodes it; the current code drops the whole header when any JSON field is null. Reproduce with the curl command in the issue, and compare a body with identitytoken: "" against one with null. Treat null/missing fields as empty values, pass the username/password through to the registry token request, and add a test for the docker-java-shaped payload so a successful pull returns a digest.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Kiri version and system
0.2.2 on macOS 26.7.3 (Apple silicon)
What you did
Ran a Testcontainers (Java, docker-java) suite whose images come from a private registry that needs a login. Testcontainers gets the credentials from DOCKER_AUTH_CONFIG / the osxkeychain helper, and docker-java sends them on POST /images/create as X-Registry-Auth. docker-java always serialises the full AuthConfig, so the fields it doesn't use are JSON null:
{"username":"me","password":"…","serveraddress":"registry.example.com",
"identitytoken":null,"registrytoken":null,"email":null,"stackOrchestrator":null}
The same thing reproduced with curl against Kiri's socket:
auth=$(printf '{"username":"%s","password":"%s","serveraddress":"registry.example.com","identitytoken":null,"email":null}' "$REG_USER" "$REG_PASS" | base64 | tr '+/' '-_' | tr -d '=\n')
curl -s --unix-socket ~/.kiri/run/docker.sock -H "X-Registry-Auth: $auth" \
-X POST 'http://localhost/v1.47/images/create?fromImage=registry.example.com/private/image&tag=1.0'
What happened
… docker login registry.example.com (https://registry.example.com/…/v2/token returned HTTP 401: unauthorized: incorrect username or password)"}}
The registry sees the pull as anonymous. Sending the same JSON with "identitytoken":"","email":"" instead of null pulls the image:
{"status":"Digest: sha256:…"}
{"status":"Status: Downloaded newer image for registry.example.com/private/image:1.0"}
Leaving the null fields out also works, and so does docker pull with the CLI, because the CLI omits empty fields.
What you expected instead
Docker Engine treats a null field as empty and uses the username/password, so the same request pulls the image on Docker Desktop and Rancher Desktop (dockerd). Kiri should decode null the same way rather than dropping the whole header.
Anything else
Happens every time, with any null field in the header. It breaks every Testcontainers-for-Java pull from a private registry on Kiri (images already in Kiri are fine, because Testcontainers skips the pull).
Workaround: pre-pull the images with the docker CLI (docker pull registry.example.com/…) before running the tests.
- Lingua principale
- Rust
- Stelle
- 7.5k
- Fork
- 329
- Merge medio
- 14h 18m
- PR unite (30g)
- 204
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di libracoder/kiri
-
bench/api.sh exec test fails with curl exit 52, and --ignore-failure still records the timingsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
libracoder/kiri#669 ·
I maintainer di solito rispondono entro 1 giorno
-
VM never idles to sleep while the Windows GUI is open (GUI /info polling resets the idle timer)Apertabug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 68/100
libracoder/kiri#668 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
libracoder/kiri#649 ·
I maintainer di solito rispondono entro 1 giorno
-
`kiri-nfs` exposes container `/sys` and `/proc` symlinks as directories, causing infinite directory loops and 100% CPU spikesForse già presa @talaatmagdyx l’ha presa oggi. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
libracoder/kiri#648 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
libracoder/kiri#647 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di libracoder/kiri
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
antithesishq/bombadil#473 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 5 giorni
-
autofixer: follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
tursodatabase/turso#12217 ·
I maintainer di solito rispondono entro 1 giorno
-
Declare the CMS schema library in the optional recipients extraForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaarea:python in-progress
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
yhay81/pyropdf#1005 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno