Open
Conversation
Signed-off-by: Matthew DeVenny <matt@codecargo.com>
Signed-off-by: Matthew DeVenny <matt@codecargo.com>
Signed-off-by: Matthew DeVenny <matt@codecargo.com>
Signed-off-by: Matthew DeVenny <matt@codecargo.com>
Signed-off-by: Matthew DeVenny <matt@codecargo.com>
There was a problem hiding this comment.
Pull request overview
Adds glob-style wildcard matching for hostname rules so dynamic hostnames can be allowed/denied using * and ** label-based patterns.
Changes:
- Introduces hostname glob pattern compilation/matching and integrates it into rule resolution and DNS query filtering.
- Updates DNS server logic + tests to recognize hostname patterns and validate matching behavior.
- Expands documentation/examples and CI workflow to demonstrate and exercise wildcard host allowances.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents new hostname glob pattern syntax and provides examples. |
| pkg/dns/server.go | Extends hostname-to-ports lookup to consider glob pattern rules. |
| pkg/dns/server_test.go | Adds tests covering hostname pattern behavior in port lookup and query allowance. |
| pkg/config/pattern.go | Implements glob pattern parsing/compilation and matching for hostname labels. |
| pkg/config/pattern_test.go | Adds unit tests for pattern detection, compilation, and matching semantics. |
| pkg/config/config.go | Adds compiled pattern storage to resolved rules and uses patterns during hostname action lookups. |
| pkg/config/config_test.go | Updates env parsing tests and adds new tests for pattern-based rule behavior. |
| design.md | Updates design doc to reflect hostname glob pattern support. |
| config.example.json | Adds an example hostname glob pattern rule. |
| .gitignore | Adds .omc to ignored files. |
| .github/workflows/ci.yml | Adds integration coverage for allowing traffic via a hostname glob pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Matthew DeVenny <matt@codecargo.com>
caleblloyd
reviewed
Apr 6, 2026
| registry.npmjs.org | ||
| ``` | ||
|
|
||
| Hostname rules support **glob patterns** for matching dynamic hostnames: |
Contributor
There was a problem hiding this comment.
Does a glob pattern have to be a full segment? Example - what is the behavior of google.co*? Should document that behavior here
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.
Closes #33
Adds support for wildcard hostname rule