-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fix CI by fixing the type errors for PyNaCl #484
Conversation
Signed-off-by: Olivier Wilkinson (reivilibre) <[email protected]>
sydent/config/crypto.py
Outdated
@@ -46,7 +53,7 @@ def parse_config(self, cfg: "ConfigParser") -> bool: | |||
print("INFO: Updating signing key format: brace yourselves") | |||
|
|||
self.signing_key = nacl.signing.SigningKey( | |||
signing_key_str, encoder=nacl.encoding.HexEncoder | |||
signing_key_str.encode(), encoder=nacl.encoding.HexEncoder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this ought to be encode("ascii")
so it doesn't fail silently if we give it something exotic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds fair enough. I don't think it makes sense to put full-fat Unicode into your key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I found this encoder=...
stuff to be fiddley when I was annotating this. But AFAICS they're all meant to take bytes and return bytes. Besides, I think pynacl might want to get rid of them anyway: pyca/pynacl#504 (comment)
Needs a quick linter script, I think. But mypy is happy, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for this!
No description provided.