anthonyharrison / lib4sbom

Library to ingest and generate SBOMs
Apache License 2.0
14 stars 10 forks source link

Improved parser file handling #26

Closed anthonyharrison closed 6 months ago

anthonyharrison commented 6 months ago

Lib4SBOM follows the conventions for file names for SPDX documents and determines the type of SBOM based on the extension e.g. a file with extension .spdx is assumed to be tag Value, .spdx.json is a file in SJON format. However if a filename does not conform to the naming convention, the file will be attempted to be parsed by the CycloneDX parser.

However filenames with extensions such as .sbom, .txt etc are unlikely to be parsed correctly and generate an exception. This needs to be improved so that invalid filename extensions are handled approriately.

The CycloneDX parser just needs to recognize the CycloneDX filename conventions of .bom.json, .cdx.json. .bom.xml and .cdx.xml