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

Protobuf: Evidence.identity is repeated, but should be optional #272

Closed
nscuro opened this issue Jul 29, 2023 · 6 comments · Fixed by #359
Closed

Protobuf: Evidence.identity is repeated, but should be optional #272

nscuro opened this issue Jul 29, 2023 · 6 comments · Fixed by #359
Assignees
Labels
Milestone

Comments

@nscuro
Copy link
Member

nscuro commented Jul 29, 2023

The identity field of Evidence is repeated in the current v1.5 Protobuf schema, whereas it is a singular object in the JSON and XML variants of the schema.

message Evidence {
repeated LicenseChoice licenses = 1;
repeated EvidenceCopyright copyright = 2;
repeated EvidenceIdentity identity = 3;
repeated EvidenceOccurrences occurrences = 4;
optional Callstack callstack = 5;
}

"componentEvidence": {
"type": "object",
"title": "Evidence",
"description": "Provides the ability to document evidence collected through various forms of extraction or analysis.",
"additionalProperties": false,
"properties": {
"identity": {
"type": "object",
"description": "Evidence that substantiates the identity of a component.",
"required": [ "field" ],
"additionalProperties": false,
"properties": {

<xs:complexType name="componentEvidenceType">
<xs:sequence>
<xs:element name="identity" minOccurs="0" maxOccurs="1">

As the field is not required, it should be optional.

@stevespringett stevespringett self-assigned this Dec 9, 2023
@stevespringett stevespringett added this to the 1.6 milestone Dec 9, 2023
@prabhu
Copy link
Contributor

prabhu commented Dec 24, 2023

Am I correct in assuming that even Evidence must be optional as shown in the below commit?

AppThreat/cdx-proto@3b57244?diff=split&w=1#diff-8dd4e24a6bce8169f7ec43877352e1f85f2c5cf66b8f0733b1957c7f540e6861

I think in 1.6, we need to add some conformance tests where we serialize using proto and then attempt to deserialize and read as json and vice versa.

@stevespringett
Copy link
Member

Actually, the defect is in the JSON and XML schemas. In this case, the protobuf is correct. Identity should be an array.

@stevespringett
Copy link
Member

I think in 1.6, we need to add some conformance tests where we serialize using proto and then attempt to deserialize and read as json and vice versa.

I think there's some tests that are performed in .NET. Perhaps @coderpatros can shed some light.

@prabhu
Copy link
Contributor

prabhu commented Dec 27, 2023

Actually, the defect is in the JSON and XML schemas. In this case, the protobuf is correct. Identity should be an array.

This would be a large breaking change for cdxgen and depscan users since the identity object is used quite heavily

@stevespringett
Copy link
Member

This would be a large breaking change for cdxgen and depscan users since the identity object is used quite heavily

How would this be a breaking change? The unit tests, which incorporate both single object and arrays, are passing validation. There will be no changes required in cdxgen or depscan, although the current method (single object) has been deprecated. So implementations will be encouraged to update to supporting arrays. But no functionality is breaking.

@jkowalleck jkowalleck linked a pull request Jan 13, 2024 that will close this issue
stevespringett added a commit that referenced this issue Jan 16, 2024
Fixed issue with evidence identity that restricted identity to only a
single object. The defect was found in JSON and XML schemas but was
correct in protobuf. Updated JSON and XML schemas in a way where they
are backward compatible. Updated test cases in v1.6 that support BOTH
methods (single object and array of objects) of specifying identity
evidence.

Closes #272
@stevespringett
Copy link
Member

Fix will be included in v1.6

@jkowalleck jkowalleck mentioned this issue Jan 16, 2024
stevespringett added a commit that referenced this issue Apr 9, 2024
## Added

* Core enhancement: Attestation
([#192](#192) via
[#348](#348))
* Core enhancement: Cryptography Bill of Materials — CBOM
([#171](#171),
[#291](#291) via
[#347](#347))
* Feature to express the URL to source distribution
([#98](#98) via
[#269](#269))
* Feature to express the URL to RFC 9116 compliant documents
([#380](#380) via
[#381](#381))
* Feature to express tags/keywords for services and components (via
[#383](#383))
* Feature to express details for component authors
([#335](#335) via
[#379](#379))
* Feature to express details for component and BOM manufacturer
([#346](#346) via
[#379](#379))
* Feature to express communicate concluded values from observed
evidences ([#411](#411)
via [#412](#412))
* Features to express license acknowledgement
([#407](#407) via
[#408](#408))
* Feature to express environmental consideration information for model
cards ([#396](#396) via
[#395](#395))
* Feature to express the address of organizational entities (via
[#395](#395))
* Feature to express additional component identifiers: Universal Bill Of
Receipts Identifier and Software Heritage persistent IDs
([#413](#413) via
[#414](#414))

## Fixed

* Allow multiple evidence identities by XML/JSON schema
([#272](#272) via
[#359](#359))
  This was already correct via ProtoBuff schema.
* Prevent empty `license` entities by XML schema
([#288](#288) via
[#292](#292))
  This was already correct in JSON/ProtoBuff schema.
* Prevent empty or malformed `property` entities by JSON schema
([#371](#371) via
[#375](#375))
  This was already correct in XML/ProtoBuff schema.
* Allow multiple `licenses` in `Metadata` by ProtoBuff schema
([#264](#264) via
[#401](#401))
  This was already correct in XML/JSON schema.

## Changed

* Allow arbitrary `$schema` values by JSON schema
([#402](#402) via
[#403](#403))
* Increased max length of `versionRange` (via
[`3e01ce6`](3e01ce6))
* Harmonized length of `version` (via
[#417](#417))

## Deprecated

* Data model "Component"'s field `author` was deprecated. (via
[#379](#379))
  Use field `authors` or field `manufacturer` instead.
* Data model "Metadata"'s field `manufacture` was deprecated.
([#346](#346) via
[#379](#379))
  Use "Metadata"'s field `component`'s field `manufacturer` instead. 
  - for XML: `/bom/metadata/component/manufacturer`
  - for JSON: `$.metadata.component.manufacturer`
  - for ProtoBuf: `Bom:metadata.component.manufacturer`

## Documentation

* Centralize version and version-range (via
[#322](#322))
* Streamlined SPDX expression related descriptions (via
[#327](#327))
* Enhanced descriptions of `bom-ref`/`refType`
([#336](#336) via
[#344](#344))
* Enhanced readability of enum documentation in JSON schema
([#361](#361) via
[#362](#362))
* Fixed typo "compliment" -> "complement" (via
[#369](#369))
* Added documentation for enum "ComponentScope"'s values in JSON schema
([#293](#293) via
[`d92e58e`](d92e58e))
  Texts were a taken from the existing ones in XML/ProtoBuff schema.
* Added documentation for enum "TaskType"'s values
([#245](#245) via
[#377](#377))
* Improve documentation for data model "Metadata"'s field `licenses`
([#273](#273) via
[#378](#378))
* Added documentation for enum "MachineLearningApproachType"'s values
([#351](#351) via
[#416](#416))
* Rephrased some texts here and there.

## Test data

* Added test data for newly added use cases
* Added quality assurance for our ProtoBuf schemas
([#384](#384) via
[#385](#385))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants