Skip to content

Enforce orchestrator API authority without proxy templates - #86

Merged
j0sh merged 5 commits into
mainfrom
ja-codex/enforce-api-authority
Nov 12, 2026
Merged

j0sh merged 5 commits into
mainfrom
ja-codex/enforce-api-authority

Conversation

@j0sh

@j0sh j0sh commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Without a proxy URL template, requests bypassed API authority checking. Enforce the configured client API Host (defaulting to ServiceURL), while allowing an explicitly configured RunnerServiceURL Host only on runner routes under its own base path.

Preserve proxy routing, credentials, and advertised URLs. Reuse the parsed runner URL and existing routing block with zero net production LOC growth. Existing tests cover direct runner requests, wildcard precedence, overlapping base paths, and wrong-base rejection.

Validation passed, including pinned Python SDK compatibility:

  • go test ./orchestrator -timeout 5m -count=1
  • go test ./cmd/livepeer -run '^TestRealBinaryOffchainFlow$' -timeout 5m -count=1
  • Focused authority tests after the final coverage adjustment.

Copilot AI balanced review requested due to automatic review settings November 12, 2026 16:37
@j0sh
j0sh deployed to docker-publish November 12, 2026 16:39 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the API Host-enforcement change.

No open issues 🎉

What changed in this PR

This PR closes an orchestrator API Host-check bypass when ProxyURLTemplate is empty, while preserving template-based proxy routing.

Changes:

  • Enforce the configured API authority, defaulting to ServiceURL, before entering the API router.
  • Expand authority regression coverage and update test fixtures to use accepted Hosts.
  • Update documentation, configuration comments, and CLI help to describe unconditional enforcement.
File Description
orchestrator/​trickle_test.go Use API-authorized Hosts for trickle requests.
orchestrator/​seq_test.go Correct the heartbeat request Host.
orchestrator/​runner_address_test.go Align runner-facing request fixtures with API authority.
orchestrator/​regression_test.go Update HTTP and streaming fixtures for Host enforcement.
orchestrator/​python_media_test.go Set API authority to the Python media test listener.
orchestrator/​python_controls_test.go Set API authority for Python session-control tests.
orchestrator/​proxy_test.go Expand Host rejection and proxy-routing coverage.
orchestrator/​payment_test.go Align payment and Python SDK fixtures with API authority.
orchestrator/​payment_recipient_test.go Correct Hosts in payment-failure tests.
orchestrator/​metrics_test.go Update request and server fixtures for metrics tests.
orchestrator/​lifecycle_test.go Update lifecycle fixtures for Host enforcement.
orchestrator/​http.go Enforce API Host checks independently of proxy templates.
orchestrator/​http_test.go Add authority-aware test helpers and update HTTP fixtures.
orchestrator/​discovery_test.go Use an authority-aware discovery test server.
orchestrator/​app.go Update the API origin option description.
orchestrator/​app_test.go Test authority enforcement across proxy-template configurations.
docs/​orchestrator.md Explain API and proxy Host requirements.
configs/​orchestrator/​config.example.toml Clarify API authority in the configuration comment.
cmd/​livepeer/​testdata/​cli/​orchestrator-help.golden Reflect the updated API origin help text.

Review effort: Balanced

@j0sh
j0sh deployed to docker-publish November 12, 2026 16:40 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish November 12, 2026 16:40 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish November 12, 2026 16:40 — with GitHub Actions Active
Copilot AI balanced review requested due to automatic review settings November 12, 2026 16:44
@j0sh
j0sh deployed to docker-publish November 12, 2026 16:46 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish November 12, 2026 16:47 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish November 12, 2026 16:47 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish November 12, 2026 16:47 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The runner ingress documentation needs to retain the configured API Host requirement and clarify that RunnerServiceURL does not add an accepted authority, since a mismatched Host causes direct runner requests to return 404.

1 open issue

Review effort: Balanced

Comment thread docs/orchestrator.md Outdated
Comment on lines +106 to +108
API requests must use the Host from `APIOriginURL`, which defaults to
`ServiceURL`. If a reverse proxy rewrites Host, set `APIOriginURL` to an
HTTP(S) URL with the Host it sends, without a path.
Copilot AI balanced review requested due to automatic review settings November 12, 2026 17:20
@j0sh
j0sh deployed to docker-publish November 12, 2026 17:23 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish November 12, 2026 17:23 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish November 12, 2026 17:23 — with GitHub Actions Active
@j0sh
j0sh deployed to docker-publish November 12, 2026 17:23 — with GitHub Actions Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the API and runner Host enforcement changes.

1 open issue

Review effort: Balanced

@j0sh
j0sh merged commit 2364436 into main Nov 12, 2026
15 checks passed
@j0sh
j0sh deleted the ja-codex/enforce-api-authority branch November 12, 2026 17:25

This branch was successfully deployed

1 active deployment
docker-publish — b722fe80 Deployed Nov 12, 2026 by j0sh via docker-pr / promote #179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants