Skip to content

Redact IPv4 addresses that end a sentence - #4

Merged
dimittal merged 1 commit into
mainfrom
fix/redact-sentence-ending-ip
Nov 2, 2026
Merged

dimittal merged 1 commit into
mainfrom
fix/redact-sentence-ending-ip

Conversation

@dimittal

@dimittal dimittal commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2: this commit was pushed to that branch just as it merged, so it didn't make it into main.

Bug

The built-in IP rule's lookahead rejected any match followed by ., so an address at the end of a sentence was stored unredacted:

  • from 10.20.3.14. → unchanged (leaked)
  • from 10.20.3.14, ok → from [REDACTED:ip], ok

Fix

Only .<digit> now blocks a match, so sentence-ending IPs are redacted while longer dotted numbers such as 1.2.3.4.5 are still left alone.

Tests

The regression test in tests/core/test_core.py covers a sentence-ending IPv4 and IPv6 and checks that a dotted version number is untouched. pytest (85), ruff check and ruff format --check pass locally.

🤖 Generated with Claude Code

The IP rule rejected any match followed by ".", so "from 10.20.3.14." kept the
address. Only ".<digit>" now blocks a match, which still leaves longer dotted
numbers such as "1.2.3.4.5" alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dimittal
dimittal merged commit a918e5b into main Nov 2, 2026
4 checks passed
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.

1 participant