-
Notifications
You must be signed in to change notification settings - Fork 385
fix(connlib): match exact domains before wildcard ones #6809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(connlib): match exact domains before wildcard ones #6809
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
9606e12 to
c7c0a7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just suggested a brief explanation of the reverse iteration trick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| (Some(self_char), Some(other_char)) => { | ||
| break self_char.cmp(&other_char).reverse(); // Reverse because we compare from right to left. | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean this will return the ordering of the first non-wildcard character where they differ?
I guess we're fine with that because that means they're non overlapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean this will return the ordering of the first non-wildcard character where they differ?
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add this to docs
|
@thomaseizinger lets merge this? Want to ship it to the client that hit this issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the Changelog conflicts, but LGTM.
@AndrewDryga I'll be at my desk for standup, if you want it earlier, feel free to jump and merge it :) |
c7c0a7e to
22fec29
Compare
Co-authored-by: Reactor Scram <[email protected]> Signed-off-by: Thomas Eizinger <[email protected]>
8371363 to
fa3a4ad
Compare
Bump gui/headless clients for #6809
Documents how overlapping addresses are matched. Draft until #6809 is merged and published. --------- Signed-off-by: Jamil <[email protected]> Co-authored-by: Thomas Eizinger <[email protected]>
Currently, the order in which connlib matches against the patterns of DNS resources is not specified. We simply iterate over all patterns and take the first one that matches. Due to the iteration order of
HashMaps, this also isn't deterministic.With this patch, we introduce a defined order in which we attempt to match a particular domain against the defined DNS resources:
?) take priority over label wildcards (*)*) take priority over catch-all wildcards (**)By matching against the DNS resources in a defined order, we ensure that DNS resources that overlap always resolve to the most specific resource.