File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 526526
527527### 31. Missing Max Length on Token Refresh Schema
528528
529+ > [ !NOTE]
530+ > ✅ ** Done** : Added ` max_length=1024 ` to refresh token field, matching
531+ > MAX_JWT_TOKEN_LENGTH. This provides defense-in-depth validation with
532+ > Pydantic catching oversized tokens at schema level. See PR #818 .
533+
529534** Location** : ` app/schemas/request/auth.py:6-9 `
530535
531- - ** Issue** : Refresh token field has no length validation in schema. While the
532- endpoint validates format (auth.py:174-181), the schema itself has no
536+ - ** Issue** : Refresh token field had no length validation in schema. While the
537+ endpoint validated format (auth.py:174-181), the schema itself had no
533538 constraints.
534- - ** Fix** : Add ` max_length ` and ` min_length ` to schema for defense in depth.
539+ - ** Fix** : Add ` max_length ` to schema for defense in depth.
535540
536541### 32. Bcrypt Work Factor Not Configurable
537542
Original file line number Diff line number Diff line change 22
33from pydantic import BaseModel , EmailStr , Field
44
5+ from app .managers .helpers import MAX_JWT_TOKEN_LENGTH
6+
57
68class TokenRefreshRequest (BaseModel ):
79 """Request schema for refreshing a JWT token."""
810
911 refresh : str = Field (
1012 ...,
11- max_length = 1024 ,
13+ max_length = MAX_JWT_TOKEN_LENGTH ,
1214 description = "JWT refresh token" ,
1315 )
1416
You can’t perform that action at this time.
0 commit comments