feat: support wildcard DNS matching for resource addresses#314
Open
clement0010 wants to merge 2 commits into
Open
feat: support wildcard DNS matching for resource addresses#314clement0010 wants to merge 2 commits into
clement0010 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/ct/support-http-web-app #314 +/- ##
================================================================
- Coverage 86.35% 86.11% -0.24%
================================================================
Files 40 40
Lines 2828 2838 +10
================================================================
+ Hits 2442 2444 +2
- Misses 262 267 +5
- Partials 124 127 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds RFC 6125-style wildcard DNS matching to resource address validation during CONNECT handling, enabling resource addresses like *.example.com to authorize a single left-most subdomain label.
Changes:
- Replace strict
EqualFoldhost validation withmatchResourceAddress()supporting exact and wildcard patterns. - Implement case-insensitive wildcard matching limited to one left-most label.
- Add unit tests covering exact and wildcard matching behavior and rejection cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/connect/connect.go | Adds matchResourceAddress() and uses it in CONNECT destination validation. |
| internal/connect/connect_test.go | Adds unit tests for wildcard and exact matching behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Implement RFC 6125 wildcard matching so that resource addresses like *.example.com match single-level subdomains (e.g. api.example.com) but not the bare domain or multi-level subdomains. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
313e067 to
b699482
Compare
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.
Branched off from #310
Related Tickets & Documents
Changes
Add RFC 6125 wildcard DNS matching support for resource address validation during CONNECT handling.
matchResourceAddress()ininternal/connect/connect.gothat supports both exact matching and wildcard patterns (e.g.*.example.com)*.example.commatchesapi.example.combut notexample.comorfoo.bar.example.comapi.*.com), bare wildcards (*), and wildcards without dot separator (*example.com)