Upon checking the lastest release after merging #2433, I noticed
that some subjects with slashes goes through.
This patch fixes that by ignoring subjects which contains slashes.
Indeed, from on:
1. We strip out IPs.
2. We strip out "potential" INVALID that:
- doesn't contains dots
- contains at least 2 consecutive dots
- looks like an IP.
From now on an acceptable subject shall:
1. have at least 1 dot.
2. NOT be an IPv4 or IPv6
3. NOT look like an IP. (Example: 258.300.10.3)
This "regexless" alternative just try to implement a more
"generic" solution to the actual "problem".
Please note that this commit will fail tests, because this commit
assume that IPs are not correct rules.
Please also note that the following test will also fail because
the new implementation assume that is actually a parsable
rule. @StevenBlack need to take a decision regarding that one rule.
0.0.0 google
Also:
* My editor "blacked" the file.
Pulling in an entire dependency to call a for-loop is wasteful & largely
useless.
When user adds this module to their config, flake-utils & all of its
subdependencies will be pulled into the user’s flake.lock file. This
for-loop was only being used for the developer shell to which a lot of
folks probably aren’t doing active developments in this project as the
module itself doesn’t require it. Potentially damagingly is that this
project lacks its own flake.lock so the latest flake-utils will always
be downloaded regardless of if it that version is compatible or not.
Additionally, flake-utils’ default system list doesn’t include
i686-linux which upstream Python3 in Nixpkgs does.
The alternative solution to these problems is to remove the dependency
& just write a for-loop in this project. This solution could be more or
less robust, but it is an extensible version of that loop that could
handle overlays or config changes if needed in the future.