Remove unwanted configs - #2954
Conversation
📝 WalkthroughWalkthroughGateway configuration defaults were updated for control-plane verification, analytics, Moesif application identification, traffic-log masking, and LLM pricing resolution. Runtime tests verify seeded defaults and operator overrides, while the sample configuration removes obsolete sections. ChangesGateway configuration defaults
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/configs/config-template.toml`:
- Line 392: Update the analytics publisher defaults at the referenced enabled
settings to disabled, so fresh deployments do not activate Moesif without
explicit operator opt-in and a valid application ID. Apply the same change to
the additional analytics setting noted in the comment.
- Line 57: Set the control-plane TLS verification fallback to false in
gateway/configs/config-template.toml at lines 57-57, and update the
corresponding runtime default in gateway/gateway-controller/pkg/config/config.go
at lines 880-880 to false. Preserve true only when explicitly configured for
development or testing.
In `@gateway/gateway-runtime/policy-engine/internal/config/config.go`:
- Around line 465-474: Update defaultMaskedHeaders in
gateway/gateway-runtime/policy-engine/internal/config/config.go (lines 465-474)
to preserve an immutable denylist containing authorization, x-api-key,
x-jwt-assertion, cookie, and set-cookie while unioning operator-configured
headers rather than replacing mandatory entries. In
gateway/gateway-runtime/policy-engine/internal/config/resolvable_defaults_test.go
(lines 41-44), assert the required header names explicitly; in lines 63-79,
verify operator values are additive and cannot remove mandatory masking.
🪄 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: f12d9a92-558f-4999-b0c7-9c06850923cb
📒 Files selected for processing (5)
gateway/configs/config-template.tomlgateway/configs/config.tomlgateway/gateway-controller/pkg/config/config.gogateway/gateway-runtime/policy-engine/internal/config/config.gogateway/gateway-runtime/policy-engine/internal/config/resolvable_defaults_test.go
💤 Files with no reviewable changes (1)
- gateway/configs/config.toml
This pull request introduces important improvements to configuration defaults and security for the gateway, focusing on safer out-of-the-box settings, improved config handling, and better test coverage. The main changes include setting secure and sensible defaults for analytics and header masking, seeding config values even when not specified, and adding tests to ensure these behaviors.
config.toml#2889Configuration and Security Improvements:
insecure_skip_verifyis now set totruein bothconfig-template.tomland the Go code, which means TLS certificate verification is skipped by default for control plane connections. This is typically for development or non-production use and should be reviewed for production deployments. [1] [2]enabled = true), and a placeholder Moesif application ID is set in the template to prompt operators to supply their real value. [1] [2]authorization,x-api-key, andx-jwt-assertion, providing better security by redacting sensitive information unless explicitly overridden.policy_configurations.llm_cost_v1.pricing_file) are now seeded automatically, ensuring policies load correctly even if not specified in the config files. [1] [2]Testing and Validation:
resolvable_defaults_test.go, to verify that the new config defaults are correctly applied and that operator-supplied overrides take precedence.These changes help ensure more secure and reliable default behavior, reduce misconfiguration risk, and improve the maintainability of the gateway’s configuration system.