fix(dns): fold domain case as ASCII, matching the reverse-DNS parser#2723
Conversation
DNS names are ASCII (RFC 1123) and their case-insensitivity is defined over ASCII (RFC 4343), so `normalize_domain` now folds case with `to_ascii_lowercase` -- the same primitive `arpa_qname_to_ip` already uses. For a valid (ASCII) domain the normalized result is unchanged; the two functions now agree by construction rather than one reaching for the Unicode-aware `to_lowercase`. The debug log moves to structured fields in the same pass. The test now exercises the case folding it had skipped -- its only input was already lowercase -- covering an uppercase and a mixed-case name. This supports NVIDIA#2637. Signed-off-by: Chet Nichols III <chetn@nvidia.com>
|
@coderabbitai review |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
Walkthrough
Changesnormalize_domain: ASCII lowercasing, structured logging, and test coverage
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
Summary
normalize_domainfolded domain case withto_lowercase(Unicode-aware), whilearpa_qname_to_ip(the reverse-DNS parser from #2637) usesto_ascii_lowercase. DNS names are ASCII (RFC 1123) and case-insensitivity is ASCII-scoped (RFC 4343), so this alignsnormalize_domainto the same ASCII primitive — the two now fold case identically, by construction.to_lowercase→to_ascii_lowercase: no change for a valid ASCII domain; the two differ only on non-ASCII input, which is not valid in a DNS name.Addresses CodeRabbit's open comment on #2691. Supports #2637; part of the #2630 (reverse DNS) effort.
Draft pending review.