Repository navigation
Enforce orchestrator API authority without proxy templates - #86
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 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
There was a problem hiding this comment.
🟡 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 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. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Without a proxy URL template, requests bypassed API authority checking. Enforce the configured client API Host (defaulting to
ServiceURL), while allowing an explicitly configuredRunnerServiceURLHost 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=1go test ./cmd/livepeer -run '^TestRealBinaryOffchainFlow$' -timeout 5m -count=1