Skip to content

Compare Artifact Digests#1975

Merged
GhadimiR merged 5 commits intomainfrom
ghadimir/update_call_to_list_artifacts
Mar 7, 2025
Merged

Compare Artifact Digests#1975
GhadimiR merged 5 commits intomainfrom
ghadimir/update_call_to_list_artifacts

Conversation

@GhadimiR
Copy link
Contributor

@GhadimiR GhadimiR commented Mar 5, 2025

The Artifacts REST API and Twirp services now return a digest field, giving a SHA256 digest of whatever was uploaded to the service.

This change (combined with the implementation on the download-artifact package, will allow end users to use this to perform a comparison of this digest against the downloaded artifact to validate the integrity of what was downloaded.

The intent here is that the download-artifact package can then use the digests from the list method to supply them to download only if the comparison is desired. That package can also decide on whether to end the workflow or warn.

@GhadimiR GhadimiR requested a review from a team as a code owner March 5, 2025 11:35
/**
* Returns true if the digest of the downloaded artifact does not match the expected hash
*/
digestMismatch?: boolean
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is kinda dual-use in that it returns false if the digests match OR if a digest wasn't supplied (i.e. we're not doing the comparison), imo this is fine because the consumer of this interface knows if a digest was supplied and so it has all the information needed, but if there's a more elegant way to do this I'd love to hear about it.

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.

3 participants