2022-12-02 11:30:05 +00:00
|
|
|
# TUF Repository Application Example
|
|
|
|
|
|
2022-12-03 09:33:06 +00:00
|
|
|
:warning: This example uses the repository module which is not considered
|
|
|
|
|
part of the python-tuf stable API quite yet.
|
2022-12-02 11:30:05 +00:00
|
|
|
|
2022-12-03 09:33:06 +00:00
|
|
|
This TUF Repository Application Example has the following features:
|
2022-12-02 11:30:05 +00:00
|
|
|
- Initializes a completely new repository on startup
|
|
|
|
|
- Stores everything (metadata, targets, signing keys) in-memory
|
|
|
|
|
- Serves metadata and targets on localhost (default port 8001)
|
|
|
|
|
- Simulates a live repository by automatically adding a new target
|
|
|
|
|
file every 10 seconds.
|
2023-02-08 08:53:59 +00:00
|
|
|
- Exposes a small API for the [uploader tool example](../uploader/). API POST endpoints are:
|
2023-02-08 08:27:33 +00:00
|
|
|
- `/api/role/<ROLE>`: For uploading new delegated targets metadata. Payload
|
|
|
|
|
is new version of ROLEs metadata
|
|
|
|
|
- `/api/delegation/<ROLE>`: For modifying or creating a delegation for ROLE.
|
|
|
|
|
Payload is a dict with one keyid:Key pair
|
2022-12-02 11:30:05 +00:00
|
|
|
|
2022-12-03 09:33:06 +00:00
|
|
|
### Usage
|
2022-12-02 11:30:05 +00:00
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
./repo
|
|
|
|
|
```
|
|
|
|
|
Your repository is now running and is accessible on localhost, See e.g.
|
2022-12-03 09:33:06 +00:00
|
|
|
http://127.0.0.1:8001/metadata/1.root.json. The
|
2022-12-09 20:32:46 +00:00
|
|
|
[client example](../client/README.md) uses this address by default.
|