Skip to content

feat(install): opt-in checksum verification for downloaded deps - #50

Merged
Chemaclass merged 1 commit into
mainfrom
feat/checksum-verify
Jul 22, 2026
Merged

feat(install): opt-in checksum verification for downloaded deps#50
Chemaclass merged 1 commit into
mainfrom
feat/checksum-verify

Conversation

@Chemaclass

Copy link
Copy Markdown
Owner

Closes #38.

Append #sha256=<hex> to a dependency URL to verify its SHA-256:

https://example.com/tool.sh#sha256=e3b0c44298fc1c149afbf4c8996fb924...
https://example.com/dev-tool.sh@dev#sha256=2c26b46b...
  • _classify_dep strips the annotation into BASHDEP_DEP_SHA before download (curl/wget never see it) and it composes with @dev. Flows through the parallel path via the existing BASHDEP_DEP_* global pattern.
  • download_url computes 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.
  • Off by default — no annotation, no verification. No .bashdep format change (the annotation rides on the URL token, so install_from is untouched).

Test plan

  • Suite green + stable: 204 tests / 297 assertions (+11)
  • Tests: classify parses annotation (alone + with @dev + none), download match/mismatch/missing-tool, install-level match + reject
  • make sa + make lint clean; behavior.md + CHANGELOG updated

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
@Chemaclass Chemaclass added the enhancement New feature or request label Jul 22, 2026
@Chemaclass Chemaclass self-assigned this Jul 22, 2026
@Chemaclass
Chemaclass merged commit 65fe5c2 into main Jul 22, 2026
5 checks passed
@Chemaclass
Chemaclass deleted the feat/checksum-verify branch July 22, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(install): opt-in checksum verification for downloaded deps

1 participant