-
Notifications
You must be signed in to change notification settings - Fork 8
feat/geoblocking #2365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat/geoblocking #2365
Conversation
|
not ready for review |
There was a problem hiding this 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
countryCodefield to user access policy schema and rules - Implemented
GeolocationServicefor 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.
No description provided.