sbom

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2023 License: Apache-2.0 Imports: 19 Imported by: 11

Documentation

Index

Constants

View Source
const NodeIdentifierPrefix = "protobom"

Variables

View Source
var (
	HashAlgorithm_name = map[int32]string{
		0:  "UNKNOWN",
		1:  "MD5",
		2:  "SHA1",
		3:  "SHA256",
		4:  "SHA384",
		5:  "SHA512",
		6:  "SHA3_256",
		7:  "SHA3_384",
		8:  "SHA3_512",
		9:  "BLAKE2B_256",
		10: "BLAKE2B_384",
		11: "BLAKE2B_512",
		12: "BLAKE3",
		13: "MD2",
		14: "ADLER32",
		15: "MD4",
		16: "MD6",
		17: "SHA224",
	}
	HashAlgorithm_value = map[string]int32{
		"UNKNOWN":     0,
		"MD5":         1,
		"SHA1":        2,
		"SHA256":      3,
		"SHA384":      4,
		"SHA512":      5,
		"SHA3_256":    6,
		"SHA3_384":    7,
		"SHA3_512":    8,
		"BLAKE2B_256": 9,
		"BLAKE2B_384": 10,
		"BLAKE2B_512": 11,
		"BLAKE3":      12,
		"MD2":         13,
		"ADLER32":     14,
		"MD4":         15,
		"MD6":         16,
		"SHA224":      17,
	}
)

Enum value maps for HashAlgorithm.

View Source
var (
	SoftwareIdentifierType_name = map[int32]string{
		0: "UNKNOWN_IDENTIFIER_TYPE",
		1: "PURL",
		2: "CPE22",
		3: "CPE23",
		4: "GITOID",
	}
	SoftwareIdentifierType_value = map[string]int32{
		"UNKNOWN_IDENTIFIER_TYPE": 0,
		"PURL":                    1,
		"CPE22":                   2,
		"CPE23":                   3,
		"GITOID":                  4,
	}
)

Enum value maps for SoftwareIdentifierType.

View Source
var (
	Purpose_name = map[int32]string{
		0:  "UNKNOWN_PURPOSE",
		1:  "APPLICATION",
		2:  "ARCHIVE",
		3:  "BOM",
		4:  "CONFIGURATION",
		5:  "CONTAINER",
		6:  "DATA",
		7:  "DEVICE",
		8:  "DEVICE_DRIVER",
		9:  "DOCUMENTATION",
		10: "EVIDENCE",
		11: "EXECUTABLE",
		12: "FILE",
		13: "FIRMWARE",
		14: "FRAMEWORK",
		15: "INSTALL",
		16: "LIBRARY",
		17: "MACHINE_LEARNING_MODEL",
		18: "MANIFEST",
		19: "MODEL",
		20: "MODULE",
		21: "OPERATING_SYSTEM",
		22: "OTHER",
		23: "PATCH",
		24: "PLATFORM",
		25: "REQUIREMENT",
		26: "SOURCE",
		27: "SPECIFICATION",
		28: "TEST",
	}
	Purpose_value = map[string]int32{
		"UNKNOWN_PURPOSE":        0,
		"APPLICATION":            1,
		"ARCHIVE":                2,
		"BOM":                    3,
		"CONFIGURATION":          4,
		"CONTAINER":              5,
		"DATA":                   6,
		"DEVICE":                 7,
		"DEVICE_DRIVER":          8,
		"DOCUMENTATION":          9,
		"EVIDENCE":               10,
		"EXECUTABLE":             11,
		"FILE":                   12,
		"FIRMWARE":               13,
		"FRAMEWORK":              14,
		"INSTALL":                15,
		"LIBRARY":                16,
		"MACHINE_LEARNING_MODEL": 17,
		"MANIFEST":               18,
		"MODEL":                  19,
		"MODULE":                 20,
		"OPERATING_SYSTEM":       21,
		"OTHER":                  22,
		"PATCH":                  23,
		"PLATFORM":               24,
		"REQUIREMENT":            25,
		"SOURCE":                 26,
		"SPECIFICATION":          27,
		"TEST":                   28,
	}
)

Enum value maps for Purpose.

View Source
var (
	Node_NodeType_name = map[int32]string{
		0: "PACKAGE",
		1: "FILE",
	}
	Node_NodeType_value = map[string]int32{
		"PACKAGE": 0,
		"FILE":    1,
	}
)

Enum value maps for Node_NodeType.

View Source
var (
	Edge_Type_name = map[int32]string{
		0:  "UNKNOWN",
		1:  "amends",
		2:  "ancestor",
		3:  "buildDependency",
		4:  "buildTool",
		5:  "contains",
		6:  "contained_by",
		7:  "copy",
		8:  "dataFile",
		9:  "dependencyManifest",
		10: "dependsOn",
		11: "dependencyOf",
		12: "descendant",
		13: "describes",
		14: "describedBy",
		15: "devDependency",
		16: "devTool",
		17: "distributionArtifact",
		18: "documentation",
		19: "dynamicLink",
		20: "example",
		21: "expandedFromArchive",
		22: "fileAdded",
		23: "fileDeleted",
		24: "fileModified",
		25: "generates",
		26: "generatedFrom",
		27: "metafile",
		28: "optionalComponent",
		29: "optionalDependency",
		30: "other",
		31: "packages",
		32: "patch",
		33: "prerequisite",
		34: "prerequisiteFor",
		35: "providedDependency",
		36: "requirementFor",
		37: "runtimeDependency",
		38: "specificationFor",
		39: "staticLink",
		40: "test",
		41: "testCase",
		42: "testDependency",
		43: "testTool",
		44: "variant",
	}
	Edge_Type_value = map[string]int32{
		"UNKNOWN":              0,
		"amends":               1,
		"ancestor":             2,
		"buildDependency":      3,
		"buildTool":            4,
		"contains":             5,
		"contained_by":         6,
		"copy":                 7,
		"dataFile":             8,
		"dependencyManifest":   9,
		"dependsOn":            10,
		"dependencyOf":         11,
		"descendant":           12,
		"describes":            13,
		"describedBy":          14,
		"devDependency":        15,
		"devTool":              16,
		"distributionArtifact": 17,
		"documentation":        18,
		"dynamicLink":          19,
		"example":              20,
		"expandedFromArchive":  21,
		"fileAdded":            22,
		"fileDeleted":          23,
		"fileModified":         24,
		"generates":            25,
		"generatedFrom":        26,
		"metafile":             27,
		"optionalComponent":    28,
		"optionalDependency":   29,
		"other":                30,
		"packages":             31,
		"patch":                32,
		"prerequisite":         33,
		"prerequisiteFor":      34,
		"providedDependency":   35,
		"requirementFor":       36,
		"runtimeDependency":    37,
		"specificationFor":     38,
		"staticLink":           39,
		"test":                 40,
		"testCase":             41,
		"testDependency":       42,
		"testTool":             43,
		"variant":              44,
	}
)

Enum value maps for Edge_Type.

