Skip to content

Commit d844aa3

Browse files
authored
Bump dependencies and pre-commits (#936)
1 parent ef640b0 commit d844aa3

File tree

5 files changed

+378
-357
lines changed

5 files changed

+378
-357
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: check-toml
1212

1313
- repo: https://github.com/charliermarsh/ruff-pre-commit
14-
rev: v0.14.0
14+
rev: v0.14.6
1515
hooks:
1616
- id: ruff-check
1717
args:
@@ -21,7 +21,7 @@ repos:
2121
- id: ruff-format
2222

2323
- repo: https://github.com/astral-sh/uv-pre-commit
24-
rev: 0.9.0
24+
rev: 0.9.12
2525
hooks:
2626
- id: uv-lock
2727
- id: uv-export

backend/common/security/jwt.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
from datetime import timedelta
55
from typing import Any
66

7-
from fastapi import Depends, HTTPException, Request
7+
from fastapi import Depends, Request
88
from fastapi.security import HTTPBearer
9-
from fastapi.security.http import HTTPAuthorizationCredentials
109
from fastapi.security.utils import get_authorization_scheme_param
1110
from jose import ExpiredSignatureError, JWTError, jwt
1211
from pydantic_core import from_json
@@ -16,31 +15,13 @@
1615
from backend.app.admin.schema.user import GetUserInfoWithRelationDetail
1716
from backend.common.dataclasses import AccessToken, NewToken, RefreshToken, TokenPayload
1817
from backend.common.exception import errors
19-
from backend.common.exception.errors import TokenError
2018
from backend.core.conf import settings
2119
from backend.database.db import async_db_session
2220
from backend.database.redis import redis_client
2321
from backend.utils.timezone import timezone
2422

25-
26-
class CustomHTTPBearer(HTTPBearer):
27-
"""
28-
自定义 HTTPBearer 认证类
29-
30-
Issues: https://github.com/fastapi/fastapi/issues/10177
31-
"""
32-
33-
async def __call__(self, request: Request) -> HTTPAuthorizationCredentials | None:
34-
try:
35-
return await super().__call__(request)
36-
except HTTPException as e:
37-
if e.status_code == 403:
38-
raise TokenError
39-
raise
40-
41-
42-
# JWT authorizes dependency injection
43-
DependsJwtAuth = Depends(CustomHTTPBearer())
23+
# JWT dependency injection
24+
DependsJwtAuth = Depends(HTTPBearer())
4425

4526

4627
def jwt_encode(payload: dict[str, Any]) -> str:

pyproject.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,40 @@ license = { text = "MIT" }
1212
requires-python = ">=3.10"
1313
dynamic = ['version']
1414
dependencies = [
15-
"alembic>=1.17.1",
16-
"asgiref>=3.10.0",
15+
"alembic>=1.17.2",
16+
"asgiref>=3.11.0",
1717
"asyncmy>=0.2.10",
18-
"asyncpg>=0.30.0",
18+
"asyncpg>=0.31.0",
1919
"bcrypt>=5.0.0",
2020
"cappa>=0.30.4",
2121
"celery>=5.5.3",
2222
# When celery version < 6.0.0
2323
# https://github.com/celery/celery/issues/7874
2424
"celery-aio-pool>=0.1.0rc8",
2525
"cryptography>=46.0.3",
26-
"dulwich>=0.24.7",
26+
"dulwich>=0.24.10",
2727
"fast-captcha>=0.3.2",
2828
"fastapi-limiter>=0.1.6",
2929
"fastapi-pagination>=0.15.0",
30-
"fastapi[standard-no-fastapi-cloud-cli]>=0.121.1",
30+
"fastapi[standard-no-fastapi-cloud-cli]>=0.122.0",
3131
"flower>=2.0.1",
3232
"gevent>=25.9.1",
33-
"granian>=2.5.7",
33+
"granian>=2.6.0",
3434
"ip2loc>=1.0.0",
3535
"itsdangerous>=2.2.0",
3636
"jinja2>=3.1.6",
3737
"loguru>=0.7.3",
38-
"msgspec>=0.19.0",
39-
"psutil>=7.1.2",
38+
"msgspec>=0.20.0",
39+
"psutil>=7.1.3",
4040
# https://github.com/fastapi-practices/fastapi_best_architecture/issues/887
4141
"psycopg[binary]==3.2.10",
42-
"pwdlib>=0.2.1",
43-
"pydantic>=2.12.3",
44-
"pydantic-settings>=2.11.0",
42+
"pwdlib>=0.3.0",
43+
"pydantic>=2.12.4",
44+
"pydantic-settings>=2.12.0",
4545
"pymysql>=1.1.2",
4646
"python-jose>=3.5.0",
47-
"python-socketio>=5.14.3",
48-
"redis[hiredis]>=7.0.1",
47+
"python-socketio>=5.15.0",
48+
"redis[hiredis]>=7.1.0",
4949
"rtoml>=0.13.0",
5050
"sqlalchemy-crud-plus>=1.13.1",
5151
"sqlalchemy[asyncio]>=2.0.44",
@@ -60,10 +60,10 @@ dev = [
6060
"pytest-sugar>=1.1.1",
6161
]
6262
lint = [
63-
"prek>=0.2.13",
63+
"prek>=0.2.18",
6464
]
6565
server = [
66-
"aio-pika>=9.5.7",
66+
"aio-pika>=9.5.8",
6767
"wait-for-it>=2.3.0",
6868
]
6969

requirements.txt

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# This file was autogenerated by uv via the following command:
22
# uv export -o requirements.txt --no-hashes
33
-e .
4-
alembic==1.17.1
4+
alembic==1.17.2
55
# via fastapi-best-architecture
66
amqp==5.3.1
77
# via kombu
8-
annotated-doc==0.0.3
8+
annotated-doc==0.0.4
99
# via fastapi
1010
annotated-types==0.7.0
1111
# via pydantic
@@ -14,21 +14,21 @@ anyio==4.11.0
1414
# httpx
1515
# starlette
1616
# watchfiles
17-
asgiref==3.10.0
17+
asgiref==3.11.0
1818
# via fastapi-best-architecture
1919
async-timeout==5.0.1 ; python_full_version < '3.11.3'
2020
# via
2121
# asyncpg
2222
# redis
2323
asyncmy==0.2.10
2424
# via fastapi-best-architecture
25-
asyncpg==0.30.0
25+
asyncpg==0.31.0
2626
# via fastapi-best-architecture
2727
bcrypt==5.0.0
2828
# via fastapi-best-architecture
2929
bidict==0.23.1
3030
# via python-socketio
31-
billiard==4.2.2
31+
billiard==4.2.3
3232
# via celery
3333
cappa==0.30.4
3434
# via fastapi-best-architecture
@@ -39,15 +39,15 @@ celery==5.5.3
3939
# flower
4040
celery-aio-pool==0.1.0rc8
4141
# via fastapi-best-architecture
42-
certifi==2025.10.5
42+
certifi==2025.11.12
4343
# via
4444
# httpcore
4545
# httpx
4646
cffi==2.0.0 ; platform_python_implementation != 'PyPy'
4747
# via
4848
# cryptography
4949
# gevent
50-
click==8.3.0
50+
click==8.3.1
5151
# via
5252
# celery
5353
# click-didyoumean
@@ -73,24 +73,24 @@ cryptography==46.0.3
7373
# via fastapi-best-architecture
7474
dnspython==2.8.0
7575
# via email-validator
76-
dulwich==0.24.8
76+
dulwich==0.24.10
7777
# via fastapi-best-architecture
7878
ecdsa==0.19.1
7979
# via python-jose
8080
email-validator==2.3.0
8181
# via fastapi
82-
exceptiongroup==1.3.0 ; python_full_version < '3.11'
82+
exceptiongroup==1.3.1 ; python_full_version < '3.11'
8383
# via
8484
# anyio
8585
# pytest
8686
fast-captcha==0.3.2
8787
# via fastapi-best-architecture
88-
fastapi==0.121.1
88+
fastapi==0.122.0
8989
# via
9090
# fastapi-best-architecture
9191
# fastapi-limiter
9292
# fastapi-pagination
93-
fastapi-cli==0.0.14
93+
fastapi-cli==0.0.16
9494
# via fastapi
9595
fastapi-limiter==0.1.6
9696
# via fastapi-best-architecture
@@ -100,7 +100,7 @@ flower==2.0.1
100100
# via fastapi-best-architecture
101101
gevent==25.9.1
102102
# via fastapi-best-architecture
103-
granian==2.5.7
103+
granian==2.6.0
104104
# via fastapi-best-architecture
105105
greenlet==3.2.4
106106
# via
@@ -150,7 +150,7 @@ markupsafe==3.0.3
150150
# mako
151151
mdurl==0.1.2
152152
# via markdown-it-py
153-
msgspec==0.19.0
153+
msgspec==0.20.0
154154
# via fastapi-best-architecture
155155
packaging==25.0
156156
# via
@@ -160,7 +160,7 @@ pillow==12.0.0
160160
# via fast-captcha
161161
pluggy==1.6.0
162162
# via pytest
163-
prek==0.2.13
163+
prek==0.2.18
164164
prometheus-client==0.23.1
165165
# via flower
166166
prompt-toolkit==3.0.52
@@ -188,15 +188,15 @@ pydantic==2.12.4
188188
# sqlalchemy-crud-plus
189189
pydantic-core==2.41.5
190190
# via pydantic
191-
pydantic-settings==2.11.0
191+
pydantic-settings==2.12.0
192192
# via fastapi-best-architecture
193193
pygments==2.19.2
194194
# via
195195
# pytest
196196
# rich
197197
pymysql==1.1.2
198198
# via fastapi-best-architecture
199-
pytest==9.0.0
199+
pytest==9.0.1
200200
# via pytest-sugar
201201
pytest-sugar==1.1.1
202202
python-dateutil==2.9.0.post0
@@ -211,13 +211,13 @@ python-jose==3.5.0
211211
# via fastapi-best-architecture
212212
python-multipart==0.0.20
213213
# via fastapi
214-
python-socketio==5.14.3
214+
python-socketio==5.15.0
215215
# via fastapi-best-architecture
216216
pytz==2025.2
217217
# via flower
218218
pyyaml==6.0.3
219219
# via uvicorn
220-
redis==7.0.1
220+
redis==7.1.0
221221
# via
222222
# fastapi-best-architecture
223223
# fastapi-limiter
@@ -226,7 +226,7 @@ rich==14.2.0
226226
# cappa
227227
# rich-toolkit
228228
# typer
229-
rich-toolkit==0.15.1
229+
rich-toolkit==0.16.0
230230
# via fastapi-cli
231231
rsa==4.9.1
232232
# via python-jose
@@ -251,7 +251,7 @@ sqlalchemy-crud-plus==1.13.1
251251
# via fastapi-best-architecture
252252
sqlparse==0.5.3
253253
# via fastapi-best-architecture
254-
starlette==0.49.3
254+
starlette==0.50.0
255255
# via
256256
# fastapi
257257
# starlette-context
@@ -262,6 +262,7 @@ termcolor==3.2.0
262262
tomli==2.3.0 ; python_full_version < '3.11'
263263
# via
264264
# alembic
265+
# fastapi-cli
265266
# pytest
266267
tornado==6.5.2
267268
# via flower
@@ -325,9 +326,9 @@ websockets==15.0.1
325326
# via uvicorn
326327
win32-setctime==1.2.0 ; sys_platform == 'win32'
327328
# via loguru
328-
wsproto==1.2.0
329+
wsproto==1.3.2
329330
# via simple-websocket
330331
zope-event==6.1
331332
# via gevent
332-
zope-interface==8.0.1
333+
zope-interface==8.1.1
333334
# via gevent

0 commit comments

Comments
 (0)