Commit graph

9 commits

Author SHA1 Message Date
Jussi Kukkonen
4d99f78cf9 Rename manual repository example
I plan to add another repository example as well.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
2022-11-28 12:13:00 +02:00
Martin Vrachev
a872eb5b6d Hash bin delegation example: save versioned files
If we have a goal of making metadata that can just be served to clients,
then these (and the parent metadata) should have versioned filenames.
Change the file names of the delegated files in the
hashed_bin_delegation.py to versioned.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-07-21 22:39:31 +03:00
Martin Vrachev
b8ea2fb9b9 Add an example script about succinct roles usage
Add a basic example script showing all features of the succinct hash bin
delegations and the available API calls of SuccinctRoles.

The explanations are used to promote the usage of succinct hash bin
delegations by explaining it well enough so our users can understand
the API limitations and how to use them and at the same time I tried not
going into too many details of the SuccinctRoles math as its
implementation is inside tuf/api/metadata.py and there there are
explanations about that.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-07-21 22:39:31 +03:00
Lukas Puehringer
d8b23f1d55 test: add missing return type hint in test method
Following parallel merges of #1700 (added new test method),
and #1710 (started running mypy on tests), ci/cd fails in the
develop branch. This is fixed in this patch.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2021-12-10 10:48:36 +01:00
lukpueh
8209189a44
Merge pull request #1700 from lukpueh/repo-examples-hbd
doc:  basic hash bin delegation repo example + test
2021-12-10 10:33:04 +01:00
Martin Vrachev
d5d0b94f62 Add logging configuration in tests/test_examples
Logging configuration is part from each test file begging from commit
03b15fb4be
We should that as well for tests/test_examples.py

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2021-12-09 16:44:25 +02:00
Martin Vrachev
5aa547d6b6 Address more mypy warnings on tests files
All of the changes are made manual.
The target files are only those who test the new code.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2021-12-09 16:44:24 +02:00
Lukas Puehringer
e90acfe123 doc: basic hash bin delegation repo example + test
As 'repository_tool' and 'repository_lib' are being deprecated,
hash bin delegation interfaces are no longer available in this
implementation. The example code in this file demonstrates how to
easily implement those interfaces, and how to use them together
with the TUF metadata API, to perform hash bin delegation.

Note, the hash bin delegation logic in this example is largely
copied from repository_{lib, tool}, and modernized and simplified
for this purpose.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2021-12-03 10:33:24 +01:00
Lukas Puehringer
a1531d8c50 test: add test module for basic repo example
Adds new test module that executes the basic repo example
Python script and checks that it created certain (metadata)
files.

The test module is tailored for testing similar example scripts.

Co-authored-by: Joshua Lock <jlock@vmware.com>
Co-authored-by: Jussi Kukkonen <jku@goto.fi>

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2021-11-29 13:25:26 +01:00