Skip to content

Commit 341a2b7

Browse files
committed
tests: pulled latest test resources
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent b3d05e7 commit 341a2b7

File tree

188 files changed

+11822
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+11822
-2
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.6",
5+
"serialNumber": "urn:uuid:df628836-6b9b-41c9-a724-b44743c54d42",
6+
"version": 1,
7+
"metadata": {
8+
"lifecycles": [{"phase": "design"}]
9+
},
10+
"components": [
11+
{
12+
"type": "library",
13+
"group": "com.example",
14+
"name": "situation-A",
15+
"version": "1",
16+
"description": "Multiple licenses: declared ids/names, and a concluded expression",
17+
"licenses": [
18+
{
19+
"license": {
20+
"id": "MIT",
21+
"acknowledgement": "declared"
22+
}
23+
},
24+
{
25+
"license": {
26+
"id": "PostgreSQL",
27+
"acknowledgement": "declared"
28+
}
29+
},
30+
{
31+
"license": {
32+
"name": "Apache Software License",
33+
"acknowledgement": "declared"
34+
}
35+
},
36+
{
37+
"expression": "(MIT OR PostgreSQL OR Apache-2.0)",
38+
"acknowledgement": "concluded"
39+
}
40+
]
41+
},
42+
{
43+
"type": "library",
44+
"group": "com.example",
45+
"name": "situation-B",
46+
"version": "1",
47+
"description": "Multiple license expressions: one declared, one concluded",
48+
"licenses": [
49+
{
50+
"expression": "MIT OR (GPL-3.0 OR GPL-2.0)",
51+
"acknowledgement": "declared"
52+
},
53+
{
54+
"expression": "(GPL-3.0-only AND LGPL-2.0-only)",
55+
"acknowledgement": "concluded"
56+
}
57+
]
58+
},
59+
{
60+
"type": "library",
61+
"group": "com.example",
62+
"name": "situation-C",
63+
"version": "1",
64+
"description": "Multiple license: one declared expression, one concluded id",
65+
"licenses": [
66+
{
67+
"expression": "GPL-3.0-or-later OR GPL-2.0",
68+
"acknowledgement": "declared"
69+
},
70+
{
71+
"license": {
72+
"id": "GPL-3.0-only",
73+
"acknowledgement": "concluded"
74+
}
75+
}
76+
]
77+
}
78+
]
79+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0"?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.6"
3+
serialNumber="urn:uuid:df628836-6b9b-41c9-a724-b44743c54d42"
4+
>
5+
<!--
6+
All license posture in here is for show-case ony.
7+
This is not a real law-case!
8+
-->
9+
<metadata>
10+
<lifecycles><lifecycle><phase>design</phase></lifecycle></lifecycles>
11+
</metadata>
12+
<components>
13+
<component type="library">
14+
<group>com.example</group>
15+
<name>situation-A</name>
16+
<version>1</version>
17+
<description>Multiple licenses: declared ids/names, and a concluded expression</description>
18+
<licenses>
19+
<license acknowledgement="declared"><id>MIT</id></license>
20+
<license acknowledgement="declared"><id>PostgreSQL</id></license>
21+
<license acknowledgement="declared"><name>Apache Software License</name></license>
22+
<expression acknowledgement="concluded">(MIT OR PostgreSQL OR Apache-2.0)</expression>
23+
</licenses>
24+
</component>
25+
<component type="library">
26+
<group>com.example</group>
27+
<name>situation-B</name>
28+
<version>1</version>
29+
<description>Multiple license expressions: one declared, one concluded</description>
30+
<licenses>
31+
<expression acknowledgement="declared">MIT OR (GPL-3.0 OR GPL-2.0)</expression>
32+
<expression acknowledgement="concluded">(GPL-3.0-only AND LGPL-2.0-only)</expression>
33+
</licenses>
34+
</component>
35+
<component type="library">
36+
<group>com.example</group>
37+
<name>situation-C</name>
38+
<version>1</version>
39+
<description>Multiple license: one declared expression, one concluded id</description>
40+
<licenses>
41+
<expression acknowledgement="declared">GPL-3.0-or-later OR GPL-2.0</expression>
42+
<license acknowledgement="concluded"><id>GPL-3.0-only</id></license>
43+
</licenses>
44+
</component>
45+
</components>
46+
</bom>

