add 2fa type tracking to credentials (#3647)

This commit is contained in:
pedrohsdb
2025-10-08 11:38:34 -07:00
committed by GitHub
parent a61ff4cb4f
commit fc0f2b87ca
9 changed files with 123 additions and 6 deletions

View File

@@ -3623,6 +3623,7 @@ class AgentDB:
credential_type: CredentialType,
organization_id: str,
item_id: str,
totp_type: str = "none",
) -> Credential:
async with self.Session() as session:
credential = CredentialModel(
@@ -3630,6 +3631,7 @@ class AgentDB:
name=name,
credential_type=credential_type,
item_id=item_id,
totp_type=totp_type,
)
session.add(credential)
await session.commit()

View File

@@ -818,6 +818,7 @@ class CredentialModel(Base):
name = Column(String, nullable=False)
credential_type = Column(String, nullable=False)
totp_type = Column(String, nullable=False, default="none")
created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False)
modified_at = Column(DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow, nullable=False)