python-tuf/tests
Lukas Puehringer 3e249f5bdd Make Metadata a container class (WIP)
This commit performs restructuring on the recently added metadata
class model architecture, which shall be part of a new simple TUF
API.

The key change is that the Metadata class is now used as container
for inner TUF metadata (Root, Timestamp, Snapshot, Targets) instead
of serving as base class for these, that means we use 'composition'
instead of 'inheritance'. Still, in order to aggregate common
attributes of the inner Metadata (expires, version, spec_version),
we use a new baseclass 'Signed', which also corresponds to the
signed field of the outer metadata container.

Based on prior observations in TUF's sister project in-toto, this
architecture seems to more closely represent the metadata model as
it is defined in the specification (see in-toto/in-toto#98 and
in-toto/in-toto#142 for related discussions).

Note that the proposed changes require us to now access some
attributes/methods via the signed attribute of a Metadata object
and not directly on the Metadata object, but it would be possible
to add short-cuts. (see todo notes in doc header).

Further changes include:
 - Add minimal doc header with TODO notes

 - Make attributes that correspond to fields in TUF JSON metadata
public again. There doesn't seem to be a good reason to protect
them with leading underscores and use setters/getters instead, it
just adds more code.

 - Generally try to reduce code.

 - Remove keyring and consistent_snapshot attributes from metadata
   class. As discussed in #1060 they are a better fit for extra
   management code (also see #660)

- Remove sslib schema checks (see TODO notes about validation in
  doc header)

 - Drop usage of build_dict_conforming_to_schema, it seems a lot
   simpler and more explicit to just code this here.

 - ... same goes for make_metadata_fileinfo

 - Adapt tests accordingly

TODO: Document!!!
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2020-07-10 16:05:53 +02:00
..
repository_data Remove redundant test logic 2020-05-12 22:16:38 +01:00
ssl_certs Test: add https test with expired server certificate 2018-09-26 14:15:36 -04:00
.coveragerc Move omit to run section in .coveragerc 2019-07-11 14:32:49 +02:00
__init__.py Support ISO 8601, vendor iso8601, clean codebase. 2014-04-19 14:27:53 -04:00
aggregate_tests.py Install TUF in editable mode in tox builds 2019-07-11 14:32:49 +02:00
proxy_server.py much simpler keys 2020-07-01 18:39:35 -04:00
simple_https_server.py Test: add proxy certs and reorganize certs in test data dir 2018-09-21 13:13:52 -04:00
simple_server.py Remove six.PY2 and platform checks and add warning 2020-05-07 18:06:09 +03:00
slow_retrieval_server.py DOC: Clarify and correct comments on download timeouts 2018-09-10 16:30:32 -04:00
test_arbitrary_package_attack.py Remove PIPE arg and make QuiteHandler the default 2020-05-07 15:53:01 +03:00
test_developer_tool.py Port to new securesystemslib w abstract filesystem 2020-05-12 22:16:50 +01:00
test_download.py Use __name__ for loggers, per convention 2020-03-03 10:36:39 +00:00
test_endless_data_attack.py Remove PIPE arg and make QuiteHandler the default 2020-05-07 15:53:01 +03:00
test_exceptions.py Use __name__ for loggers, per convention 2020-03-03 10:36:39 +00:00
test_extraneous_dependencies_attack.py Remove PIPE arg and make QuiteHandler the default 2020-05-07 15:53:01 +03:00
test_formats.py Remove deprecated securesystemslib.formats schemas 2019-09-17 10:28:10 +01:00
test_indefinite_freeze_attack.py Remove PIPE arg and make QuiteHandler the default 2020-05-07 15:53:01 +03:00
test_init.py Use __name__ for loggers, per convention 2020-03-03 10:36:39 +00:00
test_key_revocation_integration.py Remove PIPE arg and make QuiteHandler the default 2020-05-07 15:53:01 +03:00
test_keydb.py Use __name__ for loggers, per convention 2020-03-03 10:36:39 +00:00
test_log.py Use __name__ for loggers, per convention 2020-03-03 10:36:39 +00:00
test_mirrors.py Minor cosmetic change to URL creation 2018-04-20 10:57:30 -04:00
test_mix_and_match_attack.py Remove PIPE arg and make QuiteHandler the default 2020-05-07 15:53:01 +03:00
test_multiple_repositories_integration.py Remove PIPE arg and make QuiteHandler the default 2020-05-07 15:53:01 +03:00
test_proxy_use.py Use __name__ for loggers, per convention 2020-03-03 10:36:39 +00:00
test_replay_attack.py Remove PIPE arg and make QuiteHandler the default 2020-05-07 15:53:01 +03:00
test_repository_lib.py Support abstract storage for timestamp metadata 2020-06-03 14:16:47 +01:00
test_repository_tool.py Update test_load_repository 2020-06-09 16:48:53 +03:00
test_roledb.py Use __name__ for loggers, per convention 2020-03-03 10:36:39 +00:00
test_root_versioning_integration.py Port to new securesystemslib w abstract filesystem 2020-05-12 22:16:50 +01:00
test_sig.py Use __name__ for loggers, per convention 2020-03-03 10:36:39 +00:00
test_slow_retrieval_attack.py Remove unused imports 2020-06-04 19:18:33 -05:00
test_tuf_api.py Make Metadata a container class (WIP) 2020-07-10 16:05:53 +02:00
test_tutorial.py Update TUTORIAL and test_tutorial 2020-04-08 18:58:27 +03:00
test_unittest_toolbox.py Use __name__ for loggers, per convention 2020-03-03 10:36:39 +00:00
test_updater.py Port to new securesystemslib w abstract filesystem 2020-05-12 22:16:50 +01:00
test_updater_root_rotation_integration.py Remove PIPE arg and make QuiteHandler the default 2020-05-07 15:53:01 +03:00