From 37916407a698620fb527156ae7637392aa166c53 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 25 Jul 2025 15:40:15 +0100 Subject: [PATCH] prevent reading runtime vars for cloud --- packages/server/src/services/variables/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/server/src/services/variables/index.ts b/packages/server/src/services/variables/index.ts index b2ecc31c5..fb1f10a48 100644 --- a/packages/server/src/services/variables/index.ts +++ b/packages/server/src/services/variables/index.ts @@ -58,6 +58,10 @@ const getAllVariables = async (workspaceId?: string, page: number = -1, limit: n } if (workspaceId) queryBuilder.andWhere('variable.workspaceId = :workspaceId', { workspaceId }) + if (appServer.identityManager.getPlatformType() === Platform.CLOUD) { + queryBuilder.andWhere('variable.type != :type', { type: 'runtime' }) + } + const [data, total] = await queryBuilder.getManyAndCount() if (page > 0 && limit > 0) { @@ -79,6 +83,11 @@ const getVariableById = async (variableId: string) => { const dbResponse = await appServer.AppDataSource.getRepository(Variable).findOneBy({ id: variableId }) + + if (appServer.identityManager.getPlatformType() === Platform.CLOUD && dbResponse?.type === 'runtime') { + throw new InternalFlowiseError(StatusCodes.FORBIDDEN, 'Cloud platform does not support runtime variables!') + } + return dbResponse } catch (error) { throw new InternalFlowiseError(