Skip to content

Add content verification - #245

Closed
judahrand wants to merge 13 commits into
oras-project:mainfrom
judahrand:validate-content
Closed

Add content verification#245
judahrand wants to merge 13 commits into
oras-project:mainfrom
judahrand:validate-content

Conversation

@judahrand

@judahrand judahrand commented Aug 2, 2026

Copy link
Copy Markdown

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:

Retrieved content SHOULD be verified against this digest when consumed via untrusted sources.

And then give guidance of what verification should check here.

Resolves #247

@judahrand
judahrand requested a review from vsoch as a code owner August 2, 2026 13:37
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
Comment thread oras/provider.py Outdated
from oras.types import container_type
from oras.utils.fileio import PathAndOptionalContent

_DIGEST_PATTERN = re.compile(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not up to speed, so we will need to ask @FeynmanZhou.

@judahrand judahrand Aug 2, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@judahrand
judahrand force-pushed the validate-content branch 3 times, most recently from 637e03a to ee11cac Compare August 2, 2026 17:31
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
@judahrand
judahrand force-pushed the validate-content branch 4 times, most recently from 3da01f5 to 9246f78 Compare August 2, 2026 17:53
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>
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>
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
Signed-off-by: Judah Rand <17158624+judahrand@users.noreply.github.com>
@judahrand judahrand closed this Aug 13, 2026
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

Successfully merging this pull request may close these issues.

Project does not verify that the content provided by a remote registry matches what was requested

2 participants