Skip to content

Commit

Permalink
Added support for concluded value. Updated test cases. (#412)
Browse files Browse the repository at this point in the history
Closes #411 

- [x] modify JSON schema
- [x] modify XML schema
- [x] modify protobuf schema
- [x] add examples & test resources
  • Loading branch information
stevespringett authored Mar 28, 2024
2 parents 2b8fd26 + 45db721 commit 6e90b46
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions schema/bom-1.6.proto
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ message EvidenceIdentity {
repeated EvidenceMethods methods = 3;
// The object in the BOM identified by its bom-ref. This is often a component or service, but may be any object type supporting bom-refs. Tools used for analysis should already be defined in the BOM, either in the metadata/tools, components, or formulation.
repeated string tools = 4;
// The value of the field (cpe, purl, etc) that has been concluded based on the aggregate of all methods (if available).
optional string concludedValue = 5;
}

message EvidenceMethods {
Expand Down
5 changes: 5 additions & 0 deletions schema/bom-1.6.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4447,6 +4447,11 @@
"title": "Confidence",
"description": "The overall confidence of the evidence from 0 - 1, where 1 is 100% confidence."
},
"concludedValue": {
"type": "string",
"title": "Concluded Value",
"description": "The value of the field (cpe, purl, etc) that has been concluded based on the aggregate of all methods (if available)."
},
"methods": {
"type": "array",
"title": "Methods",
Expand Down
5 changes: 5 additions & 0 deletions schema/bom-1.6.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2356,6 +2356,11 @@ limitations under the License.
<xs:documentation>The overall confidence of the evidence from 0 - 1, where 1 is 100% confidence.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="concludedValue" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>The value of the field (cpe, purl, etc) that has been concluded based on the aggregate of all methods (if available).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="methods" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>The methods used to extract and/or analyze the evidence.</xs:documentation>
Expand Down
3 changes: 3 additions & 0 deletions tools/src/test/resources/1.6/valid-evidence-1.6.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
{
"field": "group",
"confidence": 0.1,
"concludedValue": "com.example",
"methods": [
{
"technique": "filename",
Expand All @@ -128,6 +129,7 @@
{
"field": "name",
"confidence": 0.1,
"concludedValue": "example-project",
"methods": [
{
"technique": "filename",
Expand All @@ -139,6 +141,7 @@
{
"field": "version",
"confidence": 0.1,
"concludedValue": "1.0.0",
"methods": [
{
"technique": "filename",
Expand Down
3 changes: 3 additions & 0 deletions tools/src/test/resources/1.6/valid-evidence-1.6.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ components [
value: "example-project-1.0.0.jar"
}
]
concludedValue: "com.example"
},
{
field: EVIDENCE_FIELD_NAME
Expand All @@ -133,6 +134,7 @@ components [
value: "example-project-1.0.0.jar"
}
]
concludedValue: "example-project"
},
{
field: EVIDENCE_FIELD_VERSION
Expand All @@ -144,6 +146,7 @@ components [
value: "example-project-1.0.0.jar"
}
]
concludedValue: "1.0.0"
}
]
}
Expand Down
3 changes: 3 additions & 0 deletions tools/src/test/resources/1.6/valid-evidence-1.6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<identity>
<field>group</field>
<confidence>0.1</confidence>
<concludedValue>com.example</concludedValue>
<methods>
<method>
<technique>filename</technique>
Expand All @@ -108,6 +109,7 @@
<identity>
<field>name</field>
<confidence>0.1</confidence>
<concludedValue>example-project</concludedValue>
<methods>
<method>
<technique>filename</technique>
Expand All @@ -119,6 +121,7 @@
<identity>
<field>version</field>
<confidence>0.1</confidence>
<concludedValue>1.0.0</concludedValue>
<methods>
<method>
<technique>filename</technique>
Expand Down

0 comments on commit 6e90b46

Please sign in to comment.