-
Notifications
You must be signed in to change notification settings - Fork 10
Add domain resolution for allow/block entries #133
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
base: main
Are you sure you want to change the base?
Conversation
- Updated `--allow` and `--block` flags to accept domains, alongside CIDRs and IPs. - Implemented A-record resolution for domain entries during startup. - Added tests for domain resolution functionality.
|
I think it will be nice to have for DX. |
edigaryev
left a comment
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 overall except for a couple of comments.
Also please note that some CI checks are failing.
- simplify allow/block resolution without mem::take (refs #2661210452) - use dns.google test domain with stable A records (refs #2661236654) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ccb0ee4b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fn resolve_domain_to_ipv4_nets_dns_google() { | ||
| let nets = resolve_allow_block_entries( | ||
| "allow", | ||
| vec![AllowBlockEntry::Domain("dns.google".to_string())], | ||
| ) |
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.
Avoid external DNS dependency in unit test
This test depends on live DNS/network access by resolving dns.google and asserting specific A records. In offline CI, sandboxed builds, or environments with restricted DNS, to_socket_addrs will error and the test will fail even when the code is correct, making the suite flaky. Consider injecting a resolver or using a deterministic local fixture (e.g., a stubbed resolver) so the test doesn’t rely on external network conditions.
Useful? React with 👍 / 👎.
- switch back to let mut args: Args = Args::parse()
--allowand--blockflags to accept domains, alongside CIDRs and IPs.