@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.
Files changed (311) hide show
  1. package/README.md +33 -14
  2. package/bin/cdxgen.js +310 -138
  3. package/bin/evinse.js +22 -0
  4. package/bin/repl.js +86 -0
  5. package/bin/sign.js +119 -15
  6. package/bin/tracebom.js +69 -5
  7. package/bin/validate.js +107 -19
  8. package/bin/verify.js +172 -63
  9. package/data/helpers/init.gradle +46 -21
  10. package/data/remediations.json +85 -0
  11. package/data/rules/dependency-sources.yaml +67 -0
  12. package/data/rules/scala-evidence.yaml +115 -0
  13. package/lib/audit/index.js +38 -6
  14. package/lib/cli/bomAssembly.js +105 -15
  15. package/lib/cli/cliOptions.js +93 -1
  16. package/lib/cli/index.js +156 -58
  17. package/lib/cli/jsBom.js +99 -53
  18. package/lib/cli/jvmBom.js +708 -147
  19. package/lib/cli/managedBom.js +415 -224
  20. package/lib/cli/nativeBom.js +264 -44
  21. package/lib/core/activity.js +12 -0
  22. package/lib/core/env.js +22 -15
  23. package/lib/core/fs.js +176 -7
  24. package/lib/core/httpClient.js +159 -24
  25. package/lib/core/metadataProperties.js +97 -0
  26. package/lib/core/pluginRun.js +184 -0
  27. package/lib/core/processTree.js +100 -0
  28. package/lib/core/projectConfig.js +31 -4
  29. package/lib/core/runState.js +39 -0
  30. package/lib/core/toml.js +72 -0
  31. package/lib/ecosystems/asarutils.js +4 -2
  32. package/lib/ecosystems/bunutils.js +274 -108
  33. package/lib/ecosystems/cargoCache.js +231 -8
  34. package/lib/ecosystems/caxa.js +434 -2
  35. package/lib/ecosystems/cmakeResolver.js +76 -21
  36. package/lib/ecosystems/cppBuildContext.js +631 -0
  37. package/lib/ecosystems/cppEvidence.js +399 -51
  38. package/lib/ecosystems/cppIncludeResolver.js +294 -0
  39. package/lib/ecosystems/denoutils.js +93 -66
  40. package/lib/ecosystems/ecosystems.js +1983 -793
  41. package/lib/ecosystems/golem.js +28 -12
  42. package/lib/ecosystems/gradleutils.js +356 -37
  43. package/lib/ecosystems/jsEvidence.js +104 -44
  44. package/lib/ecosystems/kosi.js +31 -7
  45. package/lib/ecosystems/npmutils.js +174 -9
  46. package/lib/ecosystems/parsers-dotnet.js +616 -159
  47. package/lib/ecosystems/parsers-elm.js +46 -28
  48. package/lib/ecosystems/parsers-gleam.js +3 -4
  49. package/lib/ecosystems/parsers-go.js +371 -70
  50. package/lib/ecosystems/parsers-js.js +263 -76
  51. package/lib/ecosystems/parsers-julia.js +2 -3
  52. package/lib/ecosystems/parsers-jvm.js +204 -12
  53. package/lib/ecosystems/parsers-misc.js +929 -216
  54. package/lib/ecosystems/parsers-python.js +167 -24
  55. package/lib/ecosystems/parsers-rust.js +28 -22
  56. package/lib/ecosystems/parsers-terraform.js +1573 -19
  57. package/lib/ecosystems/pythonutils.js +102 -6
  58. package/lib/ecosystems/remote/huggingface.js +3 -0
  59. package/lib/ecosystems/rubyutils.js +1492 -182
  60. package/lib/ecosystems/rusi.js +54 -10
  61. package/lib/ecosystems/sbtutils.js +243 -187
  62. package/lib/ecosystems/scalacliutils.js +342 -0
  63. package/lib/ecosystems/scalasem.js +2618 -0
  64. package/lib/ecosystems/terraformRegistry.js +288 -0
  65. package/lib/ecosystems/utils.js +2 -0
  66. package/lib/ecosystems/vendoredCode.js +156 -0
  67. package/lib/evinser/evinser.js +1008 -191
  68. package/lib/evinser/swiftsem.js +1914 -302
  69. package/lib/helpers/agenticToolutils.js +2 -2
  70. package/lib/helpers/bomSigner.js +1101 -222
  71. package/lib/inventory/aiCollector.js +4 -1
  72. package/lib/inventory/analyzer.js +110 -127
  73. package/lib/inventory/atomUtils.js +703 -43
  74. package/lib/inventory/auditCategories.js +7 -0
  75. package/lib/inventory/buildToolRateLimit.js +144 -0
  76. package/lib/inventory/cacheCommands.js +2 -1
  77. package/lib/inventory/cdxrs.js +103 -12
  78. package/lib/inventory/cmakeBuildDirs.js +254 -0
  79. package/lib/inventory/deps.js +501 -124
  80. package/lib/inventory/depsUtils.js +183 -11
  81. package/lib/inventory/display.js +4 -5
  82. package/lib/inventory/dosai.js +798 -57
  83. package/lib/inventory/dosaiParsers.js +310 -15
  84. package/lib/inventory/dynamic.js +90 -6
  85. package/lib/inventory/evidenceUtils.js +166 -113
  86. package/lib/inventory/fetchBatch.js +690 -55
  87. package/lib/inventory/fetchDiskCache.js +597 -0
  88. package/lib/inventory/forgeEnricher.js +14 -5
  89. package/lib/inventory/jvmLocalRepos.js +917 -0
  90. package/lib/inventory/mcpConfigParser.js +2 -3
  91. package/lib/inventory/parentSelection.js +146 -0
  92. package/lib/inventory/protobom.js +8 -1
  93. package/lib/inventory/purl.js +152 -3
  94. package/lib/inventory/rustFormulationParser.js +3 -4
  95. package/lib/inventory/sbomDocument.js +2 -70
  96. package/lib/inventory/scalaCoords.js +153 -0
  97. package/lib/inventory/source.js +45 -27
  98. package/lib/inventory/spdx.js +101 -0
  99. package/lib/inventory/traceRunner.js +295 -25
  100. package/lib/inventory/tracedCrypto.js +294 -0
  101. package/lib/managers/binary.js +115 -24
  102. package/lib/managers/docker.js +467 -46
  103. package/lib/managers/oci.js +63 -3
  104. package/lib/parsers/cmakeCache.js +69 -0
  105. package/lib/parsers/cmakeLists.js +466 -0
  106. package/lib/parsers/cmakePresets.js +400 -0
  107. package/lib/parsers/compileCommands.js +557 -0
  108. package/lib/parsers/largeJson.js +454 -0
  109. package/lib/parsers/npmrc.js +19 -1
  110. package/lib/parsers/strictJson.js +322 -0
  111. package/lib/parsers/terraformConfig.js +1073 -0
  112. package/lib/parsers/terraformSource.js +652 -0
  113. package/lib/server/server.js +23 -0
  114. package/lib/stages/postgen/introspection/markers.js +1 -1
  115. package/lib/stages/postgen/postgen.js +83 -16
  116. package/lib/stages/postgen/specVersionCompat.js +32 -0
  117. package/lib/validator/bomValidator.js +6 -16
  118. package/lib/validator/index.js +64 -11
  119. package/lib/validator/reporters/console.js +3 -0
  120. package/lib/validator/reporters/json.js +2 -0
  121. package/lib/validator/reporters/sarif.js +7 -0
  122. package/package.json +23 -23
  123. package/types/lib/audit/index.d.ts.map +1 -1
  124. package/types/lib/cli/bomAssembly.d.ts +2 -1
  125. package/types/lib/cli/bomAssembly.d.ts.map +1 -1
  126. package/types/lib/cli/cliOptions.d.ts +33 -1
  127. package/types/lib/cli/cliOptions.d.ts.map +1 -1
  128. package/types/lib/cli/index.d.ts.map +1 -1
  129. package/types/lib/cli/jsBom.d.ts.map +1 -1
  130. package/types/lib/cli/jvmBom.d.ts +24 -1
  131. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  132. package/types/lib/cli/managedBom.d.ts +7 -4
  133. package/types/lib/cli/managedBom.d.ts.map +1 -1
  134. package/types/lib/cli/nativeBom.d.ts +3 -1
  135. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  136. package/types/lib/core/activity.d.ts.map +1 -1
  137. package/types/lib/core/env.d.ts +9 -0
  138. package/types/lib/core/env.d.ts.map +1 -1
  139. package/types/lib/core/fs.d.ts +55 -0
  140. package/types/lib/core/fs.d.ts.map +1 -1
  141. package/types/lib/core/httpClient.d.ts +13 -8
  142. package/types/lib/core/httpClient.d.ts.map +1 -1
  143. package/types/lib/core/metadataProperties.d.ts +39 -0
  144. package/types/lib/core/metadataProperties.d.ts.map +1 -0
  145. package/types/lib/core/pluginRun.d.ts +97 -0
  146. package/types/lib/core/pluginRun.d.ts.map +1 -0
  147. package/types/lib/core/processTree.d.ts +36 -0
  148. package/types/lib/core/processTree.d.ts.map +1 -0
  149. package/types/lib/core/projectConfig.d.ts +6 -2
  150. package/types/lib/core/projectConfig.d.ts.map +1 -1
  151. package/types/lib/core/runState.d.ts +29 -0
  152. package/types/lib/core/runState.d.ts.map +1 -0
  153. package/types/lib/core/toml.d.ts +20 -0
  154. package/types/lib/core/toml.d.ts.map +1 -0
  155. package/types/lib/ecosystems/asarutils.d.ts.map +1 -1
  156. package/types/lib/ecosystems/bunutils.d.ts +12 -5
  157. package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
  158. package/types/lib/ecosystems/cargoCache.d.ts +12 -0
  159. package/types/lib/ecosystems/cargoCache.d.ts.map +1 -1
  160. package/types/lib/ecosystems/caxa.d.ts +14 -0
  161. package/types/lib/ecosystems/caxa.d.ts.map +1 -1
  162. package/types/lib/ecosystems/cmakeResolver.d.ts +28 -3
  163. package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
  164. package/types/lib/ecosystems/cppBuildContext.d.ts +55 -0
  165. package/types/lib/ecosystems/cppBuildContext.d.ts.map +1 -0
  166. package/types/lib/ecosystems/cppEvidence.d.ts +17 -1
  167. package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
  168. package/types/lib/ecosystems/cppIncludeResolver.d.ts +92 -0
  169. package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -0
  170. package/types/lib/ecosystems/denoutils.d.ts +9 -3
  171. package/types/lib/ecosystems/denoutils.d.ts.map +1 -1
  172. package/types/lib/ecosystems/ecosystems.d.ts +62 -13
  173. package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
  174. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  175. package/types/lib/ecosystems/gradleutils.d.ts +70 -4
  176. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  177. package/types/lib/ecosystems/jsEvidence.d.ts +5 -2
  178. package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
  179. package/types/lib/ecosystems/kosi.d.ts +13 -0
  180. package/types/lib/ecosystems/kosi.d.ts.map +1 -1
  181. package/types/lib/ecosystems/npmutils.d.ts +57 -0
  182. package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
  183. package/types/lib/ecosystems/parsers-dotnet.d.ts +118 -4
  184. package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
  185. package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -1
  186. package/types/lib/ecosystems/parsers-gleam.d.ts.map +1 -1
  187. package/types/lib/ecosystems/parsers-go.d.ts +54 -2
  188. package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
  189. package/types/lib/ecosystems/parsers-js.d.ts +16 -5
  190. package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
  191. package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -1
  192. package/types/lib/ecosystems/parsers-jvm.d.ts +46 -1
  193. package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
  194. package/types/lib/ecosystems/parsers-misc.d.ts +70 -4
  195. package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
  196. package/types/lib/ecosystems/parsers-python.d.ts +53 -3
  197. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  198. package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
  199. package/types/lib/ecosystems/parsers-terraform.d.ts +38 -21
  200. package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -1
  201. package/types/lib/ecosystems/pythonutils.d.ts +27 -2
  202. package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
  203. package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
  204. package/types/lib/ecosystems/rubyutils.d.ts +164 -3
  205. package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
  206. package/types/lib/ecosystems/rusi.d.ts +13 -0
  207. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  208. package/types/lib/ecosystems/sbtutils.d.ts +88 -2
  209. package/types/lib/ecosystems/sbtutils.d.ts.map +1 -1
  210. package/types/lib/ecosystems/scalacliutils.d.ts +56 -0
  211. package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -0
  212. package/types/lib/ecosystems/scalasem.d.ts +311 -0
  213. package/types/lib/ecosystems/scalasem.d.ts.map +1 -0
  214. package/types/lib/ecosystems/terraformRegistry.d.ts +9 -0
  215. package/types/lib/ecosystems/terraformRegistry.d.ts.map +1 -0
  216. package/types/lib/ecosystems/utils.d.ts +2 -2
  217. package/types/lib/ecosystems/utils.d.ts.map +1 -1
  218. package/types/lib/ecosystems/vendoredCode.d.ts +32 -0
  219. package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -0
  220. package/types/lib/evinser/evinser.d.ts +132 -15
  221. package/types/lib/evinser/evinser.d.ts.map +1 -1
  222. package/types/lib/evinser/swiftsem.d.ts +280 -15
  223. package/types/lib/evinser/swiftsem.d.ts.map +1 -1
  224. package/types/lib/helpers/bomSigner.d.ts +182 -13
  225. package/types/lib/helpers/bomSigner.d.ts.map +1 -1
  226. package/types/lib/inventory/aiCollector.d.ts.map +1 -1
  227. package/types/lib/inventory/analyzer.d.ts.map +1 -1
  228. package/types/lib/inventory/atomUtils.d.ts +219 -5
  229. package/types/lib/inventory/atomUtils.d.ts.map +1 -1
  230. package/types/lib/inventory/auditCategories.d.ts +3 -0
  231. package/types/lib/inventory/auditCategories.d.ts.map +1 -1
  232. package/types/lib/inventory/buildToolRateLimit.d.ts +38 -0
  233. package/types/lib/inventory/buildToolRateLimit.d.ts.map +1 -0
  234. package/types/lib/inventory/cacheCommands.d.ts +2 -1
  235. package/types/lib/inventory/cacheCommands.d.ts.map +1 -1
  236. package/types/lib/inventory/cdxrs.d.ts +8 -3
  237. package/types/lib/inventory/cdxrs.d.ts.map +1 -1
  238. package/types/lib/inventory/cmakeBuildDirs.d.ts +58 -0
  239. package/types/lib/inventory/cmakeBuildDirs.d.ts.map +1 -0
  240. package/types/lib/inventory/deps.d.ts +59 -1
  241. package/types/lib/inventory/deps.d.ts.map +1 -1
  242. package/types/lib/inventory/depsUtils.d.ts +15 -0
  243. package/types/lib/inventory/depsUtils.d.ts.map +1 -1
  244. package/types/lib/inventory/display.d.ts.map +1 -1
  245. package/types/lib/inventory/dosai.d.ts +121 -9
  246. package/types/lib/inventory/dosai.d.ts.map +1 -1
  247. package/types/lib/inventory/dosaiParsers.d.ts +53 -7
  248. package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
  249. package/types/lib/inventory/dynamic.d.ts +10 -0
  250. package/types/lib/inventory/dynamic.d.ts.map +1 -1
  251. package/types/lib/inventory/evidenceUtils.d.ts +19 -4
  252. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  253. package/types/lib/inventory/fetchBatch.d.ts +83 -14
  254. package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
  255. package/types/lib/inventory/fetchDiskCache.d.ts +169 -0
  256. package/types/lib/inventory/fetchDiskCache.d.ts.map +1 -0
  257. package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
  258. package/types/lib/inventory/jvmLocalRepos.d.ts +178 -0
  259. package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -0
  260. package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
  261. package/types/lib/inventory/parentSelection.d.ts +34 -0
  262. package/types/lib/inventory/parentSelection.d.ts.map +1 -0
  263. package/types/lib/inventory/plugins.d.ts.map +1 -1
  264. package/types/lib/inventory/protobom.d.ts.map +1 -1
  265. package/types/lib/inventory/purl.d.ts +71 -2
  266. package/types/lib/inventory/purl.d.ts.map +1 -1
  267. package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
  268. package/types/lib/inventory/sbomDocument.d.ts.map +1 -1
  269. package/types/lib/inventory/scalaCoords.d.ts +80 -0
  270. package/types/lib/inventory/scalaCoords.d.ts.map +1 -0
  271. package/types/lib/inventory/source.d.ts.map +1 -1
  272. package/types/lib/inventory/spdx.d.ts +9 -0
  273. package/types/lib/inventory/spdx.d.ts.map +1 -1
  274. package/types/lib/inventory/traceRunner.d.ts +59 -1
  275. package/types/lib/inventory/traceRunner.d.ts.map +1 -1
  276. package/types/lib/inventory/tracedCrypto.d.ts +42 -0
  277. package/types/lib/inventory/tracedCrypto.d.ts.map +1 -0
  278. package/types/lib/managers/binary.d.ts +30 -1
  279. package/types/lib/managers/binary.d.ts.map +1 -1
  280. package/types/lib/managers/docker.d.ts +29 -0
  281. package/types/lib/managers/docker.d.ts.map +1 -1
  282. package/types/lib/managers/oci.d.ts +17 -1
  283. package/types/lib/managers/oci.d.ts.map +1 -1
  284. package/types/lib/parsers/cmakeCache.d.ts +16 -0
  285. package/types/lib/parsers/cmakeCache.d.ts.map +1 -1
  286. package/types/lib/parsers/cmakeLists.d.ts +77 -0
  287. package/types/lib/parsers/cmakeLists.d.ts.map +1 -0
  288. package/types/lib/parsers/cmakePresets.d.ts +78 -0
  289. package/types/lib/parsers/cmakePresets.d.ts.map +1 -0
  290. package/types/lib/parsers/compileCommands.d.ts +115 -0
  291. package/types/lib/parsers/compileCommands.d.ts.map +1 -0
  292. package/types/lib/parsers/largeJson.d.ts +52 -0
  293. package/types/lib/parsers/largeJson.d.ts.map +1 -0
  294. package/types/lib/parsers/npmrc.d.ts +5 -0
  295. package/types/lib/parsers/npmrc.d.ts.map +1 -1
  296. package/types/lib/parsers/strictJson.d.ts +46 -0
  297. package/types/lib/parsers/strictJson.d.ts.map +1 -0
  298. package/types/lib/parsers/terraformConfig.d.ts +70 -0
  299. package/types/lib/parsers/terraformConfig.d.ts.map +1 -0
  300. package/types/lib/parsers/terraformSource.d.ts +66 -0
  301. package/types/lib/parsers/terraformSource.d.ts.map +1 -0
  302. package/types/lib/server/server.d.ts.map +1 -1
  303. package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
  304. package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
  305. package/types/lib/validator/bomValidator.d.ts.map +1 -1
  306. package/types/lib/validator/index.d.ts +18 -1
  307. package/types/lib/validator/index.d.ts.map +1 -1
  308. package/types/lib/validator/reporters/console.d.ts.map +1 -1
  309. package/types/lib/validator/reporters/json.d.ts.map +1 -1
  310. package/types/lib/validator/reporters/sarif.d.ts.map +1 -1
  311. package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +0 -462
