support workflow_run_id in totp code (#2199)

This commit is contained in:
Shuchang Zheng
2025-04-21 08:24:29 +08:00
committed by GitHub
parent 8b9c7c17e3
commit 9038e6e047
6 changed files with 46 additions and 1 deletions

View File

@@ -2089,6 +2089,7 @@ class AgentDB:
code: str,
task_id: str | None = None,
workflow_id: str | None = None,
workflow_run_id: str | None = None,
source: str | None = None,
expired_at: datetime | None = None,
) -> TOTPCode:
@@ -2100,6 +2101,7 @@ class AgentDB:
code=code,
task_id=task_id,
workflow_id=workflow_id,
workflow_run_id=workflow_run_id,
source=source,
expired_at=expired_at,
)

View File

@@ -491,6 +491,7 @@ class TOTPCodeModel(Base):
organization_id = Column(String, ForeignKey("organizations.organization_id"))
task_id = Column(String, ForeignKey("tasks.task_id"))
workflow_id = Column(String, ForeignKey("workflows.workflow_id"))
workflow_run_id = Column(String, ForeignKey("workflow_runs.workflow_run_id"))
content = Column(String, nullable=False)
code = Column(String, nullable=False)
source = Column(String)

View File

@@ -41,6 +41,7 @@ async def send_totp_code(
code=code,
task_id=data.task_id,
workflow_id=data.workflow_id,
workflow_run_id=data.workflow_run_id,
source=data.source,
expired_at=data.expired_at,
)

View File

@@ -11,6 +11,7 @@ class TOTPCodeBase(BaseModel):
totp_identifier: str | None = None
task_id: str | None = None
workflow_id: str | None = None
workflow_run_id: str | None = None
source: str | None = None
content: str | None = None