herozion 2.0.16 → 2.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/checksums.json +5 -5
- package/install.js +18 -2
- package/package.json +2 -2
package/bin/checksums.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "SHA-256 hashes for each platform binary. Auto-generated in CI from release CHECKSUMS.sha256. DO NOT edit manually.",
|
|
3
|
-
"_version": "2.0.
|
|
4
|
-
"herozion-linux-amd64": "
|
|
5
|
-
"herozion-macos-amd64.tar.gz": "
|
|
6
|
-
"herozion-macos-arm64.tar.gz": "
|
|
7
|
-
"herozion-windows-amd64.exe": "
|
|
3
|
+
"_version": "2.0.19",
|
|
4
|
+
"herozion-linux-amd64": "53779092e01cbe8352a8ff7e07f04dacc9cc9cacc9f0f867f88c1c6269b965f3",
|
|
5
|
+
"herozion-macos-amd64.tar.gz": "b74743df87d166b90245833dad35179651e4ad56db5b9fc1f65a6a539b6f2c98",
|
|
6
|
+
"herozion-macos-arm64.tar.gz": "7b019d734c5e5581c10c757fea559e2b759378e993eac829125e1ea0fb457aea",
|
|
7
|
+
"herozion-windows-amd64.exe": "c4925276768ea34fd6b92d96bb9d9fb59a9d623cb6837ff53fc37a0bc765272f"
|
|
8
8
|
}
|
package/install.js
CHANGED
|
@@ -268,9 +268,12 @@ async function main() {
|
|
|
268
268
|
if (fs.existsSync(bundledChecksumsPath)) {
|
|
269
269
|
try {
|
|
270
270
|
const bundled = JSON.parse(fs.readFileSync(bundledChecksumsPath, "utf8"));
|
|
271
|
-
bundledHash = (bundled
|
|
271
|
+
bundledHash = bundledHashFor(bundled, binaryName, VERSION);
|
|
272
272
|
if (!bundledHash) {
|
|
273
|
-
console.warn(
|
|
273
|
+
console.warn(
|
|
274
|
+
`herozion: WARNING — no bundled hash entry for ${binaryName} v${VERSION} ` +
|
|
275
|
+
`(checksums.json is for v${bundled._version || "?"}).`
|
|
276
|
+
);
|
|
274
277
|
}
|
|
275
278
|
} catch (parseErr) {
|
|
276
279
|
console.warn(`herozion: WARNING — invalid checksums.json: ${parseErr.message}`);
|
|
@@ -350,6 +353,18 @@ function parseRemoteChecksum(checksumData, binaryName) {
|
|
|
350
353
|
* A remote mismatch always rejects the binary. A failure to fetch the remote
|
|
351
354
|
* file is fatal only when the bundled hash did not already match.
|
|
352
355
|
*/
|
|
356
|
+
/**
|
|
357
|
+
* Bundled hash for ``binaryName``, only when ``checksums.json`` was generated
|
|
358
|
+
* for this package version. A file left from another version (a source
|
|
359
|
+
* checkout of the tag, a stale build) must not be used as the trust anchor:
|
|
360
|
+
* its hashes belong to other binaries. Empty string → remote verification.
|
|
361
|
+
*/
|
|
362
|
+
function bundledHashFor(bundled, binaryName, version) {
|
|
363
|
+
if (!bundled || typeof bundled !== "object") return "";
|
|
364
|
+
if (String(bundled._version || "") !== String(version)) return "";
|
|
365
|
+
return String(bundled[binaryName] || "").toLowerCase().trim();
|
|
366
|
+
}
|
|
367
|
+
|
|
353
368
|
async function verifyChecksums({ actualHash, bundledHash, binaryName, readRemoteChecksums }) {
|
|
354
369
|
let bundledVerified = false;
|
|
355
370
|
let remoteVerified = false;
|
|
@@ -401,6 +416,7 @@ if (require.main === module) {
|
|
|
401
416
|
|
|
402
417
|
module.exports = {
|
|
403
418
|
_isRedirect,
|
|
419
|
+
bundledHashFor,
|
|
404
420
|
download,
|
|
405
421
|
downloadText,
|
|
406
422
|
parseRemoteChecksum,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "herozion",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.19",
|
|
4
4
|
"description": "Security audit and performance analysis CLI tool for developers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"security",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"preuninstall": "node uninstall.js"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
|
-
"node": ">=
|
|
36
|
+
"node": ">=22"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|