python-tuf/tuf/api
Jussi Kukkonen d2f8c99c19 Metadata API: Add default constructor arguments
This allows creating new metadata with less boilerplate:
    root = Metadata(Root())
    targets = Metadata(Targets())

Set reasonable default values for all the arguments -- version to
1, spec_version to current supported version, etc.

Expires does not have a good default value and my original plan was
to require expires argument to be set. That would mean an
incompatible API change though as arguments before expires would be
now optional... So expires now defaults to an arbitrary value of 1
day from moment of creation.

One noteworthy special case is consistent_snapshot where the default
value is True (since that's what we want people to use for new
metadata) but None is also used to imply that metadata does not contain
the field at all.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-03-23 17:25:40 +02:00
..
serialization Merge pull request #1876 from jku/more-details-on-verify-failure 2022-03-21 14:21:44 +02:00
__init__.py tuf/api: Expose tuf.api as a package 2020-10-15 14:35:14 +01:00
exceptions.py exceptions: rename FetcherHTTPError 2022-02-04 11:03:12 +02:00
metadata.py Metadata API: Add default constructor arguments 2022-03-23 17:25:40 +02:00