Skip to content

Commit 3c7f491

Browse files
committed
Removing the HTTPS record failover and load balancing
Signed-off-by: Olle E. Johansson <oej@edvina.net>
1 parent 7ed2403 commit 3c7f491

File tree

1 file changed

+13
-50
lines changed

1 file changed

+13
-50
lines changed

discovery/readme.md

+13-50
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The TEI for a product can be communicated to the user in many ways.
3737

3838
## TEA Discovery - defining an extensible identifier
3939

40-
TEA discovery is the process where a user with a product identifier can discover and downloadg
40+
TEA discovery is the process where a user with a product identifier can discover and download
4141
artifacts automatically, with or without authentication. A globally unique identifier is
4242
required for a given product. This identifier is called the Transparency Exchange Identifier (TEI).
4343

@@ -65,7 +65,7 @@ urn:tei:<type>:<domain-name>:<unique-identifier>
6565
````
6666
6767
- The **`type`** which defines the syntax of the unique identifier part
68-
- The **`domain-name`** part does not have to exist as a web server (HTTPS), but may do
68+
- The **`domain-name`** part resolves into a web server, which may not be the API host.
6969
- The uniqueness of the name is the domain name part that has to be registred at creation of the TEI.
7070
- The **`unique-identifier`** has to be unique within the `domain-name`.
7171
Recommendation is to use a UUID but it can be an existing article code too
@@ -89,6 +89,7 @@ urn:tei:purl:<domain-name>:<purl>
8989
````
9090
9191
Example:
92+
9293
```text
9394
urn:tei:purl:cyclonedx.org:pkg:pypi/cyclonedx-python-lib@8.4.0?extension=whl&qualifier=py3-none-any
9495
```
@@ -109,9 +110,9 @@ Note that there is a TEI SWID type as well as a PURL SWID type.
109110
110111
Where the `unique-identifier` is a Hash. Supports the following hash types:
111112
112-
* SHA256
113-
* SHA384
114-
* SHA512
113+
- SHA256
114+
- SHA384
115+
- SHA512
115116
116117
```text
117118
urn:tei:hash:<domain-name>:<hashtype>:<hash>
@@ -149,53 +150,25 @@ urn:tei:uuid:cyclonedx.org:d4d9f54a-abcf-11ee-ac79-1a52914d44b1
149150
### TEI resolution using DNS
150151

151152
The `domain-name` part of the TEI is used in a DNS query to find one or multiple locations for
152-
product transparency exchange information. DNS can deliver load balancing and
153-
failover functionality to make sure that the information is always reachable.
153+
product transparency exchange information.
154154

155-
At the URL we need a well-known name space to find out where the API endpoint is hosted.
155+
At the URL a well-known name space is used to find out where the API endpoint is hosted.
156156
This is solved by using the ".well-known" name space as defined by the IETF.
157157

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

161161
The name in the DNS name part points to a set of DNS records.
162162

163-
A TEI with name `tea.example.com` queries for `tea.example.com` `HTTPS` records.
163+
A TEI with name `tea.example.com` queries for `tea.example.com` `A` and `AAAA` records.
164164
These point to the hosts available for the Transparency Exchange API.
165-
Note that `tea.example.com` may not have `A`/`AAAA` records at all if it
166-
points to other servers, like `tea01.example.org` and `teahost.example.net`.
167-
168-
If there are no HTTPS records, try to resolve the name (using `AAAA` and `A` DNS records).
169165

170-
After selecting a host and resolving that to IP address, the TEA client
171-
connects to the host using HTTPS with the original name, not the one found
172-
in DNS. The URI is composed of the name with the `/.well-known/tea` prefix added.
173-
174-
```zone_file
175-
tea.example.com. 3600 IN HTTPS 1 tea01.prod.example.com.
176-
```
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.
177168

178-
Results in the base URI (without the product identifier)
179-
`https://tea.example.com/.well-known/tea/` while connecting to
180-
the host `tea01.prod.example.com`.
169+
This results in the base URI (without the product identifier)
170+
`https://tea.example.com/.well-known/tea/`
181171

182-
Results in `https://tea.example.com/.well-known/tea/<identifier>` while connecting to
183-
the host tea01.prod.example.com.
184-
185-
### Load balancing and fail over
186-
187-
Example zone:
188-
189-
```text
190-
tea.example.com. 3600 IN HTTPS 10 tea01.prod.example.com.
191-
tea.example.com. 3600 IN HTTPS 10 tea02.prod.example.com.
192-
tea.example.com. 3600 IN HTTPS 20 tea03.prod.example.com.
193-
```
194-
195-
In this case servers tea01 and tea02 will get 50% of the load each.
196-
If they are not reachable, tea03 will be used for failover.
197-
198-
It is recommended to have a third party external repository as the last priority.
199172

200173
## Connecting to the API
201174

@@ -215,18 +188,9 @@ Append the product part of the TEI to the URI found
215188

216189
- TEI: `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
217190
- DNS record: `products.example.com`
218-
- Server found in DNS `HTTPS` record: `teapot.prod.example.com`
219191
- URL: `https://products.example.com/.well-known/tea/d4d9f54a-abcf-11ee-ac79-1a52914d44b1/`
220192
- HTTP 302 redirect to "https://teapot02.consumer.example.com/tea/v2/product-index/d4d9f54a-abcf-11ee-ac79-1a52914d44b1'
221193

222-
The server at `teapot.prod.example.com` needs a TLS certificate that valid for `products.example.com`
223-
- e.g. with `products.example.com` in the subject alt name. `teapot02.consumer.example.com` needs a certificate with that
224-
host name.
225-
226-
If no `HTTPS` records are found the resolution defaults to `A` and `AAAA` records.
227-
IP address is not valid in the domain name field.
228-
229-
Append the URL prefix `/.well-known/tea/` of the TEI to the DNS name found
230194
Always prefix with the https:// scheme. http (unencrypted) is not valid.
231195

232196
- TEI: `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
@@ -242,6 +206,5 @@ has many identifiers. The redirect should not lead to a separate web server.
242206

243207
## References
244208

245-
- [RFC 9640 - Service Binding and Parameter Specification via the DNS (SVCB and HTTPS Resource Records)](https://datatracker.ietf.org/doc/html/rfc9640)
246209
- [IANA .well-known registry](https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml)
247210
- [IANA URI registry](https://www.iana.org/assignments/urn-namespaces/urn-namespaces.xhtml#urn-namespaces-1)

0 commit comments

Comments
 (0)