Repository navigation
fix(ip): let a configured whitelist decide alone in route checks and isIpAllowed - #140
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 #139
I aligned the two TypeScript IP list checks that still ran the blacklist first with the reference engine, where a configured whitelist decides alone and the blacklist applies only when no whitelist is configured.
checkRouteIpAccessnow consults the route blacklist only when the route has no whitelist.isIpAllowednow consults the blacklist only when no whitelist is configured.The global pipeline path (
checkIpAccess,IpSecurityCheck) already matched, and the new table asserts it. I addedtests/test-utils/ip-list-precedence.test.tswith 120 rows generated by running the reference (check_ip_access,is_ip_allowed,check_route_ip_access): whitelist only, blacklist only, both with the IP in both, in neither, exact and CIDR forms, IPv4-mapped clients (evaluated after the canonical identity resolution the pipeline performs) and the unknown identity. On master 22 of the 320 assertions fail, all inisIpAllowedandcheckRouteIpAccess. A second table of 243 rows composes route and global lists through the pipeline (a configured route whitelist skips the global lists) and already passes on master. Build, lint, test, coverage and conformance pass locally.