Unable to get a listing of repos as a user with read privileges
Summary
I'm trying to get a catalog listing from the Gitlab Docker Registry. The /v2/_catalog endpoint looks right for this purpose but in my testing, a GET (with valid credentials) to /api/v2/_catalog
fails with a 401 - Unauthorized.
If this is intended behaviour, is there another way to retrieve a listing of the repos that a user has access to?
Docker Trusted Registry provides the /api/v0/repositories
endpoint for this purpose. VMWare Harbor provides: /api/projects
for a list of projects you have access to, then api/repositories
with project ID.
Steps to reproduce
Make a GET request to /api/v2/_catalog with a valid authorization token.
What is the current bug behavior?
API returns HTTP status code 401 (Unauthorized)
What is the expected correct behavior?
API returns a list of repos that the current user is permitted to see.
Relevant logs and/or screenshots
{"api":"blah","auth-user":"blah","auth-userid":"administrator","component":"blah","error":"Get https://<gitlab-instance>/v2/_catalog: http: non-successful response (status=401 body=\"{\\\"errors\\\":[{\\\"code\\\":\\\"UNAUTHORIZED\\\",\\\"message\\\":\\\"authentication required\\\",\\\"detail\\\":[{\\\"Type\\\":\\\"registry\\\",\\\"Class\\\":\\\"\\\",\\\"Name\\\":\\\"catalog\\\",\\\"Action\\\":\\\"*\\\"}]}]}\\n\")","message":"Unable to retrieve repository catalog","requestID":"blah","severity":"warning","timestamp":"2018-08-14T13:51:37Z"}
Edited by brucem