Skip to content

fix: keep Relay credentials off unmanaged provider routes - #1358

Merged
mnajafian-nv merged 1 commit into
NVIDIA:release/0.10from
willkill07:fix/relay-1088-unmanaged-provider-auth
Oct 15, 2026
Merged

mnajafian-nv merged 1 commit into
NVIDIA:release/0.10from
willkill07:fix/relay-1088-unmanaged-provider-auth

Conversation

@willkill07

@willkill07 willkill07 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Overview

Prevent unmanaged provider routes from using Relay-owned credentials. These requests still reach the provider with any credentials the client sends.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Limit configured and environment provider credentials to managed routes. Apply this rule before agent auth replacement and at gateway and daemon forwarding boundaries.
  • Cover unmanaged HTTP routes, model discovery, and WebSocket upgrades across the foreground gateway, daemon broker, and workers. Keep managed startup probes and fallbacks unchanged.
  • Add regression tests for configured keys, environment keys, caller credentials, HTTP forwarding, and WebSocket frames. Update the credential and migration guides with plain-language guidance.

Compatibility: Clients must send their own provider credentials for unmanaged routes, even when authenticated to Relay. Requests without provider credentials still reach the upstream provider. Managed routes keep their existing authentication rules.

Validation: The full Rust suite, repository hooks, and documentation checks passed after rebasing onto the latest release/0.10. The Rust suite ran with inherited logging overrides cleared. Fern skipped its published-redirect comparison because the service returned 403. Python, Node.js, and Go binding suites were not run because the change affects CLI forwarding only.

Where should the reviewer start?

Start with ProviderRoute::allows_relay_auth in crates/cli/src/gateway/routes.rs, then the forwarding checks in the gateway and daemon. The unmanaged_routes_forward_only_client_credentials tests cover the forwarding paths. WebSocket tests check that requests without provider credentials still upgrade and exchange frames.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • Bug Fixes

    • Unmanaged provider routes now forward only credentials supplied by the caller, without adding Relay-configured or environment credentials. This applies even when Relay credentials are configured or the request comes from an authenticated client.
    • Managed routes continue to support configured provider credentials where eligible.
  • Documentation

    • Updated credential guidance to distinguish managed and unmanaged routes, including how requests without replacement credentials follow configured upstream settings.

@willkill07
willkill07 requested review from a team as code owners October 15, 2026 14:08
@github-actions github-actions Bot added size:M PR is medium Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NeMo-Relay/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 9778b16e-6cef-4686-a5a7-59e729dd165f
📥 Commits

Reviewing files that changed from the base of the PR and between e3a2e90 and cfdb671.

📒 Files selected for processing: 15
  • crates/cli/src/daemon/broker/server.rs
  • crates/cli/src/daemon/worker/managed.rs
  • crates/cli/src/daemon/worker/runtime.rs
  • crates/cli/src/gateway/mod.rs
  • crates/cli/src/gateway/request.rs
  • crates/cli/src/gateway/routes.rs
  • crates/cli/tests/coverage/daemon/server_tests.rs
  • crates/cli/tests/coverage/daemon/worker_managed_tests.rs
  • crates/cli/tests/coverage/daemon/worker_runtime_tests.rs
  • crates/cli/tests/coverage/shared/gateway_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/cli/tests/coverage/shared/websocket_tests.rs
  • docs/daemon/configuration.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
  • docs/reference/migration-guides.mdx

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

⏰ Context from checks skipped due to timeout: 14
  • GitHub Check: Rust / Test (windows-amd64)
  • GitHub Check: Rust / Package (linux-arm64)
  • GitHub Check: Rust / Package (windows-amd64)
  • GitHub Check: Rust / Package (linux-musl-amd64)
  • GitHub Check: Rust / Test (linux-amd64)
  • GitHub Check: Rust / Test (linux-arm64)
  • GitHub Check: Rust / Test (windows-arm64)
  • GitHub Check: Rust / Test (macos-arm64)
  • GitHub Check: Rust / Package (macos-arm64)
  • GitHub Check: Rust / Package (windows-arm64)
  • GitHub Check: Rust / Package (linux-musl-arm64)
  • GitHub Check: Rust / Package (linux-amd64)
  • GitHub Check: Check / Run
  • GitHub Check: Preview docs
🧰 Additional context used
📚 Code guidelines: 5
.agents/skills/contribute-docs/SKILL.md — configured
.agents/skills/review-doc-style/SKILL.md — configured
CONTRIBUTING.md — configured
.agents/skills/prepare-code-freeze/SKILL.md — configured
.agents/skills/draft-release-notes/SKILL.md — configured
📓 Path-based instructions: 7
Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.

⚙️ CodeRabbit configuration file

Files:

  • docs/reference/migration-guides.mdx
  • docs/daemon/configuration.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.

⚙️ CodeRabbit configuration file

Files:

  • crates/cli/tests/coverage/daemon/worker_managed_tests.rs
  • crates/cli/tests/coverage/daemon/worker_runtime_tests.rs
  • crates/cli/tests/coverage/daemon/server_tests.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/cli/tests/coverage/shared/websocket_tests.rs
  • crates/cli/tests/coverage/shared/gateway_tests.rs
Source excerpt: In MDX files, top-of-file comments must use JSX comment delimiters: `{/*` to open and `*/}` to close.

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Files:

  • docs/reference/migration-guides.mdx
  • docs/daemon/configuration.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
Source excerpt: Verify MDX files use JSX delimiters for top-of-file SPDX comments.

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Files:

  • docs/reference/migration-guides.mdx
  • docs/daemon/configuration.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
