Skip to content

Review fixes for 4.1.0: NAT64 unwrap + trust caveats in docs - #29

Merged
un33k merged 1 commit into
mainfrom
fix/review-nat64-docs
Sep 22, 2026
Merged

un33k merged 1 commit into
mainfrom
fix/review-nat64-docs

Conversation

@un33k

@un33k un33k commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Follow-up to #28. #28 was merged before these review fixes were pushed, so they are not on main yet.

What changed

  • NAT64 regression fixed: 64:ff9b::/96 (RFC 6052 well-known prefix) addresses were rejected as reserved, so modern returned None where v3 returned an address. parse_ip now unwraps them to the embedded IPv4 client, the same way it handles ::ffff: IPv4-mapped addresses. Trusted-proxy matching uses the unwrapped IPv4.
  • Docs: the README and CHANGELOG now state that:
    • without proxy_count/proxy_list, the first public hop may be an upstream proxy, so set them if you need to identify private (intranet/VPN) clients;
    • Forwarded now resolves above the CDN headers and a client can forge it, just like X-Forwarded-For, so behind a CDN you should pass an explicit precedence.
  • ip_tier docstring: classification follows the running Python's ipaddress tables. For example, 6to4 2002::/16 is global on 3.11 and private on 3.12+.
  • Tests: NAT64 unwrap, and proxy-list matching of a NAT64 proxy hop.

These come from an independent review of #28. Its verdict was approve with nits, with no blockers.

Verified locally

  • Full suite passes on Python 3.11, 3.12, 3.13 and 3.14.
  • The v3 suite passes against the legacy engine.
  • ruff check . is clean.

No tag has been pushed, so nothing is published.

🚀 Generated with Dojo ⛩️

…Forwarded trust caveats

- parse_ip unwraps 64:ff9b::/96 (RFC 6052) to the embedded IPv4 client;
  it was rejected as reserved, a regression vs v3.
- README/CHANGELOG: the first public hop may be an upstream proxy (set
  proxy_count/proxy_list for private clients); Forwarded now resolves above
  CDN headers and is client-forgeable like X-Forwarded-For.
- ip_tier docstring notes classification follows the running Python's
  ipaddress tables (6to4 differs 3.11 vs 3.12+).
@un33k
un33k merged commit 8d56789 into main Sep 22, 2026
17 checks passed
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.085% (+0.04%) from 97.05% — fix/review-nat64-docs into main

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.

2 participants