Dear developers,
mypy is complaining about the KeySetSerialization type:
error: Argument 1 to "import_key_set" of "KeySet" has incompatible type "dict[Any, Any]"; expected "KeySetSerialization" [arg-type]
I should likely import it from https://github.com/authlib/joserfc/blob/main/src/joserfc/_keys.py but this looks like a private module and KeySetSerialization does not seem to be part of the exported members:
|
__all__ = [ |
|
"OctKey", |
|
"RSAKey", |
|
"ECKey", |
|
"OKPKey", |
|
"Key", |
|
"KeySet", |
|
"JWKRegistry", |
|
] |
Is that expected?
mypy is also complaining about the get method in https://github.com/authlib/joserfc/blob/main/src/joserfc/rfc7517/models.py when we set the default value as []:
key_ops = key.get("key_ops", [])
error: Argument 2 to "get" of "BaseKey" has incompatible type "list[Never]"; expected "str | None" [arg-type]
It's because the expected type of default does not include list (only str or None), is that expected?
|
def get(self, k: str, default: str | None = None) -> str | list[str] | None: |
I can open a PR to perform the changes I am describing here if required.
Thanks
Dear developers,
mypyis complaining about theKeySetSerializationtype:I should likely import it from https://github.com/authlib/joserfc/blob/main/src/joserfc/_keys.py but this looks like a private module and
KeySetSerializationdoes not seem to be part of the exported members:joserfc/src/joserfc/_keys.py
Lines 12 to 20 in 7982683
Is that expected?
mypyis also complaining about thegetmethod in https://github.com/authlib/joserfc/blob/main/src/joserfc/rfc7517/models.py when we set the default value as[]:It's because the expected type of
defaultdoes not includelist(onlystrorNone), is that expected?joserfc/src/joserfc/rfc7517/models.py
Line 115 in 7982683
I can open a PR to perform the changes I am describing here if required.
Thanks