FastAuth/models.py

33 lines
646 B
Python
Raw Normal View History

2024-06-10 15:10:22 +00:00
import datetime
from pydantic import BaseModel
class User(BaseModel):
id: int = None
2024-06-21 04:42:02 +00:00
name: str = None
email: str = None
2024-06-10 15:10:22 +00:00
username: str
password: str
created_on: str = datetime.datetime.now(datetime.timezone.utc).isoformat()
active: bool = True
2024-06-21 04:42:02 +00:00
class Key(BaseModel):
user_id: int
encryption_key: str
encryption_key_salt: str
2024-06-10 15:10:22 +00:00
class UserLogin(BaseModel):
username: str
password: str
class Secret(BaseModel):
2024-06-13 17:54:14 +00:00
id: int = None
2024-06-10 15:10:22 +00:00
user_id: int = None
data: str
added_on: str = datetime.datetime.now(datetime.timezone.utc).isoformat()
modified_on: str = None
active: bool = True