fix: Remove API Tokens from User APIs (#4985)

This commit is contained in:
Michael Genson
2025-01-29 13:52:12 -06:00
committed by GitHub
parent f2eadd2908
commit cb05adeb48
5 changed files with 41 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ from .user import (
GroupInDB,
GroupPagination,
GroupSummary,
LongLiveTokenCreateResponse,
LongLiveTokenIn,
LongLiveTokenInDB,
LongLiveTokenOut,
@@ -57,6 +58,7 @@ __all__ = [
"GroupInDB",
"GroupPagination",
"GroupSummary",
"LongLiveTokenCreateResponse",
"LongLiveTokenIn",
"LongLiveTokenInDB",
"LongLiveTokenOut",

View File

@@ -31,7 +31,6 @@ class LongLiveTokenIn(MealieModel):
class LongLiveTokenOut(MealieModel):
token: str
name: str
id: int
created_at: datetime | None = None
@@ -42,6 +41,12 @@ class LongLiveTokenOut(MealieModel):
return [joinedload(LongLiveToken.user)]
class LongLiveTokenCreateResponse(LongLiveTokenOut):
"""Should ONLY be used when creating a new token, as the token field is sensitive"""
token: str
class CreateToken(LongLiveTokenIn):
user_id: UUID4
token: str