Skip to content
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

Issue with anonymous auth and ghcr.io #14

Closed
imjasonh opened this issue Jan 12, 2022 · 3 comments
Closed

Issue with anonymous auth and ghcr.io #14

imjasonh opened this issue Jan 12, 2022 · 3 comments

Comments

@imjasonh
Copy link

I'm trying to fetch image data about a public image on ghcr.io, using RegistryAuth::Anonymous, and it's not working. The same code can successfully fetch from gcr.io and Docker Hub.

I've got a Gist with a minimal repro case: https://gist.github.com/imjasonh/30c95b534487e72afd8f1530072878ed#file-main-rs

tl;dr:

GCR works (so does Docker Hub):

$ cargo run gcr.io/imjasonh/test
Digest: sha256:c99359ba4b63a7523525471f82a27fcc887ca2e03ecf6d5847130b2146853c12

GHCR doesn't work:

$ cargo run ghcr.io/jyotsna-penumaka/test
Error: OCI API error: authentication required on https://ghcr.io/v2/jyotsna-penumaka/test/manifests/latest

Both of these images are publicly available and can be fetched with crane using go-containerregistry.

$ crane digest ghcr.io/jyotsna-penumaka/test
sha256:cdcab0563d63cc1f1dee972d685a1d21b8fef98b11c59ce28803f77e6e93a622
@flavio
Copy link
Contributor

flavio commented Jan 13, 2022

This has been fixed by #6 - unfortunately this isn't part of a tagged release yet.

I tried your reproduced and it works fine when using the crate from the main branch.

@thomastaylor312, @bacongobbler : I think we should tag a new release of oci-distribution. He have a bunch of improvements merged into the main branch that haven't been pushed out via official release yet.

@flavio
Copy link
Contributor

flavio commented Jan 14, 2022

Fixed with the freshly released v0.8.1 release.

@flavio flavio closed this as completed Jan 14, 2022
@imjasonh
Copy link
Author

Fixed with the freshly released v0.8.1 release.

Excellent! Dependabot beat you to it: sigstore/sget#83 😄 but it was great to see.

Thanks for the fix and for the release!

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

No branches or pull requests

2 participants