Skip to content

Commit

Permalink
Fixes for pyright on strict mode (jpadilla#747)
Browse files Browse the repository at this point in the history
* Fixes for pyright on strict mode

* Update CHANGELOG.rst
  • Loading branch information
brandon-leapyear authored May 31, 2022
1 parent 599aba9 commit d0f07fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Changed
Fixed
~~~~~

- Fix for pyright on strict mode `#747 <https://github.com/jpadilla/pyjwt/pull/747>`_

Added
~~~~~
- Add to_jwk static method to ECAlgorithm by @leonsmith in https://github.com/jpadilla/pyjwt/pull/732
Expand Down
6 changes: 3 additions & 3 deletions jwt/api_jws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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]:
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions jwt/api_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d0f07fc

Please sign in to comment.