Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Typechecking errors now that signedjson 1.1.2 is published with py.typed marker #12324

Closed
DMRobertson opened this issue Mar 29, 2022 · 0 comments · Fixed by #12326
Closed

Typechecking errors now that signedjson 1.1.2 is published with py.typed marker #12324

DMRobertson opened this issue Mar 29, 2022 · 0 comments · Fixed by #12326
Assignees
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@DMRobertson
Copy link
Contributor

DMRobertson commented Mar 29, 2022

synapse/config/key.py:164: error: No overload variant of "bytes" matches argument type "SigningKey"  [call-overload]
synapse/config/key.py:164: note: Possible overload variants:
synapse/config/key.py:164: note:     def bytes(cls, Iterable[SupportsIndex]) -> bytes
synapse/config/key.py:164: note:     def bytes(cls, str, encoding: str, errors: str = ...) -> bytes
synapse/config/key.py:164: note:     def bytes(cls, SupportsIndex) -> bytes
synapse/config/key.py:164: note:     def bytes(cls) -> bytes
synapse/config/key.py:164: note:     def bytes(cls, SupportsBytes) -> bytes
synapse/config/key.py:312: error: "VerifyKey" has no attribute "expired_ts"  [attr-defined]
synapse/rest/key/v2/local_key_resource.py:85: error: Incompatible types in assignment (expression has type "VerifyKey", variable has type "SigningKey")  [assignment]
synapse/rest/key/v2/local_key_resource.py:89: error: "SigningKey" has no attribute "expired_ts"  [attr-defined]
synapse/events/builder.py:215: error: Argument "signing_key" to "EventBuilder" has incompatible type "signedjson.types.SigningKey"; expected "nacl.signing.SigningKey"  [arg-type]
synapse/events/builder.py:262: error: Argument 4 to "add_hashes_and_signatures" has incompatible type "nacl.signing.SigningKey"; expected "signedjson.types.SigningKey"  [arg-type]
synapse/crypto/keyring.py:179: error: "VerifyKey" has no attribute "expired_ts"  [attr-defined]
synapse/rest/key/v2/remote_key_resource.py:240: error: Incompatible types in assignment (expression has type "Dict[str, Any]", variable has type "bytes")  [assignment]
synapse/rest/key/v2/remote_key_resource.py:241: error: Argument 1 to "sign_json" has incompatible type "bytes"; expected "Dict[str, Any]"  [arg-type]
synapse/federation/federation_client.py:808: error: Argument 3 to "create_local_event_from_event_dict" has incompatible type "signedjson.types.SigningKey"; expected "nacl.signing.SigningKey"  [arg-type]
tests/rest/key/v2/test_remote_key_resource.py:79: error: Argument 1 to "encode_verify_key_base64" has incompatible type "nacl.signing.VerifyKey"; expected "signedjson.types.VerifyKey"  [arg-type]
tests/rest/key/v2/test_remote_key_resource.py:178: error: Argument 1 to "encode_verify_key_base64" has incompatible type "nacl.signing.VerifyKey"; expected "signedjson.types.VerifyKey"  [arg-type]
tests/rest/key/v2/test_remote_key_resource.py:232: error: Argument 1 to "encode_verify_key_base64" has incompatible type "nacl.signing.VerifyKey"; expected "signedjson.types.VerifyKey"  [arg-type]
tests/rest/key/v2/test_remote_key_resource.py:254: error: Argument 1 to "encode_verify_key_base64" has incompatible type "nacl.signing.VerifyKey"; expected "signedjson.types.VerifyKey"  [arg-type]
tests/rest/key/v2/test_remote_key_resource.py:271: error: Argument 1 to "encode_verify_key_base64" has incompatible type "nacl.signing.VerifyKey"; expected "signedjson.types.VerifyKey"  [arg-type]
tests/handlers/test_presence.py:1017: error: Argument "signing_key" to "EventBuilder" has incompatible type "signedjson.types.SigningKey"; expected "nacl.signing.SigningKey"  [arg-type]
tests/crypto/test_event_signing.py:42: error: Incompatible types in assignment (expression has type "nacl.signing.SigningKey", variable has type "signedjson.types.SigningKey")  [assignment]
tests/crypto/test_event_signing.py:46: error: Incompatible types in assignment (expression has type "int", variable has type "str")  [assignment]
Found 18 errors in 9 files (checked 693 source files)

@DMRobertson DMRobertson self-assigned this Mar 29, 2022
@babolivier babolivier added the T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. label Mar 29, 2022
squahtx pushed a commit that referenced this issue Apr 5, 2022
To be reverted after the Synapse 1.56 release.

Signed-off-by: Sean Quah <seanq@element.io>
squahtx pushed a commit that referenced this issue Apr 5, 2022
arkamar added a commit to arkamar/synapse-overlay that referenced this issue Jun 28, 2022
The issue #12324 most probably affects older version of synapse as well,
let's backport it just for sure.

Upstream-Issue: matrix-org/synapse#12324
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants