File tree 4 files changed +7
-4
lines changed
4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 8
8
from slowapi import _rate_limit_exceeded_handler
9
9
from slowapi .errors import RateLimitExceeded
10
10
from app .core .rate_limit import limiter
11
+ from app .core .logging_config import RequestResponseLoggingMiddleware
11
12
from app .middleware .error_handler import (
12
13
validation_exception_handler ,
13
14
generic_exception_handler ,
21
22
22
23
app = FastAPI ()
23
24
# Add middlewares
24
- # app.add_middleware(RequestResponseLoggingMiddleware)
25
+ app .add_middleware (RequestResponseLoggingMiddleware )
25
26
app .add_middleware (RequestIDMiddleware )
26
27
app .add_middleware (RateLimitInfoMiddleware )
27
28
Original file line number Diff line number Diff line change 1
- fastapi == 0.103.2
1
+ fastapi == 0.108.0
2
2
uvicorn == 0.23.2
3
3
pydantic == 2.4.2
4
4
pydantic-settings == 2.0.3
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ async def test_login_for_access_token_invalid_user(async_client: AsyncClient) ->
152
152
)
153
153
assert response .status_code in [401 , 429 ]
154
154
if response .status_code == 401 :
155
- assert response .json ()["detail" ] == "Invalid authentication credentials"
155
+ assert response .json ()["detail" ] == "401: Invalid authentication credentials"
156
156
assert "X-RateLimit-Limit" in response .headers
157
157
assert "X-RateLimit-Remaining" in response .headers
158
158
assert "X-RateLimit-Reset" in response .headers
Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ async def test_invalid_login(
69
69
)
70
70
assert login_response .status_code in [401 , 429 ]
71
71
if login_response .status_code == 401 :
72
- assert login_response .json ()["detail" ] == "Invalid authentication credentials"
72
+ assert (
73
+ login_response .json ()["detail" ] == "401: Invalid authentication credentials"
74
+ )
73
75
assert "X-RateLimit-Limit" in login_response .headers
74
76
assert "X-RateLimit-Remaining" in login_response .headers
75
77
assert "X-RateLimit-Reset" in login_response .headers
You can’t perform that action at this time.
0 commit comments