Add content verification - #245
Conversation
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
7acb27a to
d6d2cdf
Compare
| from oras.types import container_type | ||
| from oras.utils.fileio import PathAndOptionalContent | ||
|
|
||
| _DIGEST_PATTERN = re.compile( |
There was a problem hiding this comment.
These are not well placed - a Digest definition and helper functions do not belong in provider.py.
I'm guessing you asked the LLM to do this here. Let's simplify and just remove this final commit because it has a lot of problems.
There was a problem hiding this comment.
Oh this is a completely different PR.
These additions do not follow the conventions of the project. We have a specific module for types, and then functions to interact with them should be on the type. They do not belong in provider.py. Please check with the oras community about policy for using LLMs I'm not familiar - in other projects we have to add a line to the commit that code was assisted by Claude, etc.
There was a problem hiding this comment.
I'm guessing you asked the LLM to do this here. Let's simplify and just remove this final commit because it has a lot of problems.
I actually asked an LLM to do it, didn't like what it did and rewrote it myself for the most part so this wasn't really LLM authored 😅
I'll happily move the types around 🤷 I do think this is an important addition, however. I was honestly a bit surprised the project wasn't already doing it as other ORAS implementations do.
There was a problem hiding this comment.
I'm not up to speed, so we will need to ask @FeynmanZhou.
There was a problem hiding this comment.
Were you thinking that the types should live in oci.py? I've reworked the PR to do this and also moved that blob validation inside download_blob. Maybe this is more how you think it should work?
637e03a to
ee11cac
Compare
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
3da01f5 to
9246f78
Compare
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
84a70d8 to
5f06cca
Compare
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
1b1900c to
2e23d25
Compare
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
ae1498c to
caecabf
Compare
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
caecabf to
1b8eade
Compare
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
We really should be doing content verification when we download data from the registry. I believe other ORAS implementations do and certainly tools like Docker, Podman, etc. do. The OCI Spec(https://specs.opencontainers.org/image-spec/descriptor) says:
And then give guidance of what verification should check here.
Resolves #247