@@ -22,6 +22,7 @@ import {
22
22
  } from "../../core/fs.js";
23
23
  import { thoughtLog } from "../../core/logger.js";
24
24
  import { dirNameStr } from "../../core/paths.js";
25
+ import { sanitizeBomPropertyValue } from "../../core/propertySanitizer.js";
25
26
  import { CDXGEN_TOOL_GROUP, CDXGEN_TOOL_NAME } from "../../core/state.js";
26
27
  import {
27
28
  AI_INVENTORY_PROJECT_TYPES,
@@ -741,26 +742,26 @@ function applyReleaseNotes(bomJson, options, filePath) {
741
742
  */
742
743
  export function applyMetadata(bomJson, options) {
743
744
  if (!bomJson?.components) {
744
- return bomJson;
745
+ return applyCustomMetadataProperties(bomJson, options);
745
746
  }
746
747
  const bomPkgTypes = new Set();
747
748
  const bomPkgNamespaces = new Set();
748
749
  const bomSrcFiles = new Set();
749
- for (const comp of bomJson.components) {
750
- if (comp.purl) {
751
- try {
752
- const purlObj = Purl.parse(comp.purl);
753
- if (purlObj?.type) {
754
- bomPkgTypes.add(purlObj.type);
755
- }
756
- if (purlObj?.namespace) {
757
- bomPkgNamespaces.add(purlObj.namespace);
758
- }
759
- } catch (_e) {
760
- // ignore
761
- }
750
+ // Collect the manifests a component was identified from, rewriting any
751
+ // absolute path to a relative one as a side effect. Shared by the components
752
+ // and by metadata.component, which a collector such as the ruby one describes
753
+ // from the project's own gemspec (discussion 4410).
754
+ const collectSrcFiles = (comp) => {
755
+ if (!comp) {
756
+ return;
762
757
  }
763
758
  if (comp.properties) {
759
+ // internal:LocalNodeModulesPath is a lookup path on the scanning host.
760
+ // Collectors outside the JS evidence pass (caxa, scalasem) keep it, so
761
+ // it is removed here for every component.
762
+ comp.properties = comp.properties.filter(
763
+ (aprop) => aprop.name !== "internal:LocalNodeModulesPath",
764
+ );
764
765
  for (const aprop of comp.properties) {
765
766
  if (aprop.name === "internal:SrcFile" && aprop.value) {
766
767
  const rdir = relativeDir(aprop.value, options);
@@ -790,6 +791,10 @@ export function applyMetadata(bomJson, options) {
790
791
  Array.isArray(aidentityEvidence.methods)
791
792
  ) {
792
793
  for (const amethod of aidentityEvidence.methods) {
794
+ // `value` is optional: an attestation, for one, names no file.
795
+ if (typeof amethod?.value !== "string") {
796
+ continue;
797
+ }
793
798
  const rdir = relativeDir(amethod.value, options);
794
799
  if (
795
800
  comp.type !== "file" &&
@@ -806,7 +811,32 @@ export function applyMetadata(bomJson, options) {
806
811
  }
807
812
  }
808
813
  }
809
- }
814
+ };
815
+ for (const comp of bomJson.components) {
816
+ if (comp.purl) {
817
+ try {
818
+ const purlObj = Purl.parse(comp.purl);
819
+ if (purlObj?.type) {
820
+ bomPkgTypes.add(purlObj.type);
821
+ }
822
+ if (purlObj?.namespace) {
823
+ bomPkgNamespaces.add(purlObj.namespace);
824
+ }
825
+ } catch (_e) {
826
+ // ignore
827
+ }
828
+ }
829
+ collectSrcFiles(comp);
830
+ }
831
+ // The project's sub-components, the modules of a multi-module build, name
832
+ // their manifests the same way, at any depth.
833
+ const collectSrcFilesTree = (comp) => {
834
+ collectSrcFiles(comp);
835
+ for (const subComponent of comp?.components || []) {
836
+ collectSrcFilesTree(subComponent);
837
+ }
838
+ };
839
+ collectSrcFilesTree(bomJson.metadata?.component);
810
840
  if (!bomJson.metadata.properties) {
811
841
  bomJson.metadata.properties = [];
812
842
  }
@@ -862,6 +892,43 @@ export function applyMetadata(bomJson, options) {
862
892
  thoughtLog("BOM lacks package manifest details. Please help us improve!");
863
893
  }
864
894
  }
895
+ return applyCustomMetadataProperties(bomJson, options);
896
+ }
897
+
898
+ /**
899
+ * Add the metadata properties the user asked for on the command line, in the
900
+ * environment, or in a config file (discussion 4391), after whatever the scan
901
+ * itself discovered. They never replace a discovered property: the scan's own
902
+ * names, such as `cdx:bom:componentSrcFiles`, keep their values. A BOM without
903
+ * components still gets them.
904
+ *
905
+ * @param {Object} bomJson BOM JSON Object
906
+ * @param {Object} options CLI options, with `metadataProperties` as
907
+ * `[{name, value}]`
908
+ *
909
+ * @returns {Object} BOM JSON Object
910
+ */
911
+ function applyCustomMetadataProperties(bomJson, options) {
912
+ if (!bomJson?.metadata || !options?.metadataProperties?.length) {
913
+ return bomJson;
914
+ }
915
+ bomJson.metadata.properties = bomJson.metadata.properties || [];
916
+ for (const aprop of options.metadataProperties) {
917
+ if (!aprop?.name?.length || aprop.value === undefined) {
918
+ continue;
919
+ }
920
+ const value = sanitizeBomPropertyValue(aprop.name, `${aprop.value}`);
921
+ if (!value?.length) {
922
+ continue;
923
+ }
924
+ if (
925
+ !bomJson.metadata.properties.some(
926
+ (p) => p.name === aprop.name && p.value === value,
927
+ )
928
+ ) {
929
+ bomJson.metadata.properties.push({ name: aprop.name, value });
930
+ }
931
+ }
865
932
  return bomJson;
866
933
  }
867
934
 
@@ -1503,7 +1570,7 @@ export function annotate(bomJson, options) {
1503
1570
  for (const dep of bomJson.dependencies) {
1504
1571
  const newRef = `${bomLinkPrefix}${stripBomLink(bomJson.serialNumber, bomJson.version, dep.ref)}`;
1505
1572
  const newDependsOn = [];
1506
- for (const adon of dep.dependsOn) {
1573
+ for (const adon of dep.dependsOn || []) {
1507
1574
  newDependsOn.push(
1508
1575
  `${bomLinkPrefix}${stripBomLink(bomJson.serialNumber, bomJson.version, adon)}`,
1509
1576
  );
@@ -53,6 +53,17 @@ const DEPENDENCY_1_6_ONLY_FIELDS = new Set(["provides"]);
53
53
  // License and license expression objects gained these attributes only in the
54
54
  // given spec versions. CycloneDX forbids additional properties, so they must be
55
55
  // removed when downgrading. Ref: data/bom-1.{4,5,6}.schema.json
56
+ // The protocol types CycloneDX 1.6 defines; 1.7 added more.
57
+ const SPEC_1_6_PROTOCOL_TYPES = new Set([
58
+ "tls",
59
+ "ssh",
60
+ "ipsec",
61
+ "ike",
62
+ "sstp",
63
+ "wpa",
64
+ "other",
65
+ "unknown",
66
+ ]);
56
67
  const LICENSE_1_5_ONLY_FIELDS = new Set(["bom-ref", "licensing", "properties"]);
57
68
  const LICENSE_1_6_ONLY_FIELDS = new Set(["acknowledgement"]);
58
69
  const LICENSE_EXPRESSION_1_5_ONLY_FIELDS = new Set(["bom-ref"]);
@@ -602,8 +613,29 @@ function downgradeSubjectForSpecVersion(subject, specVersion, parentKey) {
602
613
  // cryptoProperties.algorithmProperties. 1.6 keeps the deprecated free-text
603
614
  // `curve`, so that one is preserved. Ref: data/bom-1.6.schema.json.
604
615
  const algorithmProperties = subject.cryptoProperties.algorithmProperties;
616
+ // The curve stays known through the free-text field, by its name without
617
+ // the registry prefix (`secg/secp256r1` is `secp256r1`).
618
+ if (algorithmProperties.ellipticCurve && !algorithmProperties.curve) {
619
+ algorithmProperties.curve = String(algorithmProperties.ellipticCurve)
620
+ .split("/")
621
+ .pop();
622
+ }
605
623
  delete algorithmProperties.algorithmFamily;
606
624
  delete algorithmProperties.ellipticCurve;
625
+ // `key-wrap` joined the primitive enum in 1.7.
626
+ if (algorithmProperties.primitive === "key-wrap") {
627
+ algorithmProperties.primitive = "other";
628
+ }
629
+ }
630
+ if (
631
+ specVersion < 1.7 &&
632
+ subject.cryptoProperties?.protocolProperties?.type &&
633
+ !SPEC_1_6_PROTOCOL_TYPES.has(
634
+ subject.cryptoProperties.protocolProperties.type,
635
+ )
636
+ ) {
637
+ // 1.7 added protocol types such as `dtls` and `quic`.
638
+ subject.cryptoProperties.protocolProperties.type = "other";
607
639
  }
608
640
  Object.entries(subject).forEach(([key, value]) => {
609
641
  downgradeSubjectForSpecVersion(value, specVersion, key);
@@ -15,7 +15,7 @@ import {
15
15
  toCycloneDxSpecVersionString,
16
16
  } from "../inventory/bomUtils.js";
17
17
  import { isPartialTree } from "../inventory/depsUtils.js";
18
- import { isValidPurl } from "../inventory/purl.js";
18
+ import { isValidPurl, parsePurlLoose } from "../inventory/purl.js";
19
19
 
20
20
  const dirName = dirNameStr;
21
21
  // The v13 floor is spec 1.6. 1.4 and 1.5 were dropped here so that the JS and
@@ -790,17 +790,13 @@ export const validateRefs = (bomJson) => {
790
790
  if (!refMap[dep.ref]) {
791
791
  warningsList.push(`Invalid ref in dependencies ${dep.ref}`);
792
792
  }
793
- let parentPurlType;
794
- try {
795
- const purlObj = Purl.parse(dep.ref);
796
- parentPurlType = purlObj.type;
797
- } catch (_e) {
798
- // pass
799
- }
793
+ // A ref is the decoded form of a purl, so a version with `+` does not
794
+ // parse strictly; the type is all that is needed here.
795
+ const parentPurlType = parsePurlLoose(dep.ref)?.type;
800
796
  if (
801
797
  parentComponentRef &&
802
798
  dep.ref === parentComponentRef &&
803
- dep.dependsOn.length === 0 &&
799
+ !dep.dependsOn?.length &&
804
800
  bomJson.dependencies.length > 1
805
801
  ) {
806
802
  warningsList.push(
@@ -814,13 +810,7 @@ export const validateRefs = (bomJson) => {
814
810
  `Invalid ref in dependencies.dependsOn ${don}. Parent: ${dep.ref}`,
815
811
  );
816
812
  }
817
- let childPurlType;
818
- try {
819
- const purlObj = Purl.parse(don);
820
- childPurlType = purlObj.type;
821
- } catch (_e) {
822
- // pass
823
- }
813
+ const childPurlType = parsePurlLoose(don)?.type;
824
814
  if (
825
815
  parentPurlType &&
826
816
  childPurlType &&
@@ -11,7 +11,11 @@
11
11
  * wrapper (`bin/validate.js`) is responsible for reading the input BOM.
12
12
  */
13
13
 
14
- import { verifyNode } from "../helpers/bomSigner.js";
14
+ import {
15
+ loadSharedSecret,
16
+ signatureReportReasons,
17
+ verifyBomSignatures,
18
+ } from "../helpers/bomSigner.js";
15
19
  import {
16
20
  validateBom,
17
21
  validateMetadata,
@@ -109,18 +113,26 @@ export async function validateGeneratedBom(bomJson) {
109
113
  * Run schema + deep validation checks from the existing validator helpers and
110
114
  * capture their boolean results without letting them blow up the process.
111
115
  *
116
+ * An exception is not a verdict on the BOM, so it is recorded in
117
+ * `validationErrors` instead of silently counting as a plain failure.
118
+ *
112
119
  * @param {object} bomJson
113
120
  * @param {object} opts
114
- * @returns {Promise<{ schemaValid: boolean, deepValid: boolean }>}
121
+ * @returns {Promise<{ schemaValid: boolean, deepValid: boolean, validationErrors: Array<{ stage: string, message: string }> }>}
115
122
  */
116
123
  async function runSchemaAndDeep(bomJson, opts) {
117
124
  let schemaValid = true;
118
125
  let deepValid = true;
126
+ const validationErrors = [];
119
127
  if (opts.schema !== false) {
120
128
  try {
121
129
  schemaValid = (await validateBom(bomJson)) !== false;
122
130
  } catch (err) {
123
131
  schemaValid = false;
132
+ validationErrors.push({
133
+ stage: "schema",
134
+ message: err?.message || String(err),
135
+ });
124
136
  if (opts.onError) opts.onError("schema", err);
125
137
  }
126
138
  }
@@ -133,10 +145,14 @@ async function runSchemaAndDeep(bomJson, opts) {
133
145
  validateProps(bomJson) !== false;
134
146
  } catch (err) {
135
147
  deepValid = false;
148
+ validationErrors.push({
149
+ stage: "deep",
150
+ message: err?.message || String(err),
151
+ });
136
152
  if (opts.onError) opts.onError("deep", err);
137
153
  }
138
154
  }
139
- return { schemaValid, deepValid };
155
+ return { schemaValid, deepValid, validationErrors };
140
156
  }
141
157
 
142
158
  /**
@@ -151,12 +167,17 @@ async function runSchemaAndDeep(bomJson, opts) {
151
167
  * @param {string} [options.minSeverity] Minimum severity for returned findings.
152
168
  * @param {boolean} [options.includeManual] Include manual-review findings (default true).
153
169
  * @param {boolean} [options.includePass] Include passing findings (default false).
154
- * @param {string} [options.publicKey] If set, verify the BOM signature.
170
+ * @param {string} [options.publicKey] If set, verify the BOM signature with this public key.
171
+ * @param {string|Buffer} [options.secretKey] If set, verify an HMAC (HS*) BOM signature with this shared secret.
172
+ * @param {boolean} [options.nestedSignatures] Also verify component, service, and annotation signatures (default true), as cdx-verify does.
173
+ * Parse untrusted BOM text with `parseStrictJson()` from `lib/parsers/strictJson.js` when verifying signatures.
155
174
  * @returns {{
156
175
  * schemaValid: boolean,
157
176
  * deepValid: boolean,
177
+ * validationErrors: Array<{ stage: string, message: string }>,
158
178
  * signatureVerified: boolean | null,
159
179
  * signatureDetails: object | null,
180
+ * signatureEntries: Array<{ index: number, algorithm: any, keyId: any, verified: boolean }> | null,
160
181
  * findings: Array<object>,
161
182
  * allFindings: Array<object>,
162
183
  * benchmarks: Array<object>,
@@ -164,7 +185,10 @@ async function runSchemaAndDeep(bomJson, opts) {
164
185
  * }}
165
186
  */
166
187
  export async function validateBomAdvanced(bomJson, options = {}) {
167
- const { schemaValid, deepValid } = await runSchemaAndDeep(bomJson, options);
188
+ const { schemaValid, deepValid, validationErrors } = await runSchemaAndDeep(
189
+ bomJson,
190
+ options,
191
+ );
168
192
  const allFindings = evaluateAll(bomJson, {
169
193
  categories: options.categories,
170
194
  benchmarks: options.benchmarks,
@@ -177,17 +201,44 @@ export async function validateBomAdvanced(bomJson, options = {}) {
177
201
  });
178
202
  let signatureVerified = null;
179
203
  let signatureDetails = null;
180
- if (options.publicKey && bomJson?.signature) {
204
+ let signatureEntries = null;
205
+ const verificationRequested =
206
+ (options.publicKey !== undefined && options.publicKey !== null) ||
207
+ (options.secretKey !== undefined && options.secretKey !== null);
208
+ if (verificationRequested && bomJson?.signature) {
181
209
  try {
182
- const match = verifyNode(bomJson, options.publicKey);
183
- signatureVerified = Boolean(match);
184
- signatureDetails = match || null;
210
+ const key = options.secretKey
211
+ ? loadSharedSecret(options.secretKey)
212
+ : options.publicKey;
213
+ const signatureReport = verifyBomSignatures(bomJson, [key], {
214
+ deep: options.nestedSignatures !== false,
215
+ });
216
+ signatureVerified = signatureReport.verified;
217
+ signatureEntries =
218
+ signatureReport.root?.entries.map(
219
+ ({ index, algorithm, keyId, verified }) => ({
220
+ index,
221
+ algorithm,
222
+ keyId,
223
+ verified,
224
+ }),
225
+ ) ?? null;
226
+ if (signatureReport.verified) {
227
+ signatureDetails = signatureReport.root.match;
228
+ } else {
229
+ const reasons = signatureReportReasons(signatureReport);
230
+ signatureDetails = {
231
+ error: reasons.length
232
+ ? [...new Set(reasons)].join(" ")
233
+ : "No signature matched the key.",
234
+ };
235
+ }
185
236
  } catch (err) {
186
237
  signatureVerified = false;
187
238
  signatureDetails = { error: err?.message || String(err) };
188
239
  }
189
- } else if (options.publicKey) {
190
- // Public key provided but BOM has no signature.
240
+ } else if (verificationRequested) {
241
+ // Verification key provided but BOM has no signature.
191
242
  signatureVerified = false;
192
243
  signatureDetails = { error: "BOM has no signature block." };
193
244
  }
@@ -197,8 +248,10 @@ export async function validateBomAdvanced(bomJson, options = {}) {
197
248
  return {
198
249
  schemaValid,
199
250
  deepValid,
251
+ validationErrors,
200
252
  signatureVerified,
201
253
  signatureDetails,
254
+ signatureEntries,
202
255
  findings: filtered,
203
256
  allFindings,
204
257
  benchmarks,
@@ -128,6 +128,9 @@ export function formatSummary(summary) {
128
128
  export function render(report) {
129
129
  const pieces = [];
130
130
  pieces.push(formatSummary(report.summary));
131
+ for (const e of report.validationErrors || []) {
132
+ pieces.push(`Validator error during ${e.stage} validation: ${e.message}`);
133
+ }
131
134
  if (report.benchmarks?.length) {
132
135
  pieces.push(formatBenchmarks(report.benchmarks));
133
136
  }
@@ -12,7 +12,9 @@ export function render(report, _options = {}) {
12
12
  const payload = {
13
13
  schemaValid: report.schemaValid,
14
14
  deepValid: report.deepValid,
15
+ validationErrors: report.validationErrors || [],
15
16
  signatureVerified: report.signatureVerified ?? null,
17
+ signatureEntries: report.signatureEntries ?? null,
16
18
  summary: report.summary,
17
19
  benchmarks: report.benchmarks || [],
18
20
  findings: (report.findings || []).map((f) => ({
@@ -167,12 +167,19 @@ export function render(report, options = {}) {
167
167
  {
168
168
  executionSuccessful:
169
169
  report.summary?.fail === 0 && report.schemaValid !== false,
170
+ toolExecutionNotifications: (report.validationErrors || []).map(
171
+ (e) => ({
172
+ level: "error",
173
+ message: { text: `${e.stage} validation error: ${e.message}` },
174
+ }),
175
+ ),
170
176
  },
171
177
  ],
172
178
  results: findings.map(toSarifResult),
173
179
  properties: {
174
180
  schemaValid: report.schemaValid,
175
181
  deepValid: report.deepValid,
182
+ validationErrors: report.validationErrors || [],
176
183
  signatureVerified: report.signatureVerified ?? null,
177
184
  summary: report.summary,
178
185
  benchmarks: report.benchmarks || [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdxgen/cdxgen",
3
- "version": "13.2.0",
3
+ "version": "13.4.0",
4
4
  "description": "Creates CycloneDX Software Bill of Materials (SBOM) from source or container image",
5
5
  "keywords": [
6
6
  "sbom",
@@ -123,9 +123,9 @@
123
123
  "index.cjs"
124
124
  ],
125
125
  "dependencies": {
126
- "@babel/parser": "8.0.5",
127
- "@babel/traverse": "8.0.5",
128
- "@cdxgen/cdx-purl": "0.0.5",
126
+ "@babel/parser": "8.0.7",
127
+ "@babel/traverse": "8.0.7",
128
+ "@cdxgen/cdx-purl": "0.0.6",
129
129
  "@isaacs/string-locale-compare": "1.1.0",
130
130
  "@npmcli/fs": "6.0.0",
131
131
  "@npmcli/map-workspaces": "6.0.0",
@@ -140,40 +140,40 @@
140
140
  "npm-package-arg": "14.0.0",
141
141
  "parse-conflict-json": "6.0.0",
142
142
  "semver": "7.8.5",
143
- "smol-toml": "^1.8.0",
143
+ "smol-toml": "1.9.1",
144
144
  "ssri": "14.0.0",
145
145
  "tar": "7.5.22",
146
146
  "treeverse": "3.0.0",
147
- "undici": "8.10.2",
147
+ "undici": "8.11.2",
148
148
  "walk-up-path": "4.0.0",
149
149
  "yaml": "2.9.1",
150
- "yargs": "18.1.0"
150
+ "yargs": "18.2.0"
151
151
  },
152
152
  "devDependencies": {
153
- "@biomejs/biome": "2.5.14",
154
- "esmock": "2.7.6",
153
+ "@biomejs/biome": "2.5.15",
154
+ "esmock": "2.7.9",
155
155
  "poku": "4.5.0",
156
156
  "sinon": "22.1.0",
157
157
  "typescript": "^7.0.2"
158
158
  },
159
159
  "optionalDependencies": {
160
160
  "@appthreat/atom": "3.1.1",
161
- "@appthreat/atom-parsetools": "1.7.0",
162
- "@bufbuild/protobuf": "2.15.0",
161
+ "@appthreat/atom-parsetools": "1.10.2",
162
+ "@bufbuild/protobuf": "2.16.0",
163
163
  "@cdxgen/cdx-hbom": "0.5.1",
164
164
  "@cdxgen/cdx-proto": "2.3.0",
165
- "@cdxgen/cdxgen-plugins-bin": "4.0.0",
166
- "@cdxgen/cdxgen-plugins-bin-darwin-amd64": "4.0.0",
167
- "@cdxgen/cdxgen-plugins-bin-darwin-arm64": "4.0.0",
168
- "@cdxgen/cdxgen-plugins-bin-linux-amd64": "4.0.0",
169
- "@cdxgen/cdxgen-plugins-bin-linux-arm": "4.0.0",
170
- "@cdxgen/cdxgen-plugins-bin-linux-arm64": "4.0.0",
171
- "@cdxgen/cdxgen-plugins-bin-linux-ppc64": "4.0.0",
172
- "@cdxgen/cdxgen-plugins-bin-linuxmusl-amd64": "4.0.0",
173
- "@cdxgen/cdxgen-plugins-bin-linuxmusl-arm64": "4.0.0",
174
- "@cdxgen/cdxgen-plugins-bin-windows-amd64": "4.0.0",
175
- "@cdxgen/cdxgen-plugins-bin-windows-arm64": "4.0.0",
176
- "@cdxgen/safer-exec": "0.16.0",
165
+ "@cdxgen/cdxgen-plugins-bin": "4.1.1",
166
+ "@cdxgen/cdxgen-plugins-bin-darwin-amd64": "4.1.1",
167
+ "@cdxgen/cdxgen-plugins-bin-darwin-arm64": "4.1.1",
168
+ "@cdxgen/cdxgen-plugins-bin-linux-amd64": "4.1.1",
169
+ "@cdxgen/cdxgen-plugins-bin-linux-arm": "4.1.1",
170
+ "@cdxgen/cdxgen-plugins-bin-linux-arm64": "4.1.1",
171
+ "@cdxgen/cdxgen-plugins-bin-linux-ppc64": "4.1.1",
172
+ "@cdxgen/cdxgen-plugins-bin-linuxmusl-amd64": "4.1.1",
173
+ "@cdxgen/cdxgen-plugins-bin-linuxmusl-arm64": "4.1.1",
174
+ "@cdxgen/cdxgen-plugins-bin-windows-amd64": "4.1.1",
175
+ "@cdxgen/cdxgen-plugins-bin-windows-arm64": "4.1.1",
176
+ "@cdxgen/safer-exec": "1.1.2",
177
177
  "body-parser": "2.3.0",
178
178
  "compression": "1.8.2",
179
179
  "connect": "3.7.0",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/audit/index.js"],"names":[],"mappings":"AA6EA,yFAAyF;AACzF,eAAO,MAAM,wBAAwB,UAKpC,CAAC;AAuCF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAHxB,MAGwB,GAFtB,MAAM,CAclB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAHxB,MAGwB,GAFtB,MAAM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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"}
@@ -65,7 +65,8 @@ export declare const componentToSimpleFullName: (comp: object) => string;
65
65
  /**
66
66
  * Strips transient keys (`evidence`, `_integrity`, `license`, `qualifiers`,
67
67
  * `repository`, `homepage`) from a parent component while preserving licenses
68
- * and external references (bug #1519).
68
+ * and external references (bug #1519). External references whose URL is not a
69
+ * valid IRI reference are dropped.
69
70
  *
70
71
  * @param {object} comp Parent component to clean in place
71
72
  * @returns {object} The cleaned parent component
@@ -1 +1 @@
1
- {"version":3,"file":"bomAssembly.d.ts","sourceRoot":"","sources":["../../../lib/cli/bomAssembly.js"],"names":[],"mappings":"AA8DA;;;;;;;;;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;AAqFF;;;;;;;;;GASG;AACH,eAAO,MAAM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sB,CAAC,WAAW,EAJvC,MAIuC,EAAE,aAAa,EAHtD,MAGsD,GAFpD,IAAI,CAyDhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAPtB,MAOsB,EAAE,UAAU,OAAA,EAAE,eAAe,EALnD,MAKmD,EAAE,YAAY,OAAA,GAF/D,MAAM,CA8ClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,YAJjC,MAAM,mBACN,MAAM,KACJ,OAYZ,CAAC"}
@@ -37,6 +37,33 @@ export declare function validateSpecVersion(specVersion: number, commandName?: s
37
37
  * @returns {boolean} True when the user explicitly set this flag
38
38
  */
39
39
  export declare function isUserProvided(value: any, yaDefault: any): boolean;
40
+ /**
41
+ * Combine the custom metadata properties of every source (discussion 4391):
42
+ * the `--metadata-property` flag, the CDXGEN_METADATA_PROPERTY and
43
+ * CDXGEN_METADATA_PROPERTIES environment variables, and a config file's
44
+ * `metadata-property` or `metadataProperties` entry.
45
+ *
46
+ * yargs would let the highest-precedence source replace the others outright,
47
+ * so each is read on its own and they are merged instead. A name set by more
48
+ * than one source takes its values from the one that wins in the usual order
49
+ * — the command line, then the environment, then the config file — while a
50
+ * source may repeat a name for a multi-valued property.
51
+ *
52
+ * @param {object} args Parsed yargs argv
53
+ * @param {object} [context]
54
+ * @param {string[]} [context.argv] Raw command-line arguments, which tell a
55
+ * flag on the command line from one yargs filled in from elsewhere
56
+ * @param {object} [context.projectConfig] The sanitized config file contents.
57
+ * Without it, a programmatic caller's `args` are taken as the config.
58
+ * @returns {{name: string, value: string}[]} The merged properties
59
+ */
60
+ export declare function resolveMetadataProperties(args: object, { argv, projectConfig }?: {
61
+ argv?: string[];
62
+ projectConfig?: object;
63
+ }): {
64
+ name: string;
65
+ value: string;
66
+ }[];
40
67
  /**
41
68
  * Apply command-name-based defaults to the raw parsed args. When cdxgen is
42
69
  * invoked via a symlink or alias (e.g. `obom`, `cbom`, `spdxgen`, `aibom`),
@@ -50,10 +77,11 @@ export declare function isUserProvided(value: any, yaDefault: any): boolean;
50
77
  * @returns {object} A shallow copy of args with alias-based defaults applied
51
78
  */
52
79
  export declare function applyCommandNameDefaults(args: object, invokedCommandName: string): object;
53
- export declare function buildInitialOptions(args: any, { filePath, isRemoteOrPurl, argv }: {
80
+ export declare function buildInitialOptions(args: any, { filePath, isRemoteOrPurl, argv, projectConfig }: {
54
81
  argv?: any;
55
82
  filePath: any;
56
83
  isRemoteOrPurl: any;
84
+ projectConfig: any;
57
85
  }): any;
58
86
  export type OptionsWarning = {
59
87
  /**
@@ -141,6 +169,9 @@ export declare function applyAdvancedOptions(options: object, context?: {
141
169
  * passed `--spec-version`
142
170
  * @param {boolean} [context.isDryRun=false] Dry-run mode
143
171
  * @param {boolean} [context.isSecureMode] Secure mode
172
+ * @param {object} [context.projectConfig] Sanitized config file contents,
173
+ * whose metadata properties merge
174
+ * with the other sources'
144
175
  * @returns {{ options: object, warnings: OptionsWarning[] }}
145
176
  */
146
177
  export declare function buildOptionsFromArgs(args: object, context: {
@@ -150,6 +181,7 @@ export declare function buildOptionsFromArgs(args: object, context: {
150
181
  userSetSpecVersion: boolean;
151
182
  isDryRun?: boolean;
152
183
  isSecureMode?: boolean;
184
+ projectConfig?: object;
153
185
  }): {
154
186
  options: object;
155
187
  warnings: OptionsWarning[];
@@ -1 +1 @@
1
- {"version":3,"file":"cliOptions.d.ts","sourceRoot":"","sources":["../../../lib/cli/cliOptions.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAoBH;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAJpC,MAIoC,EAAE,WAAW,AAHzD,CACA,EADQ,MAG4D,GAF1D,MAAM,GAAC,IAAI,CAoBvB;AA4CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAJzB,GAIyB,EAAE,SAAS,EAHpC,GAGoC,GAFlC,OAAO,CAInB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,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