[management] Accept domain target type for L4 reverse proxy services#5612
[management] Accept domain target type for L4 reverse proxy services#5612
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR centralizes target validation in the reverse-proxy manager by adding helpers that validate peers and network resources (with explicit resource-type checks) and expands L4 service validation to allow Domain-type targets. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@management/internals/modules/reverseproxy/service/service_test.go`:
- Around line 866-868: The UDP test case in service_test.go sets the
Target.Protocol incorrectly to "tcp"; update the Target literal in the Targets
slice (the entry with TargetId "resource-1" and TargetType TargetTypeDomain) to
use Protocol: "udp" for the UDP mode so it matches other UDP tests (e.g.,
TestValidate_UDPProxyProtocolRejected) and correctly exercises UDP behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ebc8783c-4082-4fa6-9160-e61024b20d86
📒 Files selected for processing (4)
management/internals/modules/reverseproxy/service/manager/manager.gomanagement/internals/modules/reverseproxy/service/manager/manager_test.gomanagement/internals/modules/reverseproxy/service/service.gomanagement/internals/modules/reverseproxy/service/service_test.go
|



Describe your changes
L4 services (TCP/TLS/UDP) rejected
target_type: "domain"even though HTTP services accepted it. This caused domain-backed resources to fail when used as targets for L4 services. Additionally, there was no validation thattarget_typematched the actual network resource type, so sendingtarget_type: "host"for a domain resource would silently produce an invalid backend address.This PR adds
TargetTypeDomainto L4 validation and cross-validates that the declaredtarget_typematches the actual resource type duringvalidateTargetReferences.Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit
New Features
Improvements
Tests