Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump github.com/CycloneDX/cyclonedx-go from 0.6.0 to 0.7.0 #15081

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ require (
)

require (
github.com/CycloneDX/cyclonedx-go v0.6.0
github.com/CycloneDX/cyclonedx-go v0.7.0
github.com/DataDog/go-libddwaf v0.0.0-20221118110754-0372d7c76b8a
github.com/go-redis/redis/v9 v9.0.0-rc.2
github.com/safchain/baloum v0.0.0-20221229104256-b1fc8f70a86b
Expand Down
7 changes: 3 additions & 4 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions pkg/collector/corechecks/sbom/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ type inArrayElement interface {
cyclonedx.Tool |
cyclonedx.Vulnerability |
cyclonedx.VulnerabilityRating |
cyclonedx.VulnerabilityReference
cyclonedx.VulnerabilityReference |
string
}

type outArrayElement interface {
Expand Down Expand Up @@ -125,7 +126,7 @@ func convertBOM(in *cyclonedx.BOM) *cyclonedx_v1_4.Bom {
}

return &cyclonedx_v1_4.Bom{
SpecVersion: in.SpecVersion,
SpecVersion: in.SpecVersion.String(),
Version: pointer.Int32Ptr(int32(in.Version)),
SerialNumber: stringPtr(in.SerialNumber),
Metadata: convertMetadata(in.Metadata),
Expand Down Expand Up @@ -295,7 +296,17 @@ func convertDependency(in *cyclonedx.Dependency) *cyclonedx_v1_4.Dependency {

return &cyclonedx_v1_4.Dependency{
Ref: in.Ref,
Dependencies: convertArray(in.Dependencies, convertDependency),
Dependencies: convertArray(in.Dependencies, convertDependencyString),
}
}

func convertDependencyString(in *string) *cyclonedx_v1_4.Dependency {
if in == nil {
return nil
}

return &cyclonedx_v1_4.Dependency{
Ref: *in,
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/collector/corechecks/sbom/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestProcessEvents(t *testing.T) {
ID: strconv.Itoa(i),
},
CycloneDXBOM: &cyclonedx.BOM{
SpecVersion: "1.4",
SpecVersion: cyclonedx.SpecVersion1_4,
Version: 42,
Components: &[]cyclonedx.Component{
{
Expand Down