Skip to content

feat!: ipv6 zoneid#21

Merged
qjerome merged 1 commit intomainfrom
feat-ipv6-zone-id
Mar 2, 2026
Merged

feat!: ipv6 zoneid#21
qjerome merged 1 commit intomainfrom
feat-ipv6-zone-id

Conversation

@qjerome
Copy link
Collaborator

@qjerome qjerome commented Mar 2, 2026

Summary
Add IPv6 zone ID support and refactor Host enum to separate IPv4/IPv6 variants.

Motivation
IPv6 addresses can include zone IDs (interface identifiers) in the format [address%zone]. The parser needed to support this syntax, and the Host enum was refactored to better distinguish between IPv4 and IPv6 addresses.

Changes

  • Split Host::Ip enum variant into Host::IpV4 and Host::IpV6
  • Add zone ID support to Host::IpV6 variant (stores Ipv6Addr and Option<Cow<'url, str>>)
  • Update grammar to parse zone IDs (% followed by any characters except ])
  • Refactor IPv6 parsing to handle optional zone IDs
  • Update all pattern matches throughout codebase to use new enum variants
  • Add is_hostname(), is_ipv4(), and is_ipv6() methods to Host
  • Update Python bindings to match new enum structure
  • Fix IPv6 grammar to support compressed zeros (e.g., ::1)

Breaking Changes

  • YES: The Host enum variant Ip has been split into IpV4 and IpV6
  • Python Host enum: Ip variant renamed to Ipv4 and Ipv6
  • All code matching on Host::Ip must be updated to match specific variants

Testing

  • Existing tests updated to use new enum variants
  • New test added for IPv6 zone ID parsing
  • IPv6 addresses with zone IDs should now be properly parsed
  • Zone ID information is available in Rust API but not yet exposed in Python bindings

Notes
The zone ID is parsed and stored in the Rust API but is not yet exposed through the Python bindings. The Python bindings currently only expose the IPv6 address without the zone ID. This is a known limitation that may need to be addressed in a future update.

@qjerome qjerome changed the title feat: ipv6 zoneid feat!: ipv6 zoneid Mar 2, 2026
@qjerome qjerome merged commit 9b63975 into main Mar 2, 2026
19 checks passed
@qjerome qjerome deleted the feat-ipv6-zone-id branch March 3, 2026 10:01
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