Skip to content

Commit 344c0e1

Browse files
authored
Merge pull request #111 from ppkarwasz/feat/clarify-product
Clarify TEA Product fields
2 parents 33d4d0d + 1dd867e commit 344c0e1

File tree

3 files changed

+66
-9
lines changed

3 files changed

+66
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The working group has produced a list of use cases and requirements for the prot
3939

4040
## Data model
4141

42-
- [TEA Product index](tea-index/tea-index.md): This is the starting point. A "product" is something for sale. The [Transparency Exchange Identifier, TEI](/discovery/readme.md) points to a single product.
42+
- [TEA Product](tea-product/tea-product): This is the starting point. A "product" is something for sale or distributed as an Open Source project. The [Transparency Exchange Identifier, TEI](/discovery/readme.md) points to a single product.
4343
- [TEA Component index](tea-component/tea-component.md): A Component index is a version entry. The Component version index has one entry per version of the product.
4444
- [TEA Collection](tea-collection/tea-collection.md): The collection is a list of artefacts for a specific version. The collection can be dynamic or static, depending on the implemenation.
4545

spec/openapi.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,10 @@ components:
232232
description: An identifier with a specified type
233233
properties:
234234
idType:
235+
description: Type of identifier, e.g. `tei`, `purl`, `cpe`
235236
"$ref": "#/components/schemas/identifier-type"
236237
idValue:
238+
description: Identifier value
237239
type: string
238240
identifier-type:
239241
type: string
@@ -256,6 +258,7 @@ components:
256258
description: A TEA product
257259
properties:
258260
uuid:
261+
description: A unique identifier for the TEA product
259262
"$ref": "#/components/schemas/uuid"
260263
name:
261264
type: string
@@ -269,12 +272,30 @@ components:
269272
type: array
270273
description: List of TEA components for the product
271274
items:
275+
description: Unique identifier of the TEA component
272276
"$ref": "#/components/schemas/uuid"
273277
required:
274278
- uuid
275279
- name
276280
- identifiers
277281
- components
282+
examples:
283+
log4j2:
284+
uuid: 09e8c73b-ac45-4475-acac-33e6a7314e6d
285+
name: Apache Log4j 2
286+
identifiers:
287+
- idType: cpe
288+
idValue: cpe:2.3:a:apache:log4j
289+
- idType: purl
290+
idValue: pkg:maven/org.apache.logging.log4j/log4j-api
291+
- idType: purl
292+
idValue: pkg:maven/org.apache.logging.log4j/log4j-core
293+
- idType: purl
294+
idValue: pkg:maven/org.apache.logging.log4j/log4j-layout-template-json
295+
components:
296+
- 3910e0fd-aff4-48d6-b75f-8bf6b84687f0
297+
- b844c9bd-55d6-478c-af59-954a932b6ad3
298+
- d6d3f754-d4f4-4672-b096-b994b064ca2d
278299

279300
#
280301
# TEA Component and related objects
Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,57 @@ same vendor.
2929

3030
## TEA Product object
3131

32-
- __uuid__: A unique identifier for this product
33-
- __name__: Product name in clear text (str)
34-
- __identifiers__: A list of TEIs that apply to this product
35-
- __type__: Type of identifier - one of "tei", "purl", or "cpe"
36-
- __id__: The complete identifier (str)
37-
- __leaves__: A list of product leaves
38-
- __uuid__: TEA COMPONENT UUID
32+
A TEA Product object has the following parts:
33+
34+
- __uuid__: A unique identifier for the TEA product
35+
- __name__: Product name
36+
- __identifiers__: List of identifiers for the product
37+
- __idType__: Type of identifier, e.g. `tei`, `purl`, `cpe`
38+
- __idValue__: Identifier value
39+
- __components__: List of TEA components for the product
40+
- __uuid__: Unique identifier of the TEA component
3941

4042
The TEA Component UUID is used in the Component API to find out which versions
4143
of the Component that exists.
4244

43-
The goal of the TEA index is to provide a selection of product
45+
The goal of the TEA Product API is to provide a selection of product
4446
versions to assist the user software in finding a match for the
4547
owned version.
4648

49+
### Example
50+
51+
An example of a product consisting of an OSS project and all its Maven artifacts:
52+
53+
```json
54+
{
55+
"uuid": "09e8c73b-ac45-4475-acac-33e6a7314e6d",
56+
"name": "Apache Log4j 2",
57+
"identifiers": [
58+
{
59+
"idType": "cpe",
60+
"idValue": "cpe:2.3:a:apache:log4j"
61+
},
62+
{
63+
"idType": "purl",
64+
"idValue": "pkg:maven/org.apache.logging.log4j/log4j-api"
65+
},
66+
{
67+
"idType": "purl",
68+
"idValue": "pkg:maven/org.apache.logging.log4j/log4j-core"
69+
},
70+
{
71+
"idType": "purl",
72+
"idValue": "pkg:maven/org.apache.logging.log4j/log4j-layout-template-json"
73+
}
74+
],
75+
"components": [
76+
"3910e0fd-aff4-48d6-b75f-8bf6b84687f0",
77+
"b844c9bd-55d6-478c-af59-954a932b6ad3",
78+
"d6d3f754-d4f4-4672-b096-b994b064ca2d"
79+
]
80+
}
81+
```
82+
4783
### API usage
4884

4985
The user will find this API end point using TEA discovery.

0 commit comments

Comments
 (0)