hallo hier ein commit
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2025-07-10 12:06:41 +02:00
parent b91a7ae0fc
commit 117a74989e
2 changed files with 44 additions and 7 deletions

View File

@@ -63,7 +63,8 @@ def minimalSbomFormatConverter(minimalSbom, classifier):
bom.metadata.component = root_component = Component(
name=minimalSbomObject['product'],
type=__converterClassifierToComponentType(classifier),
type=__converterClassifierToComponentType(minimalSbomObject['classifier']),
description=minimalSbomObject['description'],
version=minimalSbomObject['version'],
licenses=[lc_factory.make_from_string(minimalSbomObject['license'])],
supplier=OrganizationalEntity(
@@ -73,6 +74,21 @@ def minimalSbomFormatConverter(minimalSbom, classifier):
bom_ref = f"urn:uuid:{uuid.uuid4()}"
)
component = Component(
type=__converterClassifierToComponentType(minimalSbomObject['classifier']),
name=f"{minimalSbomObject['supplier']['name']}´s own code",
version=minimalSbomObject['version'],
licenses=[lc_factory.make_from_string(minimalSbomObject['license'])],
supplier=OrganizationalEntity(
name=minimalSbomObject['supplier']['name'],
urls=[XsUri(minimalSbomObject['supplier']['url'])]
),
bom_ref = f"urn:uuid:{uuid.uuid4()}"
)
bom.components.add(component)
bom.register_dependency(root_component, [component])
for minimalComponentDescription in minimalSbomObject['components']:
component = Component(
type=ComponentType.LIBRARY,
@@ -91,6 +107,8 @@ def minimalSbomFormatConverter(minimalSbom, classifier):
outputSbom = JsonV1Dot5(bom).output_as_string(indent=2)
logger.info(outputSbom)
with open('/tmp/bom.json', 'w') as f:
f.write(outputSbom)
raise Exception("Conversion aborted")
return (outputSbom, minimalSbomObject['product'], minimalSbomObject['version'], minimalSbomObject['classifier'], minimalSbomObject['description'])