Skip to content

Commit 7feee4b

Browse files
committed
Adapt test samples to ensure consistency between the different formats
Signed-off-by: andreas hilti <69210561+andreas-hilti@users.noreply.github.com>
1 parent bfb6f8b commit 7feee4b

Some content is hidden

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

42 files changed

+406
-176
lines changed

tools/src/test/resources/1.6/valid-annotation-1.6.json

+7
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@
7777
"name": "Partner Org",
7878
"url": [
7979
"https://partner.org"
80+
],
81+
"contact" : [
82+
{
83+
"name": "Support",
84+
"email": "support@partner.org",
85+
"phone": "800-555-1212"
86+
}
8087
]
8188
},
8289
"group": "org.partner",

tools/src/test/resources/1.6/valid-annotation-1.6.textproto

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ annotations {
2424
}
2525
}
2626
timestamp {
27-
seconds: 3173618478
28-
nanos: 3
27+
seconds: 1640995200
28+
nanos: 0
2929
}
3030
text: "This is a sample annotation made by an organization"
3131
}
@@ -40,10 +40,10 @@ annotations {
4040
}
4141
}
4242
timestamp {
43-
seconds: 3173618478
44-
nanos: 3
43+
seconds: 1640995200
44+
nanos: 0
4545
}
46-
text: "This is a sample annotation made by an person"
46+
text: "This is a sample annotation made by a person"
4747
}
4848
annotations {
4949
bom_ref: "annotation-3"
@@ -56,8 +56,8 @@ annotations {
5656
}
5757
}
5858
timestamp {
59-
seconds: 3173618478
60-
nanos: 3
59+
seconds: 1640995200
60+
nanos: 0
6161
}
6262
text: "This is a sample annotation made by a component"
6363
}
@@ -72,7 +72,7 @@ annotations {
7272
url: "https://partner.org"
7373
contact {
7474
name: "Support"
75-
email: "support@partner"
75+
email: "support@partner.org"
7676
phone: "800-555-1212"
7777
}
7878
}
@@ -90,8 +90,8 @@ annotations {
9090
}
9191
}
9292
timestamp {
93-
seconds: 3173618478
94-
nanos: 3
93+
seconds: 1640995200
94+
nanos: 0
9595
}
9696
text: "This is a sample annotation made by a service"
9797
}

tools/src/test/resources/1.6/valid-annotation-1.6.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</contact>
2222
</organization>
2323
</annotator>
24-
<timestamp>2020-04-07T07:01:00Z</timestamp>
24+
<timestamp>2022-01-01T00:00:00Z</timestamp>
2525
<text>This is a sample annotation made by an organization</text>
2626
</annotation>
2727
<annotation bom-ref="annotation-2">
@@ -35,8 +35,8 @@
3535
<phone>800-555-1212</phone>
3636
</individual>
3737
</annotator>
38-
<timestamp>2020-04-07T07:01:00Z</timestamp>
39-
<text>This is a sample annotation made by an person</text>
38+
<timestamp>2022-01-01T00:00:00Z</timestamp>
39+
<text>This is a sample annotation made by a person</text>
4040
</annotation>
4141
<annotation bom-ref="annotation-3">
4242
<subjects>
@@ -48,7 +48,7 @@
4848
<version>9.1.2</version>
4949
</component>
5050
</annotator>
51-
<timestamp>2020-04-07T07:01:00Z</timestamp>
51+
<timestamp>2022-01-01T00:00:00Z</timestamp>
5252
<text>This is a sample annotation made by a component</text>
5353
</annotation>
5454
<annotation bom-ref="annotation-4">
@@ -62,7 +62,7 @@
6262
<url>https://partner.org</url>
6363
<contact>
6464
<name>Support</name>
65-
<email>support@partner</email>
65+
<email>support@partner.org</email>
6666
<phone>800-555-1212</phone>
6767
</contact>
6868
</provider>
@@ -76,11 +76,11 @@
7676
<authenticated>true</authenticated>
7777
<x-trust-boundary>true</x-trust-boundary>
7878
<data>
79-
<classification flow="bi-directional">pubic</classification>
79+
<classification flow="bi-directional">public</classification>
8080
</data>
8181
</service>
8282
</annotator>
83-
<timestamp>2020-04-07T07:01:00Z</timestamp>
83+
<timestamp>2022-01-01T00:00:00Z</timestamp>
8484
<text>This is a sample annotation made by a service</text>
8585
</annotation>
8686
</annotations>

