Improvement to gateway controller's Management API flows - #2983
Conversation
|
Warning Review limit reached
Next review available in: 11 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughManagement subscription routes are now admin-only. Upstream credentials are write-only, inherited during updates when omitted, and redacted from materialized responses for LLM provider, LLM proxy, and MCP proxy configurations. ChangesCredential protection and management authorization
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)Update credential inheritancesequenceDiagram
participant ManagementAPI
participant DeploymentPipeline
participant storedSourceForUpdate
participant CredentialInheritance
ManagementAPI->>DeploymentPipeline: parse update configuration
DeploymentPipeline->>storedSourceForUpdate: load persisted SourceConfiguration
storedSourceForUpdate-->>DeploymentPipeline: stored configuration
DeploymentPipeline->>CredentialInheritance: inherit missing credentials
CredentialInheritance-->>DeploymentPipeline: updated configuration
DeploymentPipeline->>DeploymentPipeline: render and validate
Management response redactionsequenceDiagram
participant SearchDeployments
participant buildDeploymentListItem
participant rematerializeConfig
participant ManagementResponse
SearchDeployments->>buildDeploymentListItem: build deployment item
buildDeploymentListItem->>rematerializeConfig: rematerialize stored configuration
rematerializeConfig->>rematerializeConfig: clear upstream auth values
rematerializeConfig-->>buildDeploymentListItem: redacted configuration
buildDeploymentListItem-->>ManagementResponse: resource response without credential values
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gateway/gateway-controller/pkg/api/handlers/handlers.go`:
- Around line 285-293: Update the buildDeploymentListItem error handling in
SearchDeployments to log the malformed configuration and continue iterating,
rather than writing a 500 response and returning. Preserve the existing
continue-on-error behavior used for context-filter failures, and append only
successfully built items.
In `@gateway/gateway-controller/pkg/utils/credential_inheritance.go`:
- Around line 136-157: The credential inheritance helpers inherit stored values
even when the incoming authentication type changes. Update
inheritLLMProviderCredential, inheritLLMUpstreamAuth, and
inheritMCPProxyCredential so stored credentials are reused only when
incoming.Type matches stored.Type; preserve explicit "none" removal and avoid
inheriting values for changed or unsupported auth types.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 89cc6a85-6387-4095-a20c-2953a5c9292b
📒 Files selected for processing (13)
gateway/gateway-controller/api/management-openapi.yamlgateway/gateway-controller/cmd/controller/main.gogateway/gateway-controller/pkg/api/handlers/credential_redaction.gogateway/gateway-controller/pkg/api/handlers/credential_redaction_test.gogateway/gateway-controller/pkg/api/handlers/handlers.gogateway/gateway-controller/pkg/api/handlers/llm_provider_handler.gogateway/gateway-controller/pkg/api/handlers/llm_proxy_handler.gogateway/gateway-controller/pkg/api/handlers/mcp_proxy_handler.gogateway/gateway-controller/pkg/api/management/generated.gogateway/gateway-controller/pkg/utils/credential_inheritance.gogateway/gateway-controller/pkg/utils/credential_inheritance_test.gogateway/gateway-controller/pkg/utils/llm_deployment.gogateway/gateway-controller/pkg/utils/mcp_deployment.go
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gateway/it/features/template-functions.feature`:
- Line 189: Update the database assertion in the “secret template in LlmProvider
upstream auth value” scenario to verify that the resolved secret value
“llm-prov-secret-789” is absent from the persisted configuration, while
retaining the check that the template remains stored.
In `@gateway/it/steps/assert_steps.go`:
- Around line 201-208: Update jsonFieldShouldNotExist to treat only the
dedicated missing-field/not-found error from getJSONField as success; propagate
malformed JSON, invalid-index, type-mismatch, and other errors unchanged, while
retaining the existing failure for a present field.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 196e1473-be9b-4ef1-a60f-51c2c6aff8a0
📒 Files selected for processing (2)
gateway/it/features/template-functions.featuregateway/it/steps/assert_steps.go
Purpose
$subject