View Source
var (
	ExternalReference_ExternalReferenceType_name = map[int32]string{
		0:  "UNKNOWN",
		1:  "ATTESTATION",
		2:  "BINARY",
		3:  "BOM",
		4:  "BOWER",
		5:  "BUILD_META",
		6:  "BUILD_SYSTEM",
		7:  "CERTIFICATION_REPORT",
		8:  "CHAT",
		9:  "CODIFIED_INFRASTRUCTURE",
		10: "COMPONENT_ANALYSIS_REPORT",
		11: "CONFIGURATION",
		12: "DISTRIBUTION_INTAKE",
		13: "DOCUMENTATION",
		14: "DOWNLOAD",
		15: "DYNAMIC_ANALYSIS_REPORT",
		16: "EOL_NOTICE",
		17: "EVIDENCE",
		18: "EXPORT_CONTROL_ASSESSMENT",
		19: "FORMULATION",
		20: "FUNDING",
		21: "ISSUE_TRACKER",
		22: "LICENSE",
		23: "LOG",
		24: "MAILING_LIST",
		25: "MATURITY_REPORT",
		26: "MAVEN_CENTRAL",
		27: "METRICS",
		28: "MODEL_CARD",
		29: "NPM",
		30: "NUGET",
		31: "OTHER",
		32: "POAM",
		33: "PRIVACY_ASSESSMENT",
		34: "PRODUCT_METADATA",
		35: "PURCHASE_ORDER",
		36: "QUALITY_ASSESSMENT_REPORT",
		37: "QUALITY_METRICS",
		38: "RELEASE_HISTORY",
		39: "RELEASE_NOTES",
		40: "RISK_ASSESSMENT",
		41: "RUNTIME_ANALYSIS_REPORT",
		42: "SECURE_SOFTWARE_ATTESTATION",
		43: "SECURITY_ADVERSARY_MODEL",
		44: "SECURITY_ADVISORY",
		45: "SECURITY_CONTACT",
		46: "SECURITY_FIX",
		47: "SECURITY_OTHER",
		48: "SECURITY_PENTEST_REPORT",
		49: "SECURITY_POLICY",
		50: "SECURITY_SWID",
		51: "SECURITY_THREAT_MODEL",
		52: "SOCIAL",
		53: "SOURCE_ARTIFACT",
		54: "STATIC_ANALYSIS_REPORT",
		55: "SUPPORT",
		56: "VCS",
		57: "VULNERABILITY_ASSERTION",
		58: "VULNERABILITY_DISCLOSURE_REPORT",
		59: "VULNERABILITY_EXPLOITABILITY_ASSESSMENT",
		60: "WEBSITE",
	}
	ExternalReference_ExternalReferenceType_value = map[string]int32{
		"UNKNOWN":                         0,
		"ATTESTATION":                     1,
		"BINARY":                          2,
		"BOM":                             3,
		"BOWER":                           4,
		"BUILD_META":                      5,
		"BUILD_SYSTEM":                    6,
		"CERTIFICATION_REPORT":            7,
		"CHAT":                            8,
		"CODIFIED_INFRASTRUCTURE":         9,
		"COMPONENT_ANALYSIS_REPORT":       10,
		"CONFIGURATION":                   11,
		"DISTRIBUTION_INTAKE":             12,
		"DOCUMENTATION":                   13,
		"DOWNLOAD":                        14,
		"DYNAMIC_ANALYSIS_REPORT":         15,
		"EOL_NOTICE":                      16,
		"EVIDENCE":                        17,
		"EXPORT_CONTROL_ASSESSMENT":       18,
		"FORMULATION":                     19,
		"FUNDING":                         20,
		"ISSUE_TRACKER":                   21,
		"LICENSE":                         22,
		"LOG":                             23,
		"MAILING_LIST":                    24,
		"MATURITY_REPORT":                 25,
		"MAVEN_CENTRAL":                   26,
		"METRICS":                         27,
		"MODEL_CARD":                      28,
		"NPM":                             29,
		"NUGET":                           30,
		"OTHER":                           31,
		"POAM":                            32,
		"PRIVACY_ASSESSMENT":              33,
		"PRODUCT_METADATA":                34,
		"PURCHASE_ORDER":                  35,
		"QUALITY_ASSESSMENT_REPORT":       36,
		"QUALITY_METRICS":                 37,
		"RELEASE_HISTORY":                 38,
		"RELEASE_NOTES":                   39,
		"RISK_ASSESSMENT":                 40,
		"RUNTIME_ANALYSIS_REPORT":         41,
		"SECURE_SOFTWARE_ATTESTATION":     42,
		"SECURITY_ADVERSARY_MODEL":        43,
		"SECURITY_ADVISORY":               44,
		"SECURITY_CONTACT":                45,
		"SECURITY_FIX":                    46,
		"SECURITY_OTHER":                  47,
		"SECURITY_PENTEST_REPORT":         48,
		"SECURITY_POLICY":                 49,
		"SECURITY_SWID":                   50,
		"SECURITY_THREAT_MODEL":           51,
		"SOCIAL":                          52,
		"SOURCE_ARTIFACT":                 53,
		"STATIC_ANALYSIS_REPORT":          54,
		"SUPPORT":                         55,
		"VCS":                             56,
		"VULNERABILITY_ASSERTION":         57,
		"VULNERABILITY_DISCLOSURE_REPORT": 58,
		"VULNERABILITY_EXPLOITABILITY_ASSESSMENT": 59,
		"WEBSITE": 60,
	}
)

Enum value maps for ExternalReference_ExternalReferenceType.

View Source
var (
	DocumentType_SBOMType_name = map[int32]string{
		0: "OTHER",
		1: "DESIGN",
		2: "SOURCE",
		3: "BUILD",
		4: "ANALYZED",
		5: "DEPLOYED",
		6: "RUNTIME",
		7: "DISCOVERY",
		8: "DECOMISSION",
	}
	DocumentType_SBOMType_value = map[string]int32{
		"OTHER":       0,
		"DESIGN":      1,
		"SOURCE":      2,
		"BUILD":       3,
		"ANALYZED":    4,
		"DEPLOYED":    5,
		"RUNTIME":     6,
		"DISCOVERY":   7,
		"DECOMISSION": 8,
	}
)

Enum value maps for DocumentType_SBOMType.

View Source
var ErrorMoreThanOneMatch = fmt.Errorf("More than one node matches")
View Source
var File_api_sbom_proto protoreflect.FileDescriptor

Functions

func NewNodeIdentifier

func NewNodeIdentifier(prefixes ...string) string

NewNodeIdentifier returns an identifier string that can be used in a node and that is guaranteed to be compatible with CycloneDX and SPDX.

Without options, identifiers will be created using a new UUID and prefixed with a prefix like "protobom-xx-yy--". This prefix allows serializers to read characteristics of the identifier string, by looking for keywords before the double dash. For example, "auto" means that it was autogenerated and did not come from an ingested SBOM.

Without any strings seeding it, NewNodeIdentifier generates the identifier using an UUID. If a string is provided, any invalid characters will be removed and the new string will be used as the identifier.

Types

type Document

type Document struct {
	Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	NodeList *NodeList `protobuf:"bytes,2,opt,name=node_list,json=nodeList,proto3" json:"node_list,omitempty"`
	// contains filtered or unexported fields
}

func NewDocument

func NewDocument() *Document

func (*Document) Descriptor deprecated

func (*Document) Descriptor() ([]byte, []int)

Deprecated: Use Document.ProtoReflect.Descriptor instead.

func (*Document) GetMetadata

func (x *Document) GetMetadata() *Metadata

func (*Document) GetNodeList

func (x *Document) GetNodeList() *NodeList

func (*Document) GetRootNodes

func (d *Document) GetRootNodes() []*Node

