Skip to content

#33 add wildcard matching#40

Open
matthewdevenny wants to merge 6 commits intomainfrom
matt/33-glob-pattern-rule
Open

#33 add wildcard matching#40
matthewdevenny wants to merge 6 commits intomainfrom
matt/33-glob-pattern-rule

Conversation

@matthewdevenny
Copy link
Copy Markdown
Contributor

@matthewdevenny matthewdevenny commented Apr 6, 2026

Closes #33

Adds support for wildcard hostname rule

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>
Copy link
Copy Markdown

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 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>
@matthewdevenny matthewdevenny marked this pull request as ready for review April 6, 2026 23:03
registry.npmjs.org
```

Hostname rules support **glob patterns** for matching dynamic hostnames:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does a glob pattern have to be a full segment? Example - what is the behavior of google.co*? Should document that behavior here

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.

Add Glob Pattern Matching for Hostname Rules

3 participants