Skip to content

Commit

Permalink
Remove root from snapshot
Browse files Browse the repository at this point in the history
In PR #40 aginst the specification "root.json" has been removed from
the meta dictionary in "snapshot.json".

Update generate_snapshot_metadata() to no longer add an entry for
root.json to root.json

Signed-off-by: Joshua Lock <jlock@vmware.com>
  • Loading branch information
joshuagl committed Feb 27, 2020
1 parent a044d23 commit c7650c2
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tuf/repository_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,8 +1356,7 @@ def generate_targets_metadata(targets_directory, target_files, version,


def generate_snapshot_metadata(metadata_directory, version, expiration_date,
root_filename, targets_filename, consistent_snapshot=False,
repository_name='default'):
targets_filename, consistent_snapshot=False, repository_name='default'):
"""
<Purpose>
Create the snapshot metadata. The minimum metadata must exist (i.e.,
Expand All @@ -1379,10 +1378,6 @@ def generate_snapshot_metadata(metadata_directory, version, expiration_date,
The expiration date of the metadata file.
Conformant to 'securesystemslib.formats.ISO8601_DATETIME_SCHEMA'.
root_filename:
The filename of the top-level root role. The hash and file size of this
file is listed in the snapshot role.
targets_filename:
The filename of the top-level targets role. The hash and file size of
this file is listed in the snapshot role.
Expand Down Expand Up @@ -1417,7 +1412,6 @@ def generate_snapshot_metadata(metadata_directory, version, expiration_date,
securesystemslib.formats.PATH_SCHEMA.check_match(metadata_directory)
tuf.formats.METADATAVERSION_SCHEMA.check_match(version)
securesystemslib.formats.ISO8601_DATETIME_SCHEMA.check_match(expiration_date)
securesystemslib.formats.PATH_SCHEMA.check_match(root_filename)
securesystemslib.formats.PATH_SCHEMA.check_match(targets_filename)
securesystemslib.formats.BOOLEAN_SCHEMA.check_match(consistent_snapshot)
securesystemslib.formats.NAME_SCHEMA.check_match(repository_name)
Expand All @@ -1427,8 +1421,6 @@ def generate_snapshot_metadata(metadata_directory, version, expiration_date,
# Snapshot's 'fileinfodict' shall contain the version number of Root,
# Targets, and all delegated roles fo the repository.
fileinfodict = {}
fileinfodict[ROOT_FILENAME] = get_metadata_versioninfo(root_filename,
repository_name)
fileinfodict[TARGETS_FILENAME] = get_metadata_versioninfo(targets_filename,
repository_name)

Expand Down

0 comments on commit c7650c2

Please sign in to comment.