After seeing the coveralls report I realized the projects were not
relocatable. While this might be convenient for some uses, moving a
project from one place to another might not be optimal. This has been
changed now.
The only place where absolute filepaths are handled now is with flat
project layouts. However, it is possible to overwrite this filepath if
the targets folder is to be changed.
As of the current version, some functions that were provided by the
repository_tool have been moved to the repository_lib module. This
commit fixes those conflicts
Metadata and targets directory names were redeclared in a local
variable. They are now imported from the repository_tool.
I also removed an unnecessary declaration for the targets.json file
expiration since it didn't have anything to do with the developer tools
There is a new entry in tuf.formats.py that represents the layout of the
project.cfg file. This new schema will be used to check for sanity upon
loading the .cfg file in the load_project function
The public key for the whole project used to be stored in a non-standard
way (this means, not as a keydict schema). I migrated the data structure
to a valid keydict schema with the aim of improving code-consistency in
the developer tools.
This will also make schema checks easier
To avoid conflicts in the load_project function, we clear the roledb and
the keydb modules. This ensures that there are no repeated entries from
previous runs.
Project name is now an argument of the project constructor and the
create_new project function.
The project_name field defines the rolename to add to the roledb, the
filename to create and adds a new field to the project.cfg file.
The local _prompt and _get_password methods were deleted in order to use
the version contained in the tuf.repository_tools. The main motivation
of this change is to provide code reutilization
The repository tool now provides a method called
"_metadata_is_partially_loaded" to provide the same functionality, the
return type changed so the flow of this module had to adapt to the new
function:
_check_if_partial_loaded() -> updated the roleinfo data as an effect
_metadata_is_partially_loaded -> returns a boolean and forces us to
update the roleinfo data.
The load_project contained statements that called the previously
included "targets" instance, since we now inherit Targets, we don't
require them, the statements were updated the following way:
self._targets
to a plain:
self
The add verification key method now prohibits the ability to have more
than one key in the Project role, however, delegations do support
having more.
This is the suggested behavior as of this version, removing these two
wapper functions would prevent to have this limitation but would require
the extension of the write_project_configuration function
The motivation behind this change is code reutilization and quick
updating. Most of the methods called in the old version of the developer
tool immediate to the targets counterpart. The calling convention now
resembles more objective intended without losing any functionality and
with automatic updates from any changes in the repository_tool.
The project object used to have a Targets object contained. This did
make more sense in a conceptual way (a project could have had more roles
than only targets). However, after reviewing the functionality of the
tool, it seems clear that the best way to adopt the changes
automatically is to inherit the targets object.
Soft wrappers are still to be made, we need to override the
add_verification_key method to in order to avoid having more than one
key on the project.