joserfc
joserfc copied to clipboard
mypy issues
Dear developers,
-
mypyis complaining about theKeySetSerializationtype:
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: https://github.com/authlib/joserfc/blob/7982683c1e6dc68554169c393412a2d0818e4d22/src/joserfc/_keys.py#L12-L20
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[]:
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?
https://github.com/authlib/joserfc/blob/7982683c1e6dc68554169c393412a2d0818e4d22/src/joserfc/rfc7517/models.py#L115
I can open a PR to perform the changes I am describing here if required.
Thanks