Skip to content

Commit 1b392bd

Browse files
committed
ngclient UpdaterConfig: Add docstring
Docstrings for each class are required by linting tool. Signed-off-by: Martin Vrachev <[email protected]>
1 parent 7d92672 commit 1b392bd

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

tuf/ngclient/config.py

+17-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,27 @@
99

1010
@dataclass
1111
class UpdaterConfig:
12+
"""Used to store Updater configuration.
13+
14+
Arguments:
15+
max_root_rotations: The maximum number of root rotations.
16+
max_delegations: The maximum number of delegations.
17+
root_max_length: The maxmimum length of a root metadata file.
18+
timestamp_max_length: The maximum length of a timestamp metadata file.
19+
snapshot_max_length: The maximum length of a snapshot metadata file.
20+
targets_max_length: The maximum length of a targets metadata file.
21+
prefix_targets_with_hash: When consistent snapshots are used
22+
(see https://theupdateframework.github.io/specification/latest/#consistent-snapshots), #pylint: disable=line-too-long
23+
target download URLs are formed by prefixing the filename with a
24+
hash digest of file content by default. This can be overridden by
25+
setting prefix_targets_with_hash to False.
26+
27+
"""
28+
1229
max_root_rotations: int = 32
1330
max_delegations: int = 32
1431
root_max_length: int = 512000 # bytes
1532
timestamp_max_length: int = 16384 # bytes
1633
snapshot_max_length: int = 2000000 # bytes
1734
targets_max_length: int = 5000000 # bytes
18-
# We need this variable because there are use cases like Warehouse where
19-
# you could use consistent_snapshot, but without adding a hash prefix.
20-
# By default, prefix_targets_with_hash is set to true to use uniquely
21-
# identifiable targets file names for repositories.
2235
prefix_targets_with_hash: bool = True

0 commit comments

Comments
 (0)