Skip to content

Commit 8574e72

Browse files
authored
Merge pull request #72 from oej/update-discovery
Discovery: Change to HTTPS DNS records
2 parents 4b79291 + 3c7f491 commit 8574e72

File tree

1 file changed

+56
-44
lines changed

1 file changed

+56
-44
lines changed

discovery/readme.md

+56-44
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,39 @@
1212
- [The TEA Version Index](#the-tea-version-index)
1313
- [References](#references)
1414

15-
1615
## From product identifier to API endpoint
1716

1817
TEA Discovery is the connection between a product identifier and the API endpoint.
18+
A "product" is something that the customer aquires or downloads. It can be a bundle
19+
of many digital devices or software applications. A "product" normally also has an
20+
entry in a large corporation's asset inventory system.
21+
1922
A product identifier is embedded in a URN where the identifier is one of many existing
20-
identifiers or a random string - like an EAN bar code, product
23+
identifiers or a random string - like an EAN or UPC bar code, UUID, product
2124
number or PURL.
2225

2326
The goal is for a user to add this URN to the transparency platform (sometimes with an
2427
associated authentication token) and have the platform access the required artifacts
2528
in a highly automated fashion.
2629

30+
## Advertising the TEI
31+
32+
The TEI for a product can be communicated to the user in many ways.
33+
34+
- A QR code on a box
35+
- On the invoice or delivery note
36+
- For software with a GUI, in an "about" box
37+
2738
## TEA Discovery - defining an extensible identifier
2839

2940
TEA discovery is the process where a user with a product identifier can discover and download
3041
artifacts automatically, with or without authentication. A globally unique identifier is
3142
required for a given product. This identifier is called the Transparency Exchange Identifier (TEI).
3243

33-
The TEI identifier is based on DNS, which assures a uniqueness per vendor (or open source project)
34-
and gives the vendor a name space to define product identifiers based on existing or new identifiers like EAN bar code, PURLs or other existing schemes. A given product may have multiple identifiers as long as they all resolve into the same destination.
44+
The TEI identifier is based on DNS, which assures a uniqueness per vendor (or open source project)
45+
and gives the vendor a name space to define product identifiers based on existing or new identifiers
46+
like EAN/UPC bar code, PURLs or other existing schemes. A given product may have multiple identifiers
47+
as long as they all resolve into the same destination.
3548

3649
## The TEI URN: An extensible identifier
3750

@@ -42,12 +55,7 @@ to global uniqueness without new registries.
4255
The TEI can be shown in the software itself, in shipping documentation, in web pages and app stores.
4356
TEI is unique for a product, not a version of a software. The TEI consist of three core parts
4457

45-
- The **`type`** which defines the syntax of the unique identifier part
46-
- The **`domain-name`** part does not have to exist as a web server (HTTPS), but may do
47-
- The uniqueness of the name is the domain name part that has to be registred at creation of the TEI.
48-
- The **`unique-identifier`** has to be unique within the `domain-name`. Recommendation is to use a UUID but it can be an existing article code too
49-
50-
A TEI belongs to a single product. A product can have multiple TEIs - like one with a EAN
58+
A TEI belongs to a single product. A product can have multiple TEIs - like one with a EAN/UPC
5159
barcode and one with the vendor's product number.
5260

5361
### TEI syntax
@@ -56,6 +64,12 @@ barcode and one with the vendor's product number.
5664
urn:tei:<type>:<domain-name>:<unique-identifier>
5765
````
5866
67+
- The **`type`** which defines the syntax of the unique identifier part
68+
- The **`domain-name`** part resolves into a web server, which may not be the API host.
69+
- The uniqueness of the name is the domain name part that has to be registred at creation of the TEI.
70+
- The **`unique-identifier`** has to be unique within the `domain-name`.
71+
Recommendation is to use a UUID but it can be an existing article code too
72+
5973
**Note**: this requires a registration of the TEI URN schema with IANA - [see here](https://github.com/CycloneDX/transparency-exchange-api/issues/18)
6074
6175
### TEI types
@@ -75,6 +89,7 @@ urn:tei:purl:<domain-name>:<purl>
7589
````
7690
7791
Example:
92+
7893
```text
7994
urn:tei:purl:cyclonedx.org:pkg:pypi/cyclonedx-python-lib@8.4.0?extension=whl&qualifier=py3-none-any
8095
```
@@ -95,9 +110,9 @@ Note that there is a TEI SWID type as well as a PURL SWID type.
95110
96111
Where the `unique-identifier` is a Hash. Supports the following hash types:
97112
98-
* SHA256
99-
* SHA384
100-
* SHA512
113+
- SHA256
114+
- SHA384
115+
- SHA512
101116
102117
```text
103118
urn:tei:hash:<domain-name>:<hashtype>:<hash>
@@ -132,58 +147,56 @@ urn:tei:uuid:cyclonedx.org:d4d9f54a-abcf-11ee-ac79-1a52914d44b1
132147
- GS1
133148
- STD
134149

135-
136150
### TEI resolution using DNS
137151

138-
The name part of the TEI is used in a DNS query to find one or multiple locations for product transparency exchange information.
139-
At the URL we need a well-known name space to find out more
152+
The `domain-name` part of the TEI is used in a DNS query to find one or multiple locations for
153+
product transparency exchange information.
154+
155+
At the URL a well-known name space is used to find out where the API endpoint is hosted.
156+
This is solved by using the ".well-known" name space as defined by the IETF.
140157

141158
- `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
142159
- Syntax: `urn:tei:uuid:<name based on domain>:<unique identifier>`
143160

144161
The name in the DNS name part points to a set of DNS records.
145-
A TEI with name “tex.example.com" queries for `_tei._tcp.tex.example.com URI records`.
146-
These point to URIs for the transparency exchange data.
147-
If there are no records, try to resolve the name (using AAAA and A DNS records) and
148-
append the /.well-known/tei prefix
149162

150-
```dns
151-
_tei._tcp.tex.example.com. 3600 IN URI 10 1 “https://www.example.com/transparency“
152-
```
163+
A TEI with name `tea.example.com` queries for `tea.example.com` `A` and `AAAA` records.
164+
These point to the hosts available for the Transparency Exchange API.
153165

154-
Example response of DNS query including multiple URIs with a priority
166+
The TEA client connects to the host using HTTPS and validates the certificate.
167+
The URI is composed of the name with the `/.well-known/tea` prefix added.
168+
169+
This results in the base URI (without the product identifier)
170+
`https://tea.example.com/.well-known/tea/`
155171

156-
```dns
157-
_tei._tcp.tex.example.com. 3600 IN URI 10 1 “https://www.example.com/transparency“
158-
_tei._tcp.tex.example.com. 3600 IN URI 20 1 “https://backup.example.com/transparency“
159-
_tei._tcp.tex.example.com. 3600 IN URI 30 1 “https://thirdparty.example.org/example.com/transparency“
160-
```
161172

162-
First try lowest priority then move up.
173+
## Connecting to the API
163174

164-
It is recommended to have a third party external repository as the last priority.
165-
The URI in DNS does not have to belong to the same domain as the URI records. I.e.
166-
it is valid for "tex.example.com" to resolve to "thirdparty.example.org".
175+
When connecting to the `.well-known/tea` URI with the unique identifier
176+
a HTTP redirect is **required**.
167177

168-
### Finding the Index using DNS result
178+
The server MUST redirect HTTP requests for that resource
179+
to the actual "context path" using one of the available mechanisms
180+
provided by HTTP (e.g., using a 301, 303, or 307 response). Clients
181+
MUST handle HTTP redirects on the `.well-known` URI. Servers MUST
182+
NOT locate the actual TEA service endpoint at the
183+
`.well-known` URI as per Section 1.1 of [RFC5785].
184+
185+
### Overview: Finding the Index using DNS result
169186

170187
Append the product part of the TEI to the URI found
171188

172189
- TEI: `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
173-
- DNS record: `_tei._tcp.products.example.com`
174-
- URI in DNS: `://www.example.com/transparency/`
175-
- URL: `https://www.example.com/transparency/d4d9f54a-abcf-11ee-ac79-1a52914d44b1/`
176-
177-
If no DNS URI records are found the resolution defaults to A and AAAA records.
178-
IP address is not valid in the domain name field.
190+
- DNS record: `products.example.com`
191+
- URL: `https://products.example.com/.well-known/tea/d4d9f54a-abcf-11ee-ac79-1a52914d44b1/`
192+
- HTTP 302 redirect to "https://teapot02.consumer.example.com/tea/v2/product-index/d4d9f54a-abcf-11ee-ac79-1a52914d44b1'
179193

180-
Append the URL prefix `/.well-known/tei/` of the TEI to the DNS name found
181194
Always prefix with the https:// scheme. http (unencrypted) is not valid.
182195

183196
- TEI: `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
184-
- URL: `https://products.example.com/.well-known/tei/d4d9f54a-abcf-11ee-ac79-1a52914d44b1/`
197+
- URL: `https://products.example.com/.well-known/tea/d4d9f54a-abcf-11ee-ac79-1a52914d44b1/`
185198

186-
**NOTE:** The `/.well-known/tei`names space needs to be registred.
199+
**NOTE:** The `/.well-known/tea`names space needs to be registred.
187200

188201
## The TEA Version Index
189202

@@ -193,6 +206,5 @@ has many identifiers. The redirect should not lead to a separate web server.
193206

194207
## References
195208

196-
- [RFC 7553 - THE DNS URI record](https://datatracker.ietf.org/doc/html/rfc7553)
197209
- [IANA .well-known registry](https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml)
198210
- [IANA URI registry](https://www.iana.org/assignments/urn-namespaces/urn-namespaces.xhtml#urn-namespaces-1)

0 commit comments

Comments
 (0)