21 lines
433 B
Python
21 lines
433 B
Python
|
|
"""Auth schemas."""
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from pydantic import BaseModel, Field
|
||
|
|
|
||
|
|
|
||
|
|
class LoginRequest(BaseModel):
|
||
|
|
username: str = Field(min_length=1, max_length=64)
|
||
|
|
password: str = Field(min_length=6, max_length=128)
|
||
|
|
|
||
|
|
|
||
|
|
class TokenPair(BaseModel):
|
||
|
|
access_token: str
|
||
|
|
refresh_token: str
|
||
|
|
token_type: str = "bearer"
|
||
|
|
expires_in: int # seconds
|
||
|
|
|
||
|
|
|
||
|
|
class RefreshRequest(BaseModel):
|
||
|
|
refresh_token: str
|