Repository navigation
feat: add content integrity verification (Verify, VerifyGraph, ExtendedVerify) - #1493
Merged
TerryHowe merged 8 commits intoOct 7, 2026
Conversation
MohamedAliBouhaouala
requested review from
TerryHowe,
Wwwsylvia,
sabre1041 and
shizhMSFT
as code owners
October 1, 2026 16:40
MohamedAliBouhaouala
force-pushed
the
feat/content-integrity-verification
branch
2 times, most recently
from
October 1, 2026 16:52
b144bea to
7c8cd2b
Compare
TerryHowe
reviewed
Oct 1, 2026
Contributor
Author
|
@TerryHowe License headers added. Feedback addressed and suggestions applied. Thanks for the feedback! Excellent project 👍 |
TerryHowe
reviewed
Oct 2, 2026
MohamedAliBouhaouala
force-pushed
the
feat/content-integrity-verification
branch
from
October 2, 2026 23:17
cf78e71 to
da22fb5
Compare
TerryHowe
reviewed
Oct 2, 2026
…edVerify) Signed-off-by: MohamedAliBouhaouala <[email protected]>
Signed-off-by: MohamedAliBouhaouala <[email protected]>
Signed-off-by: MohamedAliBouhaouala <[email protected]>
…ied/KnownVerified semantics Signed-off-by: MohamedAliBouhaouala <[email protected]>
Signed-off-by: MohamedAliBouhaouala <[email protected]>
Signed-off-by: MohamedAliBouhaouala <[email protected]>
MohamedAliBouhaouala
force-pushed
the
feat/content-integrity-verification
branch
from
October 3, 2026 14:29
75c1c2d to
be074d2
Compare
Contributor
Author
|
@TerryHowe Resolved branch conflicts following the recently merged |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1493 +/- ##
==========================================
+ Coverage 91.29% 91.46% +0.17%
==========================================
Files 99 102 +3
Lines 7872 8076 +204
==========================================
+ Hits 7187 7387 +200
- Misses 674 678 +4
Partials 11 11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ctxloop
reviewed
Oct 5, 2026
Signed-off-by: MohamedAliBouhaouala <[email protected]>
MohamedAliBouhaouala
force-pushed
the
feat/content-integrity-verification
branch
from
October 5, 2026 12:19
43d8a4d to
e2ed3c4
Compare
TerryHowe
reviewed
Oct 6, 2026
Signed-off-by: MohamedAliBouhaouala <[email protected]>
Member
|
Thanks! |
This was referenced Oct 7, 2026
This was referenced Oct 9, 2026
Closed
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially resolves #986
Changes Included
Adds content integrity verification, as proposed in #986:
content.Verify(ctx, fetcher, desc): fetches a blob and checks size anddigest via
VerifyReader, streaming toio.Discard(no full-blob buffering).oras.Verify/oras.VerifyGraph: walk a rooted DAG likeCopy/CopyGraph, but discard content instead of writing it, in"on error resume next" mode. Per-node failures are collected in
VerifyReport/VerifyGraphReport(Verified,Skipped,Failed;OK()), not returned as an error. An error is returned only when the walkitself stops (unresolvable ref, context cancellation, hook error), and the
partial report is returned with it.
oras.VerifiedSet+VerifyGraphOptions.Verified: optional caller-providedset of already-verified digests, reusable across calls so blobs shared
between artifacts in a repository or registry are not re-read. Manifests are
always re-read, since that is the only way to discover their successors.
oras.ExtendedVerify/oras.ExtendedVerifyGraph: verify an artifacttogether with its referrers/predecessors, mirroring
ExtendedCopy*(
Depth,FindPredecessors).PreVerify(may returnSkipNode),PostVerify,OnVerifySkipped,FindSuccessors, plusConcurrencyandMaxMetadataBytes, consistent withCopyGraphOptions.findRootsnow takes an unexportedfindRootsOptionsso it can be sharedby
ExtendedCopyGraphandExtendedVerifyGraph. No change to copy behavior.Behavior worth reviewing
it is not recorded as a failed node.
PostVerifyruns after the node's outcome has been recorded in the report,so a
PostVerifyerror that aborts the walk does not lose that node.Failed; its successors arenot discovered, but nodes reachable by another path are still verified.
srcimplementsregistry.ReferenceFetcher, the root manifest is readwhile resolving the ref, so a corrupt or unreadable root is returned as an
error with a nil report instead of a
Failedentry. This is documented onVerify.report, matching
copyGraph.srcdirectly (never through the caching proxy); onlynon-leaf nodes are cached.
Size and splitting
This is about 3000 lines (roughly two thirds tests) and covers three of the
four levels described in #986: blob content, DAG content, and artifact with
referrers. If reviewers prefer, I'm happy to split it into three PRs:
content.VerifyVerify/VerifyGraph/VerifiedSetExtendedVerify/ExtendedVerifyGraph(plus thefindRootsOptionsrefactor)
Not in scope
Level 4 of #986 (storage-medium verification)
Testing
content.Verify: success, empty, >32 MiB content, fetch/read errors, digestmismatch, short/long content, oversized (2^62), negative and invalid
descriptors, unsupported algorithm, reader always closed.
Verify/VerifyGraph/ExtendedVerify*: full verify, resume aftercorruption, corrupt manifest, invalid successors, foreign layers, hooks,
concurrency limit,
VerifiedSetreuse,Depth, customFindPredecessors,partial report on abort, context cancelled before and mid-walk, root fetched
once via
ReferenceFetcher.make test(race + coverage) andmake check-encodingpass locally.