Skip to content

Commit 780f883

Browse files
committed
Update docstrings to include descriptions of snapshot merkle parameters.
Signed-off-by: marinamoore <[email protected]>
1 parent b8a99c7 commit 780f883

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

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
@@ -1768,6 +1773,11 @@ def _update_metadata(self, metadata_role, upperbound_filelength, version=None,
17681773
The expected and required version number of the 'metadata_role' file
17691774
downloaded. 'expected_version' is an integer.
17701775
1776+
snapshot_merkle:
1777+
Is the metadata to be updated for a snapshot merkle file?
1778+
Snapshot merkle metadata does not contain a signature, but must
1779+
instead be verified using _verify_merkle_path.
1780+
17711781
<Exceptions>
17721782
tuf.exceptions.NoWorkingMirrorError:
17731783
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
@@ -1834,6 +1834,11 @@ def generate_snapshot_metadata(metadata_directory, version, expiration_date,
18341834
Read more at section 5.6 from the Mercury paper:
18351835
https://www.usenix.org/conference/atc17/technical-sessions/presentation/kuppusamy
18361836
1837+
snapshot_merkle:
1838+
Whether to generate snapshot merkle files in addition to snapshot.json
1839+
metadata. If this is true, this function will return the root and leaves
1840+
of the merkle tree in addition to the snapshot metadata.
1841+
18371842
<Exceptions>
18381843
securesystemslib.exceptions.FormatError, if the arguments are improperly
18391844
formatted.
@@ -1979,6 +1984,10 @@ def generate_timestamp_metadata(snapshot_file_path, version, expiration_date,
19791984
metadata file in the timestamp metadata.
19801985
Default is True.
19811986
1987+
roleinfo:
1988+
The roleinfo for the timestamp role. This is used when a snapshot
1989+
merkle tree is used to access the merkle tree's root hash.
1990+
19821991
<Exceptions>
19831992
securesystemslib.exceptions.FormatError, if the generated timestamp metadata
19841993
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)