From 9fc6871a1f5fbef2dc5ca80a5881f16097b8c44e Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Tue, 31 Mar 2026 11:39:31 +0100 Subject: [PATCH] feat: add user authorization middleware to workflow run endpoints --- Worker/FeatureSet/Workflow/API/Manual.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Worker/FeatureSet/Workflow/API/Manual.ts b/Worker/FeatureSet/Workflow/API/Manual.ts index b485e7d77d..000bd0ddd6 100644 --- a/Worker/FeatureSet/Workflow/API/Manual.ts +++ b/Worker/FeatureSet/Workflow/API/Manual.ts @@ -1,6 +1,7 @@ import QueueWorkflow from "../Services/QueueWorkflow"; import BadDataException from "Common/Types/Exception/BadDataException"; import ObjectID from "Common/Types/ObjectID"; +import UserMiddleware from "Common/Server/Middleware/UserAuthorization"; import Express, { ExpressRequest, ExpressResponse, @@ -15,9 +16,17 @@ export default class ManualAPI { public constructor() { this.router = Express.getRouter(); - this.router.get(`/run/:workflowId`, this.manuallyRunWorkflow); + this.router.get( + `/run/:workflowId`, + UserMiddleware.getUserMiddleware, + this.manuallyRunWorkflow, + ); - this.router.post(`/run/:workflowId`, this.manuallyRunWorkflow); + this.router.post( + `/run/:workflowId`, + UserMiddleware.getUserMiddleware, + this.manuallyRunWorkflow, + ); } public async manuallyRunWorkflow(