Skip to content

fix(ip): combine route country verdict and unknown identity like the reference - #142

Merged
rennf93 merged 1 commit into
masterfrom
fix/route-country-unknown-identity
Oct 15, 2026
Merged

rennf93 merged 1 commit into
masterfrom
fix/route-country-unknown-identity

Conversation

@rennf93

@rennf93 rennf93 commented Oct 15, 2026

Copy link
Copy Markdown
Member

Closes #141

I aligned three more TypeScript IP access paths with the reference engine, each verified by running the reference.

  • checkRouteIpAccess now combines the route IP list verdict with the route country verdict: false if either is false, true if either is true, otherwise no verdict. A route whitelist match no longer overrides a blocked country.
  • isIpAllowed now allows the unknown client identity unless a whitelist or country whitelist is configured, and a whitelist match skips the country verdict.
  • checkIpCountry now blocks a client with no geolocation when a country whitelist is configured.

I added tests/test-utils/ip-list-route-country.test.ts with 192 rows generated by running the reference (check_route_ip_access, check_ip_access): route whitelist x route blacklist x blocked countries x whitelist countries x client country, and global whitelist x whitelist countries including the unknown identity. On master 13 of the 192 fail. I updated the websocket guard test that encoded the old unknown-identity denial. Build, lint, test, coverage and conformance pass locally.

…ock ungeolocated under country whitelist like the reference (#141)
@github-actions github-actions Bot added area: checks Touches packages/core/src/core/checks/ area: utils Touches packages/core/src/utils.ts package: core Changes inside @guardcore/core tests Test suite changes (vitest) labels Oct 15, 2026
@rennf93
rennf93 merged commit 745a8ef into master Oct 15, 2026
17 checks passed
@rennf93
rennf93 deleted the fix/route-country-unknown-identity branch October 15, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: checks Touches packages/core/src/core/checks/ area: utils Touches packages/core/src/utils.ts package: core Changes inside @guardcore/core tests Test suite changes (vitest)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route country verdict and unknown identity diverge from the reference engine

1 participant