-
Notifications
You must be signed in to change notification settings - Fork 473
Bug matching authorization protocol with docker 1.8 #276
Comments
I take it back. Public repos don't appear to work. I set up a namespace called Login as
While if I log in as It looks like the registry asking for push&pull, instead of just pull? |
Which version of the docker registry and of the docker client are you using? |
Actually, it isn't the registry at all. It is the docker daemon itself. I am using docker 1.8.1 with registry 2.0.1. I had a discussion with some of the docker people on another github issues thread. It turns out that the protocol as they explain it may not be implemented correctly in Portus, or cesanta, or anywhere except for docker's actual auth server.. because the documentation wasn't clear. They asked for a PR to fix it. Here is how they described it:
In other words, the daemon always asks for
When user tries the token path against the auth server with credentials:
The daemon will always ask for
Yet Portus seems to return a So there are 2 issues:
Is this all new to 1.8.1? |
Wow, thanks for the detailed explanation! This is really helpful. We are going to address the issue.
Yes it is. With docker 1.7.1 I cannot reproduce the issue. |
I just now saw someone referenced my issue as a something they didn't have a problem with in 1.7.1. If you want the real dirty details, right down to my debug output and packet traces, check out moby/moby#15640 Sigh, OK, I will spin up a VM, add 1.7.1 and check it out. |
Oh, yes, that handles the "I only have pull rights, it asks for push,pull." What about the anonymous access? |
Yes you are right, sorry for not being specific. As for the anonymous access this is something that has never worked in the past. With distribution 2.0.1 anonymous users (aka users not logged into the registry) aren't even forwarded to Portus: the registry immediately replies with a 404 message. |
That doesn't sound right. After all, the first request has to get a I am running some tests right now... |
I can confirm that this is a change from 1.7 to 1.8. I spun up a clean VM and installed 1.7.1, replicated the environment, and ran docker in debug. Then I tried to pull a VM Here is the debug output
Notice the last line: it tries to get authorization for On the other hand, it looks like the registry at least can handle getting a Web token for less than the user requests and rejecting it. So changing to always |
Is this an easy fix? |
Trying to be helpful. It appears to be somewhere in https://github.com/SUSE/Portus/blob/master/app/controllers/api/v2/tokens_controller.rb specifically https://github.com/SUSE/Portus/blob/master/app/controllers/api/v2/tokens_controller.rb#L30 But I couldn't figure out where it actually matches up the scopes to the user? |
Yes, this fix should be easy. Anonymous pulls are not hard to implement, but would require more evaluations on our side (like a ui control to toggle the feature). For example: I can imagine customers who want to enforce everybody to be logged into the registry even when pulling public images. |
You are right. And whereas now we have 2 levels of access control per namespace - public (owner/member can pull+push) and private (anyone logged in can pull) - now we would need 3 levels - public, private and open (anyone anonymous can pull). Truth is, that is not a bad thing, especially if we got it to the level of a repository rather than a namespace. Think how docker hub has public/private per repo, not just per namespace. Here is what I will do. I will rename this issue to "Bug matching authorization protocol with docker 1.8", and open a separate issue for "Anonymous Access", since it is likely to last a lot longer. Can you tell me where the |
Vacation? They let those of us in the tech world take those??? :-) I see the PR. I will keep an eye on the issue. I would offer to beta test, but it is such a small change, you probably already did it yourself, and the rspec probably hits everything anyways. Thanks. |
Ah ah :)
I did a quick check with registry 2.0.1 and docker 1.8.1. More testing
would be appreciated
|
So we need to check registry:2.0.1 and registry:2.1.1 against docker:1.8.1, docker:1.7.1, docker:1.7.0. We probably should do 1.6.2 as well, but who has the time? I will try to find some time. If it moves the PR through quickly.... I just pull the branch? And your test cases are:
|
Hi. Any update? |
Thanks. |
The code has been merged into master, closing the issue. |
Excellent! Has it been pushed to the registry? |
The "issue" was inside of Portus, not "distribution". Hence the fix has been pushed to portus' master branch. |
Isn't there a suse/portus image on the docker hub? |
Not yet. But you can build it from scratch using docker-compose |
Is it possible to access a public repo anonymously? Sure, if it is public, and I am logged in as a user not of that workspace, I can do a pull, but how about if I am not logged in?
The text was updated successfully, but these errors were encountered: