Skip to content

feat: support wildcard DNS matching for resource addresses#314

Open
clement0010 wants to merge 2 commits into
feat/ct/support-http-web-appfrom
feat/ct/support-wildcard-dns
Open

feat: support wildcard DNS matching for resource addresses#314
clement0010 wants to merge 2 commits into
feat/ct/support-http-web-appfrom
feat/ct/support-wildcard-dns

Conversation

@clement0010
Copy link
Copy Markdown
Contributor

@clement0010 clement0010 commented Jun 2, 2026

Branched off from #310

Related Tickets & Documents

Changes

Add RFC 6125 wildcard DNS matching support for resource address validation during CONNECT handling.

  • Introduce matchResourceAddress() in internal/connect/connect.go that supports both exact matching and wildcard patterns (e.g. *.example.com)
  • Wildcard matching validates a single left-most label only — *.example.com matches api.example.com but not example.com or foo.bar.example.com
  • Case-insensitive matching for both exact and wildcard patterns
  • Rejects invalid patterns: non-leftmost wildcards (api.*.com), bare wildcards (*), and wildcards without dot separator (*example.com)

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.11%. Comparing base (289c6cf) to head (b699482).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@                       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     
Flag Coverage Δ
integration 52.58% <27.27%> (-0.30%) ⬇️
unit 78.89% <100.00%> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/connect/connect.go 97.72% <100.00%> (+0.29%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 EqualFold host validation with matchResourceAddress() 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.

Comment thread internal/connect/connect.go
clement0010 and others added 2 commits June 3, 2026 00:30
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>
@clement0010 clement0010 force-pushed the feat/ct/support-wildcard-dns branch from 313e067 to b699482 Compare June 2, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants