@cdxgen/cdxgen 13.2.0 → 13.4.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 +33 -14
- package/bin/cdxgen.js +310 -138
- package/bin/evinse.js +22 -0
- package/bin/repl.js +86 -0
- package/bin/sign.js +119 -15
- package/bin/tracebom.js +69 -5
- package/bin/validate.js +107 -19
- package/bin/verify.js +172 -63
- package/data/helpers/init.gradle +46 -21
- package/data/remediations.json +85 -0
- package/data/rules/dependency-sources.yaml +67 -0
- package/data/rules/scala-evidence.yaml +115 -0
- package/lib/audit/index.js +38 -6
- package/lib/cli/bomAssembly.js +105 -15
- package/lib/cli/cliOptions.js +93 -1
- package/lib/cli/index.js +156 -58
- package/lib/cli/jsBom.js +99 -53
- package/lib/cli/jvmBom.js +708 -147
- package/lib/cli/managedBom.js +415 -224
- package/lib/cli/nativeBom.js +264 -44
- package/lib/core/activity.js +12 -0
- package/lib/core/env.js +22 -15
- package/lib/core/fs.js +176 -7
- package/lib/core/httpClient.js +159 -24
- package/lib/core/metadataProperties.js +97 -0
- package/lib/core/pluginRun.js +184 -0
- package/lib/core/processTree.js +100 -0
- package/lib/core/projectConfig.js +31 -4
- package/lib/core/runState.js +39 -0
- package/lib/core/toml.js +72 -0
- package/lib/ecosystems/asarutils.js +4 -2
- package/lib/ecosystems/bunutils.js +274 -108
- package/lib/ecosystems/cargoCache.js +231 -8
- package/lib/ecosystems/caxa.js +434 -2
- package/lib/ecosystems/cmakeResolver.js +76 -21
- package/lib/ecosystems/cppBuildContext.js +631 -0
- package/lib/ecosystems/cppEvidence.js +399 -51
- package/lib/ecosystems/cppIncludeResolver.js +294 -0
- package/lib/ecosystems/denoutils.js +93 -66
- package/lib/ecosystems/ecosystems.js +1983 -793
- package/lib/ecosystems/golem.js +28 -12
- package/lib/ecosystems/gradleutils.js +356 -37
- package/lib/ecosystems/jsEvidence.js +104 -44
- package/lib/ecosystems/kosi.js +31 -7
- package/lib/ecosystems/npmutils.js +174 -9
- package/lib/ecosystems/parsers-dotnet.js +616 -159
- package/lib/ecosystems/parsers-elm.js +46 -28
- package/lib/ecosystems/parsers-gleam.js +3 -4
- package/lib/ecosystems/parsers-go.js +371 -70
- package/lib/ecosystems/parsers-js.js +263 -76
- package/lib/ecosystems/parsers-julia.js +2 -3
- package/lib/ecosystems/parsers-jvm.js +204 -12
- package/lib/ecosystems/parsers-misc.js +929 -216
- package/lib/ecosystems/parsers-python.js +167 -24
- package/lib/ecosystems/parsers-rust.js +28 -22
- package/lib/ecosystems/parsers-terraform.js +1573 -19
- package/lib/ecosystems/pythonutils.js +102 -6
- package/lib/ecosystems/remote/huggingface.js +3 -0
- package/lib/ecosystems/rubyutils.js +1492 -182
- package/lib/ecosystems/rusi.js +54 -10
- package/lib/ecosystems/sbtutils.js +243 -187
- package/lib/ecosystems/scalacliutils.js +342 -0
- package/lib/ecosystems/scalasem.js +2618 -0
- package/lib/ecosystems/terraformRegistry.js +288 -0
- package/lib/ecosystems/utils.js +2 -0
- package/lib/ecosystems/vendoredCode.js +156 -0
- package/lib/evinser/evinser.js +1008 -191
- package/lib/evinser/swiftsem.js +1914 -302
- package/lib/helpers/agenticToolutils.js +2 -2
- package/lib/helpers/bomSigner.js +1101 -222
- package/lib/inventory/aiCollector.js +4 -1
- package/lib/inventory/analyzer.js +110 -127
- package/lib/inventory/atomUtils.js +703 -43
- package/lib/inventory/auditCategories.js +7 -0
- package/lib/inventory/buildToolRateLimit.js +144 -0
- package/lib/inventory/cacheCommands.js +2 -1
- package/lib/inventory/cdxrs.js +103 -12
- package/lib/inventory/cmakeBuildDirs.js +254 -0
- package/lib/inventory/deps.js +501 -124
- package/lib/inventory/depsUtils.js +183 -11
- package/lib/inventory/display.js +4 -5
- package/lib/inventory/dosai.js +798 -57
- package/lib/inventory/dosaiParsers.js +310 -15
- package/lib/inventory/dynamic.js +90 -6
- package/lib/inventory/evidenceUtils.js +166 -113
- package/lib/inventory/fetchBatch.js +690 -55
- package/lib/inventory/fetchDiskCache.js +597 -0
- package/lib/inventory/forgeEnricher.js +14 -5
- package/lib/inventory/jvmLocalRepos.js +917 -0
- package/lib/inventory/mcpConfigParser.js +2 -3
- package/lib/inventory/parentSelection.js +146 -0
- package/lib/inventory/protobom.js +8 -1
- package/lib/inventory/purl.js +152 -3
- package/lib/inventory/rustFormulationParser.js +3 -4
- package/lib/inventory/sbomDocument.js +2 -70
- package/lib/inventory/scalaCoords.js +153 -0
- package/lib/inventory/source.js +45 -27
- package/lib/inventory/spdx.js +101 -0
- package/lib/inventory/traceRunner.js +295 -25
- package/lib/inventory/tracedCrypto.js +294 -0
- package/lib/managers/binary.js +115 -24
- package/lib/managers/docker.js +467 -46
- package/lib/managers/oci.js +63 -3
- package/lib/parsers/cmakeCache.js +69 -0
- package/lib/parsers/cmakeLists.js +466 -0
- package/lib/parsers/cmakePresets.js +400 -0
- package/lib/parsers/compileCommands.js +557 -0
- package/lib/parsers/largeJson.js +454 -0
- package/lib/parsers/npmrc.js +19 -1
- package/lib/parsers/strictJson.js +322 -0
- package/lib/parsers/terraformConfig.js +1073 -0
- package/lib/parsers/terraformSource.js +652 -0
- package/lib/server/server.js +23 -0
- package/lib/stages/postgen/introspection/markers.js +1 -1
- package/lib/stages/postgen/postgen.js +83 -16
- package/lib/stages/postgen/specVersionCompat.js +32 -0
- package/lib/validator/bomValidator.js +6 -16
- package/lib/validator/index.js +64 -11
- package/lib/validator/reporters/console.js +3 -0
- package/lib/validator/reporters/json.js +2 -0
- package/lib/validator/reporters/sarif.js +7 -0
- package/package.json +23 -23
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +2 -1
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +33 -1
- 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.map +1 -1
- package/types/lib/cli/jvmBom.d.ts +24 -1
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts +7 -4
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts +3 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/activity.d.ts.map +1 -1
- package/types/lib/core/env.d.ts +9 -0
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +55 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/httpClient.d.ts +13 -8
- package/types/lib/core/httpClient.d.ts.map +1 -1
- package/types/lib/core/metadataProperties.d.ts +39 -0
- package/types/lib/core/metadataProperties.d.ts.map +1 -0
- package/types/lib/core/pluginRun.d.ts +97 -0
- package/types/lib/core/pluginRun.d.ts.map +1 -0
- package/types/lib/core/processTree.d.ts +36 -0
- package/types/lib/core/processTree.d.ts.map +1 -0
- package/types/lib/core/projectConfig.d.ts +6 -2
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/core/runState.d.ts +29 -0
- package/types/lib/core/runState.d.ts.map +1 -0
- package/types/lib/core/toml.d.ts +20 -0
- package/types/lib/core/toml.d.ts.map +1 -0
- package/types/lib/ecosystems/asarutils.d.ts.map +1 -1
- package/types/lib/ecosystems/bunutils.d.ts +12 -5
- package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
- package/types/lib/ecosystems/cargoCache.d.ts +12 -0
- package/types/lib/ecosystems/cargoCache.d.ts.map +1 -1
- package/types/lib/ecosystems/caxa.d.ts +14 -0
- package/types/lib/ecosystems/caxa.d.ts.map +1 -1
- package/types/lib/ecosystems/cmakeResolver.d.ts +28 -3
- package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
- package/types/lib/ecosystems/cppBuildContext.d.ts +55 -0
- package/types/lib/ecosystems/cppBuildContext.d.ts.map +1 -0
- package/types/lib/ecosystems/cppEvidence.d.ts +17 -1
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts +92 -0
- package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -0
- package/types/lib/ecosystems/denoutils.d.ts +9 -3
- package/types/lib/ecosystems/denoutils.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts +62 -13
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +70 -4
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/jsEvidence.d.ts +5 -2
- package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/kosi.d.ts +13 -0
- package/types/lib/ecosystems/kosi.d.ts.map +1 -1
- package/types/lib/ecosystems/npmutils.d.ts +57 -0
- package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-dotnet.d.ts +118 -4
- package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-gleam.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-go.d.ts +54 -2
- package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts +16 -5
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-jvm.d.ts +46 -1
- package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts +70 -4
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts +53 -3
- 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/parsers-terraform.d.ts +38 -21
- package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -1
- package/types/lib/ecosystems/pythonutils.d.ts +27 -2
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
- package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts +164 -3
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts +13 -0
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/ecosystems/sbtutils.d.ts +88 -2
- package/types/lib/ecosystems/sbtutils.d.ts.map +1 -1
- package/types/lib/ecosystems/scalacliutils.d.ts +56 -0
- package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -0
- package/types/lib/ecosystems/scalasem.d.ts +311 -0
- package/types/lib/ecosystems/scalasem.d.ts.map +1 -0
- package/types/lib/ecosystems/terraformRegistry.d.ts +9 -0
- package/types/lib/ecosystems/terraformRegistry.d.ts.map +1 -0
- package/types/lib/ecosystems/utils.d.ts +2 -2
- package/types/lib/ecosystems/utils.d.ts.map +1 -1
- package/types/lib/ecosystems/vendoredCode.d.ts +32 -0
- package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +132 -15
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/swiftsem.d.ts +280 -15
- package/types/lib/evinser/swiftsem.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +182 -13
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/analyzer.d.ts.map +1 -1
- package/types/lib/inventory/atomUtils.d.ts +219 -5
- package/types/lib/inventory/atomUtils.d.ts.map +1 -1
- package/types/lib/inventory/auditCategories.d.ts +3 -0
- package/types/lib/inventory/auditCategories.d.ts.map +1 -1
- package/types/lib/inventory/buildToolRateLimit.d.ts +38 -0
- package/types/lib/inventory/buildToolRateLimit.d.ts.map +1 -0
- package/types/lib/inventory/cacheCommands.d.ts +2 -1
- package/types/lib/inventory/cacheCommands.d.ts.map +1 -1
- package/types/lib/inventory/cdxrs.d.ts +8 -3
- package/types/lib/inventory/cdxrs.d.ts.map +1 -1
- package/types/lib/inventory/cmakeBuildDirs.d.ts +58 -0
- package/types/lib/inventory/cmakeBuildDirs.d.ts.map +1 -0
- package/types/lib/inventory/deps.d.ts +59 -1
- package/types/lib/inventory/deps.d.ts.map +1 -1
- package/types/lib/inventory/depsUtils.d.ts +15 -0
- package/types/lib/inventory/depsUtils.d.ts.map +1 -1
- package/types/lib/inventory/display.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +121 -9
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dosaiParsers.d.ts +53 -7
- package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
- package/types/lib/inventory/dynamic.d.ts +10 -0
- package/types/lib/inventory/dynamic.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts +19 -4
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/fetchBatch.d.ts +83 -14
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
- package/types/lib/inventory/fetchDiskCache.d.ts +169 -0
- package/types/lib/inventory/fetchDiskCache.d.ts.map +1 -0
- package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
- package/types/lib/inventory/jvmLocalRepos.d.ts +178 -0
- package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -0
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/parentSelection.d.ts +34 -0
- package/types/lib/inventory/parentSelection.d.ts.map +1 -0
- package/types/lib/inventory/plugins.d.ts.map +1 -1
- package/types/lib/inventory/protobom.d.ts.map +1 -1
- package/types/lib/inventory/purl.d.ts +71 -2
- package/types/lib/inventory/purl.d.ts.map +1 -1
- package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/sbomDocument.d.ts.map +1 -1
- package/types/lib/inventory/scalaCoords.d.ts +80 -0
- package/types/lib/inventory/scalaCoords.d.ts.map +1 -0
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/inventory/spdx.d.ts +9 -0
- package/types/lib/inventory/spdx.d.ts.map +1 -1
- package/types/lib/inventory/traceRunner.d.ts +59 -1
- package/types/lib/inventory/traceRunner.d.ts.map +1 -1
- package/types/lib/inventory/tracedCrypto.d.ts +42 -0
- package/types/lib/inventory/tracedCrypto.d.ts.map +1 -0
- package/types/lib/managers/binary.d.ts +30 -1
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts +29 -0
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/managers/oci.d.ts +17 -1
- package/types/lib/managers/oci.d.ts.map +1 -1
- package/types/lib/parsers/cmakeCache.d.ts +16 -0
- package/types/lib/parsers/cmakeCache.d.ts.map +1 -1
- package/types/lib/parsers/cmakeLists.d.ts +77 -0
- package/types/lib/parsers/cmakeLists.d.ts.map +1 -0
- package/types/lib/parsers/cmakePresets.d.ts +78 -0
- package/types/lib/parsers/cmakePresets.d.ts.map +1 -0
- package/types/lib/parsers/compileCommands.d.ts +115 -0
- package/types/lib/parsers/compileCommands.d.ts.map +1 -0
- package/types/lib/parsers/largeJson.d.ts +52 -0
- package/types/lib/parsers/largeJson.d.ts.map +1 -0
- package/types/lib/parsers/npmrc.d.ts +5 -0
- package/types/lib/parsers/npmrc.d.ts.map +1 -1
- package/types/lib/parsers/strictJson.d.ts +46 -0
- package/types/lib/parsers/strictJson.d.ts.map +1 -0
- package/types/lib/parsers/terraformConfig.d.ts +70 -0
- package/types/lib/parsers/terraformConfig.d.ts.map +1 -0
- package/types/lib/parsers/terraformSource.d.ts +66 -0
- package/types/lib/parsers/terraformSource.d.ts.map +1 -0
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +18 -1
- package/types/lib/validator/index.d.ts.map +1 -1
- package/types/lib/validator/reporters/console.d.ts.map +1 -1
- package/types/lib/validator/reporters/json.d.ts.map +1 -1
- package/types/lib/validator/reporters/sarif.d.ts.map +1 -1
- package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +0 -462
|
@@ -1,28 +1,197 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Largest number of entries accepted in a `signers` or `chain` signature.
|
|
4
|
+
* Every entry is checked against the whole signed object, so the bound keeps
|
|
5
|
+
* the cost of verifying a document proportional to its size.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MAX_SIGNATURE_ENTRIES = 32;
|
|
8
|
+
/**
|
|
9
|
+
* Members the CycloneDX 1.4 to 1.7 and 2.0 schemas define at the root of a
|
|
10
|
+
* BOM. A root signature is only accepted on an object made of these members,
|
|
11
|
+
* so a signed component, service, or annotation cannot pass as a signed BOM.
|
|
12
|
+
*/
|
|
13
|
+
export declare const BOM_ROOT_MEMBERS: readonly string[];
|
|
14
|
+
/**
|
|
15
|
+
* Renders a value taken from a document for a message. JSON can make any field
|
|
16
|
+
* an object or array, and interpolating those directly can throw.
|
|
17
|
+
*
|
|
18
|
+
* @param {any} value - Value to render
|
|
19
|
+
* @returns {string} - Printable text
|
|
20
|
+
*/
|
|
21
|
+
export declare function displayValue(value: any): string;
|
|
22
|
+
/**
|
|
23
|
+
* Wraps shared-secret material for HMAC (HS256, HS384, HS512) signing or
|
|
24
|
+
* verification.
|
|
25
|
+
*
|
|
26
|
+
* HMAC is only ever used with a key produced by this function (or any secret
|
|
27
|
+
* KeyObject). Public and private keys are refused, so a document cannot switch
|
|
28
|
+
* a verifier to HMAC and use its public key as the secret.
|
|
29
|
+
*
|
|
30
|
+
* @param {string|Buffer|crypto.KeyObject} material - Secret bytes, a UTF-8 string, or a secret KeyObject
|
|
31
|
+
* @returns {crypto.KeyObject} - A secret KeyObject
|
|
32
|
+
*/
|
|
33
|
+
export declare function loadSharedSecret(material: string | Buffer | crypto.KeyObject): crypto.KeyObject;
|
|
34
|
+
/**
|
|
35
|
+
* Loads the key used to verify signatures.
|
|
36
|
+
*
|
|
37
|
+
* Strings and Buffers are always parsed as asymmetric keys (a private key is
|
|
38
|
+
* reduced to its public half). To verify HMAC signatures, pass the result of
|
|
39
|
+
* {@link loadSharedSecret} instead.
|
|
40
|
+
*
|
|
41
|
+
* @param {string|Buffer|Object|crypto.KeyObject} key - PEM text, a createPublicKey() input, or a KeyObject
|
|
42
|
+
* @returns {crypto.KeyObject} - A public or secret KeyObject
|
|
43
|
+
*/
|
|
44
|
+
export declare function loadVerificationKey(key: string | Buffer | Object | crypto.KeyObject): crypto.KeyObject;
|
|
45
|
+
/**
|
|
46
|
+
* Generates a PEM key pair suitable for the given JSF algorithm.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} algorithm - JSF algorithm identifier
|
|
49
|
+
* @returns {{ publicKey: string, privateKey: string }} - PEM encoded SPKI public key and PKCS#8 private key
|
|
50
|
+
*/
|
|
51
|
+
export declare function generateSigningKeyPair(algorithm: string): {
|
|
52
|
+
publicKey: string;
|
|
53
|
+
privateKey: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Applies JSF signatures to the BOM and, optionally, its components, services,
|
|
57
|
+
* and annotations.
|
|
58
|
+
*
|
|
59
|
+
* Nested elements are signed by default. When a `signers` or `chain` signature
|
|
60
|
+
* is appended to a BOM that already has a root signature, nested elements are
|
|
61
|
+
* skipped by default, because changing them would invalidate the existing root
|
|
62
|
+
* signature; explicitly requesting nested signing in that case is an error.
|
|
63
|
+
*
|
|
64
|
+
* The BOM root must carry `bomFormat` (or `specFormat`) and `specVersion`, and
|
|
65
|
+
* only members that CycloneDX defines at the root. A nested element that
|
|
66
|
+
* carries `bomFormat`, `specFormat`, or `specVersion` is refused. Verification
|
|
67
|
+
* rejects signatures over either shape.
|
|
4
68
|
*
|
|
5
69
|
* @param {Object} bomJson - CycloneDX BOM Object
|
|
6
|
-
* @param {Object} options - Signing options
|
|
70
|
+
* @param {Object} options - Signing options
|
|
71
|
+
* @param {string|Buffer|Object|crypto.KeyObject} options.privateKey - Private key (PEM or KeyObject), or the shared secret for HS* algorithms
|
|
72
|
+
* @param {string} [options.algorithm] - JSF algorithm identifier (default RS512). It must match the key type.
|
|
73
|
+
* @param {Object} [options.publicKeyJwk] - JWK of the signing key's public key to embed
|
|
74
|
+
* @param {boolean} [options.embedPublicKey] - Embed the public key derived from the signing key when publicKeyJwk is not given. Ignored for HS* algorithms and for keys without a JWK form, such as rsa-pss.
|
|
75
|
+
* @param {boolean} [options.embedPublicKeyNested] - Also embed the public key in nested signatures (default true)
|
|
76
|
+
* @param {string} [options.keyId] - Key ID to embed
|
|
77
|
+
* @param {string} [options.mode] - 'replace' (default), 'signers', or 'chain'
|
|
78
|
+
* @param {boolean} [options.signComponents] - Sign each component
|
|
79
|
+
* @param {boolean} [options.signServices] - Sign each service
|
|
80
|
+
* @param {boolean} [options.signAnnotations] - Sign each annotation
|
|
7
81
|
* @returns {Object} - Signed BOM Object
|
|
8
82
|
*/
|
|
9
|
-
export declare function signBom(bomJson: Object, options?:
|
|
83
|
+
export declare function signBom(bomJson: Object, options?: {
|
|
84
|
+
privateKey: string | Buffer | Object | crypto.KeyObject;
|
|
85
|
+
algorithm?: string;
|
|
86
|
+
publicKeyJwk?: Object;
|
|
87
|
+
embedPublicKey?: boolean;
|
|
88
|
+
embedPublicKeyNested?: boolean;
|
|
89
|
+
keyId?: string;
|
|
90
|
+
mode?: string;
|
|
91
|
+
signComponents?: boolean;
|
|
92
|
+
signServices?: boolean;
|
|
93
|
+
signAnnotations?: boolean;
|
|
94
|
+
}): Object;
|
|
10
95
|
/**
|
|
11
|
-
* Verifies the
|
|
12
|
-
*
|
|
96
|
+
* Verifies the signature of a single node (e.g., BOM root, Component, Service,
|
|
97
|
+
* Annotation). Handles single signatures, multi-signatures (signers), and
|
|
98
|
+
* signature chains, and returns the first signature object that matches the key.
|
|
99
|
+
*
|
|
100
|
+
* A signature only matches when its declared algorithm fits the key type, its
|
|
101
|
+
* embedded publicKey (if any) is the verification key, and its value covers the
|
|
102
|
+
* node content plus the signature metadata as JSF defines.
|
|
103
|
+
*
|
|
104
|
+
* This checks one object only. To verify a BOM, use {@link verifyBomSignatures}
|
|
105
|
+
* or {@link verifyBom}, which also require the signed root to be a BOM.
|
|
13
106
|
*
|
|
14
107
|
* @param {Object} node - The BOM or granular object to verify
|
|
15
|
-
* @param {string|crypto.KeyObject} publicKey -
|
|
16
|
-
* @
|
|
108
|
+
* @param {string|Buffer|Object|crypto.KeyObject} publicKey - Verification key. Strings and Buffers are parsed as public keys; use loadSharedSecret() for HMAC.
|
|
109
|
+
* @param {Object} [options]
|
|
110
|
+
* @param {string[]} [options.reasons] - When no signature matches, receives the reason each entry was rejected
|
|
111
|
+
* @returns {boolean|Object} - Matching signature object if valid. False otherwise.
|
|
112
|
+
*/
|
|
113
|
+
export declare function verifyNode(node: Object, publicKey: string | Buffer | Object | crypto.KeyObject, options?: {
|
|
114
|
+
reasons?: string[];
|
|
115
|
+
}): boolean | Object;
|
|
116
|
+
/**
|
|
117
|
+
* Verifies the signatures of a BOM against one or more trusted keys and reports
|
|
118
|
+
* the outcome for every signature entry.
|
|
119
|
+
*
|
|
120
|
+
* The BOM verifies when:
|
|
121
|
+
* - its root carries `bomFormat` (or `specFormat`) "CycloneDX" and
|
|
122
|
+
* `specVersion`, and only members that CycloneDX defines at the root of a BOM;
|
|
123
|
+
* - its root signature verifies, meaning at least one entry verifies with one
|
|
124
|
+
* of the keys. With `requireAll`, every entry must verify with one of the
|
|
125
|
+
* keys, and every key must verify at least one entry;
|
|
126
|
+
* - with `deep`, every signed component, service, and annotation verifies the
|
|
127
|
+
* same way and carries none of `bomFormat`, `specFormat`, and `specVersion`.
|
|
128
|
+
*
|
|
129
|
+
* A BOM without a root signature fails unless `allowNestedOnly` is set. Then
|
|
130
|
+
* every component, service, and annotation must carry a signature that
|
|
131
|
+
* verifies, and `notices` lists the members that no signature covers.
|
|
132
|
+
*
|
|
133
|
+
* Parse untrusted BOM text with `parseStrictJson()` from
|
|
134
|
+
* `lib/parsers/strictJson.js` before calling this function, so that the
|
|
135
|
+
* verified values are the values every JSON parser reads.
|
|
136
|
+
*
|
|
137
|
+
* @param {Object} bom - CycloneDX BOM Object
|
|
138
|
+
* @param {Array<string|Buffer|Object|crypto.KeyObject>|string|Buffer|Object|crypto.KeyObject} keys - Trusted verification keys (see verifyNode)
|
|
139
|
+
* @param {Object} [options]
|
|
140
|
+
* @param {boolean} [options.deep] - Also verify nested signatures (default true)
|
|
141
|
+
* @param {boolean} [options.allowNestedOnly] - Accept a BOM without a root signature when every nested element is signed
|
|
142
|
+
* @param {boolean} [options.requireAll] - Require every entry of each signature to verify, and every key to verify an entry of the root signature
|
|
143
|
+
* @returns {{ verified: boolean, errors: string[], notices: string[], root: Object|null, nested: Object[] }}
|
|
144
|
+
* `root` and each `nested` item hold `label`, `form`, `verified`, `match` (the first verified entry),
|
|
145
|
+
* `reasons` (why the signature could not be read), `entries` (`index`, `algorithm`, `keyId`, `verified`, `reasons`),
|
|
146
|
+
* and `keysMatched` (whether each key verified an entry).
|
|
147
|
+
*/
|
|
148
|
+
export declare function verifyBomSignatures(bom: Object, keys: Array<string | Buffer | Object | crypto.KeyObject> | string | Buffer | Object | crypto.KeyObject, options?: {
|
|
149
|
+
deep?: boolean;
|
|
150
|
+
allowNestedOnly?: boolean;
|
|
151
|
+
requireAll?: boolean;
|
|
152
|
+
}): {
|
|
153
|
+
verified: boolean;
|
|
154
|
+
errors: string[];
|
|
155
|
+
notices: string[];
|
|
156
|
+
root: Object | null;
|
|
157
|
+
nested: Object[];
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Flattens a {@link verifyBomSignatures} report into the reasons it did not
|
|
161
|
+
* verify: policy errors first, then each rejected root entry, then each
|
|
162
|
+
* rejected nested entry prefixed with the element it belongs to.
|
|
163
|
+
*
|
|
164
|
+
* @param {Object} report - Result of verifyBomSignatures
|
|
165
|
+
* @returns {string[]} - Reasons, empty when the report verified
|
|
17
166
|
*/
|
|
18
|
-
export declare function
|
|
167
|
+
export declare function signatureReportReasons(report: Object): string[];
|
|
19
168
|
/**
|
|
20
|
-
* Verifies
|
|
21
|
-
*
|
|
169
|
+
* Verifies a BOM's top-level signature, as well as nested components, services,
|
|
170
|
+
* and annotations, with one key. Returns the root match only if the BOM verifies
|
|
171
|
+
* as {@link verifyBomSignatures} defines with `deep` enabled.
|
|
22
172
|
*
|
|
23
173
|
* @param {Object} bom - CycloneDX BOM Object
|
|
24
|
-
* @param {string|crypto.KeyObject} publicKey -
|
|
25
|
-
* @
|
|
174
|
+
* @param {string|Buffer|Object|crypto.KeyObject} publicKey - Verification key (see verifyNode)
|
|
175
|
+
* @param {Object} [options] - Same options as verifyNode
|
|
176
|
+
* @returns {boolean|Object} - Signature object if valid. False otherwise.
|
|
177
|
+
*/
|
|
178
|
+
export declare function verifyBom(bom: Object, publicKey: string | Buffer | Object | crypto.KeyObject, options?: Object): boolean | Object;
|
|
179
|
+
/**
|
|
180
|
+
* Checks every signature entry of a node against a set of trusted keys. An
|
|
181
|
+
* entry is verified when one of the keys verifies that entry.
|
|
182
|
+
*
|
|
183
|
+
* `cdx-sign` uses this before appending a `signers` or `chain` entry, to check
|
|
184
|
+
* that the content still carries the earlier signatures.
|
|
185
|
+
*
|
|
186
|
+
* @param {Object} node - The BOM or granular object whose signature is checked
|
|
187
|
+
* @param {Array<string|Buffer|Object|crypto.KeyObject>} [keys] - Trusted verification keys (see verifyNode)
|
|
188
|
+
* @returns {Array<{ index: number, algorithm: any, keyId: any, verified: boolean, reasons: string[] }>} - One result per signature entry; empty for an unsigned node
|
|
26
189
|
*/
|
|
27
|
-
export declare function
|
|
190
|
+
export declare function checkSignatureEntries(node: Object, keys?: Array<string | Buffer | Object | crypto.KeyObject>): Array<{
|
|
191
|
+
index: number;
|
|
192
|
+
algorithm: any;
|
|
193
|
+
keyId: any;
|
|
194
|
+
verified: boolean;
|
|
195
|
+
reasons: string[];
|
|
196
|
+
}>;
|
|
28
197
|
//# sourceMappingURL=bomSigner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bomSigner.d.ts","sourceRoot":"","sources":["../../../lib/helpers/bomSigner.js"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"bomSigner.d.ts","sourceRoot":"","sources":["../../../lib/helpers/bomSigner.js"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAyDjC;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,mBAqB3B,CAAC;AAmBH;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAHvB,GAGuB,GAFrB,MAAM,CAWlB;AA+LD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAH9B,MAAM,GAAC,MAAM,GAAC,MAAM,CAAC,SAGS,GAF5B,MAAM,CAAC,SAAS,CA2B5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAH5B,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,CAAC,SAGA,GAF1B,MAAM,CAAC,SAAS,CAW5B;AAwBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAHrC,MAGqC,GAFnC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CA2BrD;AAmYD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAdpB,MAcoB,EAA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AAM,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,GAAC,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAqH3G;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAHlC,MAGkC,GAFhC,MAAM,EAAE,CAepB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EALlB,MAKkB,EAAE,SAAS,EAJ7B,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,CAAC,SAIC,EAAE,OAAO,AAH9C,CACA,EADQ,MAG2C,GAFzC,OAAO,GAAC,MAAM,CAc1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAJ/B,MAI+B,EAAE,IAAI,AAH7C,CACA,EADQ,KAAK,CAAC,MAAM,GAAC,MAAM,GAAC,MAAM,GAAC,MAAM,CAAC,SAAS,CAGD,GAFxC,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAoBtG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiCollector.d.ts","sourceRoot":"","sources":["../../../lib/inventory/aiCollector.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aiCollector.d.ts","sourceRoot":"","sources":["../../../lib/inventory/aiCollector.js"],"names":[],"mappings":"AAu8DA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAJvC,MAIuC,EAAE,OAAO,AAHxD,CACA,EADQ,MAGqD,GAFnD;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA2YhF;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,aAAa,EAJpD,MAIoD,EAAE,OAAO,AAHrE,CACA,EADQ,MAGkE,GAFhE;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAiMhF;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,aAAa,EAJ3C,MAI2C,EAAE,OAAO,AAH5D,CACA,EADQ,MAGyD,GAFvD;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAQhF;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,EAJ7C,MAI6C,EAAE,OAAO,AAH9D,CACA,EADQ,MAG2D,GAFzD;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAQhF;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,aAAa,EAJjD,MAIiD,EAAE,OAAO,AAHlE,CACA,EADQ,MAG+D,GAF7D;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAQhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../lib/inventory/analyzer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../../lib/inventory/analyzer.js"],"names":[],"mappings":"AA6vDA;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAJ3B,MAAM,QACN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,qBAAqB,CAAC,MAAM,EAHjC,MAGiC,GAF/B;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAC,CA2avD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,aAHrB,MAAM,KACJ;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAC,GAAC,SAUxD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,QAJzB,MAAM,SACN,OAAO,KACL,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAC,CAgC/D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,QAN7B,MAAM,SACN,OAAO,KACL;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,2BAA0B;CA+EzE,CAAC;AAg9BF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,QAJ1B,MAAM,SACN,OAAO,KACL;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAiJ7E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,QAJpB,MAAM,SACN,OAAO,KACL;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CA6pB7E,CAAC"}
|
|
@@ -3,6 +3,64 @@
|
|
|
3
3
|
* bundled native `atom` binary.
|
|
4
4
|
*/
|
|
5
5
|
export declare const ATOM_NATIVE_PACKAGES: Set<string>;
|
|
6
|
+
/**
|
|
7
|
+
* Locate the JSON compilation database (`compile_commands.json`) of a C/C++
|
|
8
|
+
* project, which lets atom parse each file with the include paths, macros and
|
|
9
|
+
* language its build uses.
|
|
10
|
+
*
|
|
11
|
+
* An explicit `options.compileCommands` (a file, or a directory holding one
|
|
12
|
+
* directly or under `build/`) wins. Otherwise the scan root and the project's
|
|
13
|
+
* build directories are searched: the directory of `options.cmakeCache`, the
|
|
14
|
+
* build directories of its CMake presets, and the conventional `build`,
|
|
15
|
+
* `out`, `builddir` and `cmake-build-` directories (see
|
|
16
|
+
* `cmakeBuildDirCandidates`). A database can come with the code it describes,
|
|
17
|
+
* and atom asks the
|
|
18
|
+
* GCC or Clang driver it names (from the PATH, or an absolute path outside
|
|
19
|
+
* the project) for its predefined macros, so in secure mode only an explicit
|
|
20
|
+
* database is used.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} src Project scan root
|
|
23
|
+
* @param {Object} options CLI options
|
|
24
|
+
* @returns {string|undefined} Absolute path of the database
|
|
25
|
+
*/
|
|
26
|
+
export declare function findCompileCommands(src: string, options?: Object): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Split an atom command that may carry a leading argument (`node
|
|
29
|
+
* script.js`, a custom `ATOM_CMD`) into its binary and that argument. The
|
|
30
|
+
* first space only splits when it can: a binary under a path with spaces
|
|
31
|
+
* (`C:\Program Files\...\node.exe script.js`) would otherwise be cut
|
|
32
|
+
* mid-path and the shell told to run `C:\Program`. A command name without a
|
|
33
|
+
* path separator (`node script.js`) resolves through the PATH, so it splits
|
|
34
|
+
* at its first space as before; otherwise the first prefix that exists as a
|
|
35
|
+
* file is the binary, and when none does the first space keeps the old
|
|
36
|
+
* behaviour.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} command The atom command, possibly with an argument
|
|
39
|
+
* @returns {[string, string|undefined]} The binary and its leading argument, when present
|
|
40
|
+
*/
|
|
41
|
+
export declare function splitAtomCommand(command: string): [string, string | undefined];
|
|
42
|
+
/**
|
|
43
|
+
* The `--frontend-args` keys the installed atom accepts for a language, as
|
|
44
|
+
* `atom --frontend-args-keys -l <language>` lists them. Asked once per atom
|
|
45
|
+
* command and language. An atom that cannot list them (a release without
|
|
46
|
+
* `--frontend-args`, or one that fails to start) accepts none.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} language atom `-l` value
|
|
49
|
+
* @returns {Set<string>} Supported keys
|
|
50
|
+
*/
|
|
51
|
+
export declare function atomFrontendArgKeys(language: string): Set<string>;
|
|
52
|
+
/**
|
|
53
|
+
* The `--frontend-args` atom takes for a C/C++ language: the project's
|
|
54
|
+
* compilation database, when there is one and the installed atom reads it
|
|
55
|
+
* (atom 4 and later). An older atom is given the arguments it has always
|
|
56
|
+
* been given, and parses the sources without the database.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} src Project scan root
|
|
59
|
+
* @param {string} language atom `-l` value
|
|
60
|
+
* @param {Object} options CLI options
|
|
61
|
+
* @returns {string[]} Arguments to add to the atom command
|
|
62
|
+
*/
|
|
63
|
+
export declare function atomCompileCommandsArgs(src: string, language: string, options?: Object): string[];
|
|
6
64
|
/**
|
|
7
65
|
* Convert cdxgen's glob-style exclude patterns to a Scala/Java regex string.
|
|
8
66
|
*
|
|
@@ -69,18 +127,47 @@ export declare function resolveAtomProvider(opts?: {
|
|
|
69
127
|
libc?: string;
|
|
70
128
|
};
|
|
71
129
|
/**
|
|
72
|
-
* Returns `"native"` or `"jar"` for the
|
|
73
|
-
*
|
|
74
|
-
*
|
|
130
|
+
* Returns `"native"` or `"jar"` for the atom provider that will actually run.
|
|
131
|
+
*
|
|
132
|
+
* The platform decides which provider atom prefers, but the dispatcher falls
|
|
133
|
+
* back to the jar package when the platform's native package is not installed
|
|
134
|
+
* (optional dependencies skipped, a failed download). The two take the heap
|
|
135
|
+
* ceiling differently, and a native-image runtime option on a jar run reaches
|
|
136
|
+
* atom as an unknown argument that fails every slice. So the kind follows what
|
|
137
|
+
* is installed where cdxgen can see it: the native binary means native, the jar
|
|
138
|
+
* package without it means jar. An `ATOM_CMD` is classified by what it names
|
|
139
|
+
* (see `atomCommandKind`). With nothing in view (an install elsewhere) the
|
|
140
|
+
* platform's kind stands.
|
|
141
|
+
*
|
|
142
|
+
* Also used to gate Java/JDK advice, so users on the five native platforms are
|
|
143
|
+
* not told to install a JDK for a failure that has nothing to do with Java.
|
|
75
144
|
*/
|
|
76
145
|
export declare function atomProviderKind(): "jar" | "native";
|
|
146
|
+
/**
|
|
147
|
+
* Whether `ATOM_CMD` launches a jar or follows the platform.
|
|
148
|
+
*
|
|
149
|
+
* The jar launchers (`plugins/bin/atom`, `plugins/bin/atom.bat`) sit next to a
|
|
150
|
+
* `plugins/lib` directory holding atom's jars, so a launcher with that sibling,
|
|
151
|
+
* or any `.bat` (only the jar payload ships one), runs on the JVM whatever the
|
|
152
|
+
* platform is. Everything else, including the npm dispatcher (`node
|
|
153
|
+
* .../index.js`, its `atom`/`atom.cmd` bin shims) and a native binary, follows
|
|
154
|
+
* the platform's kind. A GraalVM `-XX:` heap argument handed to a jar launcher
|
|
155
|
+
* is rejected by atom's option parser before any analysis starts, and a
|
|
156
|
+
* `JAVA_TOOL_OPTIONS` ceiling handed to a native image is silently ignored, so
|
|
157
|
+
* the distinction decides whether the heap is bounded at all.
|
|
158
|
+
*
|
|
159
|
+
* @param {string} command The `ATOM_CMD` value
|
|
160
|
+
* @param {"native"|"jar"} platformKind Kind the platform prefers
|
|
161
|
+
* @returns {"native"|"jar"}
|
|
162
|
+
*/
|
|
163
|
+
export declare function atomCommandKind(command: string, platformKind: "native" | "jar"): "native" | "jar";
|
|
77
164
|
/**
|
|
78
165
|
* Locate the `php-parse` binary that the PHP frontend needs.
|
|
79
166
|
*
|
|
80
167
|
* atom 3's dispatcher unconditionally sets `PHP_PARSER_BIN=<ATOM_HOME>/bin/php-parse`,
|
|
81
168
|
* which for a native sub-package does not exist and also clobbers a caller-set
|
|
82
|
-
* value. cdxgen therefore resolves the real location and forwards it through
|
|
83
|
-
*
|
|
169
|
+
* value. cdxgen therefore resolves the real location and forwards it through the
|
|
170
|
+
* child env (see `buildAtomCommandEnv`); `executeAtom` then spawns the
|
|
84
171
|
* native binary directly for PHP so the dispatcher cannot clobber it (see
|
|
85
172
|
* `resolveDirectAtomBinaryPath`). Resolution order:
|
|
86
173
|
* 1. explicit `PHP_PARSER_BIN` env var (operators / container images)
|
|
@@ -94,6 +181,35 @@ export declare function atomProviderKind(): "jar" | "native";
|
|
|
94
181
|
* @returns {string|undefined}
|
|
95
182
|
*/
|
|
96
183
|
export declare function resolvePhpParseBin(): string | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* Locate the `phpastgen` generator that lets the PHP frontend parse whole
|
|
186
|
+
* directories in one batch.
|
|
187
|
+
*
|
|
188
|
+
* `php-parse` (forwarded as `PHP_PARSER_BIN`) is the per-file parser: atom
|
|
189
|
+
* starts a php interpreter for every `.php` file, which on windows turns a
|
|
190
|
+
* vendored PHP project (thousands of files under `vendor/`) into an hours-long
|
|
191
|
+
* run that no timeout can rescue. `phpastgen` answers the `--parser-info`
|
|
192
|
+
* capability probe, so atom's batch path engages, and atom-parsetools 1.9 and
|
|
193
|
+
* later parse the whole tree, vendor included, with a few interpreters that
|
|
194
|
+
* each take a chunk of files. It is a Node script, so the frontend launches it
|
|
195
|
+
* with `node` rather than `php`; an atom that does not know `PHP_ASTGEN_BIN`
|
|
196
|
+
* simply ignores it and keeps today's per-file behaviour. Resolution order:
|
|
197
|
+
* 1. explicit `PHP_ASTGEN_BIN` env var (operators / container images)
|
|
198
|
+
* 2. `@appthreat/atom-parsetools/phpastgen.js` under cdxgen's own
|
|
199
|
+
* node_modules, then under `GLOBAL_NODE_MODULES_PATH` for global installs
|
|
200
|
+
*
|
|
201
|
+
* @returns {string|undefined}
|
|
202
|
+
*/
|
|
203
|
+
export declare function resolvePhpAstgenBin(): string | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* Resolve a file inside the installed `@appthreat/atom-parsetools` package,
|
|
206
|
+
* searching cdxgen's own node_modules and `GLOBAL_NODE_MODULES_PATH` for global
|
|
207
|
+
* installs.
|
|
208
|
+
*
|
|
209
|
+
* @param {...string} segments Path segments below the package root
|
|
210
|
+
* @returns {string|undefined}
|
|
211
|
+
*/
|
|
212
|
+
export declare function parsetoolsFile(...segments: string[]): string | undefined;
|
|
97
213
|
/**
|
|
98
214
|
* Resolve the atom native binary path directly, bypassing the dispatcher.
|
|
99
215
|
*
|
|
@@ -131,6 +247,62 @@ export declare function getAtomCommand(): any;
|
|
|
131
247
|
* @returns {number|undefined} Heap ceiling in bytes, or `undefined` to leave the runtime default in place
|
|
132
248
|
*/
|
|
133
249
|
export declare function atomMaxHeapBytes(): number | undefined;
|
|
250
|
+
/**
|
|
251
|
+
* Compute how long atom may run, and how long cdxgen waits for it.
|
|
252
|
+
*
|
|
253
|
+
* cdxgen's spawn timeout kills only the process cdxgen started, and for atom
|
|
254
|
+
* that is the npm dispatcher. The runtime under it (the native binary or the
|
|
255
|
+
* JVM) used to survive that kill, re-parented and still holding its heap. atom
|
|
256
|
+
* therefore gets its own limit, `ATOM_TIMEOUT`, which the dispatcher enforces on
|
|
257
|
+
* the runtime, and cdxgen's spawn timeout sits a grace period beyond it as the
|
|
258
|
+
* last resort.
|
|
259
|
+
*
|
|
260
|
+
* An explicit `ATOM_TIMEOUT` (milliseconds) sets atom's limit independently of
|
|
261
|
+
* `CDXGEN_TIMEOUT_MS`, which keeps bounding every other tool. Otherwise atom's
|
|
262
|
+
* limit is `CDXGEN_TIMEOUT_MS` less the grace period.
|
|
263
|
+
*
|
|
264
|
+
* @returns {{atomTimeoutMs: number, spawnTimeoutMs: number}} atom's own limit and cdxgen's spawn timeout for it
|
|
265
|
+
*/
|
|
266
|
+
export declare function atomTimeouts(): {
|
|
267
|
+
atomTimeoutMs: number;
|
|
268
|
+
spawnTimeoutMs: number;
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Reap everything a timed-out atom run left behind on Windows.
|
|
272
|
+
*
|
|
273
|
+
* cdxgen starts atom through a shell there (`shell: isWin`), so the spawn
|
|
274
|
+
* timeout terminates only that `cmd.exe`, and the runtime and every parser
|
|
275
|
+
* worker under it (one `php.exe` per file for the per-file PHP frontend) keep
|
|
276
|
+
* running against the next slice of the same run. See
|
|
277
|
+
* {@link reapProcessTree} for how they are found. A chain broken by an
|
|
278
|
+
* intermediate that already exited (the npm dispatcher stopping its runtime
|
|
279
|
+
* itself) cannot be followed, and atom 4 stops its helpers once
|
|
280
|
+
* `ATOM_PARENT_PID` is gone.
|
|
281
|
+
*
|
|
282
|
+
* @param {number|undefined} rootPid pid of the process cdxgen spawned
|
|
283
|
+
* @param {number} startedAt Epoch milliseconds at which the run started
|
|
284
|
+
* @param {number} [endedAt] Epoch milliseconds at which the spawned process ended
|
|
285
|
+
* @returns {number[]} The pids that were stopped
|
|
286
|
+
*/
|
|
287
|
+
export declare function reapAtomProcessTree(rootPid: number | undefined, startedAt: number, endedAt?: number): number[];
|
|
288
|
+
/**
|
|
289
|
+
* Whether an atom run ended because it ran out of time.
|
|
290
|
+
*
|
|
291
|
+
* The dispatcher reports its own limit with status 124. cdxgen's spawn timeout
|
|
292
|
+
* shows up as `ETIMEDOUT`. A dispatcher older than the status code stops atom
|
|
293
|
+
* with SIGTERM and passes on how the runtime ended: 1, or the runtime's own
|
|
294
|
+
* exit on SIGTERM (143) or SIGKILL (137), which is what atom 3.1 reports. Those
|
|
295
|
+
* statuses at or past the limit count as well, unless atom's own output shows
|
|
296
|
+
* it failed for another reason first (an exhausted heap, a crash), which
|
|
297
|
+
* deserves its own diagnosis. Missing one leaves the half-written atom behind,
|
|
298
|
+
* and the next slice of the run fails to load it.
|
|
299
|
+
*
|
|
300
|
+
* @param {Object} result spawnSync result
|
|
301
|
+
* @param {number} elapsedMs How long the run took
|
|
302
|
+
* @param {number} atomTimeoutMs atom's time limit
|
|
303
|
+
* @returns {boolean} true when the run hit a time limit
|
|
304
|
+
*/
|
|
305
|
+
export declare function atomRunTimedOut(result: Object, elapsedMs: number, atomTimeoutMs: number): boolean;
|
|
134
306
|
/**
|
|
135
307
|
* Execute the atom tool against a source directory or file with the given arguments.
|
|
136
308
|
*
|
|
@@ -145,6 +317,48 @@ export declare function atomMaxHeapBytes(): number | undefined;
|
|
|
145
317
|
* @returns {boolean} `true` if atom executed successfully and the language is supported; `false` otherwise
|
|
146
318
|
*/
|
|
147
319
|
export declare function executeAtom(src: string, args: string[], extra_env?: Object): boolean;
|
|
320
|
+
/**
|
|
321
|
+
* The numbered chunks atom wrote beside a reachables slices file.
|
|
322
|
+
*
|
|
323
|
+
* atom writes reachables at most 1000 flows per file: `<base>.json`, then
|
|
324
|
+
* `<base>_1.json`, `<base>_2.json` and so on. Chunks are taken until the first
|
|
325
|
+
* gap. A chunk older than the base file was left by an earlier run with more
|
|
326
|
+
* flows (atom before 4.0.0 did not remove those), so it ends the sequence
|
|
327
|
+
* instead of being merged.
|
|
328
|
+
*
|
|
329
|
+
* @param {string} slicesFile Path of the base reachables slices file
|
|
330
|
+
* @returns {string[]} Chunk file paths, in order
|
|
331
|
+
*/
|
|
332
|
+
export declare function reachablesChunkFiles(slicesFile: string): string[];
|
|
333
|
+
/**
|
|
334
|
+
* Remove the numbered chunks beside a reachables slices file, before atom
|
|
335
|
+
* writes a new set there, so no chunk of an earlier run survives next to it.
|
|
336
|
+
*
|
|
337
|
+
* @param {string} slicesFile Path of the base reachables slices file
|
|
338
|
+
*/
|
|
339
|
+
export declare function removeReachablesChunkFiles(slicesFile: string): void;
|
|
340
|
+
/**
|
|
341
|
+
* Read an atom slices file, or warn and return `undefined` when it cannot be
|
|
342
|
+
* parsed. A run stopped while writing (a timeout, a kill) can leave a
|
|
343
|
+
* truncated file, and the evidence from the other slices is still worth
|
|
344
|
+
* keeping.
|
|
345
|
+
*
|
|
346
|
+
* @param {string} slicesFile Path of the slices file
|
|
347
|
+
* @param {string} sliceType Slice type, for the warning
|
|
348
|
+
* @returns {*} The parsed slices, or `undefined`
|
|
349
|
+
*/
|
|
350
|
+
export declare function readSlicesFile(slicesFile: string, sliceType: string): any;
|
|
351
|
+
/**
|
|
352
|
+
* Read a reachables slices file together with its chunks.
|
|
353
|
+
*
|
|
354
|
+
* Reading only the base file silently dropped every flow past the first
|
|
355
|
+
* thousand. A chunk that cannot be parsed ends the sequence, keeping the flows
|
|
356
|
+
* read before it.
|
|
357
|
+
*
|
|
358
|
+
* @param {string} slicesFile Path of the base reachables slices file
|
|
359
|
+
* @returns {Object[]|Object|undefined} Every flow, in the base file's shape (an array, or an object with `reachables`)
|
|
360
|
+
*/
|
|
361
|
+
export declare function readReachablesSlices(slicesFile: string): Object[] | Object | undefined;
|
|
148
362
|
/**
|
|
149
363
|
* Find the imported modules in the application with atom parsedeps command
|
|
150
364
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/atomUtils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"atomUtils.d.ts","sourceRoot":"","sources":["../../../lib/inventory/atomUtils.js"],"names":[],"mappings":"AAiEA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,aAM/B,CAAC;AA2CH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAJ5B,MAI4B,EAAE,OAAO,GAHrC,MAG0C,GAFxC,MAAM,GAAC,SAAS,CA6C5B;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAH7B,MAG6B,GAF3B,CAAC,MAAM,EAAE,MAAM,GAAC,SAAS,CAAC,CAwBtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAHjC,MAGiC,GAF/B,GAAG,CAAC,MAAM,CAAC,CAwCvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EALhC,MAKgC,EAAE,QAAQ,EAJ1C,MAI0C,EAAE,OAAO,GAHnD,MAGwD,GAFtD,MAAM,EAAE,CAiCpB;AA0RD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,GAH3C,M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;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAHpC,MAGoC,GAFlC,MAAM,EAAE,GAAC,MAAM,GAAC,SAAS,CAwBrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EARM,MAQN,EACH,QAAQ,EARC,MAQD,EACR,WAAW,GARF,MAQa,EACtB,UAAU,GARD,MAQa,EACtB,OAAO,GARE,MAQG,OA8Cb"}
|
|
@@ -6,6 +6,8 @@ export declare const CBOM_AUDIT_CATEGORIES: readonly string[];
|
|
|
6
6
|
export declare const HOST_TOPOLOGY_AUDIT_CATEGORIES: readonly string[];
|
|
7
7
|
/** Frozen list of Golem (Go Evinse) audit categories. */
|
|
8
8
|
export declare const GOLEM_AUDIT_CATEGORIES: readonly string[];
|
|
9
|
+
/** Frozen list of Scala Evinse (scalasem) audit categories. */
|
|
10
|
+
export declare const SCALA_AUDIT_CATEGORIES: readonly string[];
|
|
9
11
|
/** Frozen list of Cargo (Rust) audit categories. */
|
|
10
12
|
export declare const CARGO_AUDIT_CATEGORIES: readonly string[];
|
|
11
13
|
/**
|
|
@@ -36,6 +38,7 @@ export declare const BOM_AUDIT_CATEGORY_ALIASES: Readonly<{
|
|
|
36
38
|
golem: string[];
|
|
37
39
|
hbom: string[];
|
|
38
40
|
rust: string[];
|
|
41
|
+
scala: string[];
|
|
39
42
|
host: string[];
|
|
40
43
|
}>;
|
|
41
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auditCategories.d.ts","sourceRoot":"","sources":["../../../lib/inventory/auditCategories.js"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,mBAIhC,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,mBAGhC,CAAC;AAEH,qDAAqD;AACrD,eAAO,MAAM,8BAA8B,mBAAmC,CAAC;AAE/E,yDAAyD;AACzD,eAAO,MAAM,sBAAsB,mBAIjC,CAAC;AAEH,oDAAo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MAAM,CAAA;CAAC,CAGa,GAFpC,MAAM,EAAE,CAMpB;AAUD;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAJ1C,MAAM,GAAC,MAAM,EAI6B,EAAE,KAAK,EAHjD,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,CAGwB,GAF/C;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,EAAE,MAAM,EAAE,CAAA;CAAC,CAyB3F;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAJzC,MAIyC,EAAE,WAAW,AAH9D,CACA,EADQ,MAGsD,GAFpD,MAAM,GAAG,SAAS,CA8B9B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a tool's combined output names a rate limit from its repository.
|
|
3
|
+
* The answer text is treated as untrusted: only fixed substrings are looked
|
|
4
|
+
* for, nothing from the output is kept.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} output Combined stdout and stderr of one invocation.
|
|
7
|
+
* @param {string} tool One of maven, gradle, sbt, mill, scala-cli.
|
|
8
|
+
* @returns {boolean} True when the output names an HTTP 429 answer.
|
|
9
|
+
*/
|
|
10
|
+
export declare function detectBuildToolRateLimit(output: string, tool: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a tool was already found rate limited in this scan, so the caller
|
|
13
|
+
* can skip its remaining invocations.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} tool One of maven, gradle, sbt, mill, scala-cli.
|
|
16
|
+
* @returns {boolean}
|
|
17
|
+
*/
|
|
18
|
+
export declare function isBuildToolRateLimited(tool: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Read a completed invocation's output for a rate limit. When one is found,
|
|
21
|
+
* the tool is remembered for the scan, one hint naming the tool's mirror
|
|
22
|
+
* setting is printed, and the `build.rate-limited` degradation is recorded.
|
|
23
|
+
* The first invocation that shows the rate limit is the one recorded; later
|
|
24
|
+
* ones add nothing, because the same answer ends them all.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} tool One of maven, gradle, sbt, mill, scala-cli.
|
|
27
|
+
* @param {string|undefined} output Combined output, as commandOutputText
|
|
28
|
+
* returns it for a spawn result.
|
|
29
|
+
* @param {Object} [context] Call-site facts for the degradation event.
|
|
30
|
+
* @param {string} [context.command] The redacted command that was attempted.
|
|
31
|
+
* @param {number} [context.exitCode] The invocation's exit status.
|
|
32
|
+
* @returns {boolean} True when this output names a rate limit.
|
|
33
|
+
*/
|
|
34
|
+
export declare function noteBuildToolRateLimit(tool: string, output: string | undefined, context?: {
|
|
35
|
+
command?: string;
|
|
36
|
+
exitCode?: number;
|
|
37
|
+
}): boolean;
|
|
38
|
+
//# sourceMappingURL=buildToolRateLimit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildToolRateLimit.d.ts","sourceRoot":"","sources":["../../../lib/inventory/buildToolRateLimit.js"],"names":[],"mappings":"AA4EA;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAJpC,MAIoC,EAAE,IAAI,EAH1C,MAG0C,GAFxC,OAAO,CAQnB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAHhC,MAGgC,GAF9B,OAAO,CAInB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EARhC,MAQgC,EAAE,MAAM,EAPxC,MAAM,GAAC,SAOiC,EAAE,OAAO,AALzD,CAGA,EAFA;IAAyB,OAAO,AAAhC,CACA,EADQ,MAAM,CACd;IAAyB,QAAQ,AAAjC,CACA,EADQ,MAAM,CACd;CAE8D,GAFpD,OAAO,CA0BnB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `cdxgen cache` subcommand — inspect and purge the metadata fetch cache
|
|
2
|
+
* `cdxgen cache` subcommand — inspect and purge the metadata fetch cache that
|
|
3
|
+
* cdxrs and the JS batch pool share.
|
|
3
4
|
*
|
|
4
5
|
* This module operates directly on the filesystem because JS is the authority
|
|
5
6
|
* for the cache directory. The cache layout is:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cacheCommands.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cacheCommands.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cacheCommands.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cacheCommands.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgCH;;;;;GAKG;AACH,wBAAgB,SAAS,IAHZ,MAAM,CAwDlB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAFb,MAAM,CAwBlB;AAUD;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAHjC,MAAM,GAAC,OAG0B,GAF/B,OAAO,CAAC,MAAM,CAAC,CAyC3B"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This module is the ONLY place that spawns the `cdxrs` binary. It enforces
|
|
5
5
|
* the governing invariant: **no failure mode may abort SBOM generation.**
|
|
6
|
-
* Every failure (missing binary, non-zero exit, timeout,
|
|
7
|
-
* version-major mismatch, CDXGEN_RS_DISABLE) logs once at
|
|
8
|
-
* a sentinel that makes the caller take the JS path.
|
|
6
|
+
* Every failure (missing binary, non-zero exit, timeout, oversized stdout,
|
|
7
|
+
* malformed stdout, version-major mismatch, CDXGEN_RS_DISABLE) logs once at
|
|
8
|
+
* `warn` and returns a sentinel that makes the caller take the JS path.
|
|
9
9
|
*
|
|
10
10
|
* Protocol:
|
|
11
11
|
* cdxrs <subcommand> --input <file|-> --output <file|-> --format json
|
|
@@ -67,6 +67,11 @@ export declare function cdxrsAvailable(subcommand?: string): {
|
|
|
67
67
|
*
|
|
68
68
|
* Passing `content` is the normal case, since cdxgen holds BOMs in memory.
|
|
69
69
|
*
|
|
70
|
+
* Collected stdout is bounded: it must become a single JS string, so a child
|
|
71
|
+
* that would exceed V8's string limit (by default; see
|
|
72
|
+
* CDXGEN_RS_MAX_STDOUT_BYTES) is killed and reported as a fallback instead of
|
|
73
|
+
* crashing the process at the concat.
|
|
74
|
+
*
|
|
70
75
|
* @param {string} subcommand The subcommand to run (e.g. "info").
|
|
71
76
|
* @param {Object} opts
|
|
72
77
|
* @param {string|Buffer} [opts.content] BOM data to feed over stdin.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdxrs.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cdxrs.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"cdxrs.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cdxrs.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAoEH,iFAAiF;AACjF,eAAO,MAAM,cAAc;;;;;EAKzB,CAAC;AAOH;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAH7B,MAG6B,GAF3B,OAAO,CAkBnB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAFlB,MAAM,GAAC,SAAS,CAI5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,UAAU,AAHtC,CACA,EADQ,MAG8B,GAF5B;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAuBrE;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,QAAQ,CAAC,UAAU,EAT9B,MAS8B,EAAE,IAAI,GAP5C;IAA6B,OAAO,AAApC,CACA,EADQ,MAAM,GAAC,MAAM,CACrB;IAAsB,KAAK,AAA3B,CAEA,EAFQ,MAAM,CAEd;IAAwB,IAAI,AAA5B,CACA,EADQ,MAAM,EAAE,CAChB;IAAsB,SAAS,AAA/B,CACA,EADQ,MAAM,CACd;CAEiD,GAFvC,OAAO,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAC,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAgS1F"}
|