@vaultcompass/conductor 0.16.0 → 0.18.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/README.md +60 -47
- package/dist/cli.js +5 -5
- package/dist/gate-runner.d.ts +1 -0
- package/dist/gate-runner.js +14 -7
- package/dist/intent-prepare.js +3 -6
- package/dist/normalize.js +42 -2
- package/dist/output-sarif.js +69 -3
- package/dist/output-text.d.ts +35 -2
- package/dist/output-text.js +98 -12
- package/dist/policy.d.ts +21 -1
- package/dist/policy.js +58 -2
- package/dist/resolve.d.ts +23 -4
- package/dist/resolve.js +64 -43
- package/dist/run.d.ts +11 -1
- package/dist/trust-base.d.ts +59 -10
- package/dist/trust-base.js +296 -33
- package/dist/unread-manifests.d.ts +1 -1
- package/dist/unread-manifests.js +25 -3
- package/package.json +1 -1
package/dist/unread-manifests.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// given. A repository whose only manifests are a pyproject.toml, a Dockerfile
|
|
6
6
|
// and a workflow gets a green vulnerabilities gate that looked at none of
|
|
7
7
|
// them, and "treated as clean" on its own reads as a statement about the code.
|
|
8
|
+
import { OSV_LOCKFILE_ECOSYSTEMS } from './products.js';
|
|
8
9
|
const EXACT_NAMES = new Set([
|
|
9
10
|
'pyproject.toml',
|
|
10
11
|
'Pipfile',
|
|
@@ -46,7 +47,28 @@ function isManifest(file) {
|
|
|
46
47
|
(file.startsWith('.github/workflows/') && /\.ya?ml$/.test(base)));
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
+
* A package.json no JavaScript lockfile the gate was handed could have resolved:
|
|
51
|
+
* none sits in its directory or an ancestor. Under one it is what that lockfile
|
|
52
|
+
* resolved, a workspace member under a root lockfile included, and naming it
|
|
53
|
+
* would put a note on every such run. Any other ecosystem's lockfile says
|
|
54
|
+
* nothing about it.
|
|
55
|
+
*/
|
|
56
|
+
function isUnresolvedPackageJson(file, handed) {
|
|
57
|
+
if (file.slice(file.lastIndexOf('/') + 1) !== 'package.json') {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
const directory = file.includes('/') ? file.slice(0, file.lastIndexOf('/')) : '';
|
|
61
|
+
return ![...handed].some((lockfile) => {
|
|
62
|
+
const base = lockfile.slice(lockfile.lastIndexOf('/') + 1);
|
|
63
|
+
if (OSV_LOCKFILE_ECOSYSTEMS[base] !== 'javascript') {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
const lockDirectory = lockfile.includes('/') ? lockfile.slice(0, lockfile.lastIndexOf('/')) : '';
|
|
67
|
+
return lockDirectory === '' || directory === lockDirectory || directory.startsWith(`${lockDirectory}/`);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Tracked dependency files that were not handed to `product`, sorted, as
|
|
50
72
|
* one sentence fragment, or null when there are none.
|
|
51
73
|
*
|
|
52
74
|
* `handed` are the repository-relative paths the gate was actually handed,
|
|
@@ -62,12 +84,12 @@ export function unreadManifestsNote(tracked, handed, product) {
|
|
|
62
84
|
const unread = tracked
|
|
63
85
|
.filter((file) => !file.split('/').some((segment) => SKIPPED_DIRS.has(segment)))
|
|
64
86
|
.filter((file) => !handed.has(file))
|
|
65
|
-
.filter(isManifest)
|
|
87
|
+
.filter((file) => isManifest(file) || isUnresolvedPackageJson(file, handed))
|
|
66
88
|
.sort();
|
|
67
89
|
if (unread.length === 0) {
|
|
68
90
|
return null;
|
|
69
91
|
}
|
|
70
92
|
const listed = unread.slice(0, MAX_LISTED).join(', ');
|
|
71
93
|
const more = unread.length > MAX_LISTED ? `, and ${unread.length - MAX_LISTED} more` : '';
|
|
72
|
-
return `Tracked
|
|
94
|
+
return `Tracked dependency files not handed to ${product}: ${listed}${more}.`;
|
|
73
95
|
}
|