xds/rbac: add additional handling for addresses with ports#8990
Open
mbissa wants to merge 1 commit intogrpc:masterfrom
Open
xds/rbac: add additional handling for addresses with ports#8990mbissa wants to merge 1 commit intogrpc:masterfrom
mbissa wants to merge 1 commit intogrpc:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8990 +/- ##
==========================================
- Coverage 83.42% 83.00% -0.42%
==========================================
Files 410 411 +1
Lines 32572 32902 +330
==========================================
+ Hits 27172 27310 +138
- Misses 4030 4191 +161
- Partials 1370 1401 +31
🚀 New features to boost your workflow:
|
arjan-bal
reviewed
Mar 24, 2026
| @@ -344,7 +345,15 @@ func newRemoteIPMatcher(cidrRange *v3corepb.CidrRange) (*remoteIPMatcher, error) | |||
| } | |||
|
|
|||
| func (sim *remoteIPMatcher) match(data *rpcData) bool { | |||
Contributor
There was a problem hiding this comment.
How big of a change would it be to make match return a (bool, error) to enable callers to handle parsing errors?
Contributor
Author
There was a problem hiding this comment.
There are 11 implementations and each implementation has on an average of 4-5 references. This would need thorough testing and effort. I suggest we merge this and do that as a follow up.
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.
This PR enhances the rbac matcher to handle IP address string with a port attached.
The fix introduces the
net.SplitHostPortutility function, ensuring the port is properly stripped out of the underlyingpeerInfo.Addr.String()andlocalAddr.String()values before parsing them withnetip.ParseAddr. A fallback mechanism is also included in caseSplitHostPortfails due to a missing port.RELEASE NOTES: