add organization_id filter for get_workflow and get_workflow_run (#1422)

This commit is contained in:
Shuchang Zheng
2024-12-22 17:49:33 -08:00
committed by GitHub
parent b256bace6a
commit 2e37542218
7 changed files with 44 additions and 18 deletions

View File

@@ -311,7 +311,10 @@ async def cancel_workflow_run(
current_org: Organization = Depends(org_auth_service.get_current_org),
x_api_key: Annotated[str | None, Header()] = None,
) -> None:
workflow_run = await app.DATABASE.get_workflow_run(workflow_run_id=workflow_run_id)
workflow_run = await app.DATABASE.get_workflow_run(
workflow_run_id=workflow_run_id,
organization_id=current_org.organization_id,
)
if not workflow_run:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,