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>
* Support any repository (that serves /targets/ and /metadata/)
with --url
* Support multiple repositories by aking the local cache
repository-specific
* Add "tofu" command to initialize with Trust-On-First-Use
* Update README so it uses the new repository application example
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
Fetcher interface should only raise DownloadErrors,
regardless of the implementation.
* Make sure fetch() wraps non-DownloadError errors in a DownloadError
* Make the abstract function private _fetch()
* Try to be more consistent in doscstrings
This now makes the example client more sensible (when server does not
respond):
$ ./client_example.py download qwerty
...
Failed to download target qwerty: Failed to download url http://127.0.0.1:8000/metadata/2.root.json
(here the latter part of the error string comes from DownloadError
raised by FetcherInterface.fetch())
Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
Add tuf/api/exceptions.py for exceptions in the new code.
I copied the exceptions from tuf/exceptions.py with a few important
decisions:
1. I only added the exceptions that are used in the new code
2. I removed the general "Error" class as we can directly inherit
Exceptions
3. I tried grouping the exceptions by relevance
4. I removed the second argument "UnsignedMetadataError" as it's only
kept for backward compatibility and is not used
5. I tried following the new code style guidelines and linted the file
with our linters.
Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
metadata_dir matches metadata_base_url better.
This is an API break for anyone using named arguments.
Fixes#1638
Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
- Simplify README and better keywords
- Fix the verbosity
- Better docstrings
- Client flow for init and main are clear
Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
Using ``print`` for high-level client output
Option to see ``tuf.ngclient`` logging output
Update the README.
Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
- Added the lint to examples
- README format moved from Restructuredtext to Markdown
- Removed the [INFO] and [ERROR] from output, to avoid confundint with
logging structure
Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
It is a simple example of TUF ngclient implementation.
This example contains a README.rst that is a tutorial/how-to-use
this simple client using static test data from TUF repository.
The code aims to be straightforward implementation, using basic
concepts from Python and Command Line Interface.
This is part of theupdateframework#1518
Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>