Skip to content

Commit 08c5361

Browse files
committed
Add test files
1 parent 947e9aa commit 08c5361

246 files changed

Lines changed: 16400 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# proto-file: schema/bom-1.7.proto
2+
# proto-message: Bom
3+
4+
spec_version: "1.7"
5+
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
6+
version: 1
7+
8+
metadata: {
9+
timestamp: {
10+
seconds: 1754424907
11+
nanos: 0
12+
}
13+
}
14+
15+
components: {
16+
type: CLASSIFICATION_LIBRARY
17+
bom_ref: "component-1"
18+
name: "example-lib"
19+
version: "1.2.3"
20+
licenses: {
21+
license: {
22+
id: "Apache-2.0"
23+
}
24+
}
25+
}
26+
27+
## !! NO formal check possible
28+
#citations: {
29+
# bom_ref: "citation-1"
30+
# pointers: { pointer: "/components/0/name" }
31+
# timestamp: {
32+
# seconds: 1746108000
33+
# nanos: 0
34+
# }
35+
# note: "Should have at least one of the following property sets: property 'attributedTo' or property 'process'"
36+
#}
37+
38+
39+
citations: {
40+
bom_ref: "citation-1"
41+
pointers: { pointer: "/components/0/name" }
42+
expressions: { expression: "$..[?(bom_ref=='component-1')].version" }
43+
timestamp: {
44+
seconds: 1746108000
45+
nanos: 0
46+
}
47+
note: "Should not have both a pointer and expression."
48+
}
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>alice@example.com</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+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.7"
3+
serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
4+
version="1"
5+
>
6+
<components>
7+
<component type="library" isExternal="true">
8+
<name>InvalidVersions</name>
9+
<version>9.0.14</version>
10+
<versionRange><![CDATA[vers:pypi/0.0.0|0.0.1|0.0.2|0.0.3|1.0|2.0pre1]]></versionRange>
11+
<description>may have `version` or `versionRange`, not both. This one does - it is invalid</description>
12+
</component>
13+
</components>
14+
</bom>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
"bom-ref": "123",
11+
"name": "acme-library",
12+
"version": "1.0.0"
13+
},
14+
{
15+
"type": "library",
16+
"bom-ref": "",
17+
"name": "acme-library",
18+
"version": "1.0.0"
19+
}
20+
]
21+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0"?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.7"
3+
serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
4+
version="1"
5+
>
6+
<components>
7+
<component type="library" bom-ref="123">
8+
<name>acme-library</name>
9+
<version>1.0.0</version>
10+
<components>
11+
<component type="library" bom-ref="123">
12+
<!-- duplicate value in attribute `bom-ref` -->
13+
<name>acme-library</name>
14+
<version>1.0.0</version>
15+
</component>
16+
<component type="library" bom-ref="123">
17+
<name>acme-library2</name>
18+
<version>1.0.0</version>
19+
</component>
20+
<component type="library" bom-ref="">
21+
<!-- empty value in attribute `bom-ref` -->
22+
<name>acme-library</name>
23+
<version>1.0.0</version>
24+
</component>
25+
</components>
26+
</component>
27+
</components>
28+
</bom>

0 commit comments

Comments
 (0)