-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: decouple metadata from its component (#379)
The following changes were made with the intent to not introduce breaking changes, neither syntactic nor semantic(!) ## Changes - add `component.manufacturer` as "OrganizationalEntity" -- fixes #346 - add `component.authors` as list of "OrganizationalContact" -- fixes #335 - deprecate `component.author` in favour of `component.authors` and `component.manufacturer` - reason: value was described to be a string that could represent person(s) or organization(s). So let's introduce dedicated fields for both of these: Organizations are represented by the new `@.manufacturer` & persons are represented by the new `@.authors`. - add `metatada.manufaturer` as "OrganizationalEntity" -- fixes #57 - deprecate `metatada.manufature` in favour of `metadata.component.manufacturer` -- fixes #346 ---- ## TODO - [x] update JSON schema - [x] update XSD - [x] update protobuff schema - [x] add examples and test resources ## Follow up tasks - [ ] update use cases on the Website - [ ] update SBOM guide - [ ] create a BC task for 2.0: remove deprecated `metadata.manufacture` - [ ] create a BC task for 2.0: remove deprecated `component.author`
- Loading branch information
Showing
12 changed files
with
201 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ | |
} | ||
} | ||
}, | ||
"manufacture": { | ||
"manufacturer": { | ||
"name": "Acme, Inc.", | ||
"url": [ | ||
"https://example.com" | ||
|
@@ -74,6 +74,7 @@ | |
{ | ||
"bom-ref": "pkg:npm/acme/[email protected]", | ||
"type": "library", | ||
"author": "Joane Doe et al.", | ||
"publisher": "Acme Inc", | ||
"group": "com.acme", | ||
"name": "tomcat-catalina", | ||
|
@@ -160,7 +161,28 @@ | |
} | ||
] | ||
}, | ||
"author": "Example Super Heros", | ||
"manufacturer": { | ||
"name": "Example-2, Inc.", | ||
"url": [ | ||
"https://example.org" | ||
], | ||
"contact": [ | ||
{ | ||
"email": "[email protected]" | ||
} | ||
] | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Anthony Edward Stark", | ||
"phone": "555-212-970-4133", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Peter Benjamin Parker", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"group": "org.example", | ||
"name": "mylibrary", | ||
"version": "1.0.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,26 +40,27 @@ metadata { | |
} | ||
} | ||
} | ||
manufacture { | ||
supplier { | ||
name: "Acme, Inc." | ||
url: "https://example.com" | ||
contact { | ||
name: "Acme Professional Services" | ||
email: "professional.services@example.com" | ||
name: "Acme Distribution" | ||
email: "distribution@example.com" | ||
} | ||
} | ||
supplier { | ||
manufacturer { | ||
name: "Acme, Inc." | ||
url: "https://example.com" | ||
contact { | ||
name: "Acme Distribution" | ||
email: "distribution@example.com" | ||
name: "Acme Professional Services" | ||
email: "professional.services@example.com" | ||
} | ||
} | ||
} | ||
components { | ||
type: CLASSIFICATION_LIBRARY | ||
bom_ref: "pkg:npm/acme/[email protected]" | ||
author: "Joane Doe et al." | ||
publisher: "Acme Inc" | ||
group: "com.acme" | ||
name: "tomcat-catalina" | ||
|
@@ -141,6 +142,22 @@ components { | |
group: "org.example" | ||
name: "mylibrary" | ||
version: "1.0.0" | ||
manufacturer { | ||
name: "Example-2, Inc." | ||
url: "https://example.org" | ||
contact { | ||
email: "[email protected]" | ||
} | ||
} | ||
authors { | ||
name: "Anthony Edward Stark" | ||
email: "[email protected]" | ||
phone: "555-212-970-4133" | ||
} | ||
authors { | ||
name: "Peter Benjamin Parker" | ||
email: "[email protected]" | ||
} | ||
} | ||
dependencies { | ||
ref: "pkg:npm/acme/[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,14 +28,14 @@ | |
<text content-type="text/xml" encoding="base64">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiID8+CjxTb2Z0d2FyZUlkZW50aXR5IHhtbDpsYW5nPSJFTiIgbmFtZT0iQWNtZSBBcHBsaWNhdGlvbiIgdmVyc2lvbj0iOS4xLjEiIAogdmVyc2lvblNjaGVtZT0ibXVsdGlwYXJ0bnVtZXJpYyIgCiB0YWdJZD0ic3dpZGdlbi1iNTk1MWFjOS00MmMwLWYzODItM2YxZS1iYzdhMmE0NDk3Y2JfOS4xLjEiIAogeG1sbnM9Imh0dHA6Ly9zdGFuZGFyZHMuaXNvLm9yZy9pc28vMTk3NzAvLTIvMjAxNS9zY2hlbWEueHNkIj4gCiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiAKIHhzaTpzY2hlbWFMb2NhdGlvbj0iaHR0cDovL3N0YW5kYXJkcy5pc28ub3JnL2lzby8xOTc3MC8tMi8yMDE1LWN1cnJlbnQvc2NoZW1hLnhzZCBzY2hlbWEueHNkIiA+CiAgPE1ldGEgZ2VuZXJhdG9yPSJTV0lEIFRhZyBPbmxpbmUgR2VuZXJhdG9yIHYwLjEiIC8+IAogIDxFbnRpdHkgbmFtZT0iQWNtZSwgSW5jLiIgcmVnaWQ9ImV4YW1wbGUuY29tIiByb2xlPSJ0YWdDcmVhdG9yIiAvPiAKPC9Tb2Z0d2FyZUlkZW50aXR5Pg==</text> | ||
</swid> | ||
</component> | ||
<manufacture> | ||
<manufacturer> | ||
<name>Acme, Inc.</name> | ||
<url>https://example.com</url> | ||
<contact> | ||
<name>Acme Professional Services</name> | ||
<email>[email protected]</email> | ||
</contact> | ||
</manufacture> | ||
</manufacturer> | ||
<supplier> | ||
<name>Acme, Inc.</name> | ||
<url>https://example.com</url> | ||
|
@@ -47,7 +47,7 @@ | |
</metadata> | ||
<components> | ||
<component type="application"> | ||
<author>Acme Super Heros</author> | ||
<author>Joane Doe et al.</author> | ||
<publisher>Acme Inc</publisher> | ||
<group>com.acme</group> | ||
<name>tomcat-catalina</name> | ||
|
@@ -120,7 +120,24 @@ | |
<email>[email protected]</email> | ||
</contact> | ||
</supplier> | ||
<author>Example Super Heros</author> | ||
<manufacturer> | ||
<name>Example-2, Inc.Example-2, Inc.</name> | ||
<url>https://example.org</url> | ||
<contact> | ||
<email>[email protected]</email> | ||
</contact> | ||
</manufacturer> | ||
<authors> | ||
<author> | ||
<name>Anthony Edward Stark</name> | ||
<email>[email protected]</email> | ||
<phone>555-212-970-4133</phone> | ||
</author> | ||
<author> | ||
<name>Peter Benjamin Parker</name> | ||
<email>[email protected]</email> | ||
</author> | ||
</authors> | ||
<group>org.example</group> | ||
<name>mylibrary</name> | ||
<version>1.0.0</version> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tools/src/test/resources/1.6/valid-metadata-manufacturer-1.6.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"bomFormat": "CycloneDX", | ||
"specVersion": "1.6", | ||
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79", | ||
"version": 1, | ||
"metadata": { | ||
"manufacturer": { | ||
"bom-ref": "manufacturer-1", | ||
"name": "Acme, Inc.", | ||
"url": [ | ||
"https://example.com" | ||
], | ||
"contact": [ | ||
{ | ||
"bom-ref": "contact-1", | ||
"name": "Acme Professional Services", | ||
"email": "[email protected]" | ||
} | ||
] | ||
} | ||
}, | ||
"components": [] | ||
} |
15 changes: 15 additions & 0 deletions
15
tools/src/test/resources/1.6/valid-metadata-manufacturer-1.6.textproto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
spec_version: "1.6" | ||
version: 1 | ||
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" | ||
metadata { | ||
manufacturer { | ||
name: "Acme, Inc." | ||
url: "https://example.com" | ||
contact { | ||
name: "Acme Professional Services" | ||
email: "[email protected]" | ||
bom_ref: "contact-1" | ||
} | ||
bom_ref: "manufacturer-1" | ||
} | ||
} |
Oops, something went wrong.