image
image copied to clipboard
podman registry search does not handle unexpected HTTP authentication scopes
rpm -q podman podman-2.2.1-1.fc32.x86_64
podman search localhost:24817/fedora --log-level=debug
DEBU[0010] GET http://localhost:24817/v2/
DEBU[0010] Ping http://localhost:24817/v2/ status 401
DEBU[0010] GET http://localhost:24817/v1/search?n=25&q=fedora
DEBU[0010] error getting search results from v1 endpoint "localhost:24817": invalid status code from registry 404 (Not Found)
DEBU[0010] trying to talk to v2 search endpoint
DEBU[0010] GET http://pulp3-source-fedora32.lan/token?account=admin&service=localhost%3A24817
DEBU[0010] GET http://localhost:24817/v2/_catalog
ERRO[0010] error getting search results from v2 endpoint "localhost:24817": unable to retrieve auth token: invalid username/password: errors:
denied: requested access to the resource is denied
unauthorized: Insufficient permissions
Here is what is in the auth header
$ http :24817/v2/_catalog
HTTP/1.1 401 Unauthorized
Access-Control-Expose-Headers: Correlation-ID
Allow: GET, HEAD, OPTIONS
Connection: close
Content-Length: 106
Content-Type: application/json
Correlation-ID: 2f1ea35d6aae49cca94803bdd06792ff
Date: Wed, 12 May 2021 15:35:10 GMT
Docker-Distribution-Api-Version: registry/2.0
Server: gunicorn/20.0.4
Vary: Accept
WWW-Authenticate: Bearer realm="http://example-fedora32.lan/token",service="localhost:24817",scope="registry:catalog:*"
X-Frame-Options: SAMEORIGIN
{
"errors": [
{
"code": "UNAUTHORIZED",
"detail": {},
"message": "Authentication credentials were not provided."
}
]
}