Commit graph

6 commits

Author SHA1 Message Date
Jussi Kukkonen
0262a8ac49 repository: Add typed edit_*() contextmanagers
The advantage here is that code within the context can take advantage
of the correct typing. This is already visible in the example code but
is even more useful in real applications.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-03-08 10:27:43 +02:00
Jussi Kukkonen
5a944f9ba2 examples: More tweaks to uploader README
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-08 11:01:07 +02:00
Jussi Kukkonen
26495a5d0a examples: Improve uploader docs/messages
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-08 10:47:34 +02:00
Jussi Kukkonen
0998c20731 examples: Explain uploader tool in READMEs
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-02 16:25:47 +02:00
Jussi Kukkonen
92e03d2d20 examples: Implement the upload API
uploader API has two POST endpoints

/api/delegation/<ROLE>
    Accepts new delegation keys for targetpath "<ROLE>/*" to role <ROLE>.
    This data is not signed in any way: In a real service this action would
    require some external authentication.

    POST content:
        { <KEYID>: <TUF KEY> }

/api/role/<ROLE>
    accepts uploads of new versions of <ROLE> metadata. The metadata
    must be correctly signed by the keys assigned to this delegation.

    POST content:
        TUF targets metadata as json

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-02 16:25:43 +02:00
Jussi Kukkonen
69b30ecadc examples: Add uploader tool example
This tool works with the example repository: it can be used to
* Add a delegation (this is an unsafe API corresponding to e.g.
  project creation in PyPI)
* Submit new delegated role version (this requires using signing keys
  already submitted with the delegation)

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-02 16:21:52 +02:00