This commit is contained in:
2026-07-17 20:03:41 +03:00
parent 4512eb6e5c
commit 4fd66e0106
7 changed files with 71 additions and 64 deletions

View File

@@ -1,4 +1,3 @@
from dataclasses import replace
from datetime import datetime
from typing import Annotated
from pydantic import BaseModel, EmailStr, Field
@@ -61,7 +60,7 @@ class PermissionsGroupsOut(Base):
class RefreshTokens(Base):
id:int
user_id:Annotated[UUID, Field(..., description="foreign key for the user")]
token_hash:Annotated[str, Field(..., description="token hash")]
device_info:Annotated[str, Field(..., description="User device info")]
@@ -69,4 +68,12 @@ class RefreshTokens(Base):
is_revoked:Annotated[bool|None, Field(None, description="revoke token if logout was made")]
expires_at:Annotated[datetime, Field(..., description="when token is going to be expired")]
class RefreshTokensOut(Base):
id:int
user_id:Annotated[UUID, Field(..., description="foreign key for the user")]
token_hash:Annotated[str, Field(..., description="token hash")]
device_info:Annotated[str, Field(..., description="User device info")]
ip_address:Annotated[str, Field(..., description="ip v4/v6 of the user")]
is_revoked:Annotated[bool|None, Field(None, description="revoke token if logout was made")]
expires_at:Annotated[datetime, Field(..., description="when token is going to be expired")]