refactor(artifact)!: make artifact digests typed - #184
Merged
Merged
Conversation
This was referenced Aug 14, 2026
wolfv
marked this pull request as ready for review
August 14, 2026 14:40
wolfv
force-pushed
the
artifact/typed-input
branch
3 times, most recently
from
August 17, 2026 12:01
c9ed912 to
e11173a
Compare
Replace ambiguous digest bytes with ArtifactDigest, which carries and validates its HashAlgorithm, and rename Artifact::Bytes to Artifact::Blob. Signing now accepts SHA-256 digests directly through prehashed ECDSA while verification rejects algorithm mismatches explicitly. BREAKING CHANGE: Artifact digest inputs must use ArtifactDigest; untyped DigestBytes conversions are removed and Artifact::Bytes is renamed Artifact::Blob. Signed-off-by: Wolf Vollprecht <w.vollprecht@gmail.com>
Signed-off-by: Wolf Vollprecht <w.vollprecht@gmail.com>
wolfv
force-pushed
the
artifact/typed-input
branch
from
August 17, 2026 12:18
e11173a to
9c58069
Compare
jku
approved these changes
Aug 17, 2026
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.
Summary
Makes artifact inputs explicit and type-safe before 1.0:
ArtifactDigestcarries itsHashAlgorithmand validates the digest length at construction. Verification therefore rejects algorithm mismatches instead of interpreting arbitrary bytes according to whichever bundle field is inspected later.Signing now accepts SHA-256 digest input as documented, signs it directly in prehashed mode, and uses the same value in the hashedrekord entry. Supplying a digest explicitly means the caller—not the library—is asserting the artifact identity.
Stack
BREAKING CHANGE: digest inputs must use
ArtifactDigest; untypedDigestBytesconversions are removed andArtifact::Bytesis renamedArtifact::Blob.Signed-off-by: Wolf Vollprecht w.vollprecht@gmail.com