@cdxgen/cdxgen 13.6.0 → 13.7.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 +15 -8
- package/bin/audit.js +7 -4
- package/bin/cdxgen.js +256 -37
- package/bin/convert.js +146 -22
- package/bin/evinse.js +25 -3
- package/bin/repl.js +47 -3
- package/bin/sign.js +211 -34
- package/bin/tracebom.js +18 -6
- package/bin/validate.js +18 -3
- package/bin/verify.js +113 -5
- package/data/behavior-taxonomy.schema.json +1491 -0
- package/data/cyclonedx-2.0-bundled.schema.json +18606 -5528
- package/data/cyclonedx-2.0-cryptography-defs.schema.json +857 -0
- package/data/pqc-migration.json +239 -0
- package/data/remediations.json +52 -0
- package/data/rules/cbom-security.yaml +4 -3
- package/data/rules/package-integrity.yaml +28 -0
- package/lib/audit/index.js +25 -3
- package/lib/cli/bomAssembly.js +80 -1
- package/lib/cli/cliOptions.js +121 -17
- package/lib/cli/index.js +609 -898
- package/lib/cli/jsBom.js +3 -0
- package/lib/cli/jvmBom.js +365 -40
- package/lib/cli/managedBom.js +19 -3
- package/lib/cli/nativeBom.js +10 -0
- package/lib/core/env.js +26 -0
- package/lib/core/fs.js +126 -3
- package/lib/core/globPatterns.js +218 -0
- package/lib/core/processTree.js +99 -12
- package/lib/core/projectConfig.js +332 -25
- package/lib/core/toolRegistry.js +15 -1
- package/lib/ecosystems/denoutils.js +2 -2
- package/lib/ecosystems/golem.js +3 -8
- package/lib/ecosystems/gradleutils.js +1082 -6
- package/lib/ecosystems/jsEvidence.js +90 -38
- package/lib/ecosystems/kosi.js +3 -5
- package/lib/ecosystems/npmVersionResolution.js +376 -0
- package/lib/ecosystems/parsers-python.js +89 -28
- package/lib/ecosystems/parsers-rust.js +117 -15
- package/lib/ecosystems/remote/huggingface.js +22 -0
- package/lib/ecosystems/rusi.js +2 -4
- package/lib/ecosystems/scalasem.js +2 -1
- package/lib/evinser/evinser.js +196 -34
- package/lib/evinser/scalasem.js +5 -1
- package/lib/helpers/agenticToolutils.js +112 -1
- package/lib/helpers/bomSigner.js +43 -9
- package/lib/helpers/jssSigner.js +1276 -0
- package/lib/inventory/agentBlueprint.js +193 -0
- package/lib/inventory/agentToolNames.js +145 -0
- package/lib/inventory/aiCollector.js +153 -7
- package/lib/inventory/aiInventory.js +44 -8
- package/lib/inventory/aiProviders.js +324 -0
- package/lib/inventory/bomUtils.js +8 -1
- package/lib/inventory/ciParsers/githubActionsLock.js +821 -0
- package/lib/inventory/citations.js +31 -2
- package/lib/inventory/communityAiConfigParser.js +978 -80
- package/lib/inventory/cyclonedx20.js +152 -0
- package/lib/inventory/cyclonedx20Common.js +286 -0
- package/lib/inventory/cyclonedx20Derived.js +159 -0
- package/lib/inventory/cyclonedx20Parties.js +552 -0
- package/lib/inventory/cyclonedx20Read.js +768 -0
- package/lib/inventory/cyclonedx20ReadCommon.js +374 -0
- package/lib/inventory/cyclonedx20ReadComponents.js +692 -0
- package/lib/inventory/cyclonedx20ReadContext.js +380 -0
- package/lib/inventory/cyclonedx20ReadEvidence.js +466 -0
- package/lib/inventory/cyclonedx20ReadSections.js +599 -0
- package/lib/inventory/cyclonedx20Render.js +766 -0
- package/lib/inventory/cyclonedx20RenderComponents.js +716 -0
- package/lib/inventory/cyclonedx20RenderDefinitions.js +405 -0
- package/lib/inventory/cyclonedx20RenderEvidence.js +726 -0
- package/lib/inventory/cyclonedx20RenderHardware.js +203 -0
- package/lib/inventory/cyclonedx20RenderPatents.js +174 -0
- package/lib/inventory/cyclonedx20RenderRefIds.js +314 -0
- package/lib/inventory/cyclonedx20RenderSections.js +499 -0
- package/lib/inventory/cyclonedx20Tables.js +594 -0
- package/lib/inventory/deps.js +106 -13
- package/lib/inventory/dosai.js +236 -1
- package/lib/inventory/dosaiParsers.js +3 -6
- package/lib/inventory/dotnetRuntime.js +164 -14
- package/lib/inventory/ecosystemFormulationParsers.js +979 -0
- package/lib/inventory/envcontext.js +132 -38
- package/lib/inventory/evidenceUtils.js +2 -1
- package/lib/inventory/formulationParsers.js +95 -13
- package/lib/inventory/hbom.js +45 -6
- package/lib/inventory/hbomLoader.js +166 -0
- package/lib/inventory/mcpConfigParser.js +5 -0
- package/lib/inventory/occurrenceKey.js +90 -0
- package/lib/inventory/pqcMigration.js +426 -0
- package/lib/inventory/rustFormulationParser.js +21 -10
- package/lib/inventory/source.js +65 -6
- package/lib/parsers/huggingfaceManifest.js +9 -1
- package/lib/parsers/huggingfaceUtils.js +18 -0
- package/lib/parsers/kiroPermissions.js +166 -0
- package/lib/server/server.js +36 -34
- package/lib/stages/postgen/postgen.js +41 -1
- package/lib/stages/postgen/specVersionCompat.js +76 -0
- package/lib/validator/bomValidator.js +8 -1
- package/lib/validator/complianceEngine.js +30 -3
- package/lib/validator/complianceRules.js +1416 -4
- package/lib/validator/generated/validate-2.0.mjs +57554 -13851
- package/lib/validator/index.js +48 -7
- package/lib/validator/reporters/json.js +6 -0
- package/package.json +9 -9
- package/types/bin/repl.d.ts.map +1 -1
- package/types/lib/audit/index.d.ts +6 -2
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +16 -0
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +6 -0
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts +2 -1
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts +15 -0
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/boundedFile.d.ts +30 -0
- package/types/lib/core/boundedFile.d.ts.map +1 -1
- package/types/lib/core/env.d.ts +10 -0
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +4 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/globPatterns.d.ts +70 -0
- package/types/lib/core/globPatterns.d.ts.map +1 -0
- package/types/lib/core/paths.d.ts +9 -0
- package/types/lib/core/paths.d.ts.map +1 -1
- package/types/lib/core/processTree.d.ts +16 -5
- package/types/lib/core/processTree.d.ts.map +1 -1
- package/types/lib/core/projectConfig.d.ts +47 -8
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/core/toolRegistry.d.ts.map +1 -1
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +248 -8
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/jsEvidence.d.ts +14 -1
- package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/kosi.d.ts.map +1 -1
- package/types/lib/ecosystems/npmVersionResolution.d.ts +119 -0
- package/types/lib/ecosystems/npmVersionResolution.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/pythonutils.d.ts +1 -1
- package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/ecosystems/scalasem.d.ts +58 -16
- package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +61 -9
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/scalasem.d.ts.map +1 -1
- package/types/lib/helpers/agenticToolutils.d.ts +53 -19
- package/types/lib/helpers/agenticToolutils.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +20 -3
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/helpers/jssSigner.d.ts +288 -0
- package/types/lib/helpers/jssSigner.d.ts.map +1 -0
- package/types/lib/helpers/vsixutils.d.ts +303 -19
- package/types/lib/helpers/vsixutils.d.ts.map +1 -1
- package/types/lib/inventory/agentBlueprint.d.ts +70 -0
- package/types/lib/inventory/agentBlueprint.d.ts.map +1 -0
- package/types/lib/inventory/agentToolNames.d.ts +51 -0
- package/types/lib/inventory/agentToolNames.d.ts.map +1 -0
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/aiInventory.d.ts.map +1 -1
- package/types/lib/inventory/aiProviders.d.ts +85 -0
- package/types/lib/inventory/aiProviders.d.ts.map +1 -0
- package/types/lib/inventory/bomUtils.d.ts.map +1 -1
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts +101 -0
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts.map +1 -0
- package/types/lib/inventory/citations.d.ts +5 -0
- package/types/lib/inventory/citations.d.ts.map +1 -1
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/cyclonedx20.d.ts +99 -0
- package/types/lib/inventory/cyclonedx20.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts +102 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts +74 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts +91 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts +51 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts +69 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts +77 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts +118 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts +40 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts +53 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts +73 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts +29 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts +110 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts +42 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts +26 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts +55 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts +134 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts.map +1 -0
- package/types/lib/inventory/deps.d.ts +35 -2
- package/types/lib/inventory/deps.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +19 -0
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
- package/types/lib/inventory/dotnetRuntime.d.ts +51 -4
- package/types/lib/inventory/dotnetRuntime.d.ts.map +1 -1
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts +73 -0
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts.map +1 -0
- package/types/lib/inventory/envcontext.d.ts +22 -6
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
- package/types/lib/inventory/hbom.d.ts +11 -0
- package/types/lib/inventory/hbom.d.ts.map +1 -1
- package/types/lib/inventory/hbomLoader.d.ts +54 -0
- package/types/lib/inventory/hbomLoader.d.ts.map +1 -1
- package/types/lib/inventory/jvmLocalRepos.d.ts +5 -1
- package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -1
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/occurrenceKey.d.ts +52 -0
- package/types/lib/inventory/occurrenceKey.d.ts.map +1 -0
- package/types/lib/inventory/pqcMigration.d.ts +84 -0
- package/types/lib/inventory/pqcMigration.d.ts.map +1 -0
- package/types/lib/inventory/rustFormulationParser.d.ts +7 -2
- package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/scalaCoords.d.ts.map +1 -1
- package/types/lib/inventory/scalaDedupe.d.ts +43 -0
- package/types/lib/inventory/scalaDedupe.d.ts.map +1 -0
- package/types/lib/inventory/source.d.ts +15 -0
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceManifest.d.ts +10 -1
- package/types/lib/parsers/huggingfaceManifest.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceUtils.d.ts +12 -0
- package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
- package/types/lib/parsers/kiroPermissions.d.ts +62 -0
- package/types/lib/parsers/kiroPermissions.d.ts.map +1 -0
- package/types/lib/parsers/vscodeExtensionId.d.ts +48 -0
- package/types/lib/parsers/vscodeExtensionId.d.ts.map +1 -0
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts +7 -0
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/postgen/specVersionCompat.d.ts +25 -0
- package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts +5 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/complianceEngine.d.ts +4 -4
- package/types/lib/validator/complianceEngine.d.ts.map +1 -1
- package/types/lib/validator/complianceRules.d.ts +14 -2
- package/types/lib/validator/complianceRules.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +10 -0
- package/types/lib/validator/index.d.ts.map +1 -1
- package/types/lib/validator/reporters/json.d.ts.map +1 -1
package/lib/validator/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
signatureReportReasons,
|
|
17
17
|
verifyBomSignatures,
|
|
18
18
|
} from "../helpers/bomSigner.js";
|
|
19
|
+
import { loadBomForAnalysis } from "../inventory/cyclonedx20.js";
|
|
19
20
|
import {
|
|
20
21
|
validateBom,
|
|
21
22
|
validateMetadata,
|
|
@@ -113,14 +114,19 @@ export async function validateGeneratedBom(bomJson) {
|
|
|
113
114
|
* Run schema + deep validation checks from the existing validator helpers and
|
|
114
115
|
* capture their boolean results without letting them blow up the process.
|
|
115
116
|
*
|
|
117
|
+
* The schema check reads the document as given. The deep checks read the
|
|
118
|
+
* 1.x-shaped model, which for a CycloneDX 2.0 document is what
|
|
119
|
+
* loadBomForAnalysis reads from it.
|
|
120
|
+
*
|
|
116
121
|
* An exception is not a verdict on the BOM, so it is recorded in
|
|
117
122
|
* `validationErrors` instead of silently counting as a plain failure.
|
|
118
123
|
*
|
|
119
|
-
* @param {object} bomJson
|
|
124
|
+
* @param {object} bomJson Document as given
|
|
125
|
+
* @param {object} internalBom The 1.x-shaped model of the document
|
|
120
126
|
* @param {object} opts
|
|
121
127
|
* @returns {Promise<{ schemaValid: boolean, deepValid: boolean, validationErrors: Array<{ stage: string, message: string }> }>}
|
|
122
128
|
*/
|
|
123
|
-
async function runSchemaAndDeep(bomJson, opts) {
|
|
129
|
+
async function runSchemaAndDeep(bomJson, internalBom, opts) {
|
|
124
130
|
let schemaValid = true;
|
|
125
131
|
let deepValid = true;
|
|
126
132
|
const validationErrors = [];
|
|
@@ -139,10 +145,10 @@ async function runSchemaAndDeep(bomJson, opts) {
|
|
|
139
145
|
if (opts.deep !== false) {
|
|
140
146
|
try {
|
|
141
147
|
deepValid =
|
|
142
|
-
validateMetadata(
|
|
143
|
-
validatePurls(
|
|
144
|
-
validateRefs(
|
|
145
|
-
validateProps(
|
|
148
|
+
validateMetadata(internalBom) !== false &&
|
|
149
|
+
validatePurls(internalBom) !== false &&
|
|
150
|
+
validateRefs(internalBom) !== false &&
|
|
151
|
+
validateProps(internalBom) !== false;
|
|
146
152
|
} catch (err) {
|
|
147
153
|
deepValid = false;
|
|
148
154
|
validationErrors.push({
|
|
@@ -155,9 +161,38 @@ async function runSchemaAndDeep(bomJson, opts) {
|
|
|
155
161
|
return { schemaValid, deepValid, validationErrors };
|
|
156
162
|
}
|
|
157
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Read a BOM into the 1.x-shaped model the deep checks and compliance rules
|
|
166
|
+
* walk. A 1.x document is used as is; a CycloneDX 2.0 document is read with
|
|
167
|
+
* loadBomForAnalysis, whose losses name the parts those checks never see.
|
|
168
|
+
* A read failure is recorded rather than thrown, and the checks then run on
|
|
169
|
+
* the document as given.
|
|
170
|
+
*
|
|
171
|
+
* @param {object} bomJson Parsed CycloneDX BOM
|
|
172
|
+
* @param {Array<{ stage: string, message: string }>} validationErrors Accumulator
|
|
173
|
+
* @returns {{ internalBom: object, readLosses: Array<{ pointer: string, reason: string }> }}
|
|
174
|
+
*/
|
|
175
|
+
function readForRules(bomJson, validationErrors) {
|
|
176
|
+
try {
|
|
177
|
+
const { internalBom, losses } = loadBomForAnalysis(bomJson);
|
|
178
|
+
return { internalBom, readLosses: losses };
|
|
179
|
+
} catch (err) {
|
|
180
|
+
validationErrors.push({
|
|
181
|
+
stage: "read",
|
|
182
|
+
message: err?.message || String(err),
|
|
183
|
+
});
|
|
184
|
+
return { internalBom: bomJson, readLosses: [] };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
158
188
|
/**
|
|
159
189
|
* Run structural + compliance validation against a parsed BOM.
|
|
160
190
|
*
|
|
191
|
+
* The JSON schema check and signature verification read the document as
|
|
192
|
+
* given. The deep checks and compliance rules read the 1.x-shaped model, so
|
|
193
|
+
* the same project gives the same rule results at 1.x and at 2.0; for a 2.0
|
|
194
|
+
* document `readLosses` lists what that model could not hold.
|
|
195
|
+
*
|
|
161
196
|
* @param {object} bomJson Parsed CycloneDX JSON BOM.
|
|
162
197
|
* @param {object} [options]
|
|
163
198
|
* @param {boolean} [options.schema] Run JSON-Schema validation (default true).
|
|
@@ -175,6 +210,7 @@ async function runSchemaAndDeep(bomJson, opts) {
|
|
|
175
210
|
* schemaValid: boolean,
|
|
176
211
|
* deepValid: boolean,
|
|
177
212
|
* validationErrors: Array<{ stage: string, message: string }>,
|
|
213
|
+
* readLosses: Array<{ pointer: string, reason: string }>,
|
|
178
214
|
* signatureVerified: boolean | null,
|
|
179
215
|
* signatureDetails: object | null,
|
|
180
216
|
* signatureEntries: Array<{ index: number, algorithm: any, keyId: any, verified: boolean }> | null,
|
|
@@ -185,11 +221,15 @@ async function runSchemaAndDeep(bomJson, opts) {
|
|
|
185
221
|
* }}
|
|
186
222
|
*/
|
|
187
223
|
export async function validateBomAdvanced(bomJson, options = {}) {
|
|
224
|
+
const readErrors = [];
|
|
225
|
+
const { internalBom, readLosses } = readForRules(bomJson, readErrors);
|
|
188
226
|
const { schemaValid, deepValid, validationErrors } = await runSchemaAndDeep(
|
|
189
227
|
bomJson,
|
|
228
|
+
internalBom,
|
|
190
229
|
options,
|
|
191
230
|
);
|
|
192
|
-
|
|
231
|
+
validationErrors.unshift(...readErrors);
|
|
232
|
+
const allFindings = evaluateAll(internalBom, {
|
|
193
233
|
categories: options.categories,
|
|
194
234
|
benchmarks: options.benchmarks,
|
|
195
235
|
});
|
|
@@ -249,6 +289,7 @@ export async function validateBomAdvanced(bomJson, options = {}) {
|
|
|
249
289
|
schemaValid,
|
|
250
290
|
deepValid,
|
|
251
291
|
validationErrors,
|
|
292
|
+
readLosses,
|
|
252
293
|
signatureVerified,
|
|
253
294
|
signatureDetails,
|
|
254
295
|
signatureEntries,
|
|
@@ -15,6 +15,12 @@ export function render(report, _options = {}) {
|
|
|
15
15
|
validationErrors: report.validationErrors || [],
|
|
16
16
|
signatureVerified: report.signatureVerified ?? null,
|
|
17
17
|
signatureEntries: report.signatureEntries ?? null,
|
|
18
|
+
// What reading a CycloneDX 2.0 input into the 1.x model behind the rules
|
|
19
|
+
// could not hold, as RFC 6901 pointers; empty for 1.x input.
|
|
20
|
+
readLosses: (report.readLosses || []).map((loss) => ({
|
|
21
|
+
pointer: loss.pointer,
|
|
22
|
+
reason: loss.reason,
|
|
23
|
+
})),
|
|
18
24
|
summary: report.summary,
|
|
19
25
|
benchmarks: report.benchmarks || [],
|
|
20
26
|
findings: (report.findings || []).map((f) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdxgen/cdxgen",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.7.0",
|
|
4
4
|
"description": "Creates CycloneDX Software Bill of Materials (SBOM) from source or container image",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sbom",
|
|
@@ -123,8 +123,8 @@
|
|
|
123
123
|
"index.cjs"
|
|
124
124
|
],
|
|
125
125
|
"dependencies": {
|
|
126
|
-
"@babel/parser": "8.0.
|
|
127
|
-
"@babel/traverse": "8.0.
|
|
126
|
+
"@babel/parser": "8.0.10",
|
|
127
|
+
"@babel/traverse": "8.0.10",
|
|
128
128
|
"@cdxgen/cdx-purl": "0.0.6",
|
|
129
129
|
"@isaacs/string-locale-compare": "1.1.0",
|
|
130
130
|
"@npmcli/fs": "6.0.0",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"ajv-formats": "3.0.1",
|
|
136
136
|
"common-ancestor-path": "2.0.0",
|
|
137
137
|
"edn-data": "1.2.2",
|
|
138
|
-
"glob": "
|
|
138
|
+
"glob": "14.0.3",
|
|
139
139
|
"node-stream-zip": "1.16.0",
|
|
140
140
|
"npm-package-arg": "14.0.0",
|
|
141
141
|
"parse-conflict-json": "6.0.0",
|
|
@@ -150,17 +150,17 @@
|
|
|
150
150
|
"yargs": "18.2.0"
|
|
151
151
|
},
|
|
152
152
|
"devDependencies": {
|
|
153
|
-
"@biomejs/biome": "2.
|
|
154
|
-
"esmock": "
|
|
153
|
+
"@biomejs/biome": "2.6.4",
|
|
154
|
+
"esmock": "3.0.0",
|
|
155
155
|
"poku": "4.5.0",
|
|
156
156
|
"sinon": "22.1.0",
|
|
157
157
|
"typescript": "^7.0.2"
|
|
158
158
|
},
|
|
159
159
|
"optionalDependencies": {
|
|
160
|
-
"@appthreat/atom": "3.
|
|
160
|
+
"@appthreat/atom": "3.2.1",
|
|
161
161
|
"@appthreat/atom-parsetools": "1.10.6",
|
|
162
162
|
"@bufbuild/protobuf": "2.16.0",
|
|
163
|
-
"@cdxgen/cdx-hbom": "0.
|
|
163
|
+
"@cdxgen/cdx-hbom": "0.8.0",
|
|
164
164
|
"@cdxgen/cdx-proto": "2.3.0",
|
|
165
165
|
"@cdxgen/cdxgen-plugins-bin": "4.2.0",
|
|
166
166
|
"@cdxgen/cdxgen-plugins-bin-darwin-amd64": "4.2.0",
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"@cdxgen/cdxgen-plugins-bin-windows-amd64": "4.2.0",
|
|
175
175
|
"@cdxgen/cdxgen-plugins-bin-windows-arm64": "4.2.0",
|
|
176
176
|
"@cdxgen/safer-exec": "1.2.1",
|
|
177
|
-
"body-parser": "2.
|
|
177
|
+
"body-parser": "2.4.0",
|
|
178
178
|
"compression": "1.8.2",
|
|
179
179
|
"connect": "3.7.0",
|
|
180
180
|
"jsonata": "2.2.2"
|
package/types/bin/repl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../bin/repl.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../bin/repl.js"],"names":[],"mappings":";AAybA,eAAO,MAAM,UAAU,oCA0FtB,CAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/** Default predictive audit category list applied when none are explicitly requested. */
|
|
2
2
|
export declare const DEFAULT_AUDIT_CATEGORIES: string[];
|
|
3
3
|
/**
|
|
4
|
-
* Read and validate a CycloneDX BOM file.
|
|
4
|
+
* Read and validate a CycloneDX BOM file. A CycloneDX 2.0 document is read
|
|
5
|
+
* into cdxgen's internal 1.x-shaped model, so the audit rules keep reading
|
|
6
|
+
* `components`, `bom-ref` and `metadata.component`; the number of losses
|
|
7
|
+
* the read reported is printed once on stderr, with the details in
|
|
8
|
+
* thoughtLog.
|
|
5
9
|
*
|
|
6
10
|
* @param {string} bomPath BOM file path
|
|
7
|
-
* @returns {object} parsed CycloneDX BOM
|
|
11
|
+
* @returns {object} parsed CycloneDX BOM in the 1.x shape
|
|
8
12
|
*/
|
|
9
13
|
export declare function loadBomFile(bomPath: string): object;
|
|
10
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/audit/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/audit/index.js"],"names":[],"mappings":"AAkFA,yFAAyF;AACzF,eAAO,MAAM,wBAAwB,UAKpC,CAAC;AAuCF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAHxB,MAGwB,GAFtB,MAAM,CA4BlB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAHxB,MAGwB,GAFt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;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,SAAS,EAJrC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAIE,EAAE,OAAO,EAH9C,MAG8C,GAF5C,OAAO,CAAC,MAAM,CAAC,CAuJ3B;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAH3B,MAG2B,GAFzB,OAAO,CAAC,MAAM,CAAC,CA0B3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EALnC,MAKmC,EAAE,SAAS,EAJ9C,MAAM,EAIwC,EAAE,MAAM,EAHtD,MAAM,GAAC,IAG+C,GAFpD,IAAI,CAwChB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAJ/B,MAI+B,EAAE,OAAO,EAHxC,MAGwC,GAFtC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAwChD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAH9B,MAG8B,GAF5B,MAAM,GAAG,SAAS,CAU9B"}
|
|
@@ -182,6 +182,22 @@ export declare function getPackageBinCommandNames(pkg: object): Set<string>;
|
|
|
182
182
|
* @returns {boolean} True when at least one bin command is imported
|
|
183
183
|
*/
|
|
184
184
|
export declare function hasNpmBinCommandEvidence(allImports: object, pkg: object): boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Return a CycloneDX organisational entity built from a collector-supplied
|
|
187
|
+
* supplier or manufacturer, or undefined when the value is not a well-formed
|
|
188
|
+
* entity.
|
|
189
|
+
*
|
|
190
|
+
* An entity needs a non-empty string name. When a url is present it must be
|
|
191
|
+
* an array of valid IRI references; any other shape (a single string, an
|
|
192
|
+
* array holding non-strings) drops the entity so the BOM stays schema
|
|
193
|
+
* valid. Each contact is reduced to its string name, email and phone, and a
|
|
194
|
+
* contact with none of them is left out. The entity bom-ref is not copied,
|
|
195
|
+
* because CycloneDX 1.4 does not allow it there.
|
|
196
|
+
*
|
|
197
|
+
* @param {Object} entity Collector-supplied organisational entity
|
|
198
|
+
* @returns {Object|undefined} Organisational entity, or undefined
|
|
199
|
+
*/
|
|
200
|
+
export declare function toOrganizationalEntity(entity: Object): Object | undefined;
|
|
185
201
|
/**
|
|
186
202
|
* Given the specified package, create a CycloneDX component and add it to the list.
|
|
187
203
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bomAssembly.d.ts","sourceRoot":"","sources":["../../../lib/cli/bomAssembly.js"],"names":[],"mappings":"AAkEA;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,aAJ7B,MAAM,qBACN,MAAM,EAAE,KACN,OAsBZ,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAFf,MAG8E,CAAC;AAEzF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,0CAH9B,MAAM;;;;;CAwChB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,YAJ1B,MAAM,KACJ,MAAM,GAAC,SAyBnB,CAAC;AA8GF;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,QAF3B,MAAM,EA6BlB,CAAC;AAqCF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,YALjB,MAAM,YACN,MAAM,KACJ;IAAE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CAsDrD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,SAH3B,MAAM,KACJ,MAQZ,CAAC;AAEF;;;;;;;;GAQG;AAGH,eAAO,MAAM,oBAAoB,SALtB,MAAM,KACJ,MA6BZ,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,YAHnB,MAAM,KACJ,MAAM,EAgBlB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM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AAS,CAS5B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,wBAAwB,EAHtD,MAAM,EAGgD,GAFpD,OAAO,CAInB;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EALvC,MAAM,EAKiC,EAAE,aAAa,EAJtD,MAIsD,EAAE,OAAO,EAH/D,GAAG,CAAC,MAAM,CAGqD,GAF7D,MAAM,EAAE,CAgBpB;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,EAH9C,MAAM,EAGwC,GAF5C,MAAM,EAAE,CAQpB;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EALvC,MAKuC,EAAE,KAAK,EAJ9C,MAI8C,EAAE,QAAQ,EAHxD,MAAM,EAGkD,GAFtD,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAJvC,MAIuC,EAAE,aAAa,EAHtD,MAGsD,GAFpD,IAAI,CAyDhB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAVE,MAUF,EACP,UAAU,OAAA,EACV,eAAe,EAVN,MAUM,EACf,YAAY,OAAA,EACZ,kBAAkB,AAVjB,CAGA,OAOsB,GAPZ,MAAM,CAwDlB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,YAJjC,MAAM,mBACN,MAAM,KACJ,OAYZ,CAAC"}
|
|
@@ -184,10 +184,13 @@ export declare function applyPostConstructionOverrides(options: object, context:
|
|
|
184
184
|
* @param {object} options The options object
|
|
185
185
|
* @param {object} [context]
|
|
186
186
|
* @param {boolean} [context.isSecureMode] Whether cdxgen runs in secure mode
|
|
187
|
+
* @param {string} [context.invokedCommandName] Binary name (e.g. "cbom"),
|
|
188
|
+
* which can turn on formulation
|
|
187
189
|
* @returns {OptionsWarning[]} Warnings for the caller
|
|
188
190
|
*/
|
|
189
191
|
export declare function applyAdvancedOptions(options: object, context?: {
|
|
190
192
|
isSecureMode?: boolean;
|
|
193
|
+
invokedCommandName?: string;
|
|
191
194
|
}): OptionsWarning[];
|
|
192
195
|
/**
|
|
193
196
|
* Build the complete `options` object from parsed CLI arguments.
|
|
@@ -215,6 +218,8 @@ export declare function applyAdvancedOptions(options: object, context?: {
|
|
|
215
218
|
* @param {object} [context.projectConfig] Sanitized config file contents,
|
|
216
219
|
* whose metadata properties merge
|
|
217
220
|
* with the other sources'
|
|
221
|
+
* @param {string[]} [context.argv] Raw command-line arguments,
|
|
222
|
+
* process.argv when absent
|
|
218
223
|
* @returns {{ options: object, warnings: OptionsWarning[] }}
|
|
219
224
|
*/
|
|
220
225
|
export declare function buildOptionsFromArgs(args: object, context: {
|
|
@@ -225,6 +230,7 @@ export declare function buildOptionsFromArgs(args: object, context: {
|
|
|
225
230
|
isDryRun?: boolean;
|
|
226
231
|
isSecureMode?: boolean;
|
|
227
232
|
projectConfig?: object;
|
|
233
|
+
argv?: string[];
|
|
228
234
|
}): {
|
|
229
235
|
options: object;
|
|
230
236
|
warnings: OptionsWarning[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliOptions.d.ts","sourceRoot":"","sources":["../../../lib/cli/cliOptions.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAyBH;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAJpC,MAIoC,EAAE,WAAW,AAHzD,CACA,EADQ,MAG4D,GAF1D,MAAM,GAAC,IAAI,CAoBvB;
|
|
1
|
+
{"version":3,"file":"cliOptions.d.ts","sourceRoot":"","sources":["../../../lib/cli/cliOptions.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAyBH;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAJpC,MAIoC,EAAE,WAAW,AAHzD,CACA,EADQ,MAG4D,GAF1D,MAAM,GAAC,IAAI,CAoBvB;AA2DD;;;;;;;;;;;;GAYG;A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C3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AA4FA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AA8CnE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA0C1D,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,eAAe,EACf,UAAU,EACV,aAAa,EACb,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,eAAe,EACf,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,gBAAgB,CAAC;AAoDxB;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAJ5B,MAI4B,EAAE,OAAO,EAHrC,MAGqC,GAFnC,OAAO,CAAC,MAAM,CAAC,CAsJ3B;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAAC,IAAI,EAJ1C,MAI0C,EAAE,OAAO,EAHnD,MAGmD,GAFjD,OAAO,CAAC,MAAM,CAAC,CAqU3B;AAgCD;;;;;;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} options CLI options
|
|
97
97
|
* @param {Object[]} pkgList Mutable array to push discovered components into
|
|
98
98
|
* @param {Object[]} dependencies Mutable array to merge dependencies into
|
|
99
|
+
* @param {string} [onlyEntry] Analyze only this extension folder
|
|
99
100
|
*/
|
|
100
|
-
export declare function analyzeInstalledExtensionDirs(extensionsDir: string, options: Object, pkgList: Object[], dependencies: Object[]): Promise<void>;
|
|
101
|
+
export declare function analyzeInstalledExtensionDirs(extensionsDir: string, options: Object, pkgList: Object[], dependencies: Object[], onlyEntry?: string): Promise<void>;
|
|
101
102
|
//# sourceMappingURL=jsBom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/jsBom.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jsBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/jsBom.js"],"names":[],"mappings":"AA6IA,wBAAgB,wBAAwB,CAAC,IAAI,KAAA,EAAE,OAAO,KAAA,sBAsBrD;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAJ/B,MAI+B,EAAE,OAAO,EAHxC,MAGwC,GAFtC,OAAO,CAAC,MAAM,CAAC,CAy5C3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAFtB,MAE4C,CAAC;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,YAJ9B,KAAK,CAAC,MAAM,CAAC,cACb,MAAM,KACJ,KAAK,CAAC,MAAM,CAwExB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAJ7B,MAI6B,EAAE,OAAO,EAHtC,MAGsC,GAFpC,OAAO,CAAC,MAAM,CAAC,CAmD3B;AAED;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAJxC,MAIwC,EAAE,OAAO,EAHjD,MAGiD,GAF/C,OAAO,CAAC,MAAM,CAAC,CAsI3B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EANhC,MAMgC,EAAE,OAAO,EAHzC,MAGyC,GAFvC,OAAO,CAAC,MAAM,CAAC,CA6B3B;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAJ7B,MAI6B,EAAE,OAAO,EAHtC,MAGsC,GAFpC,OAAO,CAAC,MAAM,CAAC,CAoN3B;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAJxC,MAIwC,EAAE,OAAO,EAHjD,MAGiD,GAF/C,OAAO,CAAC,MAAM,CAAC,CAoD3B;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAJrC,MAIqC,EAAE,OAAO,EAH9C,MAG8C,GAF5C,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAC,CAAC,CA2ChE;AAED;;;;;;;;;GASG;AACH,wBAAsB,6BAA6B,CACjD,aAAa,EAPJ,MAOI,EACb,OAAO,EAPE,MAOF,EACP,OAAO,EAPE,MAAM,EAOR,EACP,YAAY,EAPH,MAAM,EAOH,EACZ,SAAS,AAPR,CACF,EADU,MAOA,iBAyBV"}
|
|
@@ -29,6 +29,21 @@ export declare const SBT_CACHE_DIR: string;
|
|
|
29
29
|
* @returns {Promise<Object>} Jar namespace mapping keyed by package purl.
|
|
30
30
|
*/
|
|
31
31
|
export declare function collectSbtDependencyJars(pkgList: Object[], known?: Object): Promise<Object>;
|
|
32
|
+
/**
|
|
33
|
+
* Keep apart two independent Maven projects that declare the same
|
|
34
|
+
* coordinates, such as sample projects in `one/` and `two/` that both call
|
|
35
|
+
* themselves `com.example:demo:0.0.1-SNAPSHOT`. When `component` has the
|
|
36
|
+
* bom-ref of the parent or of a module already collected but comes from a
|
|
37
|
+
* different pom.xml, it gets the directory of its pom, relative to the scan
|
|
38
|
+
* root, as the purl subpath, and the dependency entries that name it follow.
|
|
39
|
+
*
|
|
40
|
+
* @param {Object} component Root component of a Maven tree, updated in place
|
|
41
|
+
* @param {Object} parentComponent Parent component and the modules under it
|
|
42
|
+
* @param {string} rootPath Directory being scanned
|
|
43
|
+
* @param {Object[]} dependenciesList Dependency entries of the tree, updated in place
|
|
44
|
+
* @returns {boolean} True when the component got a distinct identity
|
|
45
|
+
*/
|
|
46
|
+
export declare function separateDuplicateMavenProject(component: Object, parentComponent: Object, rootPath: string, dependenciesList?: Object[]): boolean;
|
|
32
47
|
/**
|
|
33
48
|
* The purls and bom-refs of a parent component and the module components
|
|
34
49
|
* nested under it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jvmBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/jvmBom.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jvmBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/jvmBom.js"],"names":[],"mappings":"AAsJA;;;;;GAKG;AACH,eAAO,IAAI,gBAAgB,EAFjB,MAIsD,CAAC;AAUjE;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,EAHrB,MAQT,CAAC;AAEF;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,EAHhB,MAIqE,CAAC;AAuDhF;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAL3C,MAAM,EAKqC,EAAE,KAAK,AAJ1D,CAEA,EAFQ,MAIuD,GAFrD,OAAO,CAAC,MAAM,CAAC,CA2B3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAPA,MAOA,EACT,eAAe,EAPN,MAOM,EACf,QAAQ,EAPC,MAOD,EACR,gBAAgB,GAPP,MAAM,EAOM,GANV,OAAO,CA+CnB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,EAHrC,MAGqC,GAFnC,GAAG,CAAC,MAAM,CAAC,CAwBvB;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAL5B,MAK4B,EAAE,OAAO,EAJrC,MAIqC,GAFnC,MAAM,CAmFlB;AAiCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAPC,MAOD,EACR,MAAM,EAPG,MAOH,EACN,GAAG,EAPM,MAON,EACH,YAAY,AAPX,CACA,EADQ,MAAM,EAOE,GANN,MAAM,EAAE,CAwEpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EALtC,MAKsC,EAAE,QAAQ,EAJhD,MAIgD,EAAE,KAAK,AAH/D,CACA,eAE+D,GAFrD;IAAC,eAAe,EAAE,MAAM,GAAC,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAC,CAyClE;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAJ7B,MAI6B,EAAE,OAAO,EAHtC,MAGsC,GAFpC,OAAO,CAAC,MAAM,CAAC,CAiiF3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managedBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/managedBom.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"managedBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/managedBom.js"],"names":[],"mappings":"AAiLA;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,QAJ5B,MAAM,YACN,MAAM,KACJ,OAMZ,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,QAJ1B,MAAM,YACN,MAAM,KACJ,OAeZ,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,IAAI,QAAA,EAAE,OAAO,EAHhC,MAGgC,GAF9B,MAAM,GAAG,IAAI,CAyEzB;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAJ/B,MAI+B,EAAE,OAAO,EAHxC,MAGwC,G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AF9B,MAAM,CAmClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAJlC,MAIkC,EAAE,OAAO,EAH3C,MAG2C,GAFzC,OAAO,CAAC,MAAM,CAAC,CA6B3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/nativeBom.js"],"names":[],"mappings":"AAuMA;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAFnB,MAAM,GAAC,SAAS,CAU5B;AA0BD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAJ3B,MAI2B,EAAE,OAAO,EAHpC,MAGoC,GAFlC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAygBvC;AAuQD,wBAAsB,aAAa,CAAC,IAAI,KAAA,EAAE,OAAO,KAAA,+BA2MhD;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAHvC,MAGuC,GAFrC,MAAM,GAAC,SAAS,CAiC5B;AAED;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAAC,SAAS,EAJ9C,MAI8C,EAAE,SAAS,AAHjE,CACA,EADQ,MAGyD,GAFvD,OAAO,CAAC,MAAM,GAAC,SAAS,CAAC,CAyDrC;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAJnC,MAImC,EAAE,OAAO,EAH5C,MAG4C,GAF1C,OAAO,CAAC,MAAM,CAAC,CAwB3B;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAJ7B,MAI6B,EAAE,OAAO,EAHtC,MAGsC,GAFpC,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"nativeBom.d.ts","sourceRoot":"","sources":["../../../lib/cli/nativeBom.js"],"names":[],"mappings":"AAuMA;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAFnB,MAAM,GAAC,SAAS,CAU5B;AA0BD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AFnC,OAAO,CAAC,MAAM,CAAC,CAoE3B;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAJhC,MAIgC,EAAE,OAAO,EAHzC,MAGyC,GAFvC,OAAO,CAAC,MAAM,CAAC,CAuC3B;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAJ5B,MAI4B,EAAE,OAAO,EAHrC,MAGqC,GAFnC,OAAO,CAAC,MAAM,CAAC,CA0C3B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAJ5B,MAI4B,EAAE,OAAO,EAHrC,MAGqC,GAFnC,OAAO,CAAC,MAAM,CAAC,CA2D3B;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAJ9B,MAI8B,EAAE,OAAO,EAHvC,MAGuC,GAFrC,OAAO,CAAC,MAAM,CAAC,CAwD3B"}
|
|
@@ -67,4 +67,34 @@ export declare function scanFileMarkers(absPath: string, rootDir: string | undef
|
|
|
67
67
|
size: number;
|
|
68
68
|
skipped?: string;
|
|
69
69
|
} | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Compute the digest of a regular file with bounded chunked reads, under the
|
|
72
|
+
* same rules as readRegularTextFile: a FIFO, a directory, a symlink, a file
|
|
73
|
+
* that resolves outside rootDir or one larger than maxBytes yields undefined.
|
|
74
|
+
*
|
|
75
|
+
* @param {string} absPath absolute path
|
|
76
|
+
* @param {number} maxBytes largest size hashed
|
|
77
|
+
* @param {string|undefined} [rootDir] root the path must stay under
|
|
78
|
+
* @param {string} [algorithm="sha256"] node:crypto hash algorithm
|
|
79
|
+
* @returns {string|undefined} the hex digest, or undefined
|
|
80
|
+
*/
|
|
81
|
+
export declare function hashRegularFile(absPath: string, maxBytes: number, rootDir?: string | undefined, algorithm?: string): string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* True when the process runs as root, where a symlink planted in a user's
|
|
84
|
+
* home could point a scan at files only root can read.
|
|
85
|
+
*
|
|
86
|
+
* @returns {boolean} true for uid 0
|
|
87
|
+
*/
|
|
88
|
+
export declare function isRunningAsRoot(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Read a small text file a user keeps in their home, such as an editor's or an
|
|
91
|
+
* agent's configuration. Dotfile managers often make these symlinks, so a
|
|
92
|
+
* symlink to a regular file is followed, except when the process runs as root.
|
|
93
|
+
* The target must still be a regular file no larger than maxBytes.
|
|
94
|
+
*
|
|
95
|
+
* @param {string} absPath absolute path
|
|
96
|
+
* @param {number} maxBytes largest size read
|
|
97
|
+
* @returns {string|undefined} the text, or undefined
|
|
98
|
+
*/
|
|
99
|
+
export declare function readUserFileText(absPath: string, maxBytes: number): string | undefined;
|
|
70
100
|
//# sourceMappingURL=boundedFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boundedFile.d.ts","sourceRoot":"","sources":["../../../lib/core/boundedFile.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"boundedFile.d.ts","sourceRoot":"","sources":["../../../lib/core/boundedFile.js"],"names":[],"mappings":"AA8BA;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAFxB,MAEiD,CAAC;AAE5D;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAL5B,MAK4B,EAAE,OAAO,EAJrC,MAAM,GAAC,SAI8B,GAHnC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CAsChD;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EALhC,MAKgC,EAAE,QAAQ,EAJ1C,MAI0C,EAAE,OAAO,AAH3D,CACA,EADQ,MAAM,GAAC,SAG4C,GAFjD,MAAM,GAAC,SAAS,CAoC5B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAdE,MAcF,EACP,OAAO,EAdE,MAAM,GAAC,SAcT,EACP,OAAO,EAdE,MAAM,EAcR,EACP,EACE,QAAgC,EAChC,YAAiB,EACjB,WAAe,EACf,OAAY,GACb,AAnBA,CAKA,EAJA;IAAyB,QAAQ,AAAjC,CACA,EADQ,MAAM,CACd;IAAyB,YAAY,AAArC,CACA,EADQ,MAAM,CACd;IAAyB,WAAW,AAApC,CACA,EADQ,MAAM,CACd;IAAyB,OAAO,AAAhC,CACA,EADQ,MAAM,CACd;CAcK,GAdK;IAAC,IAAI,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,EAAE,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CAsGjH;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAPE,MAOF,EACP,QAAQ,EAPC,MAOD,EACR,OAAO,AAPN,CACA,EADQ,MAAM,GAAC,SAOT,EACP,SAAS,AAPR,CACA,EADQ,MAOW,GANT,MAAM,GAAC,SAAS,CA2C5B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAFlB,OAAO,CAInB;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAJ7B,MAI6B,EAAE,QAAQ,EAHvC,MAGuC,GAFrC,MAAM,GAAC,SAAS,CAkB5B"}
|
package/types/lib/core/env.d.ts
CHANGED
|
@@ -181,6 +181,16 @@ export declare const PROJECT_TYPE_ALIASES: {
|
|
|
181
181
|
dynamic: string[];
|
|
182
182
|
"ai-provenance": string[];
|
|
183
183
|
};
|
|
184
|
+
/**
|
|
185
|
+
* Project types, with their aliases, that inventory the host cdxgen runs on
|
|
186
|
+
* rather than the scan path: installed packages, users, shell history, IDE
|
|
187
|
+
* and browser extensions, or the Maven, Gradle, sbt, Cargo and Helm caches in
|
|
188
|
+
* the user's home directory. Only the operator may select them; neither a
|
|
189
|
+
* server request nor a config file in the scanned directory can.
|
|
190
|
+
*
|
|
191
|
+
* @type {Set<string>}
|
|
192
|
+
*/
|
|
193
|
+
export declare const HOST_SCOPE_PROJECT_TYPES: Set<string>;
|
|
184
194
|
/** Map of base package manager to the array of accepted alias strings. */
|
|
185
195
|
export declare const PACKAGE_MANAGER_ALIASES: {
|
|
186
196
|
scala: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../lib/core/env.js"],"names":[],"mappings":"AAUA,uCAAuC;AACvC,eAAO,MAAM,MAAM,SAAmD,CAAC;AACvE,mCAAmC;AACnC,eAAO,MAAM,KAAK,SAAwC,CAAC;AAC3D,oCAAoC;AACpC,eAAO,MAAM,MAAM,SAA+C,CAAC;AAEnE,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,oBAElC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAIrB,CAAC;AAEX,sJAAsJ;AACtJ,eAAO,MAAM,qBAAqB,SAI/B,CAAC;AAEJ,sIAAsI;AACtI,eAAO,MAAM,sBAAsB,SAElC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAH9B,MAG8B,GAF5B,MAAM,EAAE,CAiDpB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAFrB,OAAO,CAOnB;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,IAFhC,OAAO,CAMnB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,IAF7B,OAAO,CAInB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAFjB,OAAO,CAOnB;AAED,mGAAmG;AACnG,eAAO,MAAM,aAAa,SAAuB,CAAC;AAElD,oJAAoJ;AACpJ,eAAO,MAAM,gBAAgB,SAEwC,CAAC;AAEtE,yFAAyF;AACzF,eAAO,MAAM,QAAQ,QAAmB,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,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H,cAAc;IACd,WAAW;IACX,aAAa;IACb,aAAa;IACb,EAAE;IAyCF,GAAG;IACH,UAAU;IACV,OAAO;IACP,EAAE;IAyBF,EAAE;IACF,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,MAAM;IA8BN,IAAI;IACJ,OAAO;IACP,MAAM;IACN,MAAM;IACN,KAAK;IACL,CAAC;IACD,KAAK;IACL,GAAG;IACH,OAAO;IACP,GAAG;IACH,GAAG;IACH,IAAI;IACJ,KAAK;IACL,SAAS;IACT,CAAC;IACD,OAAO;IACP,MAAM;IACN,IAAI;IACJ,EAAE;IACF,OAAO;IACP,IAAI;IACJ,YAAY;IACZ,SAAS;IAcT,UAAU;IACV,KAAK;IAUL,MAAM;IACN,GAAG;IACH,KAAK;IACL,KAAK;IACL,GAAG;IACH,GAAG;IACH,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,kBAAkB;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../lib/core/env.js"],"names":[],"mappings":"AAUA,uCAAuC;AACvC,eAAO,MAAM,MAAM,SAAmD,CAAC;AACvE,mCAAmC;AACnC,eAAO,MAAM,KAAK,SAAwC,CAAC;AAC3D,oCAAoC;AACpC,eAAO,MAAM,MAAM,SAA+C,CAAC;AAEnE,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,oBAElC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAIrB,CAAC;AAEX,sJAAsJ;AACtJ,eAAO,MAAM,qBAAqB,SAI/B,CAAC;AAEJ,sIAAsI;AACtI,eAAO,MAAM,sBAAsB,SAElC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAH9B,MAG8B,GAF5B,MAAM,EAAE,CAiDpB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAFrB,OAAO,CAOnB;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,IAFhC,OAAO,CAMnB;AAED;;;;GAIG;AACH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B,CAAC,UAAU,EALhC,MAKgC,EAAE,OAAO,QAAA,WAiBnD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,OAAA,EAAE,OAAO,EAH5C,MAG4C,EAAE,aAAa,UAAO,OA2G5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,WAAW,AAHvC,CACA,EADQ,MAG+B,GAF7B,MAAM,CAOlB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAJxC,MAIwC,EAAE,WAAW,AAH7D,CACA,EADQ,MAGqD,GAFnD,OAAO,CA8BnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,QAAA,EAAE,mBAAmB,OAAA,EAAE,OAAO,EAJ/D,MAI+D,WAezE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,KAAA,OA8CvC"}
|
package/types/lib/core/fs.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ export declare function safeIsExecutableSync(filePath: string): boolean;
|
|
|
19
19
|
* Permission- and dry-run-aware wrapper around writeFileSync. Records the
|
|
20
20
|
* activity and returns undefined when blocked.
|
|
21
21
|
*
|
|
22
|
+
* The last component of the path is never followed when it is a symbolic
|
|
23
|
+
* link: the link is replaced with a regular file. Paths under /dev and /proc,
|
|
24
|
+
* such as /dev/stdout, are written through as given.
|
|
25
|
+
*
|
|
22
26
|
* @param {string} filePath File path to write.
|
|
23
27
|
* @param {string|Buffer} data Data to write.
|
|
24
28
|
* @param {Object} [options] writeFileSync options (encoding, mode, flag).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../lib/core/fs.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA+ErC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,QAAA,OAmCtC;AAED;;;;;;;GAOG;AACH,wBAAgB,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AIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAFhC,MAAM,GAAC,SAEyB,QAK1C;AA4BD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,SAGtC;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EARE,MAQF,EACP,OAAO,EARE,MAQF,EACP,UAAU,SAAA,EACV,UAAU,OAAA,OAmDX;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAFf,MAAM,CAIlB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,IAFZ,MAAM,CAYlB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAJ1B,MAI0B,EAAE,IAAI,EAHhC,MAGgC,GAF9B,OAAO,QAAQ,CAU3B;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,KAAA,EAAE,IAAI,EAHvC,MAGuC,GAFrC,OAAO,CAAC,MAAM,CAAC,CA8B3B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Longest exclude or include pattern cdxgen accepts from an untrusted source,
|
|
3
|
+
* such as a server request or a config file in the scanned directory.
|
|
4
|
+
*/
|
|
5
|
+
export declare const UNTRUSTED_GLOB_PATTERN_MAX_LENGTH = 512;
|
|
6
|
+
/**
|
|
7
|
+
* Most patterns a list of untrusted exclude or include patterns may stand
|
|
8
|
+
* for once brace expressions are expanded. Every expanded pattern is matched
|
|
9
|
+
* against every file the scan walks, so the total, not the length of the
|
|
10
|
+
* list as written, is what decides the cost.
|
|
11
|
+
*/
|
|
12
|
+
export declare const UNTRUSTED_GLOB_EXPANSION_BUDGET = 128;
|
|
13
|
+
/**
|
|
14
|
+
* Count, from above, how many patterns a glob's brace expressions expand to,
|
|
15
|
+
* following the brace-expansion package that minimatch uses:
|
|
16
|
+
*
|
|
17
|
+
* - alternatives in `{a,b}` add up, and groups side by side or inside one
|
|
18
|
+
* another multiply;
|
|
19
|
+
* - a range such as `{1..9}`, `{a..z}` or `{0..100..5}` counts its members;
|
|
20
|
+
* - a group with no comma of its own but a list inside it, such as
|
|
21
|
+
* `{{a,b}c}`, is expanded and each result is braced and expanded again,
|
|
22
|
+
* so it counts as its contents, unless its text holds `..` and a result
|
|
23
|
+
* could become a range of any size.
|
|
24
|
+
*
|
|
25
|
+
* brace-expansion reads braces that form neither a list nor a range in ways
|
|
26
|
+
* that depend on the rest of the pattern, so a group that is neither, a
|
|
27
|
+
* closing brace with no group open, a group left open, and the `..` case
|
|
28
|
+
* above all count as more than `cap`. Patterns that list alternatives or
|
|
29
|
+
* ranges, such as `{test,tests}` or `*.{js,ts}`, get the exact count, or one
|
|
30
|
+
* slightly above it where a letter range such as `{Z..c}` spans the `\` that
|
|
31
|
+
* brace-expansion leaves out. `\` escapes the next character. The count stops growing at
|
|
32
|
+
* `cap + 1` and each character is read once, so a pattern that would expand
|
|
33
|
+
* to millions costs no more to count than its length.
|
|
34
|
+
*
|
|
35
|
+
* @param {string} pattern glob pattern
|
|
36
|
+
* @param {number} [cap] largest count of interest
|
|
37
|
+
* @returns {number} upper bound on the number of expanded patterns, at most
|
|
38
|
+
* `cap + 1`
|
|
39
|
+
*/
|
|
40
|
+
export declare function globBraceExpansionCount(pattern: string, cap?: number): number;
|
|
41
|
+
/**
|
|
42
|
+
* Split exclude or include patterns from an untrusted source into the ones
|
|
43
|
+
* cdxgen uses and the ones it refuses. Patterns are taken in order while
|
|
44
|
+
* they fit the expansion budget, so a list cannot multiply the work of a
|
|
45
|
+
* scan by brace expansion or sheer number.
|
|
46
|
+
*
|
|
47
|
+
* @param {unknown} patterns a pattern, a list of patterns, or nothing
|
|
48
|
+
* @param {Object} [options] bound options
|
|
49
|
+
* @param {boolean} [options.allowBraces=true] refuse every pattern with a
|
|
50
|
+
* brace when false
|
|
51
|
+
* @param {number} [options.budget] expanded patterns allowed in all
|
|
52
|
+
* @param {number} [options.used=0] expanded patterns earlier lists have
|
|
53
|
+
* already taken from the budget
|
|
54
|
+
* @returns {{accepted: string[], refused: {pattern: string, reason: string}[], expansions: number}}
|
|
55
|
+
* the patterns to use, the ones refused with the reason, and the expanded
|
|
56
|
+
* patterns the accepted ones use
|
|
57
|
+
*/
|
|
58
|
+
export declare function boundUntrustedGlobPatterns(patterns: unknown, { allowBraces, budget, used, }?: {
|
|
59
|
+
allowBraces?: boolean;
|
|
60
|
+
budget?: number;
|
|
61
|
+
used?: number;
|
|
62
|
+
}): {
|
|
63
|
+
accepted: string[];
|
|
64
|
+
refused: {
|
|
65
|
+
pattern: string;
|
|
66
|
+
reason: string;
|
|
67
|
+
}[];
|
|
68
|
+
expansions: number;
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=globPatterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globPatterns.d.ts","sourceRoot":"","sources":["../../../lib/core/globPatterns.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AA0DnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EANE,MAMF,EACP,GAAG,AANF,CACA,EADQ,MAMwB,GALtB,MAAM,CAmDlB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAZC,OAYD,EACR,EACE,WAAkB,EAClB,MAAwC,EACxC,IAAQ,GACT,AAhBA,CAMA,EALA;IAA0B,WAAW,AAArC,CAEA,EAFQ,OAAO,CAEf;IAAyB,MAAM,AAA/B,CACA,EADQ,MAAM,CACd;IAAyB,IAAI,AAA7B,CAEA,EAFQ,MAAM,CAEd;CAUK,GAVK;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,CAyDlG"}
|
|
@@ -33,4 +33,13 @@ export declare function isValidDriveRoot(root: string): boolean;
|
|
|
33
33
|
* @returns {string} camelCase representation of the input.
|
|
34
34
|
*/
|
|
35
35
|
export declare function toCamel(str: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Rewrite an absolute path under the user's home directory to a `~`-relative
|
|
38
|
+
* form so the emitted BOM does not carry the local username.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} filePath Absolute path
|
|
41
|
+
* @param {string} [home] Home directory, defaulting to the current user's
|
|
42
|
+
* @returns {string} Home-relative path when applicable, else the input
|
|
43
|
+
*/
|
|
44
|
+
export declare function redactHomePath(filePath: string, home?: string): string;
|
|
36
45
|
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../lib/core/paths.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,iFAAiF;AACjF,eAAO,MAAM,UAAU,KAEV,CAAC;AAEd,oCAAoC;AACpC,eAAO,MAAM,KAAK,SAAyB,CAAC;AAC5C,kCAAkC;AAClC,eAAO,MAAM,KAAK,SAA0B,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAH1B,MAG0B,GAFxB,OAAO,CAmBnB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAHhB,MAGgB,GAFd,MAAM,CAIlB"}
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../lib/core/paths.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,iFAAiF;AACjF,eAAO,MAAM,UAAU,KAEV,CAAC;AAEd,oCAAoC;AACpC,eAAO,MAAM,KAAK,SAAyB,CAAC;AAC5C,kCAAkC;AAClC,eAAO,MAAM,KAAK,SAA0B,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAH1B,MAG0B,GAFxB,OAAO,CAmBnB;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAHhB,MAGgB,GAFd,MAAM,CAIlB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAJ5B,MAI4B,EAAE,IAAI,AAH1C,CACA,EADQ,MAG8C,GAF5C,MAAM,CAelB"}
|