Skip to content

fix(ip): treat an empty global whitelist as absent - #57

Merged
rennf93 merged 1 commit into
masterfrom
test/ip-list-precedence
Oct 15, 2026
Merged

rennf93 merged 1 commit into
masterfrom
test/ip-list-precedence

Conversation

@rennf93

@rennf93 rennf93 commented Oct 15, 2026

Copy link
Copy Markdown
Member

Closes #56

I treat an empty global whitelist like an absent one in AccessControl.kt (checkWhitelist, checkIpListsDetail, checkUnknownIdentityAccess), matching the reference's if config.whitelist: truthiness. Before, whitelist = emptyList() denied every client with a 403.

The list precedence itself (a configured whitelist decides alone, the blacklist applies only without a whitelist) and the route-level path (ChecksHelpers.checkRouteIpAccess, plus a route whitelist skipping the global lists) already matched the reference. I added IpListPrecedenceTest with tables generated by running the reference: 120 rows for the global (check_ip_access) and route (check_route_ip_access) checks, and 243 rows composing route and global lists through RouteConfigCheck and IpSecurityCheck. IPv4-mapped clients are evaluated after the canonical identity resolution the pipeline performs. On master the global test fails for 22 rows (all with an explicit empty whitelist).

This PR also carries the client IP resolution regression guard tests from the earlier parity work (ClientIpParityTest, client_ip_cases.json, client_ip_lists.json, 104 + 78 reference rows), which pass unchanged. spotlessApply detekt, build and fullCorpusGate pass locally.

@github-actions github-actions Bot added area: facade Touches guard-core/ (published facade module) tests Test suite changes labels Oct 15, 2026
@rennf93
rennf93 merged commit 6cde4af into master Oct 15, 2026
10 checks passed
@rennf93
rennf93 deleted the test/ip-list-precedence branch October 15, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: facade Touches guard-core/ (published facade module) tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An empty global whitelist denies every client instead of being treated as absent

1 participant