GetRootNodes returns the top level nodes of the document. It calls the underlying method in the document's NodeList.

func (*Document) ProtoMessage

func (*Document) ProtoMessage()

func (*Document) ProtoReflect

func (x *Document) ProtoReflect() protoreflect.Message

func (*Document) Reset

func (x *Document) Reset()

func (*Document) String

func (x *Document) String() string

type DocumentType added in v0.2.0

type DocumentType struct {
	Type        *DocumentType_SBOMType `protobuf:"varint,1,opt,name=type,proto3,enum=bomsquad.protobom.DocumentType_SBOMType,oneof" json:"type,omitempty"`
	Name        *string                `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
	Description *string                `protobuf:"bytes,3,opt,name=description,proto3,oneof" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*DocumentType) Descriptor deprecated added in v0.2.0

func (*DocumentType) Descriptor() ([]byte, []int)

Deprecated: Use DocumentType.ProtoReflect.Descriptor instead.

func (*DocumentType) GetDescription added in v0.2.0

func (x *DocumentType) GetDescription() string

func (*DocumentType) GetName added in v0.2.0

func (x *DocumentType) GetName() string

func (*DocumentType) GetType added in v0.2.0

func (x *DocumentType) GetType() DocumentType_SBOMType

func (*DocumentType) ProtoMessage added in v0.2.0

func (*DocumentType) ProtoMessage()

func (*DocumentType) ProtoReflect added in v0.2.0

func (x *DocumentType) ProtoReflect() protoreflect.Message

func (*DocumentType) Reset added in v0.2.0

func (x *DocumentType) Reset()

func (*DocumentType) String added in v0.2.0

func (x *DocumentType) String() string

type DocumentType_SBOMType added in v0.2.0

type DocumentType_SBOMType int32
const (
	DocumentType_OTHER       DocumentType_SBOMType = 0
	DocumentType_DESIGN      DocumentType_SBOMType = 1 // CDX: design
	DocumentType_SOURCE      DocumentType_SBOMType = 2 // CDX: pre-build
	DocumentType_BUILD       DocumentType_SBOMType = 3 // CDX: build
	DocumentType_ANALYZED    DocumentType_SBOMType = 4 // CDX: post-build
	DocumentType_DEPLOYED    DocumentType_SBOMType = 5 // CDX: operations
	DocumentType_RUNTIME     DocumentType_SBOMType = 6 // CDX: none
	DocumentType_DISCOVERY   DocumentType_SBOMType = 7 // CDX Specific
	DocumentType_DECOMISSION DocumentType_SBOMType = 8 // CDX Specific
)

func (DocumentType_SBOMType) Descriptor added in v0.2.0

func (DocumentType_SBOMType) Enum added in v0.2.0

func (DocumentType_SBOMType) EnumDescriptor deprecated added in v0.2.0

func (DocumentType_SBOMType) EnumDescriptor() ([]byte, []int)

Deprecated: Use DocumentType_SBOMType.Descriptor instead.

func (DocumentType_SBOMType) Number added in v0.2.0

func (DocumentType_SBOMType) String added in v0.2.0

func (x DocumentType_SBOMType) String() string

func (DocumentType_SBOMType) Type added in v0.2.0

type Edge

type Edge struct {
	Type Edge_Type `protobuf:"varint,1,opt,name=type,proto3,enum=bomsquad.protobom.Edge_Type" json:"type,omitempty"`
	From string    `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"`
	To   []string  `protobuf:"bytes,3,rep,name=to,proto3" json:"to,omitempty"`
	// contains filtered or unexported fields
}

func NewEdge added in v0.2.0

func NewEdge() *Edge

func (*Edge) Copy

func (e *Edge) Copy() *Edge

Copy returns a new edge with copies of all edges

func (*Edge) Descriptor deprecated

func (*Edge) Descriptor() ([]byte, []int)

Deprecated: Use Edge.ProtoReflect.Descriptor instead.

func (*Edge) Equal

func (e *Edge) Equal(e2 *Edge) bool

Equal compares Edge e to e2 and returns true if they are the same

func (*Edge) GetFrom

func (x *Edge) GetFrom() string

func (*Edge) GetTo

func (x *Edge) GetTo() []string

func (*Edge) GetType

func (x *Edge) GetType() Edge_Type

func (*Edge) PointsTo

func (e *Edge) PointsTo(id string) bool

PointsTo returns true if an edge points to a node, in other words if it has id in its list of Tos

func (*Edge) ProtoMessage

func (*Edge) ProtoMessage()

func (*Edge) ProtoReflect

func (x *Edge) ProtoReflect() protoreflect.Message

func (*Edge) Reset

func (x *Edge) Reset()

func (*Edge) String

func (x *Edge) String() string

type Edge_Type

type Edge_Type int32
const (
	Edge_UNKNOWN              Edge_Type = 0
	Edge_amends               Edge_Type = 1
	Edge_ancestor             Edge_Type = 2
	Edge_buildDependency      Edge_Type = 3
	Edge_buildTool            Edge_Type = 4
	Edge_contains             Edge_Type = 5
	Edge_contained_by         Edge_Type = 6 // Not in SPDX3
	Edge_copy                 Edge_Type = 7
	Edge_dataFile             Edge_Type = 8
	Edge_dependencyManifest   Edge_Type = 9
	Edge_dependsOn            Edge_Type = 10
	Edge_dependencyOf         Edge_Type = 11 // Not in SPDX3
	Edge_descendant           Edge_Type = 12
	Edge_describes            Edge_Type = 13
	Edge_describedBy          Edge_Type = 14 // Not in SPDX3
	Edge_devDependency        Edge_Type = 15
	Edge_devTool              Edge_Type = 16
	Edge_distributionArtifact Edge_Type = 17
	Edge_documentation        Edge_Type = 18
	Edge_dynamicLink          Edge_Type = 19
	Edge_example              Edge_Type = 20
	Edge_expandedFromArchive  Edge_Type = 21
	Edge_fileAdded            Edge_Type = 22
	Edge_fileDeleted          Edge_Type = 23
	Edge_fileModified         Edge_Type = 24
	Edge_generates            Edge_Type = 25
	Edge_generatedFrom        Edge_Type = 26 // Not in SPDX3
	Edge_metafile             Edge_Type = 27
	Edge_optionalComponent    Edge_Type = 28
	Edge_optionalDependency   Edge_Type = 29
	Edge_other                Edge_Type = 30
	Edge_packages             Edge_Type = 31
	Edge_patch                Edge_Type = 32
	Edge_prerequisite         Edge_Type = 33
	Edge_prerequisiteFor      Edge_Type = 34 // Not in SPDX3
	Edge_providedDependency   Edge_Type = 35
	Edge_requirementFor       Edge_Type = 36
	Edge_runtimeDependency    Edge_Type = 37
	Edge_specificationFor     Edge_Type = 38
	Edge_staticLink           Edge_Type = 39
	Edge_test                 Edge_Type = 40
	Edge_testCase             Edge_Type = 41
	Edge_testDependency       Edge_Type = 42
	Edge_testTool             Edge_Type = 43
	Edge_variant              Edge_Type = 44
)

func EdgeTypeFromSPDX

func EdgeTypeFromSPDX(spdxName string) Edge_Type

func EdgeTypeFromSPDX2

func EdgeTypeFromSPDX2(spdx2Type string) Edge_Type

func (Edge_Type) Descriptor

