@vscode/vsce 3.4.1-1 → 3.4.2-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/out/package.js +2 -1
- package/out/secretLint.js +22 -7
- package/package.json +1 -1
package/out/package.js
CHANGED
|
@@ -1572,8 +1572,9 @@ async function scanFilesForSecrets(files, fileExclusion, options) {
|
|
|
1572
1572
|
return; // No need to scan
|
|
1573
1573
|
}
|
|
1574
1574
|
const onDiskFiles = files.filter(file => !isInMemoryFile(file));
|
|
1575
|
+
const onDiskNoneNodeModulesFiles = onDiskFiles.filter(file => !file.localPath.includes('node_modules'));
|
|
1575
1576
|
const inMemoryFiles = files.filter(file => isInMemoryFile(file));
|
|
1576
|
-
const onDiskResult = await (0, secretLint_1.lintFiles)(
|
|
1577
|
+
const onDiskResult = await (0, secretLint_1.lintFiles)(onDiskNoneNodeModulesFiles.map(file => file.localPath));
|
|
1577
1578
|
const inMemoryResults = await Promise.all(inMemoryFiles.map(file => (0, secretLint_1.lintText)(typeof file.contents === 'string' ? file.contents : file.contents.toString('utf8'), file.path)));
|
|
1578
1579
|
const secretsFound = [...inMemoryResults, onDiskResult].filter(result => !result.ok).flatMap(result => result.results);
|
|
1579
1580
|
// secrets found
|
package/out/secretLint.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.prettyPrintLintResult = exports.getRuleNameFromRuleId = exports.lintText = exports.lintFiles = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const secret_lint_types_1 = require("./typings/secret-lint-types");
|
|
9
|
+
const util_1 = require("./util");
|
|
9
10
|
const lintConfig = {
|
|
10
11
|
rules: [
|
|
11
12
|
{
|
|
@@ -47,18 +48,32 @@ async function getEngine() {
|
|
|
47
48
|
}
|
|
48
49
|
async function lintFiles(filePaths) {
|
|
49
50
|
const engine = await getEngine();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
let engineResult;
|
|
52
|
+
try {
|
|
53
|
+
engineResult = await engine.executeOnFiles({
|
|
54
|
+
filePathList: filePaths
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
util_1.log.error('Error occurred while scanning secrets (files):', error);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
53
61
|
return parseResult(engineResult);
|
|
54
62
|
}
|
|
55
63
|
exports.lintFiles = lintFiles;
|
|
56
64
|
async function lintText(content, fileName) {
|
|
57
65
|
const engine = await getEngine();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
let engineResult;
|
|
67
|
+
try {
|
|
68
|
+
engineResult = await engine.executeOnContent({
|
|
69
|
+
content,
|
|
70
|
+
filePath: fileName
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
util_1.log.error('Error occurred while scanning secrets (content):', error);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
62
77
|
return parseResult(engineResult);
|
|
63
78
|
}
|
|
64
79
|
exports.lintText = lintText;
|