Skip to content

Support for concludedValue in evidence/identity - #260

Open
goldmann wants to merge 1 commit into
CycloneDX:masterfrom
goldmann:evidence-identity-concludedvalue
Open

Support for concludedValue in evidence/identity#260
goldmann wants to merge 1 commit into
CycloneDX:masterfrom
goldmann:evidence-identity-concludedvalue

Conversation

@goldmann

Copy link
Copy Markdown

This adds missing support for serialization and deserialization of data that uses the evidence.identity[].concludedValue field which was introduced in CycloneDX 1.6.

https://cyclonedx.org/docs/1.6/json/#components_items_evidence_identity_oneOf_i0_items_concludedValue

This adds missing support for serialization and
deserialization of data that uses the
evidence.identity[].concludedValue field which was
introduced in CycloneDX 1.6.

https://cyclonedx.org/docs/1.6/json/#components_items_evidence_identity_oneOf_i0_items_concludedValue

Signed-off-by: Marek Goldmann <marek.goldmann@gmail.com>
@goldmann
goldmann requested a review from a team as a code owner February 26, 2026 10:14

@nscuro nscuro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update convert.go to strip this field when converting to spec versions < 1.6:

cyclonedx-go/convert.go

Lines 204 to 222 in 3ed34da

if specVersion < SpecVersion1_6 {
// Spec version 1.5 uses only one Identity.
// cf. https://cyclonedx.org/docs/1.5/json/#components_items_evidence_identity
if c.Evidence.Identity != nil {
ids := *c.Evidence.Identity
ids = ids[:1]
c.Evidence.Identity = &ids
}
if c.Evidence.Occurrences != nil {
for i := range *c.Evidence.Occurrences {
occ := &(*c.Evidence.Occurrences)[i]
occ.Line = nil
occ.Offset = nil
occ.Symbol = ""
occ.AdditionalContext = ""
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants