Skip to content

Fix exact IP matching in OnlyFrom - #48

Merged
umputun merged 2 commits into
masterfrom
fix/onlyfrom-exact-ip
Jul 22, 2026
Merged

Fix exact IP matching in OnlyFrom#48
umputun merged 2 commits into
masterfrom
fix/onlyfrom-exact-ip

Conversation

@umputun

@umputun umputun commented Jul 22, 2026

Copy link
Copy Markdown
Member

fixes complete IP rules in OnlyFrom accepting other addresses with the same text prefix.

valid IP rules now use semantic address equality. CIDR and explicit textual prefix rules keep their existing behavior.

adds IPv4 and IPv6 regression coverage, including normalized IPv6 forms and later allowlist rules.

umputun added 2 commits July 22, 2026 12:34
Parse complete allowlist entries as IP addresses before falling back to textual prefix matching. Cover exact IPv4 and IPv6, CIDR, and explicit prefix behavior.
- [minor] [README.md:107] clarify semantic IP matching rules
- [minor] [onlyfrom.go:12] document exact IP, CIDR, and prefix behavior
- [major] [onlyfrom.go:46] normalize the in-function comment
- [minor] [onlyfrom_test.go:109] cover IPv6 prefix and CIDR behavior
- [minor] [onlyfrom_test.go:102] cover matching a later allowlist rule
- [major] [onlyfrom_test.go:109] normalize subtest messages
Copilot AI review requested due to automatic review settings July 22, 2026 17:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@umputun
umputun merged commit 7a6b874 into master Jul 22, 2026
3 checks passed
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 29943272850

Coverage increased (+0.02%) to 96.234%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: 9 of 9 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1301
Covered Lines: 1252
Line Coverage: 96.23%
Coverage Strength: 51.13 hits per line

💛 - Coveralls

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