Repository navigation
fix(ip): let a configured whitelist decide alone in the global and route IP stages - #88
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #87
I aligned the global and route IP list checks in
IpSecurityCheckwith the reference engine, where a configured whitelist decides alone and the blacklist applies only when no whitelist is configured.isWhitelistedand skips the country stage on a match) and consults the blacklist only in theelsearm.skip_ip_listsgate), still clearing the identity flags. The existingbin/test_geo_country.phpassertion that pinned the old behavior now expects the route whitelist match to pass.checkRouteIpAccessnow consults the route blacklist only when the route has no whitelist. The route country verdict still combines with it as before.I added
bin/test_ip_list_precedence.phpwithtests/data/ip_list_precedence.json, 100 rows (plus a 243-row route and global table,tests/data/ip_list_route_global.json) generated by running the reference (check_ip_access,check_route_ip_access): whitelist only, blacklist only, both with the IP in both, in neither, exact and CIDR forms and IPv4-mapped clients (evaluated after the canonical identity resolution the pipeline performs). The runner is registered in the Makefile and CI (including the coverage loop). On master 22 of its first 200 assertions fail (11 global, 11 route), and 24 of the 243 route and global rows fail on top of the precedence fix.php -l,composer validate --strict, every CI runner (against a private Redis), the 100% coverage gate andcomposer auditpass locally.