openvibers/openvibe.deals Commits
Restore openvibe-publishing v1.2.0 lock integrity and guard codeload…
Changes
@@@ -1165,6 +1165,7 @@"node_modules/openvibe-publishing": {"version": "1.2.0","resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.2.0",++ "integrity": "sha512-n/20yxXo5jRs0wi7KsR+R9jDkGsoBak3gqElHV6XyU+i1t3XCzaoz+sDb10G2cbc4uEaNB/F09VtQKrQzLp6YQ==","license": "MIT","engines": {"node": ">=20"nnew file mode 100644@@@ -0,0 +1,29 @@++'use strict';++/**++ * Every codeload GitHub tarball pin is installed as-is by `npm ci`, so its lock entry must keep an++ * integrity and point at the same tag package.json pins. A hand-edited bump can drop the integrity++ * (it happened to openvibe-publishing v1.2.0); without this the tarball is accepted unchecked.++ */++const assert = require('assert');++const fs = require('fs');++const path = require('path');++const { check, done } = require('./helpers/boot');++++const ROOT = path.join(__dirname, '..');++const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'));++const lock = JSON.parse(fs.readFileSync(path.join(ROOT, 'package-lock.json'), 'utf8'));++++(async () => {++ await check('every codeload GitHub tarball pin has a lock entry with sha512 integrity and the same resolved URL', async () => {++ const pins = { ...pkg.dependencies, ...pkg.devDependencies };++ const tarballs = Object.entries(pins).filter(([, spec]) => /^https:\/\/codeload\.github\.com\//.test(spec));++ assert.ok(tarballs.length > 0, 'expected at least one codeload tarball pin');++ for (const [name, spec] of tarballs) {++ const entry = lock.packages[`node_modules/${name}`];++ assert.ok(entry, `package-lock.json has no entry for ${name}`);++ assert.strictEqual(entry.resolved, spec, `${name}: package.json and package-lock.json disagree on the tag`);++ assert.match(entry.integrity || '', /^sha512-[A-Za-z0-9+/]+=*$/, `${name}: lock entry has no sha512 integrity`);++ }++ });++ done();++})();
@@ -1165,6 +1165,7 @@
@@ -1165,6 +1165,7 @@
"node_modules/openvibe-publishing": {
"node_modules/openvibe-publishing": {
"version": "1.2.0",
"version": "1.2.0",
"resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.2.0",
"resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.2.0",
+ "integrity": "sha512-n/20yxXo5jRs0wi7KsR+R9jDkGsoBak3gqElHV6XyU+i1t3XCzaoz+sDb10G2cbc4uEaNB/F09VtQKrQzLp6YQ==",
"license": "MIT",
"license": "MIT",
"engines": {
"engines": {
"node": ">=20"
"node": ">=20"
new file mode 100644
new file mode 100644
@@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
+'use strict';
+/**
+ * Every codeload GitHub tarball pin is installed as-is by `npm ci`, so its lock entry must keep an
+ * integrity and point at the same tag package.json pins. A hand-edited bump can drop the integrity
+ * (it happened to openvibe-publishing v1.2.0); without this the tarball is accepted unchecked.
+ */
+const assert = require('assert');
+const fs = require('fs');
+const path = require('path');
+const { check, done } = require('./helpers/boot');
+
+const ROOT = path.join(__dirname, '..');
+const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'));
+const lock = JSON.parse(fs.readFileSync(path.join(ROOT, 'package-lock.json'), 'utf8'));
+
+(async () => {
+ await check('every codeload GitHub tarball pin has a lock entry with sha512 integrity and the same resolved URL', async () => {
+ const pins = { ...pkg.dependencies, ...pkg.devDependencies };
+ const tarballs = Object.entries(pins).filter(([, spec]) => /^https:\/\/codeload\.github\.com\//.test(spec));
+ assert.ok(tarballs.length > 0, 'expected at least one codeload tarball pin');
+ for (const [name, spec] of tarballs) {
+ const entry = lock.packages[`node_modules/${name}`];
+ assert.ok(entry, `package-lock.json has no entry for ${name}`);
+ assert.strictEqual(entry.resolved, spec, `${name}: package.json and package-lock.json disagree on the tag`);
+ assert.match(entry.integrity || '', /^sha512-[A-Za-z0-9+/]+=*$/, `${name}: lock entry has no sha512 integrity`);
+ }
+ });
+ done();
+})();