Skip to content

Conversation

@fkorotkov
Copy link
Contributor

  • 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.

- 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.
@fkorotkov fkorotkov requested a review from edigaryev as a code owner December 20, 2025 11:45
@fkorotkov
Copy link
Contributor Author

I think it will be nice to have for DX.

Copy link
Collaborator

@edigaryev edigaryev left a 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>
@fkorotkov
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines +340 to +344
fn resolve_domain_to_ipv4_nets_dns_google() {
let nets = resolve_allow_block_entries(
"allow",
vec![AllowBlockEntry::Domain("dns.google".to_string())],
)

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

3 participants