Skip to content

Commit 4480595

Browse files
Copilothotlong
andcommitted
docs: add MVP security comments to expression evaluators
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 4e9da24 commit 4480595

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

packages/services/service-automation/src/engine.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ export class AutomationEngine implements IAutomationService {
224224
}
225225

226226
private evaluateCondition(expression: string, variables: Map<string, unknown>): boolean {
227-
// Simple template replacement + expression evaluation (MVP version)
227+
// MVP: Simple template replacement + expression evaluation.
228+
// Flow definitions are authored by trusted developers/admins.
229+
// TODO: Replace with safe expression evaluator (e.g., jexl) for production.
228230
let resolved = expression;
229231
for (const [key, value] of variables) {
230232
resolved = resolved.replaceAll(`{${key}}`, String(value));

packages/services/service-automation/src/plugins/logic-nodes-plugin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export class LogicNodesPlugin implements Plugin {
2525
const conditions = (config?.conditions ?? []) as Array<{ label: string; expression: string }>;
2626

2727
for (const cond of conditions) {
28+
// MVP: Simple template replacement + expression evaluation.
29+
// Flow definitions are authored by trusted developers/admins.
30+
// TODO: Replace with safe expression evaluator (e.g., jexl) for production.
2831
let expr = cond.expression;
2932
for (const [k, v] of variables) {
3033
expr = expr.replaceAll(`{${k}}`, String(v));

0 commit comments

Comments
 (0)