snyk 1.1099.0 → 1.1101.0
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/dist/bootstrap.js +8 -18
- package/dist/bootstrap.js.map +1 -1
- package/dist/common.d.ts +3 -1
- package/dist/common.js +58 -24
- package/dist/common.js.map +1 -1
- package/dist/generated/sha256sums.txt +10 -10
- package/dist/generated/version +1 -1
- package/dist/index.js +35 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -2,19 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const common = require("./common");
|
|
4
4
|
const process = require("process");
|
|
5
|
-
const
|
|
6
|
-
async function logError(err) {
|
|
7
|
-
const version = common.getCurrentVersion(common.versionFile);
|
|
8
|
-
Sentry.init({
|
|
9
|
-
dsn: 'https://3e845233db8c4f43b4c4b9245f1d7bd6@o30291.ingest.sentry.io/4504599528079360',
|
|
10
|
-
release: version,
|
|
11
|
-
});
|
|
12
|
-
const sentryError = new Error('Error downloading binary (' + err + ')');
|
|
13
|
-
sentryError.stack = err.stack;
|
|
14
|
-
Sentry.captureException(sentryError);
|
|
15
|
-
await Sentry.close();
|
|
16
|
-
console.error(err);
|
|
17
|
-
}
|
|
5
|
+
const errorContextMessage = 'Download Error';
|
|
18
6
|
try {
|
|
19
7
|
const config = common.getCurrentConfiguration();
|
|
20
8
|
const executable = config.getLocalLocation();
|
|
@@ -23,17 +11,19 @@ try {
|
|
|
23
11
|
const downloadUrl = config.getDownloadLocation();
|
|
24
12
|
common
|
|
25
13
|
.downloadExecutable(downloadUrl, executable, filenameShasum)
|
|
26
|
-
.then(
|
|
27
|
-
if (
|
|
28
|
-
|
|
14
|
+
.then((error) => {
|
|
15
|
+
if (error !== undefined) {
|
|
16
|
+
common
|
|
17
|
+
.logError(errorContextMessage, error)
|
|
18
|
+
.then(() => process.exit(1));
|
|
29
19
|
}
|
|
30
20
|
})
|
|
31
21
|
.catch((err) => {
|
|
32
|
-
logError(err).then(() => process.exit(
|
|
22
|
+
common.logError(errorContextMessage, err).then(() => process.exit(2));
|
|
33
23
|
});
|
|
34
24
|
}
|
|
35
25
|
}
|
|
36
26
|
catch (err) {
|
|
37
|
-
logError(err).then(() => process.exit(
|
|
27
|
+
common.logError(errorContextMessage, err).then(() => process.exit(3));
|
|
38
28
|
}
|
|
39
29
|
//# sourceMappingURL=bootstrap.js.map
|
package/dist/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;AAAA,mCAAmC;AACnC,mCAAmC;
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;AAAA,mCAAmC;AACnC,mCAAmC;AAEnC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAE7C,IAAI;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAC;IAChD,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAE7C,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,cAAc,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC9C,MAAM,WAAW,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAEjD,MAAM;aACH,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC;aAC3D,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;YACd,IAAI,KAAK,KAAK,SAAS,EAAE;gBACvB,MAAM;qBACH,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC;qBACpC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;aAChC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,MAAM,CAAC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;KACN;CACF;AAAC,OAAO,GAAG,EAAE;IACZ,MAAM,CAAC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;CACvE"}
|
package/dist/common.d.ts
CHANGED
|
@@ -19,4 +19,6 @@ export declare function getCurrentConfiguration(): WrapperConfiguration;
|
|
|
19
19
|
export declare function getCliArguments(inputArgv: string[]): string[];
|
|
20
20
|
export declare function debugEnabled(cliArguments: string[]): boolean;
|
|
21
21
|
export declare function runWrapper(executable: string, cliArguments: string[]): number;
|
|
22
|
-
export declare function downloadExecutable(downloadUrl: string, filename: string, filenameShasum: string): Promise<
|
|
22
|
+
export declare function downloadExecutable(downloadUrl: string, filename: string, filenameShasum: string): Promise<Error | undefined>;
|
|
23
|
+
export declare function logError(context: string, err: any): Promise<void>;
|
|
24
|
+
export declare function isAnalyticsEnabled(): boolean;
|
package/dist/common.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.downloadExecutable = exports.runWrapper = exports.debugEnabled = exports.getCliArguments = exports.getCurrentConfiguration = exports.getCurrentSha256sum = exports.getCurrentVersion = exports.determineBinaryName = exports.WrapperConfiguration = exports.shasumFile = exports.versionFile = void 0;
|
|
3
|
+
exports.isAnalyticsEnabled = exports.logError = exports.downloadExecutable = exports.runWrapper = exports.debugEnabled = exports.getCliArguments = exports.getCurrentConfiguration = exports.getCurrentSha256sum = exports.getCurrentVersion = exports.determineBinaryName = exports.WrapperConfiguration = exports.shasumFile = exports.versionFile = void 0;
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const os = require("os");
|
|
6
6
|
const fs = require("fs");
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
8
|
const https = require("https");
|
|
9
9
|
const crypto_1 = require("crypto");
|
|
10
|
+
const Sentry = require("@sentry/node");
|
|
10
11
|
exports.versionFile = path.join(__dirname, 'generated', 'version');
|
|
11
12
|
exports.shasumFile = path.join(__dirname, 'generated', 'sha256sums.txt');
|
|
12
13
|
class WrapperConfiguration {
|
|
@@ -149,19 +150,26 @@ function runWrapper(executable, cliArguments) {
|
|
|
149
150
|
shell: false,
|
|
150
151
|
stdio: 'inherit',
|
|
151
152
|
});
|
|
152
|
-
if (debug) {
|
|
153
|
-
console.debug(res);
|
|
154
|
-
}
|
|
155
|
-
let exitCode = 2;
|
|
156
153
|
if (res.status !== null) {
|
|
157
|
-
|
|
154
|
+
if (debug) {
|
|
155
|
+
console.debug(res);
|
|
156
|
+
}
|
|
157
|
+
return res.status;
|
|
158
158
|
}
|
|
159
159
|
else {
|
|
160
|
-
console.error(
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
console.error(res);
|
|
161
|
+
const spawnError = res.error;
|
|
162
|
+
if ((spawnError === null || spawnError === void 0 ? void 0 : spawnError.code) == 'EACCES') {
|
|
163
|
+
console.error("We don't have the permissions to install snyk. Please try the following options:\n" +
|
|
164
|
+
'* If installing with increased privileges (eg sudo), try adding --unsafe-perm as a parameter to npm install\n' +
|
|
165
|
+
'* If you run NPM <= 6, please upgrade to a later version.\n' +
|
|
166
|
+
'If the problems persist please contact support@snyk.io and include the information provided above.');
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
console.error('Failed to spawn child process. (' + executable + ')');
|
|
170
|
+
}
|
|
171
|
+
return 2;
|
|
163
172
|
}
|
|
164
|
-
return exitCode;
|
|
165
173
|
}
|
|
166
174
|
exports.runWrapper = runWrapper;
|
|
167
175
|
function downloadExecutable(downloadUrl, filename, filenameShasum) {
|
|
@@ -169,16 +177,16 @@ function downloadExecutable(downloadUrl, filename, filenameShasum) {
|
|
|
169
177
|
const options = new URL(downloadUrl);
|
|
170
178
|
const temp = path.join(__dirname, Date.now().toString());
|
|
171
179
|
const fileStream = fs.createWriteStream(temp);
|
|
172
|
-
const cleanupAfterError = (
|
|
180
|
+
const cleanupAfterError = (error) => {
|
|
173
181
|
try {
|
|
174
182
|
fs.unlinkSync(temp);
|
|
175
183
|
}
|
|
176
184
|
catch (e) {
|
|
177
185
|
console.debug('Failed to cleanup temporary file (' + temp + '): ' + e);
|
|
178
186
|
}
|
|
179
|
-
resolve(
|
|
187
|
+
resolve(error);
|
|
180
188
|
};
|
|
181
|
-
console.debug("Downloading from '" + downloadUrl + "' to '" + filename);
|
|
189
|
+
console.debug("Downloading from '" + downloadUrl + "' to '" + filename + "'");
|
|
182
190
|
const req = https.request(options, (res) => {
|
|
183
191
|
const shasum = crypto_1.createHash('sha256');
|
|
184
192
|
res.pipe(fileStream);
|
|
@@ -187,38 +195,64 @@ function downloadExecutable(downloadUrl, filename, filenameShasum) {
|
|
|
187
195
|
fileStream.close();
|
|
188
196
|
// compare shasums
|
|
189
197
|
const actualShasum = shasum.digest('hex');
|
|
190
|
-
|
|
198
|
+
const debugMessage = 'Shasums:\n- actual: ' +
|
|
191
199
|
actualShasum +
|
|
192
200
|
'\n- expected: ' +
|
|
193
|
-
filenameShasum
|
|
201
|
+
filenameShasum;
|
|
194
202
|
if (filenameShasum && actualShasum != filenameShasum) {
|
|
195
|
-
|
|
196
|
-
cleanupAfterError(3);
|
|
203
|
+
cleanupAfterError(Error('Shasum comparison failed!\n' + debugMessage));
|
|
197
204
|
}
|
|
198
205
|
else {
|
|
206
|
+
console.debug(debugMessage);
|
|
199
207
|
// finally rename the file and change permissions
|
|
200
208
|
fs.renameSync(temp, filename);
|
|
201
|
-
fs.chmodSync(filename,
|
|
209
|
+
fs.chmodSync(filename, 0o755);
|
|
202
210
|
console.debug('Downloaded successfull! ');
|
|
203
|
-
resolve(
|
|
211
|
+
resolve(undefined);
|
|
204
212
|
}
|
|
205
213
|
});
|
|
206
214
|
});
|
|
207
215
|
req.on('error', (e) => {
|
|
208
|
-
|
|
209
|
-
console.error(e);
|
|
210
|
-
cleanupAfterError(1);
|
|
216
|
+
cleanupAfterError(e);
|
|
211
217
|
});
|
|
212
218
|
req.on('response', (incoming) => {
|
|
213
219
|
if (incoming.statusCode &&
|
|
214
220
|
!(200 <= incoming.statusCode && incoming.statusCode < 300)) {
|
|
215
221
|
req.destroy();
|
|
216
|
-
|
|
217
|
-
|
|
222
|
+
cleanupAfterError(Error('Download failed! Server Response: ' +
|
|
223
|
+
incoming.statusCode +
|
|
224
|
+
' ' +
|
|
225
|
+
incoming.statusMessage));
|
|
218
226
|
}
|
|
219
227
|
});
|
|
220
228
|
req.end();
|
|
221
229
|
});
|
|
222
230
|
}
|
|
223
231
|
exports.downloadExecutable = downloadExecutable;
|
|
232
|
+
async function logError(context, err) {
|
|
233
|
+
if (isAnalyticsEnabled()) {
|
|
234
|
+
// init error reporting
|
|
235
|
+
const version = getCurrentVersion(exports.versionFile);
|
|
236
|
+
Sentry.init({
|
|
237
|
+
dsn: 'https://3e845233db8c4f43b4c4b9245f1d7bd6@o30291.ingest.sentry.io/4504599528079360',
|
|
238
|
+
release: version,
|
|
239
|
+
});
|
|
240
|
+
// report error
|
|
241
|
+
const sentryError = new Error('[' + context + '] ' + err.message);
|
|
242
|
+
sentryError.stack = err.stack;
|
|
243
|
+
Sentry.captureException(sentryError);
|
|
244
|
+
await Sentry.close();
|
|
245
|
+
}
|
|
246
|
+
// finally log the error to the console as well
|
|
247
|
+
console.error(err);
|
|
248
|
+
}
|
|
249
|
+
exports.logError = logError;
|
|
250
|
+
function isAnalyticsEnabled() {
|
|
251
|
+
if (process.env.snyk_disable_analytics == '1' ||
|
|
252
|
+
process.env.SNYK_DISABLE_ANALYTICS == '1') {
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
exports.isAnalyticsEnabled = isAnalyticsEnabled;
|
|
224
258
|
//# sourceMappingURL=common.js.map
|
package/dist/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yBAAyB;AACzB,yBAAyB;AACzB,iDAA0C;AAC1C,+BAA+B;AAC/B,mCAAoC;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,yBAAyB;AACzB,yBAAyB;AACzB,iDAA0C;AAC1C,+BAA+B;AAC/B,mCAAoC;AACpC,uCAAuC;AAE1B,QAAA,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;AAC3D,QAAA,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;AAE9E,MAAa,oBAAoB;IAK/B,YACE,OAAe,EACf,UAAkB,EAClB,iBAAyB;QAEzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAEM,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,aAAa;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAEM,mBAAmB;QACxB,MAAM,OAAO,GAAG,8BAA8B,CAAC;QAC/C,OAAO,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC;IACxD,CAAC;IAEM,gBAAgB;QACrB,MAAM,aAAa,GAAG,SAAS,CAAC;QAChC,OAAO,IAAI,CAAC,IA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914dfa0b8c1c797eb754db2f33d00956d700df8fa01 snyk-fix.tgz
|
|
4
|
+
decb760a188ddeb6d1b2f4a67b41124728800db4a001bd2d76223fea4b896d8b snyk-for-docker-desktop-darwin-arm64.tar.gz
|
|
5
|
+
570a99a986b49702ea188cdff3a9b15f992a2d40c0fb3b3e6cf3498cace52ba5 snyk-for-docker-desktop-darwin-x64.tar.gz
|
|
6
|
+
8d3361e0867efa3af336a4876a32a2999ef4ef1711cfefc8056d39844a98e380 snyk-linux-arm64
|
|
7
|
+
d54977bef891e0d928e4bce9cfa6d2d59d2cffe40bf2e654993f153cb8cfb8c2 snyk-linux
|
|
8
|
+
0e0916fce90e68237c6dad98432136d7e022d6375404463231c722c5b696895a snyk-macos
|
|
9
|
+
04140a8deb0f57c476232942fa43a3e0cfc568d0f30c5a7772eed2d2a4b3bd49 snyk-protect.tgz
|
|
10
|
+
cea90133fb16c967a731bf2f30eba66bbdbd2dd8354468700b30b1ad61e68a22 snyk-win.exe
|
package/dist/generated/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.1101.0
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,39 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const process_1 = require("process");
|
|
5
5
|
const common = require("./common");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const errorContextMessage = 'Download Error (Runtime)';
|
|
8
|
+
function run(executable) {
|
|
9
|
+
const cliArguments = common.getCliArguments(process_1.argv);
|
|
10
|
+
const exitCode = common.runWrapper(executable, cliArguments);
|
|
11
|
+
process.exit(exitCode);
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
const config = common.getCurrentConfiguration();
|
|
15
|
+
const executable = config.getLocalLocation();
|
|
16
|
+
if (!fs.existsSync(executable)) {
|
|
17
|
+
console.warn("Executable doesn't exist, trying to download.");
|
|
18
|
+
common
|
|
19
|
+
.downloadExecutable(config.getDownloadLocation(), executable, config.getShasumFile())
|
|
20
|
+
.then((error) => {
|
|
21
|
+
if (error !== undefined) {
|
|
22
|
+
common
|
|
23
|
+
.logError(errorContextMessage, error)
|
|
24
|
+
.then(() => process.exit(2));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
run(executable);
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
.catch((error) => {
|
|
31
|
+
common.logError(errorContextMessage, error).then(() => process.exit(2));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
run(executable);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
common.logError(errorContextMessage, error).then(() => process.exit(2));
|
|
40
|
+
}
|
|
11
41
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,qCAA+B;AAC/B,mCAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,qCAA+B;AAC/B,mCAAmC;AACnC,yBAAyB;AAEzB,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAEvD,SAAS,GAAG,CAAC,UAAkB;IAC7B,MAAM,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,cAAI,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC;AAED,IAAI;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAC;IAChD,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAE7C,IAAI,CAAC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