tests/_data/schemaTestData/1.6/valid-cryptography-full-1.6.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,16 @@
6565
"0xC0"
6666
]
6767
}
68-
]
68+
],
69+
"ikev2TransformTypes": {
70+
"encr": ["bom-ref-to-encr"],
71+
"prf": ["bom-ref-to-prf"],
72+
"integ": ["bom-ref-to-integ"],
73+
"ke": ["bom-ref-to-ke"],
74+
"esn": true,
75+
"auth": ["bom-ref-to-auth"]
76+
},
77+
"cryptoRefArray": ["asset-4"]
6978
},
7079
"oid": "oid:1.2.3.4.5.6.7.8.9"
7180
}

tests/_data/schemaTestData/1.6/valid-cryptography-full-1.6.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,30 @@
4040
<certificateFormat>X.509</certificateFormat>
4141
<certificateExtension>crt</certificateExtension>
4242
</certificateProperties>
43+
<protocolProperties>
44+
<type>tls</type>
45+
<version>1.3</version>
46+
<cipherSuites>
47+
<cipherSuite>
48+
<name>TLS_DHE_RSA_WITH_AES_128_CCM</name>
49+
<algorithms>
50+
<algorithm>bom-ref-to-algorithm</algorithm>
51+
</algorithms>
52+
<identifiers>
53+
<identifier>0xC0</identifier>
54+
</identifiers>
55+
</cipherSuite>
56+
</cipherSuites>
57+
<ikev2TransformTypes>
58+
<encr>bom-ref-to-encr</encr>
59+
<prf>bom-ref-to-prf</prf>
60+
<integ>bom-ref-to-integ</integ>
61+
<ke>bom-ref-to-ke</ke>
62+
<esn>true</esn>
63+
<auth>bom-ref-to-auth</auth>
64+
</ikev2TransformTypes>
65+
<cryptoRef>asset-4</cryptoRef>
66+
</protocolProperties>
4367
<oid>oid:1.2.3.4.5.6.7.8.9</oid>
4468
</cryptoProperties>
4569
</component>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.7"
3+
serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1"
4+
>
5+
<!--
6+
this would be formal, if the support for XSD1.1's `assert` was properly implemented
7+
in validators and tools digesting XML.
8+
-->
9+
<components>
10+
<component type="library" isExternal="false">
11+
<name>InvalidVersions</name>
12+
<versionRange><![CDATA[vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1]]></versionRange>
13+
<description>versionRange may only exist on extraneous components, set `isExternal` explicit</description>
14+
</component>
15+
</components>
16+
</bom>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0"?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.7"
3+
serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1"
4+
>
5+
<!--
6+
this would be formal, if the support for XSD1.1's `assert` was properly implemented
7+
in validators and tools digesting XML.
8+
-->
9+
<components>
10+
<component type="library">
11+
<!-- @isExternal defaults to `false` -->
12+
<name>InvalidVersions</name>
13+
<versionRange><![CDATA[vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1]]></versionRange>
14+
<description>versionRange may only exist on extraneous components, set `isExternal` implicit by default value</description>
15+
</component>
16+
</components>
17+
</bom>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
3+
"bomFormat": "AnotherFormat",
4+
"specVersion": "1.7",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"components": [
8+
]
9+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
"metadata": {
8+
"timestamp": "2025-05-01T14:23:00Z"
9+
},
10+
"components": [
11+
{
12+
"type": "library",
13+
"bom-ref": "component-1",
14+
"name": "example-lib",
15+
"version": "1.2.3",
16+
"licenses": [
17+
{
18+
"license": {
19+
"id": "Apache-2.0"
20+
}
21+
}
22+
]
23+
}
24+
],
25+
"citations": [
26+
{
27+
"bom-ref": "citation-1",
28+
"pointers": ["/components/0/name"],
29+
"timestamp": "2025-05-01T14:00:00Z",
30+
"note": "Should have at least one of the following property sets: property 'attributedTo' or property 'process'"
31+
},
32+
{
33+
"bom-ref": "citation-1",
34+
"pointers": ["/components/0/name"],
35+
"expressions": ["$..[?(@.bom-ref=='component-1')].version"],
36+
"timestamp": "2025-05-01T14:00:00Z",
37+
"note": "Should not have both a pointer and expression."
38+
}
39+
]
40+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.7"
3+
serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
4+
version="1"
5+
>
6+
<metadata>
7+
<timestamp>2025-05-01T14:23:00Z</timestamp>
8+
<authors>
9+
<author bom-ref="person-1">
10+
<name>Alice Example</name>
11+
<email>[email protected]</email>
12+
</author>
13+
</authors>
14+
</metadata>
15+
<components>
16+
<component type="library" bom-ref="component-1">
17+
<name>example-lib</name>
18+
<version>1.2.3</version>
19+
<licenses>
20+
<license>
21+
<id>Apache-2.0</id>
22+
</license>
23+
</licenses>
24+
</component>
25+
</components>
26+
<formulation>
27+
<formula bom-ref="formula-1">
28+
<components>
29+
<component type="application" bom-ref="scan-tool-1">
30+
<name>My Scan Tool</name>
31+
</component>
32+
</components>
33+
<workflows>
34+
<workflow bom-ref="workflow-1">
35+
<uid>259bae74-5ec4-4de8-9386-c91b1f7719b8</uid>
36+
<name>My workflow</name>
37+
<tasks>
38+
<task bom-ref="task-license-scan">
39+
<uid>6d75f8d6-a008-41cf-8b65-c4129fc249f9</uid>
40+
<description>License scan of the source files using OpenSourceScanner v2.1</description>
41+
<taskTypes>
42+
<taskType>scan</taskType>
43+
</taskTypes>
44+
</task>
45+
<task bom-ref="task-license-scan-2">
46+
<uid>dfc0268a-89cb-4823-bb88-84115a06b64d</uid>
47+
<description>License scan of the source files using [REDACTED]</description>
48+
<taskTypes>
49+
<taskType>scan</taskType>
50+
</taskTypes>
51+
</task>
52+
</tasks>
53+
<taskTypes>
54+
<taskType>scan</taskType>
55+
</taskTypes>
56+
</workflow>
57+
</workflows>
58+
</formula>
59+
</formulation>
60+
<citations>
61+
<!-- spec-requirement that is not formalized in the XSD:
62+
<citation bom-ref="citation-1">
63+
<pointers>
64+
<pointer>/components/0/name</pointer>
65+
</pointers>
66+
<timestamp>2025-05-01T14:00:00Z</timestamp>
67+
<note>Should have at least one of the following children 'attributedTo' or 'process'</note>
68+
</citation>
69+
-->
70+
<citation bom-ref="citation-2">
71+
<pointers>
72+
<pointer>/components/0/licenses/0/license/id</pointer>
73+
</pointers>
74+
<timestamp>2025-05-01T14:05:00Z</timestamp>
75+
<attributedTo>person-1</attributedTo>
76+
<attributedTo>scan-tool-1</attributedTo>
77+
<note>Should have at max one 'attributedTo'</note>
78+
</citation>
79+
<citation bom-ref="citation-3">
80+
<pointers>
81+
<pointer>/components/0/licenses/0/license/id</pointer>
82+
</pointers>
83+
<timestamp>2025-05-01T14:05:00Z</timestamp>
84+
<process>task-license-scan</process>
85+
<process>task-license-scan-2</process>
86+
<note>Should have at max one 'process'</note>
87+
</citation>
88+
<citation bom-ref="citation-4">
89+
<pointers>
90+
<pointer>/components/0/licenses/0/license/id</pointer>
91+
</pointers>
92+
<expressions>
93+
<expression>//*[@bom-ref='component-1']/version</expression>
94+
</expressions>
95+
<timestamp>2025-05-01T14:05:00Z</timestamp>
96+
<process>task-license-scan</process>
97+
<note>Should not have both a pointer and expression.</note>
98+
</citation>
99+
</citations>
100+
</bom>
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+
"type": "library",
10+
"name": "InvalidVersions",
11+
"description": "may have `version` or `versionRange`, not both. This one does - it is invalid",
12+
"version": "9.0.14",
13+
"versionRange": "vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1",
14+
"isExternal": true
15+
}
16+
]
17+
}

0 commit comments

Comments
 (0)