Skip to content

Commit

Permalink
Merge pull request #1450 from MVrachev/threshold-validation
Browse files Browse the repository at this point in the history
Metadata API: Add simple threshold validation
  • Loading branch information
Jussi Kukkonen authored Jun 16, 2021
2 parents fa2268d + 6c5d970 commit 6c4e2be
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tuf/api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ def __init__(
f"keyids should be a list of unique strings,"
f" instead got {keyids}"
)
if threshold < 1:
raise ValueError("threshold should be at least 1!")
self.keyids = keyids_set
self.threshold = threshold
self.unrecognized_fields: Mapping[str, Any] = unrecognized_fields or {}
Expand Down

0 comments on commit 6c4e2be

Please sign in to comment.