Commit graph

20 commits

Author SHA1 Message Date
Jussi Kukkonen
b6465ddedf examples: Add missing link in repository README
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-08 10:53:59 +02:00
Jussi Kukkonen
46930e56c4 examples: Improve repository README
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-08 10:27:33 +02:00
Jussi Kukkonen
d36c0cfa02 examples: Rename client example directory
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-02 16:25:47 +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
efcb3cfb80 examples: Add further scaffolding for upload API
The API doesn't modify the repository yet but the data flow is there now.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-02 16:21:52 +02:00
Jussi Kukkonen
9ec8459379 examples: Add skeleton API endpoints
Also use ThreadingHTTPServer: Using Chrome utterly breaks the non-threading
server.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-02-02 16:21:52 +02:00
Jussi Kukkonen
22642ed267 examples: Update one more from_securesystemslib_key() usage
This method is now in SSlibKey

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2023-01-17 15:27:06 +02:00
Jussi Kukkonen
fd02226acb repository: Improve dosctrings
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-12-17 23:09:11 +02:00
Jussi Kukkonen
48865aede9 repository: Remove sign_only argument from close()
This is only needed for threshold signing and not even used in the
example: leave it to the implementations to handle for now.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-12-14 20:05:56 +02:00
Jussi Kukkonen
9e9c156288 repository: remove init argument from open()
This no longer seems needed: if the metadata store does not contain
a single version of role, then open() can assume it is initializing.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-12-14 19:53:43 +02:00
Jussi Kukkonen
c1bb46b6c2 repository: Improve docstrings
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-12-05 13:45:27 +02:00
Jussi Kukkonen
fdf0affcad repository: Address review comments
This is a collection of comment, documentation and logging fixes.

The noteworthy part is making it clear that repository is not stable
API yet: I think this is a good idea.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-12-03 11:34:21 +02:00
Jussi Kukkonen
0f94c03756 repository: Handle linting issues
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-12-02 13:40:58 +02:00
Jussi Kukkonen
69cb140cb3 examples: Add README for repository example
Tweak comments as well

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-12-02 13:33:14 +02:00
Jussi Kukkonen
87c74a83bc examples: Maintain a meta info cache
This is not required for the demo but is more realistic: we keep
a cache of targets versions so that we can produce a new snapshot
whenever one is needed, without accessing all of the targets metadata
to do so.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-11-30 21:19:43 +02:00
Jussi Kukkonen
df6b044c5a repository: Make snapshot/targets info required properties
This does not make the examples simpler now, but it will when
there are multiple locations where snapshot/timestamp are called.

* This way the snapshot/timestamp input material is an internal detail
  of Repository and the call sites will be simpler.
* Both methods now have a "force" argument that can be used to create a
  new version regardless of meta info changes
* but implementations are now required to implement snapshot_info
  and targets_infos properties that represent the current snapshot and
  targets versions in the repository

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-11-30 18:44:16 +02:00
Jussi Kukkonen
314efaf3da Examples: Add repository application example
This uses the repository module to create an app that
* generates everything from scratch
* serves metadata and targets from memory
* simulates a live repository by adding new targets every few seconds

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-11-28 12:13:00 +02:00
Vladimir Diaz
709ada1e65
Remove example metadata
Instead of having duplicate metadata in examples/ and tests/repository_data, retain only the metadata in tests/repository_data and link to them from METADATA.md
2017-10-11 10:38:08 -04:00
vladdd
5f94d5be0d Support ISO 8601, vendor iso8601, clean codebase. 2014-04-19 14:27:53 -04:00