func (Edge_Type) Descriptor() protoreflect.EnumDescriptor

func (Edge_Type) Enum

func (x Edge_Type) Enum() *Edge_Type

func (Edge_Type) EnumDescriptor deprecated

func (Edge_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Edge_Type.Descriptor instead.

func (Edge_Type) Number

func (x Edge_Type) Number() protoreflect.EnumNumber

func (Edge_Type) String

func (x Edge_Type) String() string

func (Edge_Type) ToSPDX2

func (et Edge_Type) ToSPDX2() string

ToSPDX2 converts the edge type to the corresponding SDPX2 label

func (Edge_Type) Type

type ExternalReference

type ExternalReference struct {
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// Field 2 was the old string type. Replaced by ExternalReferenceType
	// see https://github.com/bom-squad/protobom/issues/148
	// string type = 2;
	Comment   string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"`
	Authority string `protobuf:"bytes,4,opt,name=authority,proto3" json:"authority,omitempty"`
	// Field 5 was the old string map.
	// Removed, see https://github.com/bom-squad/protobom/issues/89
	Hashes map[int32]string                        `` /* 154-byte string literal not displayed */
	Type   ExternalReference_ExternalReferenceType `protobuf:"varint,7,opt,name=type,proto3,enum=bomsquad.protobom.ExternalReference_ExternalReferenceType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

ExternalReference is an entry linking an element to a resource defined outside the SBOM standard

func (*ExternalReference) Copy added in v0.2.0

Copy returns an exact copy of ExternalReference e.

func (*ExternalReference) Descriptor deprecated

func (*ExternalReference) Descriptor() ([]byte, []int)

Deprecated: Use ExternalReference.ProtoReflect.Descriptor instead.

func (*ExternalReference) GetAuthority

func (x *ExternalReference) GetAuthority() string

func (*ExternalReference) GetComment

func (x *ExternalReference) GetComment() string

func (*ExternalReference) GetHashes

func (x *ExternalReference) GetHashes() map[int32]string

func (*ExternalReference) GetType

func (*ExternalReference) GetUrl

func (x *ExternalReference) GetUrl() string

func (*ExternalReference) ProtoMessage

func (*ExternalReference) ProtoMessage()

func (*ExternalReference) ProtoReflect

func (x *ExternalReference) ProtoReflect() protoreflect.Message

func (*ExternalReference) Reset

func (x *ExternalReference) Reset()

func (*ExternalReference) String

func (x *ExternalReference) String() string

type ExternalReference_ExternalReferenceType added in v0.3.0

type ExternalReference_ExternalReferenceType int32
const (
	ExternalReference_UNKNOWN                                 ExternalReference_ExternalReferenceType = 0
	ExternalReference_ATTESTATION                             ExternalReference_ExternalReferenceType = 1
	ExternalReference_BINARY                                  ExternalReference_ExternalReferenceType = 2
	ExternalReference_BOM                                     ExternalReference_ExternalReferenceType = 3
	ExternalReference_BOWER                                   ExternalReference_ExternalReferenceType = 4
	ExternalReference_BUILD_META                              ExternalReference_ExternalReferenceType = 5
	ExternalReference_BUILD_SYSTEM                            ExternalReference_ExternalReferenceType = 6
	ExternalReference_CERTIFICATION_REPORT                    ExternalReference_ExternalReferenceType = 7
	ExternalReference_CHAT                                    ExternalReference_ExternalReferenceType = 8
	ExternalReference_CODIFIED_INFRASTRUCTURE                 ExternalReference_ExternalReferenceType = 9
	ExternalReference_COMPONENT_ANALYSIS_REPORT               ExternalReference_ExternalReferenceType = 10
	ExternalReference_CONFIGURATION                           ExternalReference_ExternalReferenceType = 11
	ExternalReference_DISTRIBUTION_INTAKE                     ExternalReference_ExternalReferenceType = 12
	ExternalReference_DOCUMENTATION                           ExternalReference_ExternalReferenceType = 13
	ExternalReference_DOWNLOAD                                ExternalReference_ExternalReferenceType = 14
	ExternalReference_DYNAMIC_ANALYSIS_REPORT                 ExternalReference_ExternalReferenceType = 15
	ExternalReference_EOL_NOTICE                              ExternalReference_ExternalReferenceType = 16
	ExternalReference_EVIDENCE                                ExternalReference_ExternalReferenceType = 17
	ExternalReference_EXPORT_CONTROL_ASSESSMENT               ExternalReference_ExternalReferenceType = 18
	ExternalReference_FORMULATION                             ExternalReference_ExternalReferenceType = 19
	ExternalReference_FUNDING                                 ExternalReference_ExternalReferenceType = 20
	ExternalReference_ISSUE_TRACKER                           ExternalReference_ExternalReferenceType = 21
	ExternalReference_LICENSE                                 ExternalReference_ExternalReferenceType = 22
	ExternalReference_LOG                                     ExternalReference_ExternalReferenceType = 23
	ExternalReference_MAILING_LIST                            ExternalReference_ExternalReferenceType = 24
	ExternalReference_MATURITY_REPORT                         ExternalReference_ExternalReferenceType = 25
	ExternalReference_MAVEN_CENTRAL                           ExternalReference_ExternalReferenceType = 26
	ExternalReference_METRICS                                 ExternalReference_ExternalReferenceType = 27
	ExternalReference_MODEL_CARD                              ExternalReference_ExternalReferenceType = 28
	ExternalReference_NPM                                     ExternalReference_ExternalReferenceType = 29
	ExternalReference_NUGET                                   ExternalReference_ExternalReferenceType = 30
	ExternalReference_OTHER                                   ExternalReference_ExternalReferenceType = 31
	ExternalReference_POAM                                    ExternalReference_ExternalReferenceType = 32
	ExternalReference_PRIVACY_ASSESSMENT                      ExternalReference_ExternalReferenceType = 33
	ExternalReference_PRODUCT_METADATA                        ExternalReference_ExternalReferenceType = 34
	ExternalReference_PURCHASE_ORDER                          ExternalReference_ExternalReferenceType = 35
	ExternalReference_QUALITY_ASSESSMENT_REPORT               ExternalReference_ExternalReferenceType = 36
	ExternalReference_QUALITY_METRICS                         ExternalReference_ExternalReferenceType = 37
	ExternalReference_RELEASE_HISTORY                         ExternalReference_ExternalReferenceType = 38
	ExternalReference_RELEASE_NOTES                           ExternalReference_ExternalReferenceType = 39
	ExternalReference_RISK_ASSESSMENT                         ExternalReference_ExternalReferenceType = 40
	ExternalReference_RUNTIME_ANALYSIS_REPORT                 ExternalReference_ExternalReferenceType = 41
	ExternalReference_SECURE_SOFTWARE_ATTESTATION             ExternalReference_ExternalReferenceType = 42
	ExternalReference_SECURITY_ADVERSARY_MODEL                ExternalReference_ExternalReferenceType = 43
	ExternalReference_SECURITY_ADVISORY                       ExternalReference_ExternalReferenceType = 44
	ExternalReference_SECURITY_CONTACT                        ExternalReference_ExternalReferenceType = 45
	ExternalReference_SECURITY_FIX                            ExternalReference_ExternalReferenceType = 46
	ExternalReference_SECURITY_OTHER                          ExternalReference_ExternalReferenceType = 47
	ExternalReference_SECURITY_PENTEST_REPORT                 ExternalReference_ExternalReferenceType = 48
	ExternalReference_SECURITY_POLICY                         ExternalReference_ExternalReferenceType = 49
	ExternalReference_SECURITY_SWID                           ExternalReference_ExternalReferenceType = 50
	ExternalReference_SECURITY_THREAT_MODEL                   ExternalReference_ExternalReferenceType = 51
	ExternalReference_SOCIAL                                  ExternalReference_ExternalReferenceType = 52
	ExternalReference_SOURCE_ARTIFACT                         ExternalReference_ExternalReferenceType = 53
	ExternalReference_STATIC_ANALYSIS_REPORT                  ExternalReference_ExternalReferenceType = 54
	ExternalReference_SUPPORT                                 ExternalReference_ExternalReferenceType = 55
	ExternalReference_VCS                                     ExternalReference_ExternalReferenceType = 56
	ExternalReference_VULNERABILITY_ASSERTION                 ExternalReference_ExternalReferenceType = 57
	ExternalReference_VULNERABILITY_DISCLOSURE_REPORT         ExternalReference_ExternalReferenceType = 58
	ExternalReference_VULNERABILITY_EXPLOITABILITY_ASSESSMENT ExternalReference_ExternalReferenceType = 59
	ExternalReference_WEBSITE                                 ExternalReference_ExternalReferenceType = 60
)

func (ExternalReference_ExternalReferenceType) Descriptor added in v0.3.0

func (ExternalReference_ExternalReferenceType) Enum added in v0.3.0

func (ExternalReference_ExternalReferenceType) EnumDescriptor deprecated added in v0.3.0

func (ExternalReference_ExternalReferenceType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ExternalReference_ExternalReferenceType.Descriptor instead.

func (ExternalReference_ExternalReferenceType) Number added in v0.3.0

func (ExternalReference_ExternalReferenceType) String added in v0.3.0

func (ExternalReference_ExternalReferenceType) Type added in v0.3.0

type HashAlgorithm

type HashAlgorithm int32
const (
	HashAlgorithm_UNKNOWN     HashAlgorithm = 0
	HashAlgorithm_MD5         HashAlgorithm = 1
	HashAlgorithm_SHA1        HashAlgorithm = 2
	HashAlgorithm_SHA256      HashAlgorithm = 3
	HashAlgorithm_SHA384      HashAlgorithm = 4
	HashAlgorithm_SHA512      HashAlgorithm = 5
	HashAlgorithm_SHA3_256    HashAlgorithm = 6
	HashAlgorithm_SHA3_384    HashAlgorithm = 7
	HashAlgorithm_SHA3_512    HashAlgorithm = 8
	HashAlgorithm_BLAKE2B_256 HashAlgorithm = 9
	HashAlgorithm_BLAKE2B_384 HashAlgorithm = 10
	HashAlgorithm_BLAKE2B_512 HashAlgorithm = 11
	HashAlgorithm_BLAKE3      HashAlgorithm = 12
	// 2DO what should we do
	HashAlgorithm_MD2     HashAlgorithm = 13 // Only supported by SPDX
	HashAlgorithm_ADLER32 HashAlgorithm = 14 // Only supported by SPDX
	HashAlgorithm_MD4     HashAlgorithm = 15 // Only supported by SPDX
	HashAlgorithm_MD6     HashAlgorithm = 16 // Only supported by SPDX
	HashAlgorithm_SHA224  HashAlgorithm = 17 // Only supported by SPDX
)

func HashAlgorithmFromCDX

func HashAlgorithmFromCDX(cdxAlgorithm cyclonedx.HashAlgorithm) HashAlgorithm

func HashAlgorithmFromCycloneDX

func HashAlgorithmFromCycloneDX(cdxAlgo cdx.HashAlgorithm) HashAlgorithm

func HashAlgorithmFromSPDX added in v0.2.0

func HashAlgorithmFromSPDX(spdxAlgo common.ChecksumAlgorithm) HashAlgorithm

func (HashAlgorithm) Descriptor

func (HashAlgorithm) Enum

func (x HashAlgorithm) Enum() *HashAlgorithm

func (HashAlgorithm) EnumDescriptor deprecated

func (HashAlgorithm) EnumDescriptor() ([]byte, []int)

Deprecated: Use HashAlgorithm.Descriptor instead.

func (HashAlgorithm) Number

func (HashAlgorithm) String

func (x HashAlgorithm) String() string

func (HashAlgorithm) ToSPDX

ToSPDX returns the SPDX label equivalent of the HashAlgorithm

func (HashAlgorithm) ToSPDX3 added in v0.2.0

func (ha HashAlgorithm) ToSPDX3() string

ToSPDX3 converts the hash algorithm enumeration to an SPDX3 algorithm label. As the SPDX3 spec is still changing these values could change at any moment while we track changers to the vocabulary defined here: https://github.com/spdx/spdx-3-model/blob/main/model/Core/Vocabularies/HashAlgorithm.md

func (HashAlgorithm) Type

type Metadata

type Metadata struct {
	Id            string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`           // Serial number in cyclone, SPDXID in spdx
	Version       string                 `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // Int in CDX, but lets string it to capture other possible schemes
	Name          string                 `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Date          *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=date,proto3" json:"date,omitempty"` // created date in spdx
	Tools         []*Tool                `protobuf:"bytes,5,rep,name=tools,proto3" json:"tools,omitempty"`
	Authors       []*Person              `protobuf:"bytes,6,rep,name=authors,proto3" json:"authors,omitempty"`
	Comment       string                 `protobuf:"bytes,7,opt,name=comment,proto3" json:"comment,omitempty"`
	DocumentTypes []*DocumentType        `protobuf:"bytes,8,rep,name=documentTypes,proto3" json:"documentTypes,omitempty"`
	// contains filtered or unexported fields
}

func (*Metadata) Descriptor deprecated

func (*Metadata) Descriptor() ([]byte, []int)

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetAuthors

func (x *Metadata) GetAuthors() []*Person

func (*Metadata) GetComment

func (x *Metadata) GetComment() string

func (*Metadata) GetDate

func (x *Metadata) GetDate() *timestamppb.Timestamp

func (*Metadata) GetDocumentTypes added in v0.2.0

func (x *Metadata) GetDocumentTypes() []*DocumentType

func (*Metadata) GetId

func (x *Metadata) GetId() string

func (*Metadata) GetName

func (x *Metadata) GetName() string

func (*Metadata) GetTools

func (x *Metadata) GetTools() []*Tool

func (*Metadata) GetVersion

func (x *Metadata) GetVersion() string

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect

func (x *Metadata) ProtoReflect() protoreflect.Message

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) String

