fix(http-api): bind 127.0.0.1, support trigger body params, fix kill-workflow fields #136
Reference in New Issue
Block a user
Delete Branch "feat/133-http-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Fix 3 security/functionality issues in the Phase 1 HTTP API.
Why
0.0.0.0by default — Phase 1 has no auth, should not be exposed to networkPOST /api/trigger-workflowignores request body, hardcodesprompt=""anddryRun=falsePOST /api/kill-workflowrequiresnamefield but never uses itChanges
packages/daemon/src/http-api.tsHTTP_API_BIND_HOST = "127.0.0.1"constant, pass toserver.listen()explicitlyPOST /api/trigger-workflow: parse optionalprompt(string),maxRounds(number),dryRun(boolean) from body with type validationPOST /api/kill-workflow: makethreadIdrequired,nameoptional (used for stderr logging only)packages/daemon/src/__tests__/file-watcher.test.tsandfile-watcher-workflow.test.tschanges.lengthbefore assertions to eliminate flakyfs.watchnoise events (unrelated to HTTP changes)Ref
9d46472e37toe5bdcf9474LGTM ✅
亮点:
DaemonHandlerBundle抽象让 IPC + HTTP 共享 handler,零重复,Phase 2 transport 接入会很顺127.0.0.1绑定 + 无 auth 阶段安全到位hostnamein health ✓nerve workflow list(daemon实时) vsruns(历史日志) 拆分合理