Applicability reference: AGENTS.md: # NeMo Relay Repository Guidance See `CONTRIBUTING.md` and `docs/contribute/testing-and-docs.mdx` for contributor details, and `.agents/skills/README.md` for the maintainer skill boundary.

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Files:

  • crates/cli/src/daemon/worker/runtime.rs
  • crates/cli/src/gateway/request.rs
  • crates/cli/src/daemon/broker/server.rs
  • crates/cli/tests/coverage/daemon/worker_managed_tests.rs
  • crates/cli/tests/coverage/daemon/worker_runtime_tests.rs
  • crates/cli/src/daemon/worker/managed.rs
  • crates/cli/tests/coverage/daemon/server_tests.rs
  • crates/cli/src/gateway/mod.rs
  • crates/cli/tests/coverage/shared/server_tests.rs
  • crates/cli/src/gateway/routes.rs
  • crates/cli/tests/coverage/shared/websocket_tests.rs
  • crates/cli/tests/coverage/shared/gateway_tests.rs
Source excerpt: Search documentation source for references to the old version and update current-version install commands, package examples, and configuration examples to `` where appropriate: Review matches before changing th...

📄 CodeRabbit inference engine (.agents/skills/prepare-code-freeze/SKILL.md)

Files:

  • docs/reference/migration-guides.mdx
  • docs/daemon/configuration.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
Source excerpt: Preserve MDX front matter and the JSX SPDX comment.

📄 CodeRabbit inference engine (.agents/skills/draft-release-notes/SKILL.md)

Files:

  • docs/reference/migration-guides.mdx
  • docs/daemon/configuration.mdx
  • docs/nemo-relay-cli/basic-usage.mdx
🔇 Additional comments: 16
crates/cli/src/gateway/routes.rs: 2

57-66: LGTM!

446-446: LGTM!

crates/cli/src/gateway/mod.rs: 2

166-176: LGTM!

1539-1539: LGTM!

crates/cli/src/gateway/request.rs: 1

62-63: LGTM!

crates/cli/src/daemon/broker/server.rs: 1

1865-1866: LGTM!

crates/cli/src/daemon/worker/managed.rs: 1

709-710: LGTM!

Also applies to: 771-772

crates/cli/src/daemon/worker/runtime.rs: 1

734-735: LGTM!

crates/cli/tests/coverage/shared/gateway_tests.rs: 1

3250-3280: LGTM!

crates/cli/tests/coverage/shared/websocket_tests.rs: 1

41-45: LGTM!

Also applies to: 79-82, 322-338, 492-492

crates/cli/tests/coverage/shared/server_tests.rs: 1

7209-7271: LGTM!

crates/cli/tests/coverage/daemon/server_tests.rs: 1

4320-4320: LGTM!

Also applies to: 4574-4636

crates/cli/tests/coverage/daemon/worker_managed_tests.rs: 1

2750-2819: LGTM!

crates/cli/tests/coverage/daemon/worker_runtime_tests.rs: 1

1031-1093: LGTM!

docs/nemo-relay-cli/basic-usage.mdx: 1

394-414: LGTM!

Also applies to: 474-475, 489-493

docs/reference/migration-guides.mdx: 1

575-584: LGTM!

Walkthrough

Relay authentication now depends on provider-route eligibility. Gateway and daemon forwarding restrict provider credential injection or replacement to eligible routes. Tests and documentation cover unmanaged routes forwarding only caller-supplied credentials.

Changes

Provider authentication

Layer / File(s) Summary
Route eligibility and gateway authentication
crates/cli/src/gateway/routes.rs, crates/cli/src/gateway/mod.rs, crates/cli/src/gateway/request.rs
Provider routes now expose relay-auth eligibility. Gateway credential replacement and environment or configured credential injection are restricted by that policy.
Daemon forwarding checks
crates/cli/src/daemon/broker/server.rs, crates/cli/src/daemon/worker/managed.rs, crates/cli/src/daemon/worker/runtime.rs
Daemon broker and worker forwarding require the request path to allow relay authentication before enabling environment-based provider authentication.
Route forwarding tests
crates/cli/tests/coverage/{shared,daemon}/*tests.rs
Tests cover unmanaged routes with absent, caller-supplied, and configured credentials. WebSocket tests also cover requests without provider credentials.
Credential behavior documentation
docs/daemon/configuration.mdx, docs/nemo-relay-cli/basic-usage.mdx, docs/reference/migration-guides.mdx
Documentation distinguishes managed and unmanaged route credential behavior and describes how each uses caller, configured, or environment credentials.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to cfdb6

The documented distinction between managed credential replacement and unmanaged model discovery is consistent. No merge-blocking issue was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 12 files. (3 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title follows Conventional Commits format, uses the allowed lowercase type fix, clearly describes the change, is 57 characters, and has no trailing period.
Description check Passed The description includes the required Overview, Details, reviewer guidance, related issue, contribution confirmations, change scope, compatibility notes, and validation results.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 12 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

@willkill07 willkill07 self-assigned this Oct 15, 2026
@willkill07 willkill07 added this to the 0.10 milestone Oct 15, 2026

@mnajafian-nv mnajafian-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm, found no p0s or p1s

@mnajafian-nv
mnajafian-nv merged commit c628ea9 into NVIDIA:release/0.10 Oct 15, 2026
46 checks passed
@willkill07
willkill07 deleted the fix/relay-1088-unmanaged-provider-auth branch October 30, 2026 14:46

This branch was previously deployed

1 inactive deployment
fern — cfdb671e Deployed Oct 15, 2026 by mnajafian-nv via Clean up docs preview #5827
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants