Skip to content

Commit 9b9b2a4

Browse files
committed
feat: add port as mandatory TEI element
Signed-off-by: Pavel Shukhman <[email protected]>
1 parent 4a33a85 commit 9b9b2a4

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

discovery/readme.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ barcode and one with the vendor's product number.
7070
The TEI consists of three core parts
7171

7272
```text
73-
urn:tei:<type>:<domain-name>:<unique-identifier>
73+
urn:tei:<type>:<domain-name>:<domain-port>:<unique-identifier>
7474
````
7575
7676
- The **`type`** which defines the syntax of the unique identifier part
7777
- The **`domain-name`** part resolves into a web server, which may not be the API host.
7878
- The uniqueness of the name is the domain name part that has to be registred at creation of the TEI.
79+
- The **`domain-port`** is the port number of the web server on which ./well-known/tea is available.
7980
- The **`unique-identifier`** has to be unique within the `domain-name`.
8081
Recommendation is to use a UUID but it can be an existing article code too
8182
@@ -94,13 +95,13 @@ Where the `unique-identifier` is a PURL in it's canonical string form.
9495
Syntax:
9596
9697
```text
97-
urn:tei:purl:<domain-name>:<purl>
98+
urn:tei:purl:<domain-name>:<domain-port>:<purl>
9899
````
99100
100101
Example:
101102
102103
```text
103-
urn:tei:purl:cyclonedx.org:pkg:pypi/[email protected]?extension=whl&qualifier=py3-none-any
104+
urn:tei:purl:cyclonedx.org:443:pkg:pypi/[email protected]?extension=whl&qualifier=py3-none-any
104105
```
105106

106107
#### SWID
@@ -110,7 +111,7 @@ Where the `unique-identifier` is a SWID.
110111
Syntax:
111112

112113
```text
113-
urn:tei:swid:<domain-name>:<swid>
114+
urn:tei:swid:<domain-name>:<domain-port>:<swid>
114115
````
115116
116117
Note that there is a TEI SWID type as well as a PURL SWID type.
@@ -124,12 +125,12 @@ Where the `unique-identifier` is a Hash. Supports the following hash types:
124125
- SHA512
125126
126127
```text
127-
urn:tei:hash:<domain-name>:<hashtype>:<hash>
128+
urn:tei:hash:<domain-name>:<domain-port>:<hashtype>:<hash>
128129
````
129130
130131
Example:
131132
```text
132-
urn:tei:hash:cyclonedx.org:SHA256:fd44efd601f651c8865acf0dfeacb0df19a2b50ec69ead0262096fd2f67197b9
133+
urn:tei:hash:cyclonedx.org:443:SHA256:fd44efd601f651c8865acf0dfeacb0df19a2b50ec69ead0262096fd2f67197b9
133134
```
134135

135136
The origin of the hash is up to the vendor to define.
@@ -141,12 +142,12 @@ Where the `unique-identifier` is a UUID.
141142
Syntax:
142143

143144
```text
144-
urn:tei:uuid:<domain-name>:<uuid>
145+
urn:tei:uuid:<domain-name>:<domain-port>:<uuid>
145146
````
146147
147148
Example:
148149
```text
149-
urn:tei:uuid:cyclonedx.org:d4d9f54a-abcf-11ee-ac79-1a52914d44b1
150+
urn:tei:uuid:cyclonedx.org:443:d4d9f54a-abcf-11ee-ac79-1a52914d44b1
150151
```
151152

152153

@@ -169,8 +170,8 @@ product transparency exchange information.
169170
At the URL a well-known name space is used to find out where the API endpoint is hosted.
170171
This is solved by using the ".well-known" name space as defined by the IETF.
171172

172-
- `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
173-
- Syntax: `urn:tei:uuid:<name based on domain>:<unique identifier>`
173+
- `urn:tei:uuid:products.example.com:443:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
174+
- Syntax: `urn:tei:uuid:<name based on domain>:<domain-port>:<unique identifier>`
174175

175176
The name in the DNS name part points to a set of DNS records.
176177

@@ -231,10 +232,10 @@ plus "/discovery?tei=", plus the TEI that is url-encoded according to [RFC3986]
231232
and [RFC3986]).
232233

233234
Examples:
234-
1. For TEI `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b`
235-
`https://api.teaexample.com/v0.2.0-beta.2/discovery?tei=urn%3Atei%3Auuid%3Aproducts.example.com%3Ad4d9f54a-abcf-11ee-ac79-1a52914d44b`
236-
2. For TEI `urn:tei:purl:products.example.com:pkg:deb/debian/[email protected]?arch=i386&distro=jessie`
237-
`https://api2.teaexample.com/mytea/v1.0.0/discovery?tei=urn%3Atei%3Apurl%3Aproducts.example.com%3Apkg%3Adeb%2Fdebian%2Fcurl%407.50.3-1%3Farch%3Di386%26distro%3Djessie`
235+
1. For TEI `urn:tei:uuid:products.example.com:443:d4d9f54a-abcf-11ee-ac79-1a52914d44b`
236+
`https://api.teaexample.com/v0.2.0-beta.2/discovery?tei=urn%3Atei%3Auuid%3Aproducts.example.com%3A443%3Ad4d9f54a-abcf-11ee-ac79-1a52914d44b`
237+
2. For TEI `urn:tei:purl:products.example.com:443:pkg:deb/debian/[email protected]?arch=i386&distro=jessie`
238+
`https://api2.teaexample.com/mytea/v1.0.0/discovery?tei=urn%3Atei%3Apurl%3Aproducts.example.com%3A443%3Apkg%3Adeb%2Fdebian%2Fcurl%407.50.3-1%3Farch%3Di386%26distro%3Djessie`
238239

239240
The discovery endpoint is a part of the TEA OpenAPI specification.
240241

@@ -264,7 +265,7 @@ Servers MUST NOT locate the actual TEA service endpoint at the
264265

265266
The .well-known endpoint must only be available via HTTPS. Using unencrypted HTTP is not valid.
266267

267-
- TEI: `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
268+
- TEI: `urn:tei:uuid:products.example.com:443:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
268269
- URL: `https://products.example.com/.well-known/tea`
269270

270271
**NOTE:** The `/.well-known/tea` names space needs to be registred.

spec/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ paths:
389389
description: Transparency Exchange Identifier (TEI) for the product being discovered. Provide the TEI as a URL-encoded string per RFC 3986, RFC 3987.
390390
schema:
391391
type: string
392-
example: urn%3Atei%3Auuid%3Aproducts.example.com%3Ad4d9f54a-abcf-11ee-ac79-1a52914d44b
392+
example: urn%3Atei%3Auuid%3Aproducts.example.com%3A443%3Ad4d9f54a-abcf-11ee-ac79-1a52914d44b
393393
responses:
394394
'200':
395395
$ref: "#/components/responses/discovery-response"

0 commit comments

Comments
 (0)