Skip to content

Commit 4fbb330

Browse files
committed
feat: add classifier component field
Add a new field to components to specify whether the component is to be understood as source or binary. Signed-off-by: Christoph Steiger <christoph.steiger@siemens.com>
1 parent 027f14c commit 4fbb330

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

schema/bom-1.7.schema.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,20 @@
11591159
"$ref": "#/definitions/signature",
11601160
"title": "Signature",
11611161
"description": "Enveloped signature in [JSON Signature Format (JSF)](https://cyberphone.github.io/doc/security/jsf.html)."
1162+
},
1163+
"classifier": {
1164+
"type": "string",
1165+
"enum": [
1166+
"binary",
1167+
"sources"
1168+
],
1169+
"title": "Classifier",
1170+
"meta:enum": {
1171+
"binary": "The component can be classified as 'binary'. This is the case for most components. If a component includes both source and binary parts it is still considered 'binary'.",
1172+
"sources": "The component can be classified as 'sources'. Examples are Debian Source packages (as opposed to Debian Binary packages), or a source JAR in Java."
1173+
},
1174+
"description": "Specifies the classifier of the component. If the classifier is not specified, 'binary' SHOULD be assumed by the consumer of the BOM.",
1175+
"default": "binary"
11621176
}
11631177
},
11641178
"allOf": [

schema/bom-1.7.xsd

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,14 @@ limitations under the License.
812812
</xs:annotation>
813813
</xs:element>
814814
<xs:element name="tags" type="bom:tagsType" minOccurs="0" maxOccurs="1" />
815+
<xs:element name="classifier" type="bom:classifier" minOccurs="0" maxOccurs="1" default="binary">
816+
<xs:annotation>
817+
<xs:documentation>
818+
Specifies the classifier of the component. If the classifier is not specified, 'binary' SHOULD
819+
be assumed by the consumer of the BOM.
820+
</xs:documentation>
821+
</xs:annotation>
822+
</xs:element>
815823
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
816824
<xs:annotation>
817825
<xs:documentation>
@@ -1262,6 +1270,24 @@ limitations under the License.
12621270
</xs:restriction>
12631271
</xs:simpleType>
12641272

1273+
<xs:simpleType name="classifier">
1274+
<xs:restriction base="xs:string">
1275+
<xs:enumeration value="binary">
1276+
<xs:annotation>
1277+
<xs:documentation>The component can be classified as 'binary'. This is the case for most
1278+
components. If a component includes both source and binary parts it is still considered
1279+
'binary'.</xs:documentation>
1280+
</xs:annotation>
1281+
</xs:enumeration>
1282+
<xs:enumeration value="sources">
1283+
<xs:annotation>
1284+
<xs:documentation>The component can be classified as 'sources'. Examples are Debian Source
1285+
packages (as opposed to Debian Binary packages), or a source JAR in Java.</xs:documentation>
1286+
</xs:annotation>
1287+
</xs:enumeration>
1288+
</xs:restriction>
1289+
</xs:simpleType>
1290+
12651291
<xs:simpleType name="classification">
12661292
<xs:restriction base="xs:string">
12671293
<xs:enumeration value="application">
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.7",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"components": [
8+
{
9+
"bom-ref": "pkg:deb/debian/curl@7.50.3-1?arch=source&distro=jessie",
10+
"type": "application",
11+
"classifier": "sources",
12+
"name": "curl",
13+
"version": "7.50.3-1",
14+
"purl": "pkg:deb/debian/curl@7.50.3-1?arch=source&distro=jessie"
15+
}
16+
]
17+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# proto-file: schema/bom-1.7.proto
2+
# proto-message: Bom
3+
4+
spec_version: "1.7"
5+
version: 1
6+
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
7+
components {
8+
type: CLASSIFICATION_APPLICATION
9+
name: "curl"
10+
classifier: "sources"
11+
version: "7.50.3-1"
12+
purl: "pkg:deb/debian/curl@7.50.3-1?arch=source&distro=jessie"
13+
}

0 commit comments

Comments
 (0)