Erste Produktivversion

This commit is contained in:
2026-08-08 20:31:58 +02:00
parent d8ded2816d
commit 7b21e2d1b4
110 changed files with 18170 additions and 644 deletions

74
backend/app/schemas.py Normal file
View File

@@ -0,0 +1,74 @@
from datetime import datetime
from pydantic import BaseModel, ConfigDict, EmailStr, Field
class RegisterIn(BaseModel):
email: EmailStr
# Untergrenze nach BSI/NIST-Empfehlung: Laenge statt Zeichenklassen.
password: str = Field(min_length=12, max_length=256)
display_name: str | None = Field(default=None, max_length=80)
class LoginIn(BaseModel):
email: EmailStr
password: str = Field(max_length=256)
class PasswordResetRequestIn(BaseModel):
email: EmailStr
class PasswordResetIn(BaseModel):
token: str = Field(max_length=128)
password: str = Field(min_length=12, max_length=256)
class PasswordChangeIn(BaseModel):
current_password: str = Field(max_length=256)
new_password: str = Field(min_length=12, max_length=256)
class ProfileUpdateIn(BaseModel):
display_name: str | None = Field(default=None, max_length=80)
class UserOut(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: str
email: EmailStr
display_name: str | None
is_admin: bool
verified: bool
must_change_password: bool
created_at: datetime
@classmethod
def of(cls, user) -> "UserOut":
return cls(
id=user.id,
email=user.email,
display_name=user.display_name,
is_admin=user.is_admin,
verified=user.verified_at is not None,
must_change_password=user.must_change_password,
created_at=user.created_at,
)
class MessageOut(BaseModel):
detail: str
class MailCheckOut(BaseModel):
ok: bool
detail: str
host: str
port: int
security: str
envelope_from: str
class MailTestIn(BaseModel):
to: EmailStr