From c65036c6d2a154eb9390eed1738358fed6ae699e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 21 Jun 2023 09:27:17 -0400 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#694) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/yesqa: v1.4.0 → v1.5.0](https://github.com/asottile/yesqa/compare/v1.4.0...v1.5.0) - [github.com/psf/black: 22.12.0 → 23.3.0](https://github.com/psf/black/compare/22.12.0...23.3.0) - [github.com/asottile/pyupgrade: v3.3.1 → v3.7.0](https://github.com/asottile/pyupgrade/compare/v3.3.1...v3.7.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 | 6 +++--- .../token_blacklist/migrations/0001_initial.py | 1 - .../migrations/0002_outstandingtoken_jti_hex.py | 1 - .../token_blacklist/migrations/0003_auto_20171017_2007.py | 1 - .../token_blacklist/migrations/0004_auto_20171017_2013.py | 1 - .../migrations/0005_remove_outstandingtoken_jti.py | 1 - .../token_blacklist/migrations/0006_auto_20171017_2113.py | 1 - .../token_blacklist/migrations/0007_auto_20171017_2214.py | 1 - .../migrations/0008_migrate_to_bigautofield.py | 1 - .../migrations/0010_fix_migrate_to_bigautofield.py | 1 - .../migrations/0012_alter_outstandingtoken_user.py | 1 - rest_framework_simplejwt/tokens.py | 1 - tests/test_backends.py | 2 -- 13 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9363708a8..2a2894302 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: hooks: - id: check-merge-conflict - repo: https://github.com/asottile/yesqa - rev: v1.4.0 + rev: v1.5.0 hooks: - id: yesqa - repo: https://github.com/pycqa/isort @@ -13,7 +13,7 @@ repos: - id: isort args: ["--profile", "black"] - repo: https://github.com/psf/black - rev: '22.12.0' + rev: '23.3.0' hooks: - id: black language_version: python3 # Should be a command that runs python3.6+ @@ -48,7 +48,7 @@ repos: - id: detect-private-key exclude: ^tests/ - repo: https://github.com/asottile/pyupgrade - rev: 'v3.3.1' + rev: 'v3.7.0' hooks: - id: pyupgrade args: ['--py37-plus', '--keep-mock'] diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0001_initial.py b/rest_framework_simplejwt/token_blacklist/migrations/0001_initial.py index b80d9f0a7..88baa7d93 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0001_initial.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0001_initial.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0002_outstandingtoken_jti_hex.py b/rest_framework_simplejwt/token_blacklist/migrations/0002_outstandingtoken_jti_hex.py index 56df7d1a8..59af197e6 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0002_outstandingtoken_jti_hex.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0002_outstandingtoken_jti_hex.py @@ -2,7 +2,6 @@ class Migration(migrations.Migration): - dependencies = [ ("token_blacklist", "0001_initial"), ] diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0003_auto_20171017_2007.py b/rest_framework_simplejwt/token_blacklist/migrations/0003_auto_20171017_2007.py index 336827ba4..1b753499a 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0003_auto_20171017_2007.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0003_auto_20171017_2007.py @@ -22,7 +22,6 @@ def reverse_populate_jti_hex(apps, schema_editor): # pragma: no cover class Migration(migrations.Migration): - dependencies = [ ("token_blacklist", "0002_outstandingtoken_jti_hex"), ] diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0004_auto_20171017_2013.py b/rest_framework_simplejwt/token_blacklist/migrations/0004_auto_20171017_2013.py index b11bdc33d..f5ba7e9ff 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0004_auto_20171017_2013.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0004_auto_20171017_2013.py @@ -2,7 +2,6 @@ class Migration(migrations.Migration): - dependencies = [ ("token_blacklist", "0003_auto_20171017_2007"), ] diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0005_remove_outstandingtoken_jti.py b/rest_framework_simplejwt/token_blacklist/migrations/0005_remove_outstandingtoken_jti.py index 14e6af147..2b140ed9f 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0005_remove_outstandingtoken_jti.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0005_remove_outstandingtoken_jti.py @@ -2,7 +2,6 @@ class Migration(migrations.Migration): - dependencies = [ ("token_blacklist", "0004_auto_20171017_2013"), ] diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0006_auto_20171017_2113.py b/rest_framework_simplejwt/token_blacklist/migrations/0006_auto_20171017_2113.py index abaef538f..10f9f1e2a 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0006_auto_20171017_2113.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0006_auto_20171017_2113.py @@ -2,7 +2,6 @@ class Migration(migrations.Migration): - dependencies = [ ("token_blacklist", "0005_remove_outstandingtoken_jti"), ] diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0007_auto_20171017_2214.py b/rest_framework_simplejwt/token_blacklist/migrations/0007_auto_20171017_2214.py index 87961ddb8..5fa602fd1 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0007_auto_20171017_2214.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0007_auto_20171017_2214.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("token_blacklist", "0006_auto_20171017_2113"), ] diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0008_migrate_to_bigautofield.py b/rest_framework_simplejwt/token_blacklist/migrations/0008_migrate_to_bigautofield.py index 46f516e23..9a7735729 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0008_migrate_to_bigautofield.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0008_migrate_to_bigautofield.py @@ -2,7 +2,6 @@ class Migration(migrations.Migration): - dependencies = [ ("token_blacklist", "0007_auto_20171017_2214"), ] diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0010_fix_migrate_to_bigautofield.py b/rest_framework_simplejwt/token_blacklist/migrations/0010_fix_migrate_to_bigautofield.py index 4046e8bf5..b6d595df9 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0010_fix_migrate_to_bigautofield.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0010_fix_migrate_to_bigautofield.py @@ -8,7 +8,6 @@ class Migration(migrations.Migration): - dependencies = [ ("token_blacklist", "0008_migrate_to_bigautofield"), ] diff --git a/rest_framework_simplejwt/token_blacklist/migrations/0012_alter_outstandingtoken_user.py b/rest_framework_simplejwt/token_blacklist/migrations/0012_alter_outstandingtoken_user.py index 652f06b69..91d5e0645 100644 --- a/rest_framework_simplejwt/token_blacklist/migrations/0012_alter_outstandingtoken_user.py +++ b/rest_framework_simplejwt/token_blacklist/migrations/0012_alter_outstandingtoken_user.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("token_blacklist", "0011_linearizes_history"), diff --git a/rest_framework_simplejwt/tokens.py b/rest_framework_simplejwt/tokens.py index 49eb48a5c..bb2ee8780 100644 --- a/rest_framework_simplejwt/tokens.py +++ b/rest_framework_simplejwt/tokens.py @@ -110,7 +110,6 @@ def verify(self) -> None: raise TokenError(_("Token has no id")) if api_settings.TOKEN_TYPE_CLAIM is not None: - self.verify_token_type() def verify_token_type(self) -> None: diff --git a/tests/test_backends.py b/tests/test_backends.py index 0314ba671..540e01820 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -162,7 +162,6 @@ def test_decode_with_expiry(self): self.payload["exp"] = aware_utcnow() - timedelta(seconds=1) for backend in self.backends: with self.subTest("Test decode with expiry for f{backend.algorithm}"): - expired_token = jwt.encode( self.payload, backend.signing_key, algorithm=backend.algorithm ) @@ -228,7 +227,6 @@ def test_decode_success(self): self.payload["foo"] = "baz" for backend in self.backends: with self.subTest("Test decode success for f{backend.algorithm}"): - token = jwt.encode( self.payload, backend.signing_key, algorithm=backend.algorithm )