Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark key types as SupportsBytes #21

Merged
merged 2 commits into from
Mar 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions signedjson/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

import sys
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, SupportsBytes

import nacl.signing

Expand All @@ -24,7 +24,7 @@
from typing import Protocol


class BaseKey(Protocol):
class BaseKey(Protocol, SupportsBytes):
"""Common base type for VerifyKey and SigningKey"""

version = "" # type: str
Expand Down Expand Up @@ -56,5 +56,7 @@ def sign(self, message):

@property
def verify_key(self):
# Note: use `signedjson.key.get_verify_key` to get a
# `signedjson.types.VerifyKey`.
# type: () -> nacl.signing.VerifyKey
pass # pragma: nocover