func (x *Metadata) String() string

type Node

type Node struct {
	Id                 string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Type               Node_NodeType          `protobuf:"varint,2,opt,name=type,proto3,enum=bomsquad.protobom.Node_NodeType" json:"type,omitempty"`
	Name               string                 `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Version            string                 `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`                                           // Version string
	FileName           string                 `protobuf:"bytes,5,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`                         // Package filename when there is one
	UrlHome            string                 `protobuf:"bytes,6,opt,name=url_home,json=urlHome,proto3" json:"url_home,omitempty"`                            // Website of the packge
	UrlDownload        string                 `protobuf:"bytes,7,opt,name=url_download,json=urlDownload,proto3" json:"url_download,omitempty"`                // Location to download the package
	Licenses           []string               `protobuf:"bytes,8,rep,name=licenses,proto3" json:"licenses,omitempty"`                                         // Multiple for CDX 1.4, files in SPDX. Ideally license expressions
	LicenseConcluded   string                 `protobuf:"bytes,9,opt,name=license_concluded,json=licenseConcluded,proto3" json:"license_concluded,omitempty"` // This is only in SPDX and it is just one
	LicenseComments    string                 `protobuf:"bytes,10,opt,name=license_comments,json=licenseComments,proto3" json:"license_comments,omitempty"`
	Copyright          string                 `protobuf:"bytes,11,opt,name=copyright,proto3" json:"copyright,omitempty"`
	SourceInfo         string                 `protobuf:"bytes,13,opt,name=source_info,json=sourceInfo,proto3" json:"source_info,omitempty"` // any relevant background information or additional comments about the origin
	Comment            string                 `protobuf:"bytes,15,opt,name=comment,proto3" json:"comment,omitempty"`
	Summary            string                 `protobuf:"bytes,16,opt,name=summary,proto3" json:"summary,omitempty"`         // Short package description
	Description        string                 `protobuf:"bytes,17,opt,name=description,proto3" json:"description,omitempty"` // Package description (full)
	Attribution        []string               `protobuf:"bytes,18,rep,name=attribution,proto3" json:"attribution,omitempty"` // One or more attribution texts
	Suppliers          []*Person              `protobuf:"bytes,19,rep,name=suppliers,proto3" json:"suppliers,omitempty"`
	Originators        []*Person              `protobuf:"bytes,20,rep,name=originators,proto3" json:"originators,omitempty"`
	ReleaseDate        *timestamppb.Timestamp `protobuf:"bytes,21,opt,name=release_date,json=releaseDate,proto3" json:"release_date,omitempty"`
	BuildDate          *timestamppb.Timestamp `protobuf:"bytes,22,opt,name=build_date,json=buildDate,proto3" json:"build_date,omitempty"`
	ValidUntilDate     *timestamppb.Timestamp `protobuf:"bytes,23,opt,name=valid_until_date,json=validUntilDate,proto3" json:"valid_until_date,omitempty"`
	ExternalReferences []*ExternalReference   `protobuf:"bytes,24,rep,name=external_references,json=externalReferences,proto3" json:"external_references,omitempty"`
	FileTypes          []string               `protobuf:"bytes,27,rep,name=file_types,json=fileTypes,proto3" json:"file_types,omitempty"` // File types
	Identifiers        map[int32]string       ``                                                                                          // Software identifiers
	/* 165-byte string literal not displayed */
	Hashes         map[int32]string `` /* 155-byte string literal not displayed */
	PrimaryPurpose []Purpose        `` /* 143-byte string literal not displayed */
	// contains filtered or unexported fields
}

