From c4b2d6b825047ebbe817f6d3a31d3b8a1d58ac87 Mon Sep 17 00:00:00 2001 From: dscanteianu Date: Mon, 9 Dec 2024 17:48:23 +0000 Subject: [PATCH] combiner --- combiner.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/combiner.py b/combiner.py index 87022dea4..8354160e2 100644 --- a/combiner.py +++ b/combiner.py @@ -8,10 +8,23 @@ sbom["metadata"] = {} if "properties" not in sbom["metadata"]: sbom["metadata"]["properties"] = [] - properties_to_skip = [] + properties_to_skip = [ + "version" + ] # todo: do we flatten this? or put it somewhere else in some meaningful way? cyclone dx wasn't expecting a dict + properties_to_flatten = [ + "" + ] # todo: BUILD_CONFIGURATION_param - are these redundant/should we just skip this, or is this what andrew means we should add to that bash script arg for property in metadata: if property in properties_to_skip: continue + if property in properties_to_flatten: + for sub in metadata[property]: + sbom["metadata"]["properties"].append( + {"name": sub, "value": json.dumps(metadata[property])} + ) + print(property) + print(metadata[property]) + print("\n\n\n") sbom["metadata"]["properties"].append( {"name": property, "value": metadata[property]} )