Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt test samples to ensure consistency between the different formats #514

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tools/src/test/resources/1.6/valid-annotation-1.6.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
"name": "Partner Org",
"url": [
"https://partner.org"
],
"contact" : [
{
"name": "Support",
"email": "[email protected]",
"phone": "800-555-1212"
}
]
},
"group": "org.partner",
Expand Down
20 changes: 10 additions & 10 deletions tools/src/test/resources/1.6/valid-annotation-1.6.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ annotations {
}
}
timestamp {
seconds: 3173618478
nanos: 3
seconds: 1640995200
nanos: 0
}
text: "This is a sample annotation made by an organization"
}
Expand All @@ -40,10 +40,10 @@ annotations {
}
}
timestamp {
seconds: 3173618478
nanos: 3
seconds: 1640995200
nanos: 0
}
text: "This is a sample annotation made by an person"
text: "This is a sample annotation made by a person"
}
annotations {
bom_ref: "annotation-3"
Expand All @@ -56,8 +56,8 @@ annotations {
}
}
timestamp {
seconds: 3173618478
nanos: 3
seconds: 1640995200
nanos: 0
}
text: "This is a sample annotation made by a component"
}
Expand All @@ -72,7 +72,7 @@ annotations {
url: "https://partner.org"
contact {
name: "Support"
email: "support@partner"
email: "support@partner.org"
phone: "800-555-1212"
}
}
Expand All @@ -90,8 +90,8 @@ annotations {
}
}
timestamp {
seconds: 3173618478
nanos: 3
seconds: 1640995200
nanos: 0
}
text: "This is a sample annotation made by a service"
}
14 changes: 7 additions & 7 deletions tools/src/test/resources/1.6/valid-annotation-1.6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</contact>
</organization>
</annotator>
<timestamp>2020-04-07T07:01:00Z</timestamp>
<timestamp>2022-01-01T00:00:00Z</timestamp>
<text>This is a sample annotation made by an organization</text>
</annotation>
<annotation bom-ref="annotation-2">
Expand All @@ -35,8 +35,8 @@
<phone>800-555-1212</phone>
</individual>
</annotator>
<timestamp>2020-04-07T07:01:00Z</timestamp>
<text>This is a sample annotation made by an person</text>
<timestamp>2022-01-01T00:00:00Z</timestamp>
<text>This is a sample annotation made by a person</text>
</annotation>
<annotation bom-ref="annotation-3">
<subjects>
Expand All @@ -48,7 +48,7 @@
<version>9.1.2</version>
</component>
</annotator>
<timestamp>2020-04-07T07:01:00Z</timestamp>
<timestamp>2022-01-01T00:00:00Z</timestamp>
<text>This is a sample annotation made by a component</text>
</annotation>
<annotation bom-ref="annotation-4">
Expand All @@ -62,7 +62,7 @@
<url>https://partner.org</url>
<contact>
<name>Support</name>
<email>support@partner</email>
<email>support@partner.org</email>
<phone>800-555-1212</phone>
</contact>
</provider>
Expand All @@ -76,11 +76,11 @@
<authenticated>true</authenticated>
<x-trust-boundary>true</x-trust-boundary>
<data>
<classification flow="bi-directional">pubic</classification>
<classification flow="bi-directional">public</classification>
</data>
</service>
</annotator>
<timestamp>2020-04-07T07:01:00Z</timestamp>
<timestamp>2022-01-01T00:00:00Z</timestamp>
<text>This is a sample annotation made by a service</text>
</annotation>
</annotations>
Expand Down
12 changes: 6 additions & 6 deletions tools/src/test/resources/1.6/valid-attestation-1.6.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ declarations: {
}
]
created {
seconds: 1714003200
seconds: 1682380800
nanos: 0
}
expires {
seconds: 1712102400
seconds: 1684972800
nanos: 0
}
author: {
Expand Down Expand Up @@ -104,11 +104,11 @@ declarations: {
}
]
created {
seconds: 1714003200
seconds: 1682380800
nanos: 0
}
expires {
seconds: 1712102400
seconds: 1684972800
nanos: 0
}
author: {
Expand Down Expand Up @@ -136,11 +136,11 @@ declarations: {
}
]
created {
seconds: 1714003200
seconds: 1682380800
nanos: 0
}
expires {
seconds: 1712102400
seconds: 1684972800
nanos: 0
}
author: {
Expand Down
8 changes: 4 additions & 4 deletions tools/src/test/resources/1.6/valid-attestation-1.6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<declarations>
<assessors>
<assessor bom-ref="assessor-1">
<thirdParty>false</thirdParty>
<thirdParty>true</thirdParty>
<organization>
<name>Acme Inc</name>
<name>Assessors Inc</name>
</organization>
</assessor>
</assessors>
Expand All @@ -25,7 +25,7 @@
<score>0.8</score>
<rationale>Conformance rationale here</rationale>
<mitigationStrategies>
<mitigationStrategy>mitigations-1</mitigationStrategy>
<mitigationStrategy>mitigationStrategy-1</mitigationStrategy>
</mitigationStrategies>
</conformance>
<confidence>
Expand Down Expand Up @@ -110,7 +110,7 @@
<contents>
<attachment content-type="text/plain">Mitigation strategy here</attachment>
</contents>
<classification>Public</classification>
<classification>Company Confidential</classification>
<sensitiveData>Describe sensitive data here</sensitiveData>
</data>
<created>2023-04-25T00:00:00+00:00</created>
Expand Down
145 changes: 121 additions & 24 deletions tools/src/test/resources/1.6/valid-bom-1.6.json

Large diffs are not rendered by default.

141 changes: 115 additions & 26 deletions tools/src/test/resources/1.6/valid-bom-1.6.textproto

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions tools/src/test/resources/1.6/valid-bom-1.6.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.6">
<metadata>
<timestamp>2020-04-07T07:01:00Z</timestamp>
<timestamp>2020-04-13T20:20:39+00:00</timestamp>
<tools>
<tool>
<vendor>Awesome Vendor</vendor>
Expand Down Expand Up @@ -46,7 +46,7 @@
</supplier>
</metadata>
<components>
<component type="application">
<component type="application" bom-ref="pkg:maven/com.acme/[email protected]?packaging=jar">
<author>Joane Doe et al.</author>
<publisher>Acme Inc</publisher>
<group>com.acme</group>
Expand Down Expand Up @@ -90,7 +90,7 @@
<uid>7638417db6d59f3c431d3e1f261cc637155684cd</uid>
<url>https://location/to/7638417db6d59f3c431d3e1f261cc637155684cd</url>
<author>
<timestamp>2018-11-07T22:01:45Z</timestamp>
<timestamp>2018-11-13T20:20:39+00:00</timestamp>
<name>John Doe</name>
<email>[email protected]</email>
</author>
Expand All @@ -105,9 +105,9 @@
<notes>Commentary here</notes>
</pedigree>
</component>
<component type="library">
<component type="library" bom-ref="pkg:maven/com.example/[email protected]?packaging=war">
<supplier>
<name>Example Inc.</name>
<name>Example, Inc.</name>
<url>https://example.com</url>
<url>https://example.net</url>
<contact>
Expand All @@ -121,7 +121,7 @@
</contact>
</supplier>
<manufacturer>
<name>Example-2, Inc.Example-2, Inc.</name>
<name>Example-2, Inc.</name>
<url>https://example.org</url>
<contact>
<email>[email protected]</email>
Expand Down Expand Up @@ -195,4 +195,9 @@
</externalReferences>
</component>
</components>
<dependencies>
<dependency ref="pkg:maven/com.acme/[email protected]?packaging=jar">
<dependency ref="pkg:maven/com.example/[email protected]?packaging=war"/>
</dependency>
</dependencies>
</bom>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
components {
type: CLASSIFICATION_LIBRARY
group: "com.example"
name: "acme-example"
name: "acme-library"
version: "1.0.0"
cpe: "cpe:2.3:a:example:acme-library:1.0.0:*:*:*:*:*:*:*"
purl: "pkg:maven/com.example/[email protected]"
Expand Down
12 changes: 10 additions & 2 deletions tools/src/test/resources/1.6/valid-component-ref-1.6.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@
"type": "library",
"bom-ref": "123",
"name": "acme-library",
"version": "1.0.0"
"version": "1.0.0",
"components" : [
{
"type": "library",
"bom-ref": "456",
"name": "acme-library",
"version": "1.0.0"
}
]
},
{
"type": "library",
"bom-ref": "456",
"bom-ref": "789",
"name": "acme-library",
"version": "1.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ components {
bom_ref: "123"
name: "acme-library"
version: "1.0.0"
components {
type: CLASSIFICATION_LIBRARY
bom_ref: "456"
name: "acme-library"
version: "1.0.0"
}
}
components {
type: CLASSIFICATION_LIBRARY
bom_ref: "456"
bom_ref: "789"
name: "acme-library"
version: "1.0.0"
}
8 changes: 4 additions & 4 deletions tools/src/test/resources/1.6/valid-compositions-1.6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</component>
<component type="library" bom-ref="pkg:maven/acme/[email protected]">
<name>Acme Library</name>
<version>2.0</version>
<version>3.0</version>
<purl>pkg:maven/acme/[email protected]</purl>
</component>
</components>
Expand Down Expand Up @@ -49,9 +49,9 @@
</composition>
<composition>
<aggregate>incomplete_first_party_only</aggregate>
<assemblies>
<assembly ref="vulnerability-1"/>
</assemblies>
<vulnerabilities>
<vulnerability ref="vulnerability-1"/>
</vulnerabilities>
</composition>
</compositions>
<vulnerabilities>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ components: [
subjectName: "Subject name here"
issuerName: "Issuer name here"
notValidBefore {
seconds: 3173618478
nanos: 3
seconds: 1640995200
nanos: 0
}
notValidAfter {
seconds: 3173618478
nanos: 3
seconds: 1704067200
nanos: 0
}
signatureAlgorithmRef: "bom-ref-to-algorithm"
subjectPublicKeyRef: "bom-ref-to-public-key"
Expand Down Expand Up @@ -93,20 +93,20 @@ components: [
state: CRYPTO_RELATED_STATE_ACTIVE
algorithmRef: "bom-ref-to-algorithm"
creationDate {
seconds: 3173618478
nanos: 3
seconds: 1704067200
nanos: 0
}
activationDate {
seconds: 3173618478
nanos: 3
seconds: 1704153600
nanos: 0
}
updateDate {
seconds: 3173618478
nanos: 3
seconds: 1704240000
nanos: 0
}
expirationDate {
seconds: 3173618478
nanos: 3
seconds: 1704326400
nanos: 0
}
value: "Value here"
size: 1024
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
</cryptoProperties>
</component>
<component type="library" bom-ref="crypto-library">
<name>Crypto Library</name>
<name>Crypto library</name>
<version>1.0.0</version>
</component>
<component type="library" bom-ref="some-library">
<name>Some Library</name>
<name>Some library</name>
<version>1.0.0</version>
</component>
</components>
Expand Down
Loading
Loading