Skip to content

Commit 32e87a9

Browse files
Merge pull request #177 from CycloneDX/v1.5-dev-license-properties
Added property support to license along with unit tests
2 parents 27fa4cb + d6f85b1 commit 32e87a9

File tree

6 files changed

+84
-8
lines changed

6 files changed

+84
-8
lines changed

schema/bom-1.5.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ message License {
279279
optional string bom_ref = 5;
280280
// Licensing details describing the licensor/licensee, license type, renewal and expiration dates, and other important metadata
281281
optional Licensing licensing = 6;
282+
// Specifies optional, custom, properties
283+
repeated Property properties = 7;
282284
}
283285

284286
message Licensing {

schema/bom-1.5.schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,13 @@
783783
"description": "The timestamp indicating when the current license expires (if applicable)."
784784
}
785785
}
786+
},
787+
"properties": {
788+
"type": "array",
789+
"title": "Properties",
790+
"description": "Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is OPTIONAL.",
791+
"additionalItems": false,
792+
"items": {"$ref": "#/definitions/property"}
786793
}
787794
}
788795
},

schema/bom-1.5.xsd

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ limitations under the License.
8989
<xs:element name="licenses" type="bom:licenseChoiceType" minOccurs="0" maxOccurs="1"/>
9090
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
9191
<xs:annotation>
92-
<xs:documentation>Provides the ability to document properties in a key/value store.
92+
<xs:documentation>Provides the ability to document properties in a name/value store.
9393
This provides flexibility to include data not officially supported in the standard
9494
without having to use additional namespaces or create extensions. Property names
9595
of interest to the general public are encouraged to be registered in the
@@ -358,7 +358,7 @@ limitations under the License.
358358
</xs:element>
359359
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
360360
<xs:annotation>
361-
<xs:documentation>Provides the ability to document properties in a key/value store.
361+
<xs:documentation>Provides the ability to document properties in a name/value store.
362362
This provides flexibility to include data not officially supported in the standard
363363
without having to use additional namespaces or create extensions. Property names
364364
of interest to the general public are encouraged to be registered in the
@@ -588,6 +588,16 @@ limitations under the License.
588588
</xs:sequence>
589589
</xs:complexType>
590590
</xs:element>
591+
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
592+
<xs:annotation>
593+
<xs:documentation>Provides the ability to document properties in a name/value store.
594+
This provides flexibility to include data not officially supported in the standard
595+
without having to use additional namespaces or create extensions. Property names
596+
of interest to the general public are encouraged to be registered in the
597+
CycloneDX Property Taxonomy - https://github.com/CycloneDX/cyclonedx-property-taxonomy.
598+
Formal registration is OPTIONAL.</xs:documentation>
599+
</xs:annotation>
600+
</xs:element>
591601
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
592602
<xs:annotation>
593603
<xs:documentation>
@@ -1046,8 +1056,8 @@ limitations under the License.
10461056
are URIs and therefore can accept any URL scheme including https, mailto, tel, and dns.
10471057
External references may also include formally registered URNs such as CycloneDX BOM-Link to
10481058
reference CycloneDX BOMs or any object within a BOM. BOM-Link transforms applicable external
1049-
references into relationships that can be expressed in a BOM or across BOMs. Refer to:</xs:documentation>
1050-
https://cyclonedx.org/capabilities/bomlink/
1059+
references into relationships that can be expressed in a BOM or across BOMs. Refer to:
1060+
https://cyclonedx.org/capabilities/bomlink/</xs:documentation>
10511061
</xs:annotation>
10521062
</xs:element>
10531063
<xs:element name="comment" type="xs:string" minOccurs="0" maxOccurs="1">
@@ -1548,7 +1558,7 @@ limitations under the License.
15481558
</xs:element>
15491559
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
15501560
<xs:annotation>
1551-
<xs:documentation>Provides the ability to document properties in a key/value store.
1561+
<xs:documentation>Provides the ability to document properties in a name/value store.
15521562
This provides flexibility to include data not officially supported in the standard
15531563
without having to use additional namespaces or create extensions. Property names
15541564
of interest to the general public are encouraged to be registered in the
@@ -1900,7 +1910,7 @@ limitations under the License.
19001910
</xs:element>
19011911
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
19021912
<xs:annotation>
1903-
<xs:documentation>Provides the ability to document properties in a key/value store.
1913+
<xs:documentation>Provides the ability to document properties in a name/value store.
19041914
This provides flexibility to include data not officially supported in the standard
19051915
without having to use additional namespaces or create extensions. Property names
19061916
of interest to the general public are encouraged to be registered in the
@@ -2271,7 +2281,7 @@ limitations under the License.
22712281
</xs:element>
22722282
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
22732283
<xs:annotation>
2274-
<xs:documentation>Provides the ability to document properties in a key/value store.
2284+
<xs:documentation>Provides the ability to document properties in a name/value store.
22752285
This provides flexibility to include data not officially supported in the standard
22762286
without having to use additional namespaces or create extensions. Property names
22772287
of interest to the general public are encouraged to be registered in the
@@ -2621,7 +2631,7 @@ limitations under the License.
26212631
</xs:element>
26222632
<xs:element name="properties" type="bom:propertiesType" minOccurs="0" maxOccurs="1">
26232633
<xs:annotation>
2624-
<xs:documentation>Provides the ability to document properties in a key/value store.
2634+
<xs:documentation>Provides the ability to document properties in a name/value store.
26252635
This provides flexibility to include data not officially supported in the standard
26262636
without having to use additional namespaces or create extensions. Property names
26272637
of interest to the general public are encouraged to be registered in the

tools/src/test/resources/1.5/valid-properties-1.5.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,31 @@
2828
"type": "library",
2929
"name": "acme-library",
3030
"version": "1.0.0",
31+
"licenses": [
32+
{
33+
"license": {
34+
"id": "Apache-2.0",
35+
"properties": [
36+
{
37+
"name": "Foo",
38+
"value": "Bar"
39+
},
40+
{
41+
"name": "Foo",
42+
"value": "You"
43+
},
44+
{
45+
"name": "Foo",
46+
"value": "Two"
47+
},
48+
{
49+
"name": "Bar",
50+
"value": "Foo"
51+
}
52+
]
53+
}
54+
}
55+
],
3156
"properties": [
3257
{
3358
"name": "Foo",

tools/src/test/resources/1.5/valid-properties-1.5.textproto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ components {
2323
type: CLASSIFICATION_LIBRARY
2424
name: "acme-library"
2525
version: "1.0.0"
26+
licenses {
27+
license {
28+
id: "Apache-2.0"
29+
properties {
30+
name: "Foo"
31+
value: "Bar"
32+
}
33+
properties {
34+
name: "Foo"
35+
value: "You"
36+
}
37+
properties {
38+
name: "Foo"
39+
value: "Two"
40+
}
41+
properties {
42+
name: "Bar"
43+
value: "Foo"
44+
}
45+
}
46+
}
2647
properties {
2748
name: "Foo"
2849
value: "Bar"

tools/src/test/resources/1.5/valid-properties-1.5.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212
<component type="library">
1313
<name>acme-library</name>
1414
<version>1.0.0</version>
15+
<licenses>
16+
<license>
17+
<id>Apache-2.0</id>
18+
<properties>
19+
<property name="Foo">Bar</property>
20+
<property name="Foo">You</property>
21+
<property name="Foo">Two</property>
22+
<property name="Bar">Foo</property>
23+
</properties>
24+
</license>
25+
</licenses>
1526
<properties>
1627
<property name="Foo">Bar</property>
1728
<property name="Bar">Foo</property>

0 commit comments

Comments
 (0)