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

Question: any digest support #34

Closed
cutecutecat opened this issue Feb 7, 2023 · 3 comments
Closed

Question: any digest support #34

cutecutecat opened this issue Feb 7, 2023 · 3 comments

Comments

@cutecutecat
Copy link

cutecutecat commented Feb 7, 2023

Hello, I have a question about this oci registry. In oci image spec, it says:

Implementations SHOULD allow digests with unrecognized algorithms to pass validation if they comply with the above grammar.

ref: https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md#digests

This implement seems to reject artifacts with algorithms other than sha256? Do I understand correctly? Is there any special reason for this design?

Thanks for your answer.

calculated_digest = self.calculate_digest(body)

@vsoch
Copy link
Owner

vsoch commented Feb 7, 2023

@cutecutecat if it’s up to the registry, we could expose this choice as a variable. Would you want to contribute a PR?

@cutecutecat
Copy link
Author

@cutecutecat if it’s up to the registry, we could expose this choice as a variable. Would you want to contribute a PR?

Actually, I am doing a survey about the compatibility of this feature from all registries. I found that even the official registry library https://github.com/distribution/distribution and its dependent lib go-digest does not support it either. They will return a UnsupportedAlgorithm error and behaves like this project.

Maybe it's also a good choice to be consistent with them.

@vsoch
Copy link
Owner

vsoch commented Feb 9, 2023

If I had to guess, the spec wants to be flexible for the world to change, e.g., for another kind of digest to be considered best practice. But in actual practice, that doesn't mean a registry actually follows that to support every and any digest - I think we still tend to focus on the one we think is best for the time. So I agree, since most people use/expect sha256 that's what we should use, and only make it more complicated when it's absolutely warranted.

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