Skip to content

Commit 226c9ae

Browse files
committed
Update docstrings to include descriptions of snapshot merkle parameters.
Signed-off-by: marinamoore <mnm678@gmail.com>
1 parent 2d82f34 commit 226c9ae

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

tuf/client/updater.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,11 @@ def _get_metadata_file(self, metadata_role, remote_filename,
15221522
The expected and required version number of the 'metadata_role' file
15231523
downloaded. 'expected_version' is an integer.
15241524
1525+
snapshot_merkle:
1526+
Is the metadata file a snapshot merkle file? Snapshot merkle files
1527+
are not signed and so should skip some of the verification steps here.
1528+
Instead, they must be verified using _verify_merkle_path.
1529+
15251530
<Exceptions>
15261531
tuf.exceptions.NoWorkingMirrorError:
15271532
The metadata could not be fetched. This is raised only when all known
@@ -1767,6 +1772,11 @@ def _update_metadata(self, metadata_role, upperbound_filelength, version=None,
17671772
The expected and required version number of the 'metadata_role' file
17681773
downloaded. 'expected_version' is an integer.
17691774
1775+
snapshot_merkle:
1776+
Is the metadata to be updated for a snapshot merkle file?
1777+
Snapshot merkle metadata does not contain a signature, but must
1778+
instead be verified using _verify_merkle_path.
1779+
17701780
<Exceptions>
17711781
tuf.exceptions.NoWorkingMirrorError:
17721782
The metadata cannot be updated. This is not specific to a single

tuf/repository_lib.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,11 @@ def generate_snapshot_metadata(metadata_directory, version, expiration_date,
18351835
Read more at section 5.6 from the Mercury paper:
18361836
https://www.usenix.org/conference/atc17/technical-sessions/presentation/kuppusamy
18371837
1838+
snapshot_merkle:
1839+
Whether to generate snapshot merkle files in addition to snapshot.json
1840+
metadata. If this is true, this function will return the root and leaves
1841+
of the merkle tree in addition to the snapshot metadata.
1842+
18381843
<Exceptions>
18391844
securesystemslib.exceptions.FormatError, if the arguments are improperly
18401845
formatted.
@@ -1980,6 +1985,10 @@ def generate_timestamp_metadata(snapshot_file_path, version, expiration_date,
19801985
metadata file in the timestamp metadata.
19811986
Default is True.
19821987
1988+
roleinfo:
1989+
The roleinfo for the timestamp role. This is used when a snapshot
1990+
merkle tree is used to access the merkle tree's root hash.
1991+
19831992
<Exceptions>
19841993
securesystemslib.exceptions.FormatError, if the generated timestamp metadata
19851994
object cannot be formatted correctly, or one of the arguments is improperly

tuf/repository_tool.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ def writeall(self, consistent_snapshot=False, use_existing_fileinfo=False, snaps
291291
written as-is (True) or whether hashes should be generated (False,
292292
requires access to the targets files on-disk).
293293
294+
snapshot_merkle:
295+
Whether to generate snapshot merkle metadata in addition to snapshot
296+
metadata.
297+
294298
<Exceptions>
295299
tuf.exceptions.UnsignedMetadataError, if any of the top-level
296300
and delegated roles do not have the minimum threshold of signatures.

0 commit comments

Comments
 (0)