func NewNode added in v0.2.0

func NewNode() *Node

func (*Node) AddHash added in v0.2.0

func (n *Node) AddHash(algo HashAlgorithm, value string)

AddHash adds a new hash of algorithm algo to the node. If the node already has a hash of the same algorithm it will get silently replaced.

func (*Node) Augment

func (n *Node) Augment(n2 *Node)

Augment takes updates fields in n with data from n2 which is not already defined (not empty string, not 0 length string, not nill pointer).

func (*Node) Checksum added in v0.2.0

func (n *Node) Checksum() string

Checksum returns a a sha256 hash representing the node's data

func (*Node) Copy

func (n *Node) Copy() *Node

Copy returns a new node that is a copy of the node

func (*Node) Descriptor deprecated

func (*Node) Descriptor() ([]byte, []int)

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) Diff added in v0.2.0

func (n *Node) Diff(n2 *Node) *NodeDiff

Diff analyses a node and returns a a new node populated with all fields that are different in n2 from n. If no changes are found, Diff returns nil

func (*Node) Equal

func (n *Node) Equal(n2 *Node) bool

Equal compares Node n to n2 and returns true if they are the same

func (*Node) GetAttribution

func (x *Node) GetAttribution() []string

func (*Node) GetBuildDate

func (x *Node) GetBuildDate() *timestamppb.Timestamp

func (*Node) GetComment

func (x *Node) GetComment() string

func (*Node) GetCopyright

func (x *Node) GetCopyright() string

func (*Node) GetDescription

func (x *Node) GetDescription() string

func (*Node) GetExternalReferences

func (x *Node) GetExternalReferences() []*ExternalReference

func (*Node) GetFileName

func (x *Node) GetFileName() string

func (*Node) GetFileTypes

func (x *Node) GetFileTypes() []string

func (*Node) GetHashes

func (x *Node) GetHashes() map[int32]string

func (*Node) GetId

func (x *Node) GetId() string

func (*Node) GetIdentifiers

func (x *Node) GetIdentifiers() map[int32]string

func (*Node) GetLicenseComments

func (x *Node) GetLicenseComments() string

func (*Node) GetLicenseConcluded

func (x *Node) GetLicenseConcluded() string

func (*Node) GetLicenses

func (x *Node) GetLicenses() []string

func (*Node) GetName

func (x *Node) GetName() string

func (*Node) GetOriginators

func (x *Node) GetOriginators() []*Person

func (*Node) GetPrimaryPurpose

func (x *Node) GetPrimaryPurpose() []Purpose

func (*Node) GetReleaseDate

func (x *Node) GetReleaseDate() *timestamppb.Timestamp

func (*Node) GetSourceInfo

func (x *Node) GetSourceInfo() string

func (*Node) GetSummary

func (x *Node) GetSummary() string

func (*Node) GetSuppliers

func (x *Node) GetSuppliers() []*Person

func (*Node) GetType

func (x *Node) GetType() Node_NodeType

func (*Node) GetUrlDownload

func (x *Node) GetUrlDownload() string

func (*Node) GetUrlHome

func (x *Node) GetUrlHome() string

func (*Node) GetValidUntilDate

func (x *Node) GetValidUntilDate() *timestamppb.Timestamp

func (*Node) GetVersion

func (x *Node) GetVersion() string

func (*Node) HashesMatch added in v0.2.0

func (n *Node) HashesMatch(th map[int32]string) bool

HashesMatch takes a map of hashes th and returns a boolean indicating if the test hashes match those of the node. The algorithm will only take into account algorithms that are common to the node and test set.

In other words, if th has any hashes in algorithms without a peer in the node, the function will ignore them and return true if others match, silently ignoring those missing in the node.

If either the node or the test hashes are empty, no match is assumed.

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

func (x *Node) ProtoReflect() protoreflect.Message

func (*Node) Purl

func (n *Node) Purl() PackageURL

Purl returns the node purl as a string

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

func (*Node) Update

func (n *Node) Update(n2 *Node)

Update updates a node's fields with information from the second node Any fields in n2 which are not null (empty string, lists longer than 0 or not nill pointers will overwrite fields in Node n.

type NodeDiff added in v0.2.0

type NodeDiff struct {
	Added     *Node
	Removed   *Node
	DiffCount int
}

type NodeList

