-
Notifications
You must be signed in to change notification settings - Fork 582
Make the IPv4|6 regex much more strict #660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This will correctly match IPv4 and IPv6 addresses and discard invalid ones.
There's something wrong with rspec(-puppet) and Ruby 2.1.5:
|
Though much more strict it still passes all the tests that we had defined so this Won't Break Anything™️ while properly rejecting anything that's not an IP address according to the specs. Also, the previous IPv6 regex did not support addresses with a |
Should I extend this to support CIDR matching for IPv4 and 6 too? Both the old and the new regexes don't support notations like |
Poke @hunner and @HelenCampbell |
@DavidS Do you know why the tests explode on Ruby 2.1.5? |
@daenney it seems that a change somewhere causes rspec-core 2.99 to be installed. That seems to cause all sorts of issues. |
@daenney I flushed travis' gem caches for stdlib, and rekicked your cells. This seems to have fixed the issue. I do not completely understand why, tho. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch, but the Compat types are specifically designed to match the behaviour of the validate_* functions bug-for-bug. See https://tickets.puppetlabs.com/browse/MODULES-3534 for this specific set.
Feel free to add properly designed IP types as Stdlib::IPv4Address, Stdlib::IPv6Address and Stdlib::IPAddress.
has anyone considered asking @thrnio for merging their module into stdlib? https://github.com/thrnio/puppet-ip |
I don't know that persisting bugs is a good option. Okay, so it'll be a slight migration hurdle for people with broken manifests; it's still a bug and should be fixed. No one should be taking advantage of this anyway and so shouldn't actually run into it. |
@hunner the whole point of the ::compat:: types is bug-for-bug compatibility. There is no reason to NOT add properly designed IP types as Stdlib::IPv4Address, Stdlib::IPv6Address and Stdlib::IPAddress, other than nobody's currently doing the work for them. |
Oh I see I see, it's not just fixing them, but specifically making the change somewhere other than |
exactly. On 19 October 2016 at 18:48, Hunter Haugen notifications@github.com wrote:
|
This will correctly match IPv4 and IPv6 addresses and discard invalid ones.