diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1960c819..c11ce06a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,8 @@ Changed Fixed ~~~~~ +- Fix for pyright on strict mode `#747 `_ + Added ~~~~~ - Add to_jwk static method to ECAlgorithm by @leonsmith in https://github.com/jpadilla/pyjwt/pull/732 diff --git a/jwt/api_jws.py b/jwt/api_jws.py index cbf4f6f5..16ec846c 100644 --- a/jwt/api_jws.py +++ b/jwt/api_jws.py @@ -78,7 +78,7 @@ def encode( payload: bytes, key: str, algorithm: Optional[str] = "HS256", - headers: Optional[Dict] = None, + headers: Optional[Dict[str, Any]] = None, json_encoder: Optional[Type[json.JSONEncoder]] = None, is_payload_detached: bool = False, ) -> str: @@ -154,7 +154,7 @@ def decode_complete( jwt: str, key: str = "", algorithms: Optional[List[str]] = None, - options: Optional[Dict] = None, + options: Optional[Dict[str, Any]] = None, detached_payload: Optional[bytes] = None, **kwargs, ) -> Dict[str, Any]: @@ -192,7 +192,7 @@ def decode( jwt: str, key: str = "", algorithms: Optional[List[str]] = None, - options: Optional[Dict] = None, + options: Optional[Dict[str, Any]] = None, **kwargs, ) -> str: decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs) diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py index 7d2177bf..a011c0fe 100644 --- a/jwt/api_jwt.py +++ b/jwt/api_jwt.py @@ -40,7 +40,7 @@ def encode( payload: Dict[str, Any], key: str, algorithm: Optional[str] = "HS256", - headers: Optional[Dict] = None, + headers: Optional[Dict[str, Any]] = None, json_encoder: Optional[Type[json.JSONEncoder]] = None, ) -> str: # Check that we get a mapping @@ -68,7 +68,7 @@ def decode_complete( jwt: str, key: str = "", algorithms: Optional[List[str]] = None, - options: Optional[Dict] = None, + options: Optional[Dict[str, Any]] = None, **kwargs, ) -> Dict[str, Any]: options = dict(options or {}) # shallow-copy or initialize an empty dict @@ -123,7 +123,7 @@ def decode( jwt: str, key: str = "", algorithms: Optional[List[str]] = None, - options: Optional[Dict] = None, + options: Optional[Dict[str, Any]] = None, **kwargs, ) -> Dict[str, Any]: decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs)