Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

API v2 does not work as expected with HTTP_ALLOW_PUBLIC_READ=true #57

Open
hjacobs opened this issue Nov 3, 2015 · 8 comments
Open
Labels

Comments

@hjacobs
Copy link
Contributor

hjacobs commented Nov 3, 2015

I could not find a way of getting the Docker client to use auth for push, but no-auth for pull 😞

@hjacobs hjacobs added the bug label Nov 3, 2015
@hjacobs
Copy link
Contributor Author

hjacobs commented Nov 3, 2015

Apparently the 401 return code is only relevant to the Docker client for the first "GET /v2/" call --- we cannot know yet whether the client wants to perform a push or a only a pull.

@hjacobs
Copy link
Contributor Author

hjacobs commented Nov 3, 2015

Background information: we need to support the HTTP_ALLOW_PUBLIC_READ mode for our Open Source Docker Registry (https://registry.opensource.zalan.do/).

@hjacobs
Copy link
Contributor Author

hjacobs commented Nov 3, 2015

I reported this as a bug (issue already reported by somebody else) in the Docker client: moby/moby#17317

@sarnowski
Copy link
Contributor

Current suggestion:

To work around this issue, we want to support multiple domains. One domain would be read-only and the other r/w but with forced authentication. In order to configure that, every request should be forced authenticated. If the used host matches HTTP_ALLOW_PUBLIC_READ_DOMAIN, then have it read-only.

@hjacobs
Copy link
Contributor Author

hjacobs commented Dec 9, 2015

I think we should check the latest Docker client (1.9.1), I think they changed the behavior (hopefully to the better). We should return WWW-Authenticate header here https://github.com/zalando-stups/friboo/blob/master/src/org/zalando/stups/friboo/system/oauth2.clj#L52

@hjacobs
Copy link
Contributor Author

hjacobs commented Dec 10, 2015

Current workaround plan:

Use two different domains, one for pulling (registry.opensource.zalan.do) and one for pushing (registry-write.opensource.zalan.do).

This is a dirty hack until the Docker client gets fixed.. 😞 ⏳

@hjacobs
Copy link
Contributor Author

hjacobs commented Dec 10, 2015

BTW I created a new issue in Docker for this: moby/moby#18569

@hjacobs
Copy link
Contributor Author

hjacobs commented Dec 11, 2015

Workaround was now deployed, I will keep this issue open as long as we need to use the workaround solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants