Merge pull request #1450 from MVrachev/threshold-validation

Metadata API: Add simple threshold validation
This commit is contained in:
Jussi Kukkonen 2021-06-16 19:56:26 +03:00 committed by GitHub
commit 6c4e2be196
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {}