python-tuf/examples/repository
Jussi Kukkonen 38f309bbbf WIP: Update to new securesystemslib API
* API changes covered:
  * keys and interface modules removed
  * SSlibSigner removed
  * CryptoSigner added: this replaces the removed functionality
  * DSSE "signatures" container type changed
* Currently pins a securesystemslib main branch commit:
  this shoudl be reverted before merging, when securesystemslib
  has made a release
* tests/generated_data/generate_md.py was simplified
* Encrypted test keys in tests/repository_data/keystore were replaced
  with the unencrypted PEM versions of the same keys
* The public test keys in tests/repository_data/keystore were removed
  as they were not used anymore

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2024-04-25 14:27:54 +03:00
..
_simplerepo.py WIP: Update to new securesystemslib API 2024-04-25 14:27:54 +03:00
README.md examples: Add missing link in repository README 2023-02-08 10:53:59 +02:00
repo examples: Implement the upload API 2023-02-02 16:25:43 +02:00

TUF Repository Application Example

⚠️ This example uses the repository module which is not considered part of the python-tuf stable API quite yet.

This TUF Repository Application Example has the following features:

  • 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.
  • Exposes a small API for the uploader tool example. API POST endpoints are:
    • /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

Usage

./repo

Your repository is now running and is accessible on localhost, See e.g. http://127.0.0.1:8001/metadata/1.root.json. The client example uses this address by default.