Skip to content

feat(agent): forward any executor route generically [PRD-567]#321

Merged
matthv merged 1 commit into
mainfrom
feature/prd-567-executor-passthrough
Jun 26, 2026
Merged

feat(agent): forward any executor route generically [PRD-567]#321
matthv merged 1 commit into
mainfrom
feature/prd-567-executor-passthrough

Conversation

@matthv

@matthv matthv commented Jun 25, 2026

Copy link
Copy Markdown
Member

What

Ports the generic executor passthrough to the Ruby agent, matching the agent-nodejs reference (agent-nodejs#1707, released 1.81.0).

  • Single catch-all route _internal/executor/*path → executor /:path verbatim (all verbs). Replaces the /runs-confined proxy. Callers address runs as runs/<id>, so any executor route (mcp-oauth-credentials, future ones) is reachable with no agent change.

Security

  • SSRF guard: string guard (empty / leading-/ / .. / %2e/%2E / backslash / NUL → NotFoundError) plus an authoritative origin check (URI.parse, reject unless scheme+host+port match the executor). A decoded control char like \t//host makes URI.parse raise → rejected.
  • Faraday's client has no FollowRedirects middleware, so redirects aren't followed (matches the Node agent's raw http client).

Tests

24/24 + rubocop clean. Run GET (caller includes runs/), POST trigger, non-runs route verbatim (asserts no /runs prefix injected), header req/resp filtering, status/body passthrough, SSRF vectors (.., %2e, NUL, control-char \t//evil.com) → NotFoundError, unreachable/timeout/SSL → 503.

fixes PRD-567

🤖 Generated with Claude Code

Note

Forward executor routes generically under /_internal/executor in WorkflowExecutorProxy

  • Changes the agent mount path from /_internal/workflow-executions to /_internal/executor and removes the hardcoded /runs prefix injection, so paths are forwarded verbatim to the configured executor URL.
  • Adds reject_off_origin! to block SSRF by comparing the computed target URL's scheme, host, and port against the configured executor origin, raising NotFoundError on mismatch.
  • Callers must now include the full subpath (e.g. runs/...) in the request — the proxy no longer prepends it.
  • Risk: any existing integration that relied on the /_internal/workflow-executions mount point or the automatic /runs prefix will break without a corresponding caller update.

🖇️ Linked Issues

Implements PRD-567.

Macroscope summarized eafae3b.

Single catch-all route /_internal/executor/*path → executor /:path verbatim
(all verbs), replacing the /runs-confined proxy. Callers address runs as
runs/<id>. Mirrors the agent-nodejs reference (1.81.0).

- SSRF: string guard (.., %2e, backslash, NUL, leading /) plus an origin check
  (URI.parse, reject off-origin) that also catches control-char escapes.
- Faraday follows no redirects (no FollowRedirects middleware), like the Node agent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 25, 2026

Copy link
Copy Markdown

PRD-567

@christophebrun-forest christophebrun-forest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matthv matthv merged commit 9bc904d into main Jun 26, 2026
48 checks passed
@matthv matthv deleted the feature/prd-567-executor-passthrough branch June 26, 2026 09:30
forest-bot added a commit that referenced this pull request Jun 26, 2026
# [1.34.0](v1.33.1...v1.34.0) (2026-06-26)

### Features

* **agent:** forward any executor route generically [PRD-567] ([#321](#321)) ([9bc904d](9bc904d))
@forest-bot

Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.34.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants