From eb041b55b2eb8685a37be6f7a9c265fb6528377b Mon Sep 17 00:00:00 2001 From: nscuro Date: Sat, 24 Jun 2023 17:33:04 +0200 Subject: [PATCH] feat(spec1-5): add new component types Signed-off-by: nscuro --- convert.go | 2 ++ cyclonedx.go | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/convert.go b/convert.go index 791de0b..ff78f7d 100644 --- a/convert.go +++ b/convert.go @@ -277,6 +277,8 @@ func (sv SpecVersion) supportsComponentType(cType ComponentType) bool { return sv >= SpecVersion1_1 case ComponentTypeContainer, ComponentTypeFirmware: return sv >= SpecVersion1_2 + case ComponentTypeData, ComponentTypeDeviceDriver, ComponentTypeMachineLearningModel, ComponentTypePlatform: + return sv >= SpecVersion1_5 } return false diff --git a/cyclonedx.go b/cyclonedx.go index a445032..6a4a6e3 100644 --- a/cyclonedx.go +++ b/cyclonedx.go @@ -103,14 +103,18 @@ type BOMReference string type ComponentType string const ( - ComponentTypeApplication ComponentType = "application" - ComponentTypeContainer ComponentType = "container" - ComponentTypeDevice ComponentType = "device" - ComponentTypeFile ComponentType = "file" - ComponentTypeFirmware ComponentType = "firmware" - ComponentTypeFramework ComponentType = "framework" - ComponentTypeLibrary ComponentType = "library" - ComponentTypeOS ComponentType = "operating-system" + ComponentTypeApplication ComponentType = "application" + ComponentTypeContainer ComponentType = "container" + ComponentTypeData ComponentType = "data" + ComponentTypeDevice ComponentType = "device" + ComponentTypeDeviceDriver ComponentType = "device-driver" + ComponentTypeFile ComponentType = "file" + ComponentTypeFirmware ComponentType = "firmware" + ComponentTypeFramework ComponentType = "framework" + ComponentTypeLibrary ComponentType = "library" + ComponentTypeMachineLearningModel ComponentType = "machine-learning-model" + ComponentTypeOS ComponentType = "operating-system" + ComponentTypePlatform ComponentType = "platform" ) type Commit struct {