python-tuf/tuf
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
..
api Metadata API: Add default constructor arguments 2022-03-23 17:25:40 +02:00
ngclient Fix expired metadata tests 2022-03-18 19:53:50 +02:00
__init__.py Remove redundant comment about version 2022-03-09 11:53:13 +00:00
py.typed Advertize type annotations with py.typed 2021-11-11 22:34:22 +02:00