Skip to content

Commit aae4886

Browse files
Initial commit of the party model and test cases. (#930)
superceeds #776 and closes #718. I have included the change to the `component` schema as an example of how this would look like in other schemas. Once approved by TC54, I will refactor the remaining part of the schemas to use the party model. The refactor shall use the same pattern as the component schema and should be considered during the review.
2 parents e7474ca + e43821f commit aae4886

25 files changed

Lines changed: 1992 additions & 21 deletions

schema/2.0/model/cyclonedx-component-2.0.schema.json

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,8 @@
6868
"title": "BOM Reference",
6969
"description": "An identifier which can be used to reference the component elsewhere in the BOM. Every `bom-ref` must be unique within the BOM.\nValue SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid conflicts with BOM-Links."
7070
},
71-
"supplier": {
72-
"title": "Component Supplier",
73-
"description": " The organization that supplied the component. The supplier may often be the manufacturer, but may also be a distributor or repackager.",
74-
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/organizationalEntity"
75-
},
76-
"manufacturer": {
77-
"title": "Component Manufacturer",
78-
"description": "The organization that created the component.\nManufacturer is common in components created through automated processes. Components created through manual means may have `@.authors` instead.",
79-
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/organizationalEntity"
80-
},
81-
"authors" :{
82-
"type": "array",
83-
"title": "Component Authors",
84-
"description": "The person(s) who created the component.\nAuthors are common in components created through manual processes. Components created through automated means may have `@.manufacturer` instead.",
85-
"items": {"$ref": "cyclonedx-common-2.0.schema.json#/$defs/organizationalContact"}
86-
},
87-
"publisher": {
88-
"type": "string",
89-
"title": "Component Publisher",
90-
"description": "The person(s) or organization(s) that published the component",
91-
"examples": ["Acme Inc"]
71+
"parties": {
72+
"$ref": "cyclonedx-party-2.0.schema.json#/$defs/parties"
9273
},
9374
"group": {
9475
"type": "string",

schema/2.0/model/cyclonedx-party-2.0.schema.json

Lines changed: 925 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"version": 1,
6+
"metadata": {
7+
"component": {
8+
"type": "application",
9+
"name": "Acme App"
10+
}
11+
},
12+
"components": [
13+
{
14+
"type": "library",
15+
"name": "Some Library",
16+
"parties": [
17+
{
18+
"roles": [
19+
{
20+
"role": "overlord"
21+
}
22+
],
23+
"person": {
24+
"name": "Alice"
25+
}
26+
}
27+
]
28+
}
29+
]
30+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"version": 1,
6+
"metadata": {
7+
"component": {
8+
"type": "application",
9+
"name": "Acme App"
10+
}
11+
},
12+
"components": [
13+
{
14+
"type": "library",
15+
"name": "Some Library",
16+
"parties": [
17+
{
18+
"roles": [],
19+
"person": {
20+
"name": "Alice"
21+
}
22+
}
23+
]
24+
}
25+
]
26+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"version": 1,
6+
"metadata": {
7+
"component": {
8+
"type": "application",
9+
"name": "Acme App"
10+
}
11+
},
12+
"components": [
13+
{
14+
"type": "library",
15+
"name": "Some Library",
16+
"parties": [
17+
{
18+
"roles": [
19+
{
20+
"role": "supplier"
21+
}
22+
],
23+
"organization": {
24+
"legalName": "Acme Inc.",
25+
"addresses": [
26+
{
27+
"isoCode": "italy-monza"
28+
}
29+
]
30+
}
31+
}
32+
]
33+
}
34+
]
35+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"version": 1,
6+
"metadata": {
7+
"component": {
8+
"type": "application",
9+
"name": "Acme App"
10+
}
11+
},
12+
"components": [
13+
{
14+
"type": "library",
15+
"name": "Some Library",
16+
"parties": [
17+
{
18+
"roles": [
19+
{
20+
"role": "supplier"
21+
}
22+
],
23+
"organization": {
24+
"legalName": "Acme Inc.",
25+
"addresses": [
26+
{
27+
"country": "Antarctica",
28+
"coordinates": {
29+
"latitude": -123.456,
30+
"longitude": 0.0
31+
}
32+
}
33+
]
34+
}
35+
}
36+
]
37+
}
38+
]
39+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"version": 1,
6+
"metadata": {
7+
"component": {
8+
"type": "application",
9+
"name": "Acme App"
10+
}
11+
},
12+
"components": [
13+
{
14+
"type": "library",
15+
"name": "Some Library",
16+
"parties": [
17+
{
18+
"person": {
19+
"name": "Alice"
20+
}
21+
}
22+
]
23+
}
24+
]
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"version": 1,
6+
"metadata": {
7+
"component": {
8+
"type": "application",
9+
"name": "Product"
10+
}
11+
},
12+
"components": [
13+
{
14+
"type": "library",
15+
"name": "Some Library",
16+
"parties": [
17+
{
18+
"organization": {
19+
"legalName": "Acme Incorporated"
20+
}
21+
}
22+
]
23+
}
24+
]
25+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"version": 1,
6+
"metadata": {
7+
"component": {
8+
"type": "application",
9+
"name": "Acme App"
10+
}
11+
},
12+
"components": [
13+
{
14+
"type": "library",
15+
"name": "Some Library",
16+
"parties": [
17+
{
18+
"roles": [
19+
{
20+
"role": "author"
21+
}
22+
]
23+
}
24+
]
25+
}
26+
]
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json",
3+
"specFormat": "CycloneDX",
4+
"specVersion": "2.0",
5+
"version": 1,
6+
"metadata": {
7+
"component": {
8+
"type": "application",
9+
"name": "Product"
10+
}
11+
},
12+
"components": [
13+
{
14+
"type": "library",
15+
"name": "Some Library",
16+
"parties": [
17+
{
18+
"roles": [
19+
{
20+
"role": "supplier"
21+
}
22+
]
23+
}
24+
]
25+
}
26+
]
27+
}

0 commit comments

Comments
 (0)