type NodeList struct {
	Nodes        []*Node  `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
	Edges        []*Edge  `protobuf:"bytes,2,rep,name=edges,proto3" json:"edges,omitempty"`
	RootElements []string `protobuf:"bytes,3,rep,name=root_elements,json=rootElements,proto3" json:"root_elements,omitempty"`
	// contains filtered or unexported fields
}

func NewNodeList added in v0.2.0

func NewNodeList() *NodeList

func (*NodeList) Add

func (nl *NodeList) Add(nl2 *NodeList)

Add combines NodeList nl2 into nl. It is the equivalent to Union but instead of returning a new NodeList it modifies nl.

func (*NodeList) AddEdge

func (nl *NodeList) AddEdge(e *Edge)

func (*NodeList) AddNode

func (nl *NodeList) AddNode(n *Node)

func (*NodeList) AddRootNode added in v0.2.0

func (nl *NodeList) AddRootNode(n *Node)

AddRootNode adds a node to the nodelist and alos registers it to the RootElements list.

func (*NodeList) Descriptor deprecated

func (*NodeList) Descriptor() ([]byte, []int)

Deprecated: Use NodeList.ProtoReflect.Descriptor instead.

func (*NodeList) Equal

func (nl *NodeList) Equal(nl2 *NodeList) bool

Equal returns true if the NodeList nl is equal to nl2

func (*NodeList) GetEdgeByType

func (nl *NodeList) GetEdgeByType(fromElement string, t Edge_Type) *Edge

GetEdgeByType returns a pointer to the first edge found from fromElement of type t.

func (*NodeList) GetEdges

func (x *NodeList) GetEdges() []*Edge

func (*NodeList) GetMatchingNode added in v0.2.0

func (nl *NodeList) GetMatchingNode(node *Node) (*Node, error)

GetMatchingNode looks up a node in the NodeList that matches the piece of software described by testNode. It will not match on ID but rather matching is performed by hash then by purl.

This function is guaranteed to only return a node when there is a single node match. If more than one node matches, an ErrorMoreThanOneMatch is returned.

See node.HashesMatch to understand how hashes are compared.

func (*NodeList) GetNodeByID

func (nl *NodeList) GetNodeByID(id string) *Node

GetNodeByID returns a node with the specified ID

func (*NodeList) GetNodes

func (x *NodeList) GetNodes() []*Node

func (*NodeList) GetNodesByIdentifier

func (nl *NodeList) GetNodesByIdentifier(t, v string) []*Node

GetNodesByIdentifier returns nodes that match an identifier of type t and value v, for example t = "purl" v = "pkg:deb/debian/libpam-modules@1.4.0-9+deb11u1?arch=i386" Not that this only does "dumb" string matching no assumptions are made on the identifier type.

func (*NodeList) GetNodesByName

func (nl *NodeList) GetNodesByName(name string) []*Node

GetNodesByName returns a list of node pointers whose name equals name

func (*NodeList) GetNodesByPurlType

func (nl *NodeList) GetNodesByPurlType(purlType string) *NodeList

GetNodesByPurlType returns a nodelist containing all nodes that match a purl (package url) type. An empty purlType returns a blank nodelist

func (*NodeList) GetRootElements

func (x *NodeList) GetRootElements() []string

func (*NodeList) GetRootNodes

func (nl *NodeList) GetRootNodes() []*Node

GetRootNodes returns a list of pointers of the root nodes of the document

func (*NodeList) Intersect

func (nl *NodeList) Intersect(nl2 *NodeList) *NodeList

Intersect returns a new NodeList with nodes which are common in nl and nl2. All common nodes will be copied from nl and then `Update`d with data from nl2

func (*NodeList) NodeDescendants added in v0.2.0

func (nl *NodeList) NodeDescendants(id string, maxDepth int) *NodeList

NodeDescendants traverses the NodeList graph starting at the node specified by id and returns a new node list with elements related at a maximal distance of maxDepth levels. If the specified id is not found, the NodeList will be empty. Traversing the graph will stop if any of the related nodes is a RootNode.

func (*NodeList) NodeGraph added in v0.2.0

func (nl *NodeList) NodeGraph(id string) *NodeList

NodeGraph looks for node id and returns a new NodeList with its full dependency graph. NodeGraph will traverse the SBOM graph and add all nodes connected to id.

func (*NodeList) NodeSiblings added in v0.2.0

func (nl *NodeList) NodeSiblings(id string) *NodeList

NodeSiblings takes a node identifier `id` and returns a NodeList with the node at the top and the immediate siblings that are related to it.

func (*NodeList) ProtoMessage

func (*NodeList) ProtoMessage()

func (*NodeList) ProtoReflect

func (x *NodeList) ProtoReflect() protoreflect.Message

func (*NodeList) RelateNodeAtID added in v0.2.0

func (nl *NodeList) RelateNodeAtID(n *Node, nodeID string, edgeType Edge_Type) error

RelateNodeAtID creates a relationship between Node n and an existing node in the NodeList specified by nodeID. If the node (as looked up by ID) does not not exist in the NodeList it will be added. If NodeID does not exist an error will be returned.

func (*NodeList) RelateNodeListAtID

func (nl *NodeList) RelateNodeListAtID(nl2 *NodeList, nodeID string, edgeType Edge_Type) error

RelateNodeListAtID relates the top level nodes in nl2 to the node with ID nodeID using a relationship of type edgeType. Returns an error if nodeID cannot be found in the graph. This function assumes that nodes in nl and nl2 having the same ID are equivalent and will be deduped.

func (*NodeList) RemoveNodes

func (nl *NodeList) RemoveNodes(ids []string)

RemoveNodes removes a list of nodes and its edges from the nodelist

func (*NodeList) Reset

func (x *NodeList) Reset()

func (*NodeList) String

func (x *NodeList) String() string

func (*NodeList) Union

func (nl *NodeList) Union(nl2 *NodeList) *NodeList

Union returns a new NodeList with all nodes from nl and nl2 joined together any nodes common in nl also found in nl2 will be `Update`d from data from the former.

type Node_NodeType

type Node_NodeType int32
const (
	Node_PACKAGE Node_NodeType = 0
	Node_FILE    Node_NodeType = 1
)

func (Node_NodeType) Descriptor

func (Node_NodeType) Enum

func (x Node_NodeType) Enum() *Node_NodeType

func (Node_NodeType) EnumDescriptor deprecated

func (Node_NodeType) EnumDescriptor() ([]byte, []int)

Deprecated: Use Node_NodeType.Descriptor instead.

func (Node_NodeType) Number

func (Node_NodeType) String

func (x Node_NodeType) String() string

func (Node_NodeType) Type

type PackageURL

type PackageURL string

type Person

type Person struct {
	Name     string    `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	IsOrg    bool      `protobuf:"varint,2,opt,name=is_org,json=isOrg,proto3" json:"is_org,omitempty"`
	Email    string    `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	Url      string    `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`
	Phone    string    `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"`       // CDX
	Contacts []*Person `protobuf:"bytes,6,rep,name=contacts,proto3" json:"contacts,omitempty"` // CDX // Support?
	// contains filtered or unexported fields
}

func (*Person) Copy added in v0.2.0

func (p *Person) Copy() *Person

Copy returns a new Person pointer which is a duplicate of Person p. The copy is recursive into the Contacts array.

func (*Person) Descriptor deprecated

func (*Person) Descriptor() ([]byte, []int)

Deprecated: Use Person.ProtoReflect.Descriptor instead.

func (*Person) GetContacts

func (x *Person) GetContacts() []*Person

func (*Person) GetEmail

func (x *Person) GetEmail() string

func (*Person) GetIsOrg

func (x *Person) GetIsOrg() bool

