Skip to content

Commit 9992f3a

Browse files
Add AdminCreate schema for admin user creation
Added schema for creating an admin user with a secret.
1 parent 8bd5e2c commit 9992f3a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

app/schemas.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ class UserBase(BaseModel):
1212
class UserCreate(UserBase):
1313
password: str
1414

15+
16+
class AdminCreate(UserCreate):
17+
"""Schema for creating an admin user. Includes a server-side secret to authorize admin creation."""
18+
admin_secret: str
19+
1520
class UserUpdate(BaseModel):
1621
name: Optional[str] = None
1722
phone: Optional[str] = None
@@ -193,4 +198,4 @@ class ShipmentResponse(ShipmentBase):
193198
id: int
194199

195200
class Config:
196-
from_attributes = True
201+
from_attributes = True

0 commit comments

Comments
 (0)