Repository navigation
fix(installer): validate release metadata - #912
Conversation
|
Thanks, this is close. The filename and SHA-256 guards and the case-insensitive comparison look right in both scripts. One change and one small hardening are needed. 1. The version pattern is looser than the CLI's, and lets a dot segment through. Please use that pattern, with the tag's optional leading valid_release_version() {
local re='^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$'
[[ "$1" =~ $re ]]
}Use the same pattern in 2. In PowerShell, |
|
Addressed both review items and merged current main. The Bash and PowerShell version guards now mirror the CLI canonical SemVer pattern with an optional leading v; the contract suites reject ., .., and v... All three PowerShell metadata regexes now use the absolute \z anchor, with trailing-newline regressions for version, filename, and SHA-256. Validation: bash syntax, 135 installer contract tests (1 platform skip), repository format check, and lint all pass locally; the PowerShell contract will run in CI. |
|
Thanks, this matches #167: version, filename and sha256 are validated before any URL is built or binary downloaded, a bad manifest fails closed, and the new tests fail when |
0271ba4 to
f46eac0
Compare
|
Rebased onto current main in f46eac0 and added the requested Unreleased |
d608579 to
6b341be
Compare
|
Rebased again onto current |
6b341be to
5f6d433
Compare
|
Follow-up: |
5f6d433 to
14629b8
Compare
|
Final validation update: rebased onto current The complete GitHub Actions suite is green on this head, including installer syntax and contract coverage, CLI tests, formatting/lint/typecheck, dependency audit, release tooling, secret scan, CodeQL, and DCO verification. GitHub reports the PR mergeable and clean. |
9b13552 to
3025415
Compare
|
Rebased once more onto current |
Signed-off-by: Ching-Wei Kang <[email protected]>
Signed-off-by: Ching-Wei Kang <[email protected]>
Signed-off-by: Ching-Wei Kang <[email protected]>
3025415 to
ebde05a
Compare
|
Merged. Thank you @WilliamK112, rejecting dot, dot-dot and trailing-newline versions in both installers with contract tests for the shell and PowerShell sides is the careful kind of hardening an installer needs. (Nik) |
Summary
Testing
bash -n install.shbun test scripts/install-contract.test.ts(131 passed, 1 skipped)bun test scripts/install-contract.test.ts --test-name-pattern "release metadata validation"(13 passed)pwshis not installed locallyCloses #167