func (*Person) GetName

func (x *Person) GetName() string

func (*Person) GetPhone

func (x *Person) GetPhone() string

func (*Person) GetUrl

func (x *Person) GetUrl() string

func (*Person) ProtoMessage

func (*Person) ProtoMessage()

func (*Person) ProtoReflect

func (x *Person) ProtoReflect() protoreflect.Message

func (*Person) Reset

func (x *Person) Reset()

func (*Person) String

func (x *Person) String() string

func (*Person) ToSPDX2ClientOrg

func (p *Person) ToSPDX2ClientOrg() string

ToSPDX2ClientOrg returns a string representing the type of actor to use in the SPDX go-tools, basically it will returns "Organization" or "Person"

func (*Person) ToSPDX2ClientString

func (p *Person) ToSPDX2ClientString() string

ToSPDX2ClientString converts the person to an SPDX actor string (not valid for an SBOM but to feed into the SPDX go-tools).

type Purpose added in v0.2.0

type Purpose int32
const (
	Purpose_UNKNOWN_PURPOSE        Purpose = 0
	Purpose_APPLICATION            Purpose = 1  // SPDX2.3, CDX1.5, SPDX3.0
	Purpose_ARCHIVE                Purpose = 2  // SPDX2.3, SPDX3.0
	Purpose_BOM                    Purpose = 3  // SPDX3.0
	Purpose_CONFIGURATION          Purpose = 4  // SPDX3.0
	Purpose_CONTAINER              Purpose = 5  // SPDX2.3, CDX1.5, SPDX3.0
	Purpose_DATA                   Purpose = 6  // CDX1.5, SPDX3.0
	Purpose_DEVICE                 Purpose = 7  // SPDX2.3, CDX1.5, SPDX3.0
	Purpose_DEVICE_DRIVER          Purpose = 8  // CDX1.5, SPDX3.0
	Purpose_DOCUMENTATION          Purpose = 9  // SPDX3.0
	Purpose_EVIDENCE               Purpose = 10 // SPDX3.0
	Purpose_EXECUTABLE             Purpose = 11 // SPDX3.0
	Purpose_FILE                   Purpose = 12 // SPDX2.3, CDX1.5, SPDX3.0
	Purpose_FIRMWARE               Purpose = 13 // SPDX2.3, CDX1.5, SPDX3.0
	Purpose_FRAMEWORK              Purpose = 14 // SPDX2.3, CDX1.5, SPDX3.0
	Purpose_INSTALL                Purpose = 15 // SPDX2.3, SPDX3.0
	Purpose_LIBRARY                Purpose = 16 // SPDX2.3, CDX1.5, SPDX3.0
	Purpose_MACHINE_LEARNING_MODEL Purpose = 17 // CDX1.5
	Purpose_MANIFEST               Purpose = 18 // SPDX3.0
	Purpose_MODEL                  Purpose = 19 // SPDX3.0
	Purpose_MODULE                 Purpose = 20 // SPDX3.0
	Purpose_OPERATING_SYSTEM       Purpose = 21 // SPDX2.3, CDX1.5, SPDX3.0
	Purpose_OTHER                  Purpose = 22 // SPDX2.3, SPDX3.0
	Purpose_PATCH                  Purpose = 23 // SPDX3.0
	Purpose_PLATFORM               Purpose = 24 // SPDX2.3, CDX1.5, SPDX3.0
	Purpose_REQUIREMENT            Purpose = 25 // SPDX3.0
	Purpose_SOURCE                 Purpose = 26 // SPDX2.3, SPDX3.0
	Purpose_SPECIFICATION          Purpose = 27 // SPDX3.0
	Purpose_TEST                   Purpose = 28 // SPDX3.0
)

func (Purpose) Descriptor added in v0.2.0

func (Purpose) Descriptor() protoreflect.EnumDescriptor

func (Purpose) Enum added in v0.2.0

func (x Purpose) Enum() *Purpose

func (Purpose) EnumDescriptor deprecated added in v0.2.0

func (Purpose) EnumDescriptor() ([]byte, []int)

Deprecated: Use Purpose.Descriptor instead.

func (Purpose) Number added in v0.2.0

func (x Purpose) Number() protoreflect.EnumNumber

func (Purpose) String added in v0.2.0

func (x Purpose) String() string

func (Purpose) Type added in v0.2.0

func (Purpose) Type() protoreflect.EnumType

type SoftwareIdentifierType added in v0.2.0

type SoftwareIdentifierType int32
const (
	SoftwareIdentifierType_UNKNOWN_IDENTIFIER_TYPE SoftwareIdentifierType = 0
	SoftwareIdentifierType_PURL                    SoftwareIdentifierType = 1
	SoftwareIdentifierType_CPE22                   SoftwareIdentifierType = 2
	SoftwareIdentifierType_CPE23                   SoftwareIdentifierType = 3
	SoftwareIdentifierType_GITOID                  SoftwareIdentifierType = 4
)

func SoftwareIdentifierTypeFromSPDXExtRefType deprecated added in v0.2.0

func SoftwareIdentifierTypeFromSPDXExtRefType(spdxType string) SoftwareIdentifierType

Deprecated: SoftwareIdentifierTypeFromSPDXExtRefType is deprecated and will be removed in an upcoming version.

func SoftwareIdentifierTypeFromString added in v0.2.0

func SoftwareIdentifierTypeFromString(queryString string) SoftwareIdentifierType

SoftwareIdentifierTypeFromString resolves a string into one of our built-in identifier types

func (SoftwareIdentifierType) Descriptor added in v0.2.0

func (SoftwareIdentifierType) Enum added in v0.2.0

func (SoftwareIdentifierType) EnumDescriptor deprecated added in v0.2.0

func (SoftwareIdentifierType) EnumDescriptor() ([]byte, []int)

Deprecated: Use SoftwareIdentifierType.Descriptor instead.

func (SoftwareIdentifierType) Number added in v0.2.0

func (SoftwareIdentifierType) String added in v0.2.0

func (x SoftwareIdentifierType) String() string

func (SoftwareIdentifierType) ToSPDX2Category added in v0.2.0

func (i SoftwareIdentifierType) ToSPDX2Category() string

ToSPDX2Category returns the type of the external reference in the spdx 2.x vocabulary.

func (SoftwareIdentifierType) ToSPDX2Type added in v0.2.0

func (i SoftwareIdentifierType) ToSPDX2Type() string

ToSPDX2Type converts the external reference type to the SPDX 2.x equivalent.

func (SoftwareIdentifierType) Type added in v0.2.0

type Tool

type Tool struct {
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Vendor  string `protobuf:"bytes,3,opt,name=vendor,proto3" json:"vendor,omitempty"`
	// contains filtered or unexported fields
}

func (*Tool) Descriptor deprecated

func (*Tool) Descriptor() ([]byte, []int)

Deprecated: Use Tool.ProtoReflect.Descriptor instead.

func (*Tool) GetName

func (x *Tool) GetName() string

func (*Tool) GetVendor

func (x *Tool) GetVendor() string

func (*Tool) GetVersion

func (x *Tool) GetVersion() string

func (*Tool) ProtoMessage

func (*Tool) ProtoMessage()

func (*Tool) ProtoReflect

func (x *Tool) ProtoReflect() protoreflect.Message

func (*Tool) Reset

func (x *Tool) Reset()

func (*Tool) String

func (x *Tool) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL