Skip to content

Commit

Permalink
ngclient UpdaterConfig: Add docstring
Browse files Browse the repository at this point in the history
Docstrings for each class are required by linting tool.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
  • Loading branch information
MVrachev committed Aug 16, 2021
1 parent 7d92672 commit 1b392bd
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions tuf/ngclient/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,27 @@

@dataclass
class UpdaterConfig:
"""Used to store Updater configuration.
Arguments:
max_root_rotations: The maximum number of root rotations.
max_delegations: The maximum number of delegations.
root_max_length: The maxmimum length of a root metadata file.
timestamp_max_length: The maximum length of a timestamp metadata file.
snapshot_max_length: The maximum length of a snapshot metadata file.
targets_max_length: The maximum length of a targets metadata file.
prefix_targets_with_hash: When consistent snapshots are used
(see https://theupdateframework.github.io/specification/latest/#consistent-snapshots), #pylint: disable=line-too-long
target download URLs are formed by prefixing the filename with a
hash digest of file content by default. This can be overridden by
setting prefix_targets_with_hash to False.
"""

max_root_rotations: int = 32
max_delegations: int = 32
root_max_length: int = 512000 # bytes
timestamp_max_length: int = 16384 # bytes
snapshot_max_length: int = 2000000 # bytes
targets_max_length: int = 5000000 # bytes
# We need this variable because there are use cases like Warehouse where
# you could use consistent_snapshot, but without adding a hash prefix.
# By default, prefix_targets_with_hash is set to true to use uniquely
# identifiable targets file names for repositories.
prefix_targets_with_hash: bool = True

0 comments on commit 1b392bd

Please sign in to comment.