before claude fix #1
This commit is contained in:
23
FitnessSync/backend/src/models/api_token.py
Normal file
23
FitnessSync/backend/src/models/api_token.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime
|
||||
from sqlalchemy.sql import func
|
||||
from ..models import Base
|
||||
import json
|
||||
|
||||
class APIToken(Base):
|
||||
__tablename__ = "api_tokens"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
token_type = Column(String, nullable=False) # 'fitbit' or 'garmin'
|
||||
access_token = Column(String, nullable=False) # This should be encrypted in production
|
||||
refresh_token = Column(String, nullable=True) # This should be encrypted in production
|
||||
expires_at = Column(DateTime, nullable=False)
|
||||
scopes = Column(String, nullable=True)
|
||||
garth_oauth1_token = Column(String, nullable=True) # OAuth1 token for garmin (JSON)
|
||||
garth_oauth2_token = Column(String, nullable=True) # OAuth2 token for garmin (JSON)
|
||||
# MFA session fields for garmin
|
||||
mfa_session_id = Column(String, nullable=True)
|
||||
mfa_resume_data = Column(String, nullable=True) # JSON blob
|
||||
mfa_expires_at = Column(DateTime, nullable=True)
|
||||
last_used = Column(DateTime, nullable=True)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
Reference in New Issue
Block a user