feat(install): opt-in checksum verification for downloaded deps - #50
Merged
Conversation
Append '#sha256=<hex>' to a dependency URL and bashdep verifies the download's SHA-256 before recording it. _classify_dep strips the annotation into BASHDEP_DEP_SHA (before download, so curl/wget never see it; combinable with @dev); download_url computes the hash via a portable _sha256 helper and, on mismatch or a missing checksum tool, removes the file and skips the lockfile entry. Off by default. Closes #38
17 tasks
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.
Closes #38.
Append
#sha256=<hex>to a dependency URL to verify its SHA-256:_classify_depstrips the annotation intoBASHDEP_DEP_SHAbefore download (curl/wget never see it) and it composes with@dev. Flows through the parallel path via the existingBASHDEP_DEP_*global pattern.download_urlcomputes the hash with a portable_sha256(shasum/sha256sum). On mismatch or a missing checksum tool, it removes the file and does not write a lockfile entry, returning non-zero..bashdepformat change (the annotation rides on the URL token, soinstall_fromis untouched).Test plan
make sa+make lintclean; behavior.md + CHANGELOG updated