Skip to content

Conversation

@HughParry
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 22, 2026 08:40
@HughParry HughParry marked this pull request as draft January 22, 2026 08:41
@HughParry
Copy link
Contributor Author

not ready for review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements geoblocking functionality by adding country code support to the user access policy system. The implementation allows blocking or restricting users based on their geographic location determined from their IP address using the MaxMind GeoIP2 database.

Changes:

  • Added countryCode field to user access policy schema and rules
  • Implemented GeolocationService for IP-to-country lookups using MaxMind GeoIP2
  • Integrated geolocation into captcha challenge endpoints

Reviewed changes

Copilot reviewed 21 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/user-access-policy/src/tests/transformRule.unit.test.ts Added countryCode to test fixture
packages/user-access-policy/src/tests/redis/redisRulesStorage.integration.test.ts Added integration tests for countryCode filtering
packages/user-access-policy/src/tests/redis/reader/redisRulesQuery.unit.test.ts Updated query tests to include countryCode ismissing checks
packages/user-access-policy/src/ruleRecord.ts Added countryCode to user attributes record fields
packages/user-access-policy/src/ruleInput/userScopeInput.ts Added countryCode validation schema
packages/user-access-policy/src/rule.ts Added countryCode to UserAttributes type
packages/user-access-policy/src/redis/redisRuleIndex.ts Added countryCode Redis schema field
packages/user-access-policy/src/mongoose/mongooseRuleSchema.ts Added countryCode to Mongoose schema
packages/types/src/config/config.ts Added maxmindDbPath configuration option
packages/provider/src/tests/unit/services/geolocation.unit.test.ts Added comprehensive unit tests for GeolocationService
packages/provider/src/tasks/powCaptcha/powTasks.ts Updated to pass undefined countryCode placeholder
packages/provider/src/tasks/detection/decodePayload.js Removed copyright header from obfuscated file
packages/provider/src/tasks/detection/decodeBehavior.js Removed copyright header from obfuscated file
packages/provider/src/services/geolocation.ts Implemented GeolocationService with MaxMind integration
packages/provider/src/api/captcha/getPoWCaptchaChallenge.ts Integrated geolocation service and passed countryCode
packages/provider/src/api/captcha/getImageCaptchaChallenge.ts Integrated geolocation service and passed countryCode
packages/provider/src/api/captcha/getFrictionlessCaptchaChallenge.ts Integrated geolocation service and passed countryCode
packages/provider/src/api/blacklistRequestInspector.ts Added countryCode parameter to getRequestUserScope
packages/provider/scripts/addUserAccessPolicy.ts Added CLI script for managing access policies with countryCode support
packages/provider/package.json Added @maxmind/geoip2-node dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HughParry HughParry marked this pull request as ready for review January 27, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants