From 97345a7635bc24d1eb59ab8d0c73389f38187472 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 07:58:03 -0400 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#953) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 23.11.0 → 24.4.2](https://github.com/psf/black/compare/23.11.0...24.4.2) - [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.0.0) - [github.com/PyCQA/isort: 5.12.0 → 5.13.2](https://github.com/PyCQA/isort/compare/5.12.0...5.13.2) - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/pre-commit/mirrors-mypy: v1.7.0 → v1.10.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.0...v1.10.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 10 ++++----- jwt/algorithms.py | 46 +++++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac45a70d..bcc2ffc4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 24.4.2 hooks: - id: black args: ["--target-version=py38"] @@ -12,18 +12,18 @@ repos: args: ["--target-version=py38"] - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 language_version: python3.9 - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -36,7 +36,7 @@ repos: args: [--no-build-isolation] - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.7.0" + rev: "v1.10.0" hooks: - id: mypy additional_dependencies: [cryptography>=3.4.0] diff --git a/jwt/algorithms.py b/jwt/algorithms.py index ece86b4d..c348a7dc 100644 --- a/jwt/algorithms.py +++ b/jwt/algorithms.py @@ -187,14 +187,12 @@ def verify(self, msg: bytes, key: Any, sig: bytes) -> bool: @overload @staticmethod @abstractmethod - def to_jwk(key_obj, as_dict: Literal[True]) -> JWKDict: - ... # pragma: no cover + def to_jwk(key_obj, as_dict: Literal[True]) -> JWKDict: ... # pragma: no cover @overload @staticmethod @abstractmethod - def to_jwk(key_obj, as_dict: Literal[False] = False) -> str: - ... # pragma: no cover + def to_jwk(key_obj, as_dict: Literal[False] = False) -> str: ... # pragma: no cover @staticmethod @abstractmethod @@ -267,13 +265,15 @@ def prepare_key(self, key: str | bytes) -> bytes: @overload @staticmethod - def to_jwk(key_obj: str | bytes, as_dict: Literal[True]) -> JWKDict: - ... # pragma: no cover + def to_jwk( + key_obj: str | bytes, as_dict: Literal[True] + ) -> JWKDict: ... # pragma: no cover @overload @staticmethod - def to_jwk(key_obj: str | bytes, as_dict: Literal[False] = False) -> str: - ... # pragma: no cover + def to_jwk( + key_obj: str | bytes, as_dict: Literal[False] = False + ) -> str: ... # pragma: no cover @staticmethod def to_jwk(key_obj: str | bytes, as_dict: bool = False) -> JWKDict | str: @@ -347,13 +347,15 @@ def prepare_key(self, key: AllowedRSAKeys | str | bytes) -> AllowedRSAKeys: @overload @staticmethod - def to_jwk(key_obj: AllowedRSAKeys, as_dict: Literal[True]) -> JWKDict: - ... # pragma: no cover + def to_jwk( + key_obj: AllowedRSAKeys, as_dict: Literal[True] + ) -> JWKDict: ... # pragma: no cover @overload @staticmethod - def to_jwk(key_obj: AllowedRSAKeys, as_dict: Literal[False] = False) -> str: - ... # pragma: no cover + def to_jwk( + key_obj: AllowedRSAKeys, as_dict: Literal[False] = False + ) -> str: ... # pragma: no cover @staticmethod def to_jwk(key_obj: AllowedRSAKeys, as_dict: bool = False) -> JWKDict | str: @@ -543,13 +545,15 @@ def verify(self, msg: bytes, key: AllowedECKeys, sig: bytes) -> bool: @overload @staticmethod - def to_jwk(key_obj: AllowedECKeys, as_dict: Literal[True]) -> JWKDict: - ... # pragma: no cover + def to_jwk( + key_obj: AllowedECKeys, as_dict: Literal[True] + ) -> JWKDict: ... # pragma: no cover @overload @staticmethod - def to_jwk(key_obj: AllowedECKeys, as_dict: Literal[False] = False) -> str: - ... # pragma: no cover + def to_jwk( + key_obj: AllowedECKeys, as_dict: Literal[False] = False + ) -> str: ... # pragma: no cover @staticmethod def to_jwk(key_obj: AllowedECKeys, as_dict: bool = False) -> JWKDict | str: @@ -760,13 +764,15 @@ def verify( @overload @staticmethod - def to_jwk(key: AllowedOKPKeys, as_dict: Literal[True]) -> JWKDict: - ... # pragma: no cover + def to_jwk( + key: AllowedOKPKeys, as_dict: Literal[True] + ) -> JWKDict: ... # pragma: no cover @overload @staticmethod - def to_jwk(key: AllowedOKPKeys, as_dict: Literal[False] = False) -> str: - ... # pragma: no cover + def to_jwk( + key: AllowedOKPKeys, as_dict: Literal[False] = False + ) -> str: ... # pragma: no cover @staticmethod def to_jwk(key: AllowedOKPKeys, as_dict: bool = False) -> JWKDict | str: