FastAuth/models.py
2024-06-21 10:12:02 +05:30

33 lines
646 B
Python

import datetime
from pydantic import BaseModel
class User(BaseModel):
id: int = None
name: str = None
email: str = None
username: str
password: str
created_on: str = datetime.datetime.now(datetime.timezone.utc).isoformat()
active: bool = True
class Key(BaseModel):
user_id: int
encryption_key: str
encryption_key_salt: str
class UserLogin(BaseModel):
username: str
password: str
class Secret(BaseModel):
id: int = None
user_id: int = None
data: str
added_on: str = datetime.datetime.now(datetime.timezone.utc).isoformat()
modified_on: str = None
active: bool = True