SurfSense/surfsense_backend/app/schemas/google_auth_credentials.py

19 lines
402 B
Python
Raw Normal View History

2025-08-02 04:39:48 +02:00
from datetime import UTC, datetime
2025-08-02 01:36:36 +02:00
from pydantic import BaseModel
class GoogleAuthCredentialsBase(BaseModel):
token: str
refresh_token: str
token_uri: str
client_id: str
expiry: datetime
scopes: list[str]
client_secret: str
2025-08-02 04:39:48 +02:00
@property
2025-08-21 01:09:13 +02:00
def expired(self) -> bool:
2025-08-02 04:39:48 +02:00
"""Check if the credentials have expired."""
return self.expiry <= datetime.now(UTC)