Hello River developers,
Something that has come to my attention recently, as you are probably
aware I've been using IPv6 multicast discovery and IPv6 service endpoints.
Host identity in LookupLocator is based on RFC3986. IPv6 addresses are
allowed to be used for hostnames and IPv6 legal syntax is relatively
flexible and can have multiple forms, unlike IPv4.
Permissions are also granted based on endpoints, so it's important to
normalize URI, so we know when they are equal.
For example the following four IPv6 addresses are equal and are all
legal forms:
06ab:23ae:0000:0000:0000:0000:078a:192f
6ab:23ae::78a:192f
6ab:23ae:0:0:0:0:78a:192f
6AB:23AE::78A:192F
RFC 5952 A Recommendation for IPv6 Address Text Representation.
If all IPv6 addresses in this case were normalized following RFC 5952
recommendations, then for example the above addresses would all
normalize to:
6ab:23ae::78a:192f
And equals comparison would be easy.
This would allow LookupLocators or URI with identical IPv6 addresses in
different forms to be normalized to the same form and as such be
recognized as being equal.
Also I have found that local IPv6 addresses also often contain a zone
component which represents a specific local network interface, while
this has limited use, not recognizing it causes problems with unexpected
URISyntaxExceptions and MalformedURLExceptions. It seems that we should
at least allow it, seeing that it is legal.
River already provides an RFC3986 compliant URI implementation, and
RFC3986 provides normalization rules, however it does not provide
guidance on IPv6 address normalization.
The following standards may be useful for normalization of IPv6 host
addresses.
RFC 5952 A Recommendation for IPv6 Address Text Representation.
RFC 6874 Representing IPv6 Zone Identifiers in Address Literals and
Uniform Resource Identifiers
It seems like a good idea to expand normalization to include
Regards,
Peter.