tools/src/test/resources/1.6/valid-attestation-1.6.textproto

+6-6
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ declarations: {
7272
}
7373
]
7474
created {
75-
seconds: 1714003200
75+
seconds: 1682380800
7676
nanos: 0
7777
}
7878
expires {
79-
seconds: 1712102400
79+
seconds: 1684972800
8080
nanos: 0
8181
}
8282
author: {
@@ -104,11 +104,11 @@ declarations: {
104104
}
105105
]
106106
created {
107-
seconds: 1714003200
107+
seconds: 1682380800
108108
nanos: 0
109109
}
110110
expires {
111-
seconds: 1712102400
111+
seconds: 1684972800
112112
nanos: 0
113113
}
114114
author: {
@@ -136,11 +136,11 @@ declarations: {
136136
}
137137
]
138138
created {
139-
seconds: 1714003200
139+
seconds: 1682380800
140140
nanos: 0
141141
}
142142
expires {
143-
seconds: 1712102400
143+
seconds: 1684972800
144144
nanos: 0
145145
}
146146
author: {

tools/src/test/resources/1.6/valid-attestation-1.6.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<declarations>
44
<assessors>
55
<assessor bom-ref="assessor-1">
6-
<thirdParty>false</thirdParty>
6+
<thirdParty>true</thirdParty>
77
<organization>
8-
<name>Acme Inc</name>
8+
<name>Assessors Inc</name>
99
</organization>
1010
</assessor>
1111
</assessors>
@@ -25,7 +25,7 @@
2525
<score>0.8</score>
2626
<rationale>Conformance rationale here</rationale>
2727
<mitigationStrategies>
28-
<mitigationStrategy>mitigations-1</mitigationStrategy>
28+
<mitigationStrategy>mitigationStrategy-1</mitigationStrategy>
2929
</mitigationStrategies>
3030
</conformance>
3131
<confidence>
@@ -110,7 +110,7 @@
110110
<contents>
111111
<attachment content-type="text/plain">Mitigation strategy here</attachment>
112112
</contents>
113-
<classification>Public</classification>
113+
<classification>Company Confidential</classification>
114114
<sensitiveData>Describe sensitive data here</sensitiveData>
115115
</data>
116116
<created>2023-04-25T00:00:00+00:00</created>

tools/src/test/resources/1.6/valid-bom-1.6.textproto

+8-9
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ version: 1
66
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
77
metadata {
88
timestamp {
9-
seconds: 3173618478
10-
nanos: 3
9+
seconds: 1586809239
10+
nanos: 0
1111
}
1212
tools {
1313
vendor: "Awesome Vendor"
@@ -112,15 +112,15 @@ components {
112112
version: "9.0.14"
113113
}
114114
commits {
115-
uid: "123"
116-
url: ""
115+
uid: "7638417db6d59f3c431d3e1f261cc637155684cd"
116+
url: "https://location/to/7638417db6d59f3c431d3e1f261cc637155684cd"
117117
author {
118118
timestamp {
119-
seconds: 3084280878
120-
nanos: 3
119+
seconds: 1542140439
120+
nanos: 0
121121
}
122-
name: ""
123-
email: ""
122+
name: "me"
123+
email: "me@acme.org"
124124
}
125125
}
126126
}
@@ -141,7 +141,6 @@ components {
141141
email: "support@apac.example.com"
142142
}
143143
}
144-
author: "Example Super Heros"
145144
group: "org.example"
146145
name: "mylibrary"
147146
version: "1.0.0"

tools/src/test/resources/1.6/valid-component-identifiers-1.6.textproto

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
77
components {
88
type: CLASSIFICATION_LIBRARY
99
group: "com.example"
10-
name: "acme-example"
10+
name: "acme-library"
1111
version: "1.0.0"
1212
cpe: "cpe:2.3:a:example:acme-library:1.0.0:*:*:*:*:*:*:*"
1313
purl: "pkg:maven/com.example/acme-library@1.0.0"

tools/src/test/resources/1.6/valid-component-ref-1.6.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@
99
"type": "library",
1010
"bom-ref": "123",
1111
"name": "acme-library",
12-
"version": "1.0.0"
12+
"version": "1.0.0",
13+
"components" : [
14+
{
15+
"type": "library",
16+
"bom-ref": "456",
17+
"name": "acme-library",
18+
"version": "1.0.0"
19+
}
20+
]
1321
},
1422
{
1523
"type": "library",
16-
"bom-ref": "456",
24+
"bom-ref": "789",
1725
"name": "acme-library",
1826
"version": "1.0.0"
1927
}

tools/src/test/resources/1.6/valid-component-ref-1.6.textproto

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ components {
99
bom_ref: "123"
1010
name: "acme-library"
1111
version: "1.0.0"
12+
components {
13+
type: CLASSIFICATION_LIBRARY
14+
bom_ref: "456"
15+
name: "acme-library"
16+
version: "1.0.0"
17+
}
1218
}
1319
components {
1420
type: CLASSIFICATION_LIBRARY
15-
bom_ref: "456"
21+
bom_ref: "789"
1622
name: "acme-library"
1723
version: "1.0.0"
1824
}

tools/src/test/resources/1.6/valid-compositions-1.6.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</component>
2222
<component type="library" bom-ref="pkg:maven/acme/library@3.0">
2323
<name>Acme Library</name>
24-
<version>2.0</version>
24+
<version>3.0</version>
2525
<purl>pkg:maven/acme/library@3.0</purl>
2626
</component>
2727
</components>
@@ -49,9 +49,9 @@
4949
</composition>
5050
<composition>
5151
<aggregate>incomplete_first_party_only</aggregate>
52-
<assemblies>
53-
<assembly ref="vulnerability-1"/>
54-
</assemblies>
52+
<vulnerabilities>
53+
<vulnerability ref="vulnerability-1"/>
54+
</vulnerabilities>
5555
</composition>
5656
</compositions>
5757
<vulnerabilities>

tools/src/test/resources/1.6/valid-cryptography-full-1.6.textproto

+12-12
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ components: [
4242
subjectName: "Subject name here"
4343
issuerName: "Issuer name here"
4444
notValidBefore {
45-
seconds: 3173618478
46-
nanos: 3
45+
seconds: 1640995200
46+
nanos: 0
4747
}
4848
notValidAfter {
49-
seconds: 3173618478
50-
nanos: 3
49+
seconds: 1704067200
50+
nanos: 0
5151
}
5252
signatureAlgorithmRef: "bom-ref-to-algorithm"
5353
subjectPublicKeyRef: "bom-ref-to-public-key"
@@ -93,20 +93,20 @@ components: [
9393
state: CRYPTO_RELATED_STATE_ACTIVE
9494
algorithmRef: "bom-ref-to-algorithm"
9595
creationDate {
96-
seconds: 3173618478
97-
nanos: 3
96+
seconds: 1704067200
97+
nanos: 0
9898
}
9999
activationDate {
100-
seconds: 3173618478
101-
nanos: 3
100+
seconds: 1704153600
101+
nanos: 0
102102
}
103103
updateDate {
104-
seconds: 3173618478
105-
nanos: 3
104+
seconds: 1704240000
105+
nanos: 0
106106
}
107107
expirationDate {
108-
seconds: 3173618478
109-
nanos: 3
108+
seconds: 1704326400
109+
nanos: 0
110110
}
111111
value: "Value here"
112112
size: 1024

tools/src/test/resources/1.6/valid-cryptography-implementation-1.6.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
</cryptoProperties>
3232
</component>
3333
<component type="library" bom-ref="crypto-library">
34-
<name>Crypto Library</name>
34+
<name>Crypto library</name>
3535
<version>1.0.0</version>
3636
</component>
3737
<component type="library" bom-ref="some-library">
38-
<name>Some Library</name>
38+
<name>Some library</name>
3939
<version>1.0.0</version>
4040
</component>
4141
</components>

tools/src/test/resources/1.6/valid-dependency-1.6.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.6">
33
<components>
44
<component type="library" bom-ref="library-a">
5-
<name>acme-library-a</name>
5+
<name>library-a</name>
66
<version>1.0.0</version>
77
</component>
88
<component type="library" bom-ref="library-b">
9-
<name>acme-library-b</name>
9+
<name>library-b</name>
1010
<version>1.0.0</version>
1111
</component>
1212
<component type="library" bom-ref="library-c">
13-
<name>acme-library-b</name>
13+
<name>library-c</name>
1414
<version>1.0.0</version>
1515
</component>
1616
</components>

tools/src/test/resources/1.6/valid-evidence-1.6.textproto

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ components [
4242
}
4343
],
4444
tools: [
45-
"bom-ref-of-tool-that-performed-analysis",
4645
"bom-ref-of-tool-that-performed-analysis"
4746
]
4847
},

0 commit comments

Comments
 (0)