27 lines
No EOL
675 B
Python
27 lines
No EOL
675 B
Python
"""
|
|
Token models and management for external authentication services.
|
|
"""
|
|
|
|
from pydantic import BaseModel
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
|
|
class GoogleToken(BaseModel):
|
|
"""Google OAuth token model"""
|
|
access_token: str
|
|
token_type: str = "bearer"
|
|
expires_at: float
|
|
refresh_token: Optional[str] = None
|
|
|
|
class MsftToken(BaseModel):
|
|
"""Microsoft OAuth token model"""
|
|
access_token: str
|
|
token_type: str = "bearer"
|
|
expires_at: float
|
|
refresh_token: Optional[str] = None
|
|
|
|
class LocalToken(BaseModel):
|
|
"""Local authentication token model"""
|
|
access_token: str
|
|
token_type: str = "bearer"
|
|
expires_at: float |