Skip to content

Commit ca695e6

Browse files
authored
Merge pull request #212 from oej/update-docs
Documentation update
2 parents 82c4b1c + 0dcdd08 commit ca695e6

2 files changed

Lines changed: 31 additions & 30 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ product related artefacts, like BOMs, between systems. The work includes:
4343
- [Discovery of servers](/discovery/readme.md): Describes discovery using the Transparency Exchange Identifier (TEI)
4444
- Retrieval of artefacts
4545
- Publication of artefacts
46-
- Authentication and authorization
46+
- [Authentication and authorization](/auth/readme.md)
4747
- Querying
4848

4949
System and tooling implementors are encouraged to adopt this API standard for

discovery/readme.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ intention to create any TEI registries.
5555

5656
## The TEI URN: An extensible identifier
5757

58-
The TEI, Transparency Exchange Identifier, is a URN schema that is extensible based on existing
58+
The TEI, __Transparency Exchange Identifier__, is a URN schema that is extensible based on existing
5959
identifiers like EAN codes, PURL and other identifiers. It is based on a DNS name, which leads
6060
to global uniqueness without new registries.
6161

@@ -110,7 +110,7 @@ Syntax:
110110

111111
```text
112112
urn:tei:swid:<domain-name>:<swid>
113-
````
113+
```
114114

115115
Note that there is a TEI SWID type as well as a PURL SWID type.
116116

@@ -209,7 +209,7 @@ Example:
209209
urn:tei:udi:cyclonedx.org:00123456789012
210210
```
211211

212-
Note that if an identifier, like EAN, is used for multiple different product releases
212+
Note that if the same identifier, like EAN, is used for multiple different product releases
213213
then this EAN code will not be unique for a given product. While this case is supported
214214
by TEA, the vendor is recommended to create a separate TEI for each unique product sold,
215215
like UUID or hash. In any case, the vendor SHOULD minimize the number of distinct product
@@ -268,33 +268,31 @@ Example:
268268
}
269269
```
270270

271-
## TODO: Port resolution
272-
273-
N.B. This needs to be resolved before finalizing the spec.
271+
## Port resolution
274272

275273
Currently, the port number is not part of the TEI but it is needed to connect to the API.
276-
The current assumption is that the client connects on the default https port (443).
277-
At this time, it is recommended that experimental clients add an optional port parameter, which
278-
allows to override the default port.
279-
280274
A port number cannot be added to the TEI URN spec as it breaks the location independence
281275
requirement of URN.
282276

283-
Possible solutions to this issue:
284-
1. Make a convention that the port number for the ./well-known/tea is always 443. Exceptions
285-
possible via explicit client setting for non-production environments only.
286-
2. Use SRV or HTTPS DNS records to resolve the ./well-known/tea URL with the port number.
277+
The TEA API server may be hosted on any port, but the server that is part of the
278+
first step of discovery will by default be running on the default HTTPS port 443.
279+
In the JSON file found there, the server URLs may contain port numbers.
287280

281+
If the clients are known to support HTTPS/SVCB DNS records for failover and
282+
load balancing, these may be used to redirect to other ports and servers.
283+
284+
Public servers are recommended to have the server hosting the DNS name used
285+
in the TEI URI running on the default port to enable discovery of the API servers.
288286

289287
## Connecting to the API
290288

291289
Clients must pick any one of the endpoints listed in the `.well-known/tea` json
292290
response. The client MUST pick an endpoint with the at least one version that is
293-
supported by the client is using. The client MUST prioritize endpoints with the
294-
highest matching version supported both by the client and the endpoint based on
291+
supported by the client is using. The client MUST prioritize endpoints with the
292+
highest matching version supported both by the client and the endpoint based on
295293
SemVer 2.0.0 specification comparison [rules](https://semver.org/#spec-item-11).
296-
If there are several endpoints like these and if the priority field is present,
297-
the client SHOULD pick the endpoint with the highest priority value (a float
294+
If there are several endpoints like these and if the priority field is present,
295+
the client SHOULD pick the endpoint with the highest priority value (a float
298296
between 0 and 1).
299297

300298
The client must then construct the full URL to the API by appending the
@@ -308,25 +306,31 @@ Examples:
308306
2. For TEI `urn:tei:purl:products.example.com:pkg:deb/debian/curl@7.50.3-1?arch=i386&distro=jessie`
309307
`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`
310308

311-
The discovery endpoint is a part of the TEA OpenAPI specification.
309+
The discovery endpoint is a part of the TEA OpenAPI specification.
312310

313-
If the TEI is known to the TEA server, the discovery endpoint must return at least
311+
If the TEI is known to the TEA server, the discovery endpoint must return at least
314312
the product release uuid, the root URL of the TEA server, the list of supported
315-
versions, plus the response may have other fields based on the current version of
313+
versions, plus the response may have other fields based on the current version of
316314
the TEA OpenAPI specification.
317315

318-
If the TEI is not known to the TEA server, the discovery endpoint must return a 404
316+
If the TEI is not known to the TEA server, the discovery endpoint must return a 404
319317
status code with a response describing the error.
320318

321319
If the DNS record for the discovery endpoint cannot be resolved by the client, or
322320
the discovery endpoint fails with 5xx error code, or the TLS certificate cannot be validated,
323321
the client MUST retry the discovery endpoint with the next endpoint in the list, if another
324-
endpoint is present. While doing so the client SHOULD preserve the priority order if provided
325-
(from highest to lowest priority). If no other endpoint is available, the client MUST retry
326-
the discovery endpoint with the first endpoint in the list. The client SHOULD implement an
322+
endpoint is present. While doing so the client SHOULD preserve the priority order if provided
323+
(from highest to lowest priority). If no other endpoint is available, the client MUST retry
324+
the discovery endpoint with the first endpoint in the list. The client SHOULD implement an
327325
exponential backoff strategy for retries.
328326

329-
TODO: Handle Auth errors (401, 403) and corresponding messages.
327+
Client implementations needs to indicate authentication errors clearly to the users,
328+
to indicate that there are no updates. An expired token or TLS Client Cert will
329+
mean that new versions of a product or updated artefacts will not be accessed.
330+
Authentication error codes (401, 403) should not lead to failover to the next endpoint
331+
in the list.
332+
333+
How this is communicated to the client users is implementation specific.
330334

331335
## Notes Regarding .well-known
332336
Servers MUST NOT locate the actual TEA service endpoint at the
@@ -339,9 +343,6 @@ The .well-known endpoint must only be available via HTTPS. Using unencrypted HTT
339343
- TEI: `urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b1`
340344
- URL: `https://products.example.com/.well-known/tea`
341345

342-
**NOTE:** The `/.well-known/tea` names space needs to be registred.
343-
344-
345346
## References
346347

347348
- [IANA .well-known registry](https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml)

0 commit comments

Comments
 (0)