Skip to content

Commit 39524a2

Browse files
committed
feat: license expression text attachment
- tests: examples for licenses with text - tests: draft for expressiosn with text Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 88de88c commit 39524a2

9 files changed

+390
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
"type": "application",
10+
"publisher": "Acme Inc",
11+
"group": "com.acme",
12+
"name": "tomcat-catalina",
13+
"version": "9.0.14",
14+
"description": "Modified version of Apache Catalina",
15+
"scope": "required",
16+
"hashes": [
17+
{
18+
"alg": "MD5",
19+
"content": "3942447fac867ae5cdb3229b658f4d48"
20+
},
21+
{
22+
"alg": "SHA-1",
23+
"content": "e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a"
24+
},
25+
{
26+
"alg": "SHA-256",
27+
"content": "f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b"
28+
},
29+
{
30+
"alg": "SHA-512",
31+
"content": "e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282"
32+
}
33+
],
34+
"licenses": [
35+
{
36+
"bom-ref": "my-license",
37+
"acknowledgement": "declared",
38+
"expression": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
39+
"expression-texts": [
40+
"license-identifier": "EPL-2.0",
41+
"text": {
42+
"content": "Eclipse Public License - v 2.0\n\n THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE\n PUBLIC LICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION\n OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT..."
43+
},
44+
{
45+
"license-identifier": "GPL-2.0 WITH Classpath-exception-2.0",
46+
"text": {
47+
"content": " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed...\n\n...\n\nLinking this library statically or dynamically with other modules is making a combined work based on this library..."
48+
}
49+
}
50+
]
51+
}
52+
],
53+
"purl": "pkg:maven/com.acme/[email protected]?packaging=jar"
54+
}
55+
]
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
publisher: "Acme Inc"
10+
group: "com.acme"
11+
name: "tomcat-catalina"
12+
version: "9.0.14"
13+
description: "Modified version of Apache Catalina"
14+
scope: SCOPE_REQUIRED
15+
hashes {
16+
alg: HASH_ALG_MD_5
17+
value: "3942447fac867ae5cdb3229b658f4d48"
18+
}
19+
hashes {
20+
alg: HASH_ALG_SHA_1
21+
value: "e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a"
22+
}
23+
hashes {
24+
alg: HASH_ALG_SHA_256
25+
value: "f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b"
26+
}
27+
hashes {
28+
alg: HASH_ALG_SHA_512
29+
value: "e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282"
30+
}
31+
licenses {
32+
bom_ref: "my-license"
33+
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
34+
expression: "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0"
35+
expression_texts {
36+
license_identifier: "EPL-2.0"
37+
text {
38+
content: "Eclipse Public License - v 2.0\n\n THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE\n PUBLIC LICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION\n OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT..."
39+
}
40+
}
41+
expression_texts {
42+
license_identifier: "GPL-2.0 WITH Classpath-exception-2.0",
43+
text: {
44+
content: " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed...\n\n...\n\nLinking this library statically or dynamically with other modules is making a combined work based on this library..."
45+
}
46+
}
47+
}
48+
purl: "pkg:maven/com.acme/[email protected]?packaging=jar"
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0"?>
2+
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
3+
<components>
4+
<component type="application">
5+
<publisher>Acme Inc</publisher>
6+
<group>com.acme</group>
7+
<name>tomcat-catalina</name>
8+
<version>9.0.14</version>
9+
<description>Modified version of Apache Catalina</description>
10+
<scope>required</scope>
11+
<hashes>
12+
<hash alg="MD5">3942447fac867ae5cdb3229b658f4d48</hash>
13+
<hash alg="SHA-1">e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a</hash>
14+
<hash alg="SHA-256">f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b</hash>
15+
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
16+
</hashes>
17+
<licenses>
18+
<expression bom-ref="my-license" acknowledgement="declared">
19+
<value>EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0</value>
20+
<text license-identifier="EPL-2.0"><![CDATA[Eclipse Public License - v 2.0
21+
22+
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
23+
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
24+
OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT...]]]></text>
25+
<text license-identifier="GPL-2.0 WITH Classpath-exception-2.0"><![CDATA[ GNU GENERAL PUBLIC LICENSE
26+
Version 2, June 1991
27+
28+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
29+
<https://fsf.org/>
30+
Everyone is permitted to copy and distribute verbatim copies
31+
of this license document, but changing it is not allowed...
32+
33+
...
34+
35+
Linking this library statically or dynamically with other modules is making a combined work based on this library...]]></text>
36+
</expression>
37+
</licenses>
38+
<purl>pkg:maven/com.acme/[email protected]?packaging=jar</purl>
39+
</component>
40+
</components>
41+
</bom>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
"type": "application",
10+
"publisher": "Acme Inc",
11+
"group": "com.acme",
12+
"name": "tomcat-catalina",
13+
"version": "9.0.14",
14+
"description": "Modified version of Apache Catalina",
15+
"scope": "required",
16+
"hashes": [
17+
{
18+
"alg": "MD5",
19+
"content": "3942447fac867ae5cdb3229b658f4d48"
20+
},
21+
{
22+
"alg": "SHA-1",
23+
"content": "e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a"
24+
},
25+
{
26+
"alg": "SHA-256",
27+
"content": "f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b"
28+
},
29+
{
30+
"alg": "SHA-512",
31+
"content": "e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282"
32+
}
33+
],
34+
"licenses": [
35+
{
36+
"license": {
37+
"id": "Apache-2.0",
38+
"acknowledgement": "declared",
39+
"bom-ref": "my-license",
40+
"text": {
41+
"content": "\n Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION..."
42+
}
43+
}
44+
}
45+
],
46+
"purl": "pkg:maven/com.acme/[email protected]?packaging=jar"
47+
}
48+
]
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
publisher: "Acme Inc"
10+
group: "com.acme"
11+
name: "tomcat-catalina"
12+
version: "9.0.14"
13+
description: "Modified version of Apache Catalina"
14+
scope: SCOPE_REQUIRED
15+
hashes {
16+
alg: HASH_ALG_MD_5
17+
value: "3942447fac867ae5cdb3229b658f4d48"
18+
}
19+
hashes {
20+
alg: HASH_ALG_SHA_1
21+
value: "e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a"
22+
}
23+
hashes {
24+
alg: HASH_ALG_SHA_256
25+
value: "f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b"
26+
}
27+
hashes {
28+
alg: HASH_ALG_SHA_512
29+
value: "e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282"
30+
}
31+
licenses {
32+
license {
33+
id: "Apache-2.0"
34+
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
35+
bom_ref: "my-license"
36+
text {
37+
value: """
38+
Apache License
39+
Version 2.0, January 2004
40+
http://www.apache.org/licenses/
41+
42+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION..."""
43+
}
44+
}
45+
}
46+
purl: "pkg:maven/com.acme/[email protected]?packaging=jar"
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0"?>
2+
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
3+
<components>
4+
<component type="application">
5+
<publisher>Acme Inc</publisher>
6+
<group>com.acme</group>
7+
<name>tomcat-catalina</name>
8+
<version>9.0.14</version>
9+
<description>Modified version of Apache Catalina</description>
10+
<scope>required</scope>
11+
<hashes>
12+
<hash alg="MD5">3942447fac867ae5cdb3229b658f4d48</hash>
13+
<hash alg="SHA-1">e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a</hash>
14+
<hash alg="SHA-256">f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b</hash>
15+
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
16+
</hashes>
17+
<licenses>
18+
<license bom-ref="my-license" acknowledgement="declared">
19+
<id>Apache-2.0</id>
20+
<text><![CDATA[
21+
Apache License
22+
Version 2.0, January 2004
23+
http://www.apache.org/licenses/
24+
25+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION...]]></text>
26+
</license>
27+
</licenses>
28+
<purl>pkg:maven/com.acme/[email protected]?packaging=jar</purl>
29+
</component>
30+
</components>
31+
</bom>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
"type": "application",
10+
"publisher": "Acme Inc",
11+
"group": "com.acme",
12+
"name": "tomcat-catalina",
13+
"version": "9.0.14",
14+
"description": "Modified version of Apache Catalina",
15+
"scope": "required",
16+
"hashes": [
17+
{
18+
"alg": "MD5",
19+
"content": "3942447fac867ae5cdb3229b658f4d48"
20+
},
21+
{
22+
"alg": "SHA-1",
23+
"content": "e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a"
24+
},
25+
{
26+
"alg": "SHA-256",
27+
"content": "f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b"
28+
},
29+
{
30+
"alg": "SHA-512",
31+
"content": "e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282"
32+
}
33+
],
34+
"licenses": [
35+
{
36+
"license": {
37+
"name": "My License",
38+
"bom-ref": "my-license",
39+
"acknowledgement": "declared",
40+
"text": {
41+
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nec turpis efficitur, ullamcorper lorem ac, fermentum nulla. Mauris a enim nunc. Aliquam diam tellus, porttitor venenatis leo in, mollis ultricies lacus. Sed sagittis hendrerit nulla, eget pulvinar diam..."
42+
}
43+
}
44+
}
45+
],
46+
"purl": "pkg:maven/com.acme/[email protected]?packaging=jar"
47+
}
48+
]
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
publisher: "Acme Inc"
10+
group: "com.acme"
11+
name: "tomcat-catalina"
12+
version: "9.0.14"
13+
description: "Modified version of Apache Catalina"
14+
scope: SCOPE_REQUIRED
15+
hashes {
16+
alg: HASH_ALG_MD_5
17+
value: "3942447fac867ae5cdb3229b658f4d48"
18+
}
19+
hashes {
20+
alg: HASH_ALG_SHA_1
21+
value: "e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a"
22+
}
23+
hashes {
24+
alg: HASH_ALG_SHA_256
25+
value: "f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b"
26+
}
27+
hashes {
28+
alg: HASH_ALG_SHA_512
29+
value: "e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282"
30+
}
31+
licenses {
32+
license {
33+
name: "My License"
34+
bom_ref: "my-license"
35+
acknowledgement: LICENSE_ACKNOWLEDGEMENT_ENUMERATION_DECLARED
36+
text {
37+
value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nec turpis efficitur, ullamcorper lorem ac, fermentum nulla. Mauris a enim nunc. Aliquam diam tellus, porttitor venenatis leo in, mollis ultricies lacus. Sed sagittis hendrerit nulla, eget pulvinar diam..."
38+
}
39+
}
40+
}
41+
purl: "pkg:maven/com.acme/[email protected]?packaging=jar"
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0"?>
2+
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.7">
3+
<components>
4+
<component type="application">
5+
<publisher>Acme Inc</publisher>
6+
<group>com.acme</group>
7+
<name>tomcat-catalina</name>
8+
<version>9.0.14</version>
9+
<description>Modified version of Apache Catalina</description>
10+
<scope>required</scope>
11+
<hashes>
12+
<hash alg="MD5">3942447fac867ae5cdb3229b658f4d48</hash>
13+
<hash alg="SHA-1">e6b1000b94e835ffd37f4c6dcbdad43f4b48a02a</hash>
14+
<hash alg="SHA-256">f498a8ff2dd007e29c2074f5e4b01a9a01775c3ff3aeaf6906ea503bc5791b7b</hash>
15+
<hash alg="SHA-512">e8f33e424f3f4ed6db76a482fde1a5298970e442c531729119e37991884bdffab4f9426b7ee11fccd074eeda0634d71697d6f88a460dce0ac8d627a29f7d1282</hash>
16+
</hashes>
17+
<licenses>
18+
<license bom-ref="my-license" acknowledgement="declared">
19+
<name>My License</name>
20+
<text><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nec turpis efficitur, ullamcorper lorem ac, fermentum nulla. Mauris a enim nunc. Aliquam diam tellus, porttitor venenatis leo in, mollis ultricies lacus. Sed sagittis hendrerit nulla, eget pulvinar diam...]]></text>
21+
</license>
22+
</licenses>
23+
<purl>pkg:maven/com.acme/[email protected]?packaging=jar</purl>
24+
</component>
25+
</components>
26+
</bom>

0 commit comments

Comments
 (0)