Skip to content

Commit

Permalink
Add typing to conda_content_trust.common (#76)
Browse files Browse the repository at this point in the history
* Drop deprecated/commented code
* Combine is_a_signature with is_signature
* Rename is_a_signable to is_signable
* Use datetime parsing
* Add typing for:
    * HexString
    * GPGSignature & Signature
    * HexKey
    * Signable
    * BytesLike
    * natural int
    * str
    * GPGFingerprint
    * key
    * Delegation
  • Loading branch information
kenodegard authored Aug 23, 2023
1 parent 51551f3 commit 9bddda5
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 236 deletions.
4 changes: 2 additions & 2 deletions conda_content_trust/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
checkformat_gpg_signature,
checkformat_hex_key,
checkformat_signable,
is_a_signable,
is_gpg_signature,
is_hex_key,
is_hex_signature,
is_signable,
is_signature,
)

Expand Down Expand Up @@ -342,7 +342,7 @@ def verify_signable(signable, authorized_pub_keys, threshold, gpg=False):
# we'll mostly have the hex strings on hand, but....

# Argument validation
if not is_a_signable(signable):
if not is_signable(signable):
raise TypeError(
"verify_signable expects a signable dictionary. "
"Given argument failed the test."
Expand Down
Loading

0 comments on commit 9bddda5

Please sign in to comment.