-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle not-logged-in public repos with credsStore #731
Conversation
Thanks for the PR. This sounds like non-spec behavior I have never seen a docker credential helper returning empty username and password. |
Usually they're used for private repositories, but for devpod it's used for all repositories, including public docker hub ones. |
I'd know for sure if there was reference implementations doing the same thing, othewise this sounds like a something non-spec compliant cred helper would do. |
Is there a spec for this? If so, I can take it to the devpod repo and ask them to fix it instead. I don't care where I fix this, I just don't want to maintain a patched If there's no spec, and it's just based on implementations, then |
only one that i am aware of is; https://github.com/docker/cli/blob/master/docs/reference/commandline/login.md#credential-helper-protocol |
Unfortunately, that doesn't specify what to output when no username is needed/available. Both an empty string vs json with empty values seem like valid guesses based on that page. |
@thesayyn This seems like spec-compliant behavior that should be handled. I looked into changing devpod, and in doing so I tried looking at docker's source code that credential helpers use or are based on. It looks to me like they would do the same behavior (returning a blank Username and Password rather than an empty Could you approve or close this PR and I'll maintain my fork indefinitely, but without bothering to upstream further? |
Yes, that makes sense, i am not sure how this translates to the wire though, but if docker pull works with same configuration and it doesn't with oci_pull and then its bug here. I'd feel more comfortable if there was a test here in rules_oci so we don't break this in the future? |
I've added a test, but unfortunately I can't figure out how to run your tests successfully on my machine. I get 404/401 failures in the e2e auth tests that already exist, so I apologize that I'll be relying on your github actions to test it for me. That's exacerbated by the fact that I don't know what the no-auth assertion should look like until I get it to run correctly at least once |
That test was broken anyway, thank you for adding the test case. |
Are the tests expected to mostly fail this way? Do you need some help fixing the tests? |
No they shouldn't be failing. Can you rebase your branch? |
Looks like I need approval to run the CI workflows after the rebase |
Looks like they fail the same way, including in another unrelated PR from a week ago. I figured it out, looks like #759 forgot one last leading underscore to remove. With that fixed all the tests pass again |
Tested with a docker config that only has a
credsStore
but without an account forindex.docker.io
. Previously, this would result in a 401 when requesting the realm URL, but now it succeeds.