Skip to content

Commit 37cc10e

Browse files
committed
added a bunch more tests for JSON output
Signed-off-by: Paul Horton <[email protected]>
1 parent 5db0ff2 commit 37cc10e

5 files changed

+433
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.3.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.3",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"metadata": {
8+
"timestamp": "2021-09-01T10:50:42.051979+00:00",
9+
"tools": [
10+
{
11+
"vendor": "CycloneDX",
12+
"name": "cyclonedx-python-lib",
13+
"version": "VERSION"
14+
}
15+
],
16+
"component": {
17+
"type": "library",
18+
"bom-ref": "df70b5f1-8f53-47a4-be48-669ae78795e6",
19+
"name": "cyclonedx-python-lib",
20+
"version": "1.0.0"
21+
}
22+
},
23+
"components": [],
24+
"services": [
25+
{
26+
"bom-ref": "my-specific-bom-ref-for-my-first-service",
27+
"provider": {
28+
"contact": [
29+
{
30+
"email": "[email protected]",
31+
"name": "Paul Horton"
32+
},
33+
{
34+
"email": "[email protected]",
35+
"name": "A N Other",
36+
"phone": "+44 (0)1234 567890"
37+
}
38+
],
39+
"name": "CycloneDX",
40+
"url": [
41+
"https://cyclonedx.org"
42+
]
43+
},
44+
"group": "a-group",
45+
"name": "my-first-service",
46+
"version": "1.2.3",
47+
"description": "Description goes here",
48+
"endpoints": [
49+
"/api/thing/1",
50+
"/api/thing/2"
51+
],
52+
"authenticated": false,
53+
"x-trust-boundary": true,
54+
"data": [
55+
{
56+
"classification": "public",
57+
"flow": "outbound"
58+
}
59+
],
60+
"licenses": [
61+
{
62+
"expression": "Commercial"
63+
}
64+
],
65+
"externalReferences": [
66+
{
67+
"comment": "No comment",
68+
"hashes": [
69+
{
70+
"alg": "SHA-256",
71+
"content": "806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"
72+
}
73+
],
74+
"type": "distribution",
75+
"url": "https://cyclonedx.org"
76+
}
77+
],
78+
"properties": [
79+
{
80+
"name": "key1",
81+
"value": "val1"
82+
},
83+
{
84+
"name": "key2",
85+
"value": "val2"
86+
}
87+
]
88+
},
89+
{
90+
"bom-ref": "e9c2e297-eee6-4f45-ac2d-6662b1db77bf",
91+
"name": "my-second-service"
92+
}
93+
]
94+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.3.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.3",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"metadata": {
8+
"timestamp": "2021-09-01T10:50:42.051979+00:00",
9+
"tools": [
10+
{
11+
"vendor": "CycloneDX",
12+
"name": "cyclonedx-python-lib",
13+
"version": "VERSION"
14+
}
15+
],
16+
"component": {
17+
"type": "library",
18+
"bom-ref": "cd3e9c95-9d41-49e7-9924-8cf0465ae789",
19+
"name": "cyclonedx-python-lib",
20+
"version": "1.0.0"
21+
}
22+
},
23+
"components": [],
24+
"services": [
25+
{
26+
"bom-ref": "bb5911d6-1a1d-41c9-b6e0-46e848d16655",
27+
"name": "my-first-service"
28+
},
29+
{
30+
"bom-ref": "bb5911d6-1a1d-41c9-b6e0-46e848d16655",
31+
"name": "my-second-service"
32+
}
33+
]
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.4",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"metadata": {
8+
"timestamp": "2021-09-01T10:50:42.051979+00:00",
9+
"tools": [
10+
{
11+
"vendor": "CycloneDX",
12+
"name": "cyclonedx-python-lib",
13+
"version": "VERSION",
14+
"externalReferences": [
15+
{
16+
"type": "build-system",
17+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions"
18+
},
19+
{
20+
"type": "distribution",
21+
"url": "https://pypi.org/project/cyclonedx-python-lib/"
22+
},
23+
{
24+
"type": "documentation",
25+
"url": "https://cyclonedx.github.io/cyclonedx-python-lib/"
26+
},
27+
{
28+
"type": "issue-tracker",
29+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues"
30+
},
31+
{
32+
"type": "license",
33+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE"
34+
},
35+
{
36+
"type": "release-notes",
37+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md"
38+
},
39+
{
40+
"type": "vcs",
41+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib"
42+
},
43+
{
44+
"type": "website",
45+
"url": "https://cyclonedx.org"
46+
}
47+
]
48+
}
49+
],
50+
"component": {
51+
"type": "library",
52+
"bom-ref": "2a4ec791-4846-4769-8332-06e6ee170395",
53+
"name": "cyclonedx-python-lib",
54+
"version": "1.0.0"
55+
}
56+
},
57+
"components": [],
58+
"services": [
59+
{
60+
"bom-ref": "my-specific-bom-ref-for-my-first-service",
61+
"provider": {
62+
"contact": [
63+
{
64+
"email": "[email protected]",
65+
"name": "Paul Horton"
66+
},
67+
{
68+
"email": "[email protected]",
69+
"name": "A N Other",
70+
"phone": "+44 (0)1234 567890"
71+
}
72+
],
73+
"name": "CycloneDX",
74+
"url": [
75+
"https://cyclonedx.org"
76+
]
77+
},
78+
"group": "a-group",
79+
"name": "my-first-service",
80+
"version": "1.2.3",
81+
"description": "Description goes here",
82+
"endpoints": [
83+
"/api/thing/1",
84+
"/api/thing/2"
85+
],
86+
"authenticated": false,
87+
"x-trust-boundary": true,
88+
"data": [
89+
{
90+
"classification": "public",
91+
"flow": "outbound"
92+
}
93+
],
94+
"licenses": [
95+
{
96+
"expression": "Commercial"
97+
}
98+
],
99+
"externalReferences": [
100+
{
101+
"comment": "No comment",
102+
"hashes": [
103+
{
104+
"alg": "SHA-256",
105+
"content": "806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"
106+
}
107+
],
108+
"type": "distribution",
109+
"url": "https://cyclonedx.org"
110+
}
111+
],
112+
"releaseNotes": {
113+
"aliases": [
114+
"First Test Release"
115+
],
116+
"description": "This release is a test release",
117+
"featuredImage": "https://cyclonedx.org/theme/assets/images/CycloneDX-Twitter-Card.png",
118+
"notes": [
119+
{
120+
"locale": "en-GB",
121+
"text": {
122+
"content": "U29tZSBzaW1wbGUgcGxhaW4gdGV4dA==",
123+
"contentType": "text/plain; charset=UTF-8",
124+
"encoding": "base64"
125+
}
126+
},
127+
{
128+
"locale": "en-US",
129+
"text": {
130+
"content": "U29tZSBzaW1wbGUgcGxhaW4gdGV4dA==",
131+
"contentType": "text/plain; charset=UTF-8",
132+
"encoding": "base64"
133+
}
134+
}
135+
],
136+
"properties": [
137+
{
138+
"name": "key1",
139+
"value": "val1"
140+
},
141+
{
142+
"name": "key2",
143+
"value": "val2"
144+
}
145+
],
146+
"resolves": [
147+
{
148+
"description": "Apache Log4j2 2.0-beta9 through 2.12.1 and 2.13.0 through 2.15.0 JNDI features...",
149+
"id": "CVE-2021-44228",
150+
"name": "Apache Log3Shell",
151+
"references": [
152+
"https://logging.apache.org/log4j/2.x/security.html",
153+
"https://central.sonatype.org/news/20211213_log4shell_help"
154+
],
155+
"source": {
156+
"name": "NVD",
157+
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-44228"
158+
},
159+
"type": "security"
160+
}
161+
],
162+
"socialImage": "https://cyclonedx.org/cyclonedx-icon.png",
163+
"tags": [
164+
"test",
165+
"alpha"
166+
],
167+
"timestamp": "2021-12-31T10:00:00+00:00",
168+
"title": "Release Notes Title",
169+
"type": "major"
170+
},
171+
"properties": [
172+
{
173+
"name": "key1",
174+
"value": "val1"
175+
},
176+
{
177+
"name": "key2",
178+
"value": "val2"
179+
}
180+
]
181+
},
182+
{
183+
"bom-ref": "b1650ab8-33fb-47e3-bc6e-07031054a946",
184+
"name": "my-second-service"
185+
}
186+
]
187+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json",
3+
"bomFormat": "CycloneDX",
4+
"specVersion": "1.4",
5+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
6+
"version": 1,
7+
"metadata": {
8+
"timestamp": "2021-09-01T10:50:42.051979+00:00",
9+
"tools": [
10+
{
11+
"vendor": "CycloneDX",
12+
"name": "cyclonedx-python-lib",
13+
"version": "VERSION",
14+
"externalReferences": [
15+
{
16+
"type": "build-system",
17+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions"
18+
},
19+
{
20+
"type": "distribution",
21+
"url": "https://pypi.org/project/cyclonedx-python-lib/"
22+
},
23+
{
24+
"type": "documentation",
25+
"url": "https://cyclonedx.github.io/cyclonedx-python-lib/"
26+
},
27+
{
28+
"type": "issue-tracker",
29+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues"
30+
},
31+
{
32+
"type": "license",
33+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE"
34+
},
35+
{
36+
"type": "release-notes",
37+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md"
38+
},
39+
{
40+
"type": "vcs",
41+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib"
42+
},
43+
{
44+
"type": "website",
45+
"url": "https://cyclonedx.org"
46+
}
47+
]
48+
}
49+
],
50+
"component": {
51+
"type": "library",
52+
"bom-ref": "44eba9c8-ccfb-4868-90cb-deb27f72b358",
53+
"name": "cyclonedx-python-lib",
54+
"version": "1.0.0"
55+
}
56+
},
57+
"components": [],
58+
"services": [
59+
{
60+
"bom-ref": "86452881-cb1a-4296-9450-2eb6f3e55744",
61+
"name": "my-first-service"
62+
},
63+
{
64+
"bom-ref": "86452881-cb1a-4296-9450-2eb6f3e55744",
65+
"name": "my-second-service"
66+
}
67+
]
68+
}

0 commit comments

Comments
 (0)