@prosopo/provider 3.3.0 → 3.12.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +718 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +4278 -0
- package/coverage/coverage-final.json +42 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +311 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/api/admin/apiAdminRoutesProvider.ts.html +214 -0
- package/coverage/src/api/admin/apiRegisterSiteKeyEndpoint.ts.html +259 -0
- package/coverage/src/api/admin/apiRemoveDetectorKeyEndpoint.ts.html +283 -0
- package/coverage/src/api/admin/apiToggleMaintenanceModeEndpoint.ts.html +334 -0
- package/coverage/src/api/admin/apiUpdateDetectorKeyEndpoint.ts.html +298 -0
- package/coverage/src/api/admin/createApiAdminRoutesProvider.ts.html +163 -0
- package/coverage/src/api/admin/index.html +191 -0
- package/coverage/src/api/blacklistRequestInspector.ts.html +751 -0
- package/coverage/src/api/block.ts.html +187 -0
- package/coverage/src/api/captcha.ts.html +2803 -0
- package/coverage/src/api/domainMiddleware.ts.html +493 -0
- package/coverage/src/api/headerCheckMiddleware.ts.html +256 -0
- package/coverage/src/api/ignoreMiddleware.ts.html +181 -0
- package/coverage/src/api/index.html +266 -0
- package/coverage/src/api/ja4Middleware.ts.html +400 -0
- package/coverage/src/api/public.ts.html +343 -0
- package/coverage/src/api/robotsMiddleware.ts.html +157 -0
- package/coverage/src/api/validateAddress.ts.html +214 -0
- package/coverage/src/api/verify.ts.html +871 -0
- package/coverage/src/compositeIpAddress.ts.html +340 -0
- package/coverage/src/index.html +161 -0
- package/coverage/src/index.ts.html +175 -0
- package/coverage/src/pairs.ts.html +238 -0
- package/coverage/src/rules/index.html +116 -0
- package/coverage/src/rules/lang.ts.html +187 -0
- package/coverage/src/schedulers/captchaScheduler.ts.html +250 -0
- package/coverage/src/schedulers/getClientList.ts.html +271 -0
- package/coverage/src/schedulers/index.html +131 -0
- package/coverage/src/services/index.html +131 -0
- package/coverage/src/services/ipComparison.ts.html +685 -0
- package/coverage/src/services/ipInfo.ts.html +490 -0
- package/coverage/src/tasks/captchaManager.ts.html +865 -0
- package/coverage/src/tasks/client/clientTasks.ts.html +1381 -0
- package/coverage/src/tasks/client/index.html +116 -0
- package/coverage/src/tasks/dataset/datasetTasks.ts.html +268 -0
- package/coverage/src/tasks/dataset/datasetTasksUtils.ts.html +271 -0
- package/coverage/src/tasks/dataset/index.html +131 -0
- package/coverage/src/tasks/detection/decodePayload.js.html +127 -0
- package/coverage/src/tasks/detection/getBotScore.ts.html +244 -0
- package/coverage/src/tasks/detection/index.html +131 -0
- package/coverage/src/tasks/frictionless/frictionlessTasks.ts.html +1216 -0
- package/coverage/src/tasks/frictionless/frictionlessTasksUtils.ts.html +247 -0
- package/coverage/src/tasks/frictionless/index.html +131 -0
- package/coverage/src/tasks/imgCaptcha/imgCaptchaTasks.ts.html +1972 -0
- package/coverage/src/tasks/imgCaptcha/imgCaptchaTasksUtils.ts.html +232 -0
- package/coverage/src/tasks/imgCaptcha/index.html +131 -0
- package/coverage/src/tasks/index.html +146 -0
- package/coverage/src/tasks/index.ts.html +127 -0
- package/coverage/src/tasks/powCaptcha/index.html +131 -0
- package/coverage/src/tasks/powCaptcha/powTasks.ts.html +961 -0
- package/coverage/src/tasks/powCaptcha/powTasksUtils.ts.html +244 -0
- package/coverage/src/tasks/tasks.ts.html +388 -0
- package/coverage/src/util.ts.html +1627 -0
- package/coverage/src/utils/hashUserAgent.ts.html +184 -0
- package/coverage/src/utils/index.html +116 -0
- package/dist/api/admin/apiAdminRoutesProvider.d.ts +9 -0
- package/dist/api/admin/apiAdminRoutesProvider.d.ts.map +1 -0
- package/dist/api/admin/apiAdminRoutesProvider.js +13 -18
- package/dist/api/admin/apiAdminRoutesProvider.js.map +1 -0
- package/dist/api/admin/apiRegisterSiteKeyEndpoint.d.ts +14 -0
- package/dist/api/admin/apiRegisterSiteKeyEndpoint.d.ts.map +1 -0
- package/dist/api/admin/apiRegisterSiteKeyEndpoint.js.map +1 -0
- package/dist/api/admin/apiRemoveDetectorKeyEndpoint.d.ts +23 -0
- package/dist/api/admin/apiRemoveDetectorKeyEndpoint.d.ts.map +1 -0
- package/dist/api/admin/apiRemoveDetectorKeyEndpoint.js +7 -4
- package/dist/api/admin/apiRemoveDetectorKeyEndpoint.js.map +1 -0
- package/dist/api/admin/apiToggleMaintenanceModeEndpoint.d.ts +13 -0
- package/dist/api/admin/apiToggleMaintenanceModeEndpoint.d.ts.map +1 -0
- package/dist/api/admin/apiToggleMaintenanceModeEndpoint.js +40 -0
- package/dist/api/admin/apiToggleMaintenanceModeEndpoint.js.map +1 -0
- package/dist/api/admin/apiUpdateDetectorKeyEndpoint.d.ts +14 -0
- package/dist/api/admin/apiUpdateDetectorKeyEndpoint.d.ts.map +1 -0
- package/dist/api/admin/apiUpdateDetectorKeyEndpoint.js.map +1 -0
- package/dist/api/admin/createApiAdminRoutesProvider.d.ts +4 -0
- package/dist/api/admin/createApiAdminRoutesProvider.d.ts.map +1 -0
- package/dist/api/admin/createApiAdminRoutesProvider.js.map +1 -0
- package/dist/api/blacklistRequestInspector.d.ts +19 -0
- package/dist/api/blacklistRequestInspector.d.ts.map +1 -0
- package/dist/api/blacklistRequestInspector.js +14 -12
- package/dist/api/blacklistRequestInspector.js.map +1 -0
- package/dist/api/block.d.ts +3 -0
- package/dist/api/block.d.ts.map +1 -0
- package/dist/api/block.js.map +1 -0
- package/dist/api/captcha.d.ts +4 -0
- package/dist/api/captcha.d.ts.map +1 -0
- package/dist/api/captcha.js +226 -48
- package/dist/api/captcha.js.map +1 -0
- package/dist/api/domainMiddleware.d.ts +4 -0
- package/dist/api/domainMiddleware.d.ts.map +1 -0
- package/dist/api/domainMiddleware.js +8 -8
- package/dist/api/domainMiddleware.js.map +1 -0
- package/dist/api/headerCheckMiddleware.d.ts +4 -0
- package/dist/api/headerCheckMiddleware.d.ts.map +1 -0
- package/dist/api/headerCheckMiddleware.js +4 -0
- package/dist/api/headerCheckMiddleware.js.map +1 -0
- package/dist/api/ignoreMiddleware.d.ts +3 -0
- package/dist/api/ignoreMiddleware.d.ts.map +1 -0
- package/dist/api/ignoreMiddleware.js +4 -1
- package/dist/api/ignoreMiddleware.js.map +1 -0
- package/dist/api/ja4Middleware.d.ts +10 -0
- package/dist/api/ja4Middleware.d.ts.map +1 -0
- package/dist/api/ja4Middleware.js +5 -23
- package/dist/api/ja4Middleware.js.map +1 -0
- package/dist/api/public.d.ts +4 -0
- package/dist/api/public.d.ts.map +1 -0
- package/dist/api/public.js +26 -3
- package/dist/api/public.js.map +1 -0
- package/dist/api/robotsMiddleware.d.ts +3 -0
- package/dist/api/robotsMiddleware.d.ts.map +1 -0
- package/dist/api/robotsMiddleware.js.map +1 -0
- package/dist/api/validateAddress.d.ts +5 -0
- package/dist/api/validateAddress.d.ts.map +1 -0
- package/dist/api/validateAddress.js.map +1 -0
- package/dist/api/verify.d.ts +4 -0
- package/dist/api/verify.d.ts.map +1 -0
- package/dist/api/verify.js +27 -3
- package/dist/api/verify.js.map +1 -0
- package/dist/cjs/api/admin/apiAdminRoutesProvider.cjs +13 -18
- package/dist/cjs/api/admin/apiRegisterSiteKeyEndpoint.cjs +2 -1
- package/dist/cjs/api/admin/apiRemoveDetectorKeyEndpoint.cjs +9 -5
- package/dist/cjs/api/admin/apiToggleMaintenanceModeEndpoint.cjs +41 -0
- package/dist/cjs/api/blacklistRequestInspector.cjs +13 -11
- package/dist/cjs/api/captcha.cjs +226 -48
- package/dist/cjs/api/domainMiddleware.cjs +8 -8
- package/dist/cjs/api/headerCheckMiddleware.cjs +4 -0
- package/dist/cjs/api/ignoreMiddleware.cjs +3 -0
- package/dist/cjs/api/ja4Middleware.cjs +6 -23
- package/dist/cjs/api/public.cjs +26 -3
- package/dist/cjs/api/verify.cjs +27 -3
- package/dist/cjs/compositeIpAddress.cjs +53 -0
- package/dist/cjs/index.cjs +7 -0
- package/dist/cjs/pairs.cjs +27 -0
- package/dist/cjs/services/ipComparison.cjs +123 -0
- package/dist/cjs/services/ipInfo.cjs +87 -0
- package/dist/cjs/tasks/captchaManager.cjs +41 -10
- package/dist/cjs/tasks/client/clientTasks.cjs +31 -43
- package/dist/cjs/tasks/detection/decodePayload.cjs +616 -281
- package/dist/cjs/tasks/detection/getBotScore.cjs +28 -4
- package/dist/cjs/tasks/frictionless/frictionlessTasks.cjs +227 -36
- package/dist/cjs/tasks/frictionless/frictionlessTasksUtils.cjs +17 -0
- package/dist/cjs/tasks/imgCaptcha/imgCaptchaTasks.cjs +78 -30
- package/dist/cjs/tasks/powCaptcha/powTasks.cjs +49 -21
- package/dist/cjs/util.cjs +262 -17
- package/dist/cjs/utils/hashUserAgent.cjs +10 -0
- package/dist/compositeIpAddress.d.ts +5 -0
- package/dist/compositeIpAddress.d.ts.map +1 -0
- package/dist/compositeIpAddress.js +53 -0
- package/dist/compositeIpAddress.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -0
- package/dist/pairs.d.ts +3 -0
- package/dist/pairs.d.ts.map +1 -0
- package/dist/pairs.js +27 -0
- package/dist/pairs.js.map +1 -0
- package/dist/rules/lang.d.ts +3 -0
- package/dist/rules/lang.d.ts.map +1 -0
- package/dist/rules/lang.js.map +1 -0
- package/dist/schedulers/captchaScheduler.d.ts +4 -0
- package/dist/schedulers/captchaScheduler.d.ts.map +1 -0
- package/dist/schedulers/captchaScheduler.js.map +1 -0
- package/dist/schedulers/getClientList.d.ts +4 -0
- package/dist/schedulers/getClientList.d.ts.map +1 -0
- package/dist/schedulers/getClientList.js.map +1 -0
- package/dist/schedulers/setClientEntropy.d.ts +4 -0
- package/dist/schedulers/setClientEntropy.d.ts.map +1 -0
- package/dist/schedulers/setClientEntropy.js +31 -0
- package/dist/schedulers/setClientEntropy.js.map +1 -0
- package/dist/services/ipComparison.d.ts +3 -0
- package/dist/services/ipComparison.d.ts.map +1 -0
- package/dist/services/ipComparison.js +123 -0
- package/dist/services/ipComparison.js.map +1 -0
- package/dist/services/ipInfo.d.ts +3 -0
- package/dist/services/ipInfo.d.ts.map +1 -0
- package/dist/services/ipInfo.js +87 -0
- package/dist/services/ipInfo.js.map +1 -0
- package/dist/tasks/captchaManager.d.ts +34 -0
- package/dist/tasks/captchaManager.d.ts.map +1 -0
- package/dist/tasks/captchaManager.js +39 -9
- package/dist/tasks/captchaManager.js.map +1 -0
- package/dist/tasks/client/clientTasks.d.ts +21 -0
- package/dist/tasks/client/clientTasks.d.ts.map +1 -0
- package/dist/tasks/client/clientTasks.js +31 -43
- package/dist/tasks/client/clientTasks.js.map +1 -0
- package/dist/tasks/dataset/datasetTasks.d.ts +13 -0
- package/dist/tasks/dataset/datasetTasks.d.ts.map +1 -0
- package/dist/tasks/dataset/datasetTasks.js.map +1 -0
- package/dist/tasks/dataset/datasetTasksUtils.d.ts +3 -0
- package/dist/tasks/dataset/datasetTasksUtils.d.ts.map +1 -0
- package/dist/tasks/dataset/datasetTasksUtils.js.map +1 -0
- package/dist/tasks/detection/decodePayload.d.ts +5 -0
- package/dist/tasks/detection/decodePayload.d.ts.map +1 -0
- package/dist/tasks/detection/decodePayload.js +616 -281
- package/dist/tasks/detection/decodePayload.js.map +1 -0
- package/dist/tasks/detection/getBotScore.d.ts +20 -0
- package/dist/tasks/detection/getBotScore.d.ts.map +1 -0
- package/dist/tasks/detection/getBotScore.js +29 -5
- package/dist/tasks/detection/getBotScore.js.map +1 -0
- package/dist/tasks/frictionless/frictionlessTasks.d.ts +67 -0
- package/dist/tasks/frictionless/frictionlessTasks.d.ts.map +1 -0
- package/dist/tasks/frictionless/frictionlessTasks.js +227 -36
- package/dist/tasks/frictionless/frictionlessTasks.js.map +1 -0
- package/dist/tasks/frictionless/frictionlessTasksUtils.d.ts +6 -0
- package/dist/tasks/frictionless/frictionlessTasksUtils.d.ts.map +1 -0
- package/dist/tasks/frictionless/frictionlessTasksUtils.js +18 -1
- package/dist/tasks/frictionless/frictionlessTasksUtils.js.map +1 -0
- package/dist/tasks/imgCaptcha/imgCaptchaTasks.d.ts +30 -0
- package/dist/tasks/imgCaptcha/imgCaptchaTasks.d.ts.map +1 -0
- package/dist/tasks/imgCaptcha/imgCaptchaTasks.js +80 -32
- package/dist/tasks/imgCaptcha/imgCaptchaTasks.js.map +1 -0
- package/dist/tasks/imgCaptcha/imgCaptchaTasksUtils.d.ts +7 -0
- package/dist/tasks/imgCaptcha/imgCaptchaTasksUtils.d.ts.map +1 -0
- package/dist/tasks/imgCaptcha/imgCaptchaTasksUtils.js.map +1 -0
- package/dist/tasks/index.d.ts +2 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/powCaptcha/powTasks.d.ts +17 -0
- package/dist/tasks/powCaptcha/powTasks.d.ts.map +1 -0
- package/dist/tasks/powCaptcha/powTasks.js +50 -22
- package/dist/tasks/powCaptcha/powTasks.js.map +1 -0
- package/dist/tasks/powCaptcha/powTasksUtils.d.ts +3 -0
- package/dist/tasks/powCaptcha/powTasksUtils.d.ts.map +1 -0
- package/dist/tasks/powCaptcha/powTasksUtils.js.map +1 -0
- package/dist/tasks/tasks.d.ts +25 -0
- package/dist/tasks/tasks.d.ts.map +1 -0
- package/dist/tasks/tasks.js.map +1 -0
- package/dist/tests/index.d.ts +2 -0
- package/dist/tests/index.d.ts.map +1 -0
- package/dist/tests/index.js +2 -0
- package/dist/tests/index.js.map +1 -0
- package/dist/tests/integration/accessRules.integration.test.d.ts +2 -0
- package/dist/tests/integration/accessRules.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/accessRules.integration.test.js +588 -0
- package/dist/tests/integration/accessRules.integration.test.js.map +1 -0
- package/dist/tests/integration/api/admin/apiRegisterSiteKeyEndpoint.integration.test.d.ts +2 -0
- package/dist/tests/integration/api/admin/apiRegisterSiteKeyEndpoint.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/api/admin/apiRegisterSiteKeyEndpoint.integration.test.js +60 -0
- package/dist/tests/integration/api/admin/apiRegisterSiteKeyEndpoint.integration.test.js.map +1 -0
- package/dist/tests/integration/api/blacklistRequestInspector.integration.test.d.ts +2 -0
- package/dist/tests/integration/api/blacklistRequestInspector.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/api/blacklistRequestInspector.integration.test.js +368 -0
- package/dist/tests/integration/api/blacklistRequestInspector.integration.test.js.map +1 -0
- package/dist/tests/integration/imgCaptcha.integration.test.d.ts +2 -0
- package/dist/tests/integration/imgCaptcha.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/imgCaptcha.integration.test.js +272 -0
- package/dist/tests/integration/imgCaptcha.integration.test.js.map +1 -0
- package/dist/tests/integration/ipValidation.integration.test.d.ts +2 -0
- package/dist/tests/integration/ipValidation.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/ipValidation.integration.test.js +75 -0
- package/dist/tests/integration/ipValidation.integration.test.js.map +1 -0
- package/dist/tests/integration/mocks/solvedTestCaptchas.d.ts +32 -0
- package/dist/tests/integration/mocks/solvedTestCaptchas.d.ts.map +1 -0
- package/dist/tests/integration/mocks/solvedTestCaptchas.js +1046 -0
- package/dist/tests/integration/mocks/solvedTestCaptchas.js.map +1 -0
- package/dist/tests/integration/powCaptcha.integration.test.d.ts +2 -0
- package/dist/tests/integration/powCaptcha.integration.test.d.ts.map +1 -0
- package/dist/tests/integration/powCaptcha.integration.test.js +308 -0
- package/dist/tests/integration/powCaptcha.integration.test.js.map +1 -0
- package/dist/tests/integration/registerSitekey.d.ts +3 -0
- package/dist/tests/integration/registerSitekey.d.ts.map +1 -0
- package/dist/tests/integration/registerSitekey.js +24 -0
- package/dist/tests/integration/registerSitekey.js.map +1 -0
- package/dist/tests/integration/userAccessPolicy.d.ts +2 -0
- package/dist/tests/integration/userAccessPolicy.d.ts.map +1 -0
- package/dist/tests/integration/userAccessPolicy.js +2 -0
- package/dist/tests/integration/userAccessPolicy.js.map +1 -0
- package/dist/tests/unit/api/blacklistRequestInspector.unit.test.d.ts +2 -0
- package/dist/tests/unit/api/blacklistRequestInspector.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/api/blacklistRequestInspector.unit.test.js +60 -0
- package/dist/tests/unit/api/blacklistRequestInspector.unit.test.js.map +1 -0
- package/dist/tests/unit/api/ignoreMiddleware.unit.test.d.ts +2 -0
- package/dist/tests/unit/api/ignoreMiddleware.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/api/ignoreMiddleware.unit.test.js +43 -0
- package/dist/tests/unit/api/ignoreMiddleware.unit.test.js.map +1 -0
- package/dist/tests/unit/api/ja4Middleware.unit.test.d.ts +2 -0
- package/dist/tests/unit/api/ja4Middleware.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/api/ja4Middleware.unit.test.js +57 -0
- package/dist/tests/unit/api/ja4Middleware.unit.test.js.map +1 -0
- package/dist/tests/unit/compositeIpAddress.unit.test.d.ts +2 -0
- package/dist/tests/unit/compositeIpAddress.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/compositeIpAddress.unit.test.js +86 -0
- package/dist/tests/unit/compositeIpAddress.unit.test.js.map +1 -0
- package/dist/tests/unit/pairs.unit.test.d.ts +2 -0
- package/dist/tests/unit/pairs.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/pairs.unit.test.js +83 -0
- package/dist/tests/unit/pairs.unit.test.js.map +1 -0
- package/dist/tests/unit/schedulers/captchaScheduler.unit.test.d.ts +2 -0
- package/dist/tests/unit/schedulers/captchaScheduler.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/schedulers/captchaScheduler.unit.test.js +75 -0
- package/dist/tests/unit/schedulers/captchaScheduler.unit.test.js.map +1 -0
- package/dist/tests/unit/services/ipComparison.unit.test.d.ts +2 -0
- package/dist/tests/unit/services/ipComparison.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/services/ipComparison.unit.test.js +258 -0
- package/dist/tests/unit/services/ipComparison.unit.test.js.map +1 -0
- package/dist/tests/unit/services/ipInfo.unit.test.d.ts +2 -0
- package/dist/tests/unit/services/ipInfo.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/services/ipInfo.unit.test.js +210 -0
- package/dist/tests/unit/services/ipInfo.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/captchaManager.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/captchaManager.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/captchaManager.unit.test.js +311 -0
- package/dist/tests/unit/tasks/captchaManager.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/client/clientTasks.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/client/clientTasks.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/client/clientTasks.unit.test.js +289 -0
- package/dist/tests/unit/tasks/client/clientTasks.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/dataset/datasetTasks.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/dataset/datasetTasks.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/dataset/datasetTasks.unit.test.js +92 -0
- package/dist/tests/unit/tasks/dataset/datasetTasks.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/dataset/datasetTasksUtils.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/dataset/datasetTasksUtils.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/dataset/datasetTasksUtils.unit.test.js +75 -0
- package/dist/tests/unit/tasks/dataset/datasetTasksUtils.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/frictionless/decryptPayload.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/frictionless/decryptPayload.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/frictionless/decryptPayload.unit.test.js +143 -0
- package/dist/tests/unit/tasks/frictionless/decryptPayload.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/frictionless/frictionlessTasks.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/frictionless/frictionlessTasks.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/frictionless/frictionlessTasks.unit.test.js +145 -0
- package/dist/tests/unit/tasks/frictionless/frictionlessTasks.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/frictionless/frictionlessTasksUtils.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/frictionless/frictionlessTasksUtils.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/frictionless/frictionlessTasksUtils.unit.test.js +64 -0
- package/dist/tests/unit/tasks/frictionless/frictionlessTasksUtils.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.js +388 -0
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasksUtils.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasksUtils.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasksUtils.unit.test.js +46 -0
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasksUtils.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/powCaptcha/powTasks.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/powCaptcha/powTasks.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/powCaptcha/powTasks.unit.test.js +216 -0
- package/dist/tests/unit/tasks/powCaptcha/powTasks.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/powCaptcha/powTasksUtils.unit.test.d.ts +2 -0
- package/dist/tests/unit/tasks/powCaptcha/powTasksUtils.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/tasks/powCaptcha/powTasksUtils.unit.test.js +69 -0
- package/dist/tests/unit/tasks/powCaptcha/powTasksUtils.unit.test.js.map +1 -0
- package/dist/tests/unit/util.evaluateIpValidationRules.unit.test.d.ts +2 -0
- package/dist/tests/unit/util.evaluateIpValidationRules.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/util.evaluateIpValidationRules.unit.test.js +505 -0
- package/dist/tests/unit/util.evaluateIpValidationRules.unit.test.js.map +1 -0
- package/dist/tests/unit/util.ipDistance.unit.test.d.ts +2 -0
- package/dist/tests/unit/util.ipDistance.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/util.ipDistance.unit.test.js +93 -0
- package/dist/tests/unit/util.ipDistance.unit.test.js.map +1 -0
- package/dist/tests/unit/util.unit.test.d.ts +2 -0
- package/dist/tests/unit/util.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/util.unit.test.js +170 -0
- package/dist/tests/unit/util.unit.test.js.map +1 -0
- package/dist/util.d.ts +24 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +263 -18
- package/dist/util.js.map +1 -0
- package/dist/utils/hashUserAgent.d.ts +2 -0
- package/dist/utils/hashUserAgent.d.ts.map +1 -0
- package/dist/utils/hashUserAgent.js +10 -0
- package/dist/utils/hashUserAgent.js.map +1 -0
- package/package.json +31 -29
- package/vite.test.config.ts +3 -2
- package/vite.threads.test.config.ts +33 -0
|
@@ -4,6 +4,7 @@ const util = require("@polkadot/util");
|
|
|
4
4
|
const common = require("@prosopo/common");
|
|
5
5
|
const types = require("@prosopo/types");
|
|
6
6
|
const util$1 = require("@prosopo/util");
|
|
7
|
+
const compositeIpAddress = require("../../compositeIpAddress.cjs");
|
|
7
8
|
const util$2 = require("../../util.cjs");
|
|
8
9
|
const captchaManager = require("../captchaManager.cjs");
|
|
9
10
|
const frictionlessTasksUtils = require("../frictionless/frictionlessTasksUtils.cjs");
|
|
@@ -47,7 +48,7 @@ class PowCaptchaManager extends captchaManager.CaptchaManager {
|
|
|
47
48
|
* @param ipAddress
|
|
48
49
|
* @param headers
|
|
49
50
|
*/
|
|
50
|
-
async verifyPowCaptchaSolution(challenge,
|
|
51
|
+
async verifyPowCaptchaSolution(challenge, providerChallengeSignature, nonce, timeout, userTimestampSignature, ipAddress, headers) {
|
|
51
52
|
powTasksUtils.checkPowSignature(
|
|
52
53
|
challenge,
|
|
53
54
|
providerChallengeSignature,
|
|
@@ -70,8 +71,9 @@ class PowCaptchaManager extends captchaManager.CaptchaManager {
|
|
|
70
71
|
}));
|
|
71
72
|
return false;
|
|
72
73
|
}
|
|
74
|
+
const difficulty = challengeRecord.difficulty;
|
|
73
75
|
if (!util$1.verifyRecency(challenge, timeout)) {
|
|
74
|
-
await this.db.
|
|
76
|
+
await this.db.updatePowCaptchaRecordResult(
|
|
75
77
|
challenge,
|
|
76
78
|
{
|
|
77
79
|
status: types.CaptchaStatus.disapproved,
|
|
@@ -93,7 +95,7 @@ class PowCaptchaManager extends captchaManager.CaptchaManager {
|
|
|
93
95
|
reason: "CAPTCHA.INVALID_SOLUTION"
|
|
94
96
|
};
|
|
95
97
|
}
|
|
96
|
-
await this.db.
|
|
98
|
+
await this.db.updatePowCaptchaRecordResult(
|
|
97
99
|
challenge,
|
|
98
100
|
result,
|
|
99
101
|
false,
|
|
@@ -111,21 +113,14 @@ class PowCaptchaManager extends captchaManager.CaptchaManager {
|
|
|
111
113
|
* @param {number} timeout - the time in milliseconds since the Provider was selected to provide the PoW captcha
|
|
112
114
|
* @param ip
|
|
113
115
|
*/
|
|
114
|
-
async serverVerifyPowCaptchaSolution(dappAccount, challenge, timeout, ip) {
|
|
116
|
+
async serverVerifyPowCaptchaSolution(dappAccount, challenge, timeout, env, ip) {
|
|
117
|
+
const notVerifiedResponse = { verified: false };
|
|
115
118
|
const challengeRecord = await this.db.getPowCaptchaRecordByChallenge(challenge);
|
|
116
119
|
if (!challengeRecord) {
|
|
117
120
|
this.logger.debug(() => ({
|
|
118
121
|
msg: `No record of this challenge: ${challenge}`
|
|
119
122
|
}));
|
|
120
|
-
return
|
|
121
|
-
}
|
|
122
|
-
const ipValidation = util$2.validateIpAddress(
|
|
123
|
-
ip,
|
|
124
|
-
challengeRecord.ipAddress,
|
|
125
|
-
this.logger
|
|
126
|
-
);
|
|
127
|
-
if (!ipValidation.isValid) {
|
|
128
|
-
return { verified: false };
|
|
123
|
+
return notVerifiedResponse;
|
|
129
124
|
}
|
|
130
125
|
if (challengeRecord.result.status !== types.CaptchaStatus.approved) {
|
|
131
126
|
throw new common.ProsopoApiError("CAPTCHA.INVALID_SOLUTION", {
|
|
@@ -135,7 +130,7 @@ class PowCaptchaManager extends captchaManager.CaptchaManager {
|
|
|
135
130
|
}
|
|
136
131
|
});
|
|
137
132
|
}
|
|
138
|
-
if (challengeRecord.serverChecked) return
|
|
133
|
+
if (challengeRecord.serverChecked) return notVerifiedResponse;
|
|
139
134
|
const challengeDappAccount = challengeRecord.dappAccount;
|
|
140
135
|
if (dappAccount !== challengeDappAccount) {
|
|
141
136
|
throw new common.ProsopoEnvError("CAPTCHA.DAPP_USER_SOLUTION_NOT_FOUND", {
|
|
@@ -146,20 +141,53 @@ class PowCaptchaManager extends captchaManager.CaptchaManager {
|
|
|
146
141
|
}
|
|
147
142
|
});
|
|
148
143
|
}
|
|
149
|
-
util$1.verifyRecency(challenge, timeout);
|
|
150
144
|
await this.db.markDappUserPoWCommitmentsChecked([
|
|
151
145
|
challengeRecord.challenge
|
|
152
146
|
]);
|
|
147
|
+
const recent = util$1.verifyRecency(challenge, timeout);
|
|
148
|
+
if (!recent) {
|
|
149
|
+
return notVerifiedResponse;
|
|
150
|
+
}
|
|
151
|
+
if (ip) {
|
|
152
|
+
const challengeIpAddress = compositeIpAddress.getIpAddressFromComposite(
|
|
153
|
+
challengeRecord.ipAddress
|
|
154
|
+
);
|
|
155
|
+
const clientRecord = await this.db.getClientRecord(dappAccount);
|
|
156
|
+
const ipValidationRules = clientRecord?.settings?.ipValidationRules;
|
|
157
|
+
await this.db.updatePowCaptchaRecord(challengeRecord.challenge, {
|
|
158
|
+
providedIp: compositeIpAddress.getCompositeIpAddress(ip)
|
|
159
|
+
});
|
|
160
|
+
const ipValidation = await util$2.deepValidateIpAddress(
|
|
161
|
+
ip,
|
|
162
|
+
challengeIpAddress,
|
|
163
|
+
this.logger,
|
|
164
|
+
env.config.ipApi.apiKey,
|
|
165
|
+
env.config.ipApi.baseUrl,
|
|
166
|
+
ipValidationRules
|
|
167
|
+
);
|
|
168
|
+
if (!ipValidation.isValid) {
|
|
169
|
+
this.logger.error(() => ({
|
|
170
|
+
msg: "IP validation failed for PoW captcha",
|
|
171
|
+
data: {
|
|
172
|
+
ip,
|
|
173
|
+
challengeIp: challengeIpAddress.address,
|
|
174
|
+
error: ipValidation.errorMessage,
|
|
175
|
+
distanceKm: ipValidation.distanceKm
|
|
176
|
+
}
|
|
177
|
+
}));
|
|
178
|
+
return notVerifiedResponse;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
153
181
|
let score;
|
|
154
|
-
if (challengeRecord.
|
|
155
|
-
const
|
|
156
|
-
challengeRecord.
|
|
182
|
+
if (challengeRecord.sessionId) {
|
|
183
|
+
const sessionRecord = await this.db.getSessionRecordBySessionId(
|
|
184
|
+
challengeRecord.sessionId
|
|
157
185
|
);
|
|
158
|
-
if (
|
|
159
|
-
score = frictionlessTasksUtils.computeFrictionlessScore(
|
|
186
|
+
if (sessionRecord) {
|
|
187
|
+
score = frictionlessTasksUtils.computeFrictionlessScore(sessionRecord?.scoreComponents);
|
|
160
188
|
this.logger.info(() => ({
|
|
161
189
|
data: {
|
|
162
|
-
|
|
190
|
+
scoreComponents: { ...sessionRecord?.scoreComponents || {} },
|
|
163
191
|
score
|
|
164
192
|
}
|
|
165
193
|
}));
|
package/dist/cjs/util.cjs
CHANGED
|
@@ -7,6 +7,7 @@ const types = require("@prosopo/types");
|
|
|
7
7
|
const util = require("@prosopo/util");
|
|
8
8
|
const utilCrypto = require("@prosopo/util-crypto");
|
|
9
9
|
const ipAddress = require("ip-address");
|
|
10
|
+
const ipComparison = require("./services/ipComparison.cjs");
|
|
10
11
|
function encodeStringAddress(address) {
|
|
11
12
|
try {
|
|
12
13
|
return utilCrypto.encodeAddress(
|
|
@@ -33,7 +34,7 @@ async function checkIfTaskIsRunning(taskName, db) {
|
|
|
33
34
|
types.ScheduledTaskStatus.Running
|
|
34
35
|
);
|
|
35
36
|
const twoMinutesAgo = (/* @__PURE__ */ new Date()).getTime() - 1e3 * 60 * 2;
|
|
36
|
-
if (runningTask && runningTask.datetime > twoMinutesAgo) {
|
|
37
|
+
if (runningTask && runningTask.datetime.getTime() > twoMinutesAgo) {
|
|
37
38
|
const completedTask = await db.getScheduledTaskStatus(
|
|
38
39
|
runningTask._id,
|
|
39
40
|
types.ScheduledTaskStatus.Completed
|
|
@@ -63,7 +64,7 @@ const getIPAddressFromBigInt = (ipAddressBigInt) => {
|
|
|
63
64
|
throw new common.ProsopoEnvError("API.INVALID_IP");
|
|
64
65
|
}
|
|
65
66
|
};
|
|
66
|
-
const validateIpAddress = (ip,
|
|
67
|
+
const validateIpAddress = (ip, challengeIpAddress, logger) => {
|
|
67
68
|
if (!ip) {
|
|
68
69
|
return { isValid: true };
|
|
69
70
|
}
|
|
@@ -76,27 +77,19 @@ const validateIpAddress = (ip, challengeRecordIpAddress, logger) => {
|
|
|
76
77
|
logger.info(() => ({ msg: errorMessage }));
|
|
77
78
|
return { isValid: false, errorMessage };
|
|
78
79
|
}
|
|
79
|
-
let challengeIpV4orV6Address = getIPAddressFromBigInt(
|
|
80
|
-
challengeRecordIpAddress
|
|
81
|
-
);
|
|
82
80
|
ipV4orV6Address = "address4" in ipV4orV6Address && ipV4orV6Address.address4 ? ipV4orV6Address.address4 : ipV4orV6Address;
|
|
83
|
-
|
|
84
|
-
if (ipV4orV6Address.v4 && !
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
if (!ipV4orV6Address.v4 && challengeIpV4orV6Address.v4) {
|
|
90
|
-
ipV4orV6Address = new ipAddress.Address6(
|
|
91
|
-
ipV4orV6Address.to4().correctForm()
|
|
81
|
+
challengeIpAddress = "address4" in challengeIpAddress && challengeIpAddress.address4 ? challengeIpAddress.address4 : challengeIpAddress;
|
|
82
|
+
if (ipV4orV6Address.v4 && !challengeIpAddress.v4) {
|
|
83
|
+
challengeIpAddress = new ipAddress.Address4(
|
|
84
|
+
challengeIpAddress.to4().correctForm()
|
|
92
85
|
);
|
|
93
86
|
}
|
|
94
|
-
if (
|
|
95
|
-
const errorMessage = `IP address mismatch: ${
|
|
87
|
+
if (challengeIpAddress.bigInt() - ipV4orV6Address.bigInt() !== 0n) {
|
|
88
|
+
const errorMessage = `IP address mismatch: ${challengeIpAddress.address} !== ${ipV4orV6Address.address}`;
|
|
96
89
|
logger.info(() => ({
|
|
97
90
|
msg: errorMessage,
|
|
98
91
|
data: {
|
|
99
|
-
challengeIp:
|
|
92
|
+
challengeIp: challengeIpAddress.address,
|
|
100
93
|
providedIp: ipV4orV6Address.address
|
|
101
94
|
}
|
|
102
95
|
}));
|
|
@@ -104,8 +97,260 @@ const validateIpAddress = (ip, challengeRecordIpAddress, logger) => {
|
|
|
104
97
|
}
|
|
105
98
|
return { isValid: true };
|
|
106
99
|
};
|
|
100
|
+
const evaluateIpValidationRules = (comparison, rules, logger) => {
|
|
101
|
+
if (!comparison.comparison) {
|
|
102
|
+
return { action: types.IPValidationAction.Allow };
|
|
103
|
+
}
|
|
104
|
+
const conditions = [];
|
|
105
|
+
const rejectActions = Object.values(rules.actions).filter(
|
|
106
|
+
(action) => action === types.IPValidationAction.Reject
|
|
107
|
+
);
|
|
108
|
+
const ip1Country = comparison.comparison.ip1Details?.country;
|
|
109
|
+
const ip2Country = comparison.comparison.ip2Details?.country;
|
|
110
|
+
const ip1CountryCode = comparison.comparison.ip1Details?.countryCode;
|
|
111
|
+
const ip2CountryCode = comparison.comparison.ip2Details?.countryCode;
|
|
112
|
+
let effectiveRules = rules;
|
|
113
|
+
let countryOverride = void 0;
|
|
114
|
+
if (ip1CountryCode && rules.countryOverrides?.[ip1CountryCode]) {
|
|
115
|
+
countryOverride = rules.countryOverrides[ip1CountryCode];
|
|
116
|
+
}
|
|
117
|
+
if (ip2CountryCode && rules.countryOverrides?.[ip2CountryCode]) {
|
|
118
|
+
countryOverride = rules.countryOverrides[ip2CountryCode];
|
|
119
|
+
}
|
|
120
|
+
if (countryOverride) {
|
|
121
|
+
effectiveRules = {
|
|
122
|
+
...rules,
|
|
123
|
+
actions: {
|
|
124
|
+
...rules.actions,
|
|
125
|
+
...countryOverride.actions
|
|
126
|
+
},
|
|
127
|
+
distanceThresholdKm: countryOverride.distanceThresholdKm ?? rules.distanceThresholdKm,
|
|
128
|
+
abuseScoreThreshold: countryOverride.abuseScoreThreshold ?? rules.abuseScoreThreshold,
|
|
129
|
+
requireAllConditions: countryOverride.requireAllConditions ?? rules.requireAllConditions
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if (ip1Country !== ip2Country) {
|
|
133
|
+
conditions.push({
|
|
134
|
+
met: true,
|
|
135
|
+
action: effectiveRules.actions.countryChangeAction,
|
|
136
|
+
message: `Country changed from ${ip1Country} to ${ip2Country}`
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
const ip1City = comparison.comparison.ip1Details?.city;
|
|
140
|
+
const ip2City = comparison.comparison.ip2Details?.city;
|
|
141
|
+
if (ip1City !== ip2City) {
|
|
142
|
+
conditions.push({
|
|
143
|
+
met: true,
|
|
144
|
+
action: effectiveRules.actions.cityChangeAction,
|
|
145
|
+
message: `City changed from ${ip1City} to ${ip2City}`
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
if (comparison.comparison.differentProviders) {
|
|
149
|
+
const ip1Provider = comparison.comparison.ip1Details?.provider;
|
|
150
|
+
const ip2Provider = comparison.comparison.ip2Details?.provider;
|
|
151
|
+
conditions.push({
|
|
152
|
+
met: true,
|
|
153
|
+
action: effectiveRules.actions.ispChangeAction,
|
|
154
|
+
message: `ISP changed from ${ip1Provider} to ${ip2Provider}`
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
const distanceKm = comparison.comparison.distanceKm;
|
|
158
|
+
if (distanceKm !== void 0 && distanceKm > effectiveRules.distanceThresholdKm) {
|
|
159
|
+
conditions.push({
|
|
160
|
+
met: true,
|
|
161
|
+
action: effectiveRules.actions.distanceExceedAction,
|
|
162
|
+
message: `IP addresses are ${distanceKm.toFixed(2)}km apart (>${effectiveRules.distanceThresholdKm}km limit)`
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
console.log(JSON.stringify(effectiveRules, null, 2));
|
|
166
|
+
const ip2AbuseScore = comparison.comparison.ip2Details?.abuserScore;
|
|
167
|
+
if (ip2AbuseScore !== void 0 && ip2AbuseScore > effectiveRules.abuseScoreThreshold) {
|
|
168
|
+
conditions.push({
|
|
169
|
+
met: true,
|
|
170
|
+
action: effectiveRules.actions.abuseScoreExceedAction,
|
|
171
|
+
message: `Abuse score ${ip2AbuseScore.toFixed(4)} exceeds threshold ${effectiveRules.abuseScoreThreshold}`
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
const ip1AbuseScore = comparison.comparison.ip1Details?.abuserScore;
|
|
175
|
+
if (ip1AbuseScore !== void 0 && ip1AbuseScore > effectiveRules.abuseScoreThreshold) {
|
|
176
|
+
conditions.push({
|
|
177
|
+
met: true,
|
|
178
|
+
action: effectiveRules.actions.abuseScoreExceedAction,
|
|
179
|
+
message: `Abuse score ${ip1AbuseScore.toFixed(4)} exceeds threshold ${effectiveRules.abuseScoreThreshold}`
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
if (conditions.length === 0) {
|
|
183
|
+
return { action: types.IPValidationAction.Allow };
|
|
184
|
+
}
|
|
185
|
+
const errorMessages = [];
|
|
186
|
+
let finalAction = types.IPValidationAction.Allow;
|
|
187
|
+
let shouldFlag = false;
|
|
188
|
+
if (effectiveRules.requireAllConditions) {
|
|
189
|
+
const rejectConditions = conditions.filter(
|
|
190
|
+
(c) => c.action === types.IPValidationAction.Reject
|
|
191
|
+
);
|
|
192
|
+
if (rejectConditions.length > 0 && rejectConditions.length >= rejectActions.length) {
|
|
193
|
+
finalAction = types.IPValidationAction.Reject;
|
|
194
|
+
}
|
|
195
|
+
for (const condition of conditions) {
|
|
196
|
+
if (condition.action === types.IPValidationAction.Reject || condition.action === types.IPValidationAction.Flag) {
|
|
197
|
+
errorMessages.push(condition.message);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
} else {
|
|
201
|
+
for (const condition of conditions) {
|
|
202
|
+
if (condition.action === types.IPValidationAction.Reject) {
|
|
203
|
+
finalAction = types.IPValidationAction.Reject;
|
|
204
|
+
errorMessages.push(condition.message);
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
if (condition.action === types.IPValidationAction.Flag) {
|
|
208
|
+
finalAction = types.IPValidationAction.Flag;
|
|
209
|
+
shouldFlag = true;
|
|
210
|
+
}
|
|
211
|
+
errorMessages.push(condition.message);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
logger.info(() => ({
|
|
215
|
+
msg: `IP validation rules evaluated: ${finalAction}`,
|
|
216
|
+
data: {
|
|
217
|
+
conditions,
|
|
218
|
+
finalAction,
|
|
219
|
+
requireAllConditions: effectiveRules.requireAllConditions
|
|
220
|
+
}
|
|
221
|
+
}));
|
|
222
|
+
return {
|
|
223
|
+
action: finalAction,
|
|
224
|
+
errorMessage: errorMessages.length > 0 ? errorMessages.join("; ") : void 0,
|
|
225
|
+
shouldFlag
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
const deepValidateIpAddress = async (ip, challengeIpAddress, logger, apiKey, apiUrl, ipValidationRules) => {
|
|
229
|
+
const standardValidation = validateIpAddress(ip, challengeIpAddress, logger);
|
|
230
|
+
if (!standardValidation.isValid) {
|
|
231
|
+
if (standardValidation.errorMessage?.includes("Invalid IP address")) {
|
|
232
|
+
return standardValidation;
|
|
233
|
+
}
|
|
234
|
+
if (ipValidationRules?.forceConsistentIp === true) {
|
|
235
|
+
logger.info(() => ({
|
|
236
|
+
msg: "IP validation failed - forceConsistentIp is true",
|
|
237
|
+
data: {
|
|
238
|
+
challengeIp: challengeIpAddress.address,
|
|
239
|
+
providedIp: ip
|
|
240
|
+
}
|
|
241
|
+
}));
|
|
242
|
+
return {
|
|
243
|
+
isValid: false,
|
|
244
|
+
errorMessage: standardValidation.errorMessage
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
return { isValid: true };
|
|
249
|
+
}
|
|
250
|
+
try {
|
|
251
|
+
const challengeIpString = challengeIpAddress.address;
|
|
252
|
+
const comparison = await ipComparison.compareIPs(challengeIpString, ip, apiKey, apiUrl);
|
|
253
|
+
if ("error" in comparison) {
|
|
254
|
+
logger.error(() => ({
|
|
255
|
+
msg: "Failed to get IP distance comparison",
|
|
256
|
+
data: {
|
|
257
|
+
error: comparison.error,
|
|
258
|
+
challengeIp: challengeIpString,
|
|
259
|
+
providedIp: ip
|
|
260
|
+
}
|
|
261
|
+
}));
|
|
262
|
+
return {
|
|
263
|
+
isValid: false,
|
|
264
|
+
errorMessage: "Could not determine IP distance"
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
if (comparison.ipsMatch) {
|
|
268
|
+
return { isValid: true };
|
|
269
|
+
}
|
|
270
|
+
const distanceKm = comparison.comparison?.distanceKm;
|
|
271
|
+
if (!ipValidationRules) {
|
|
272
|
+
logger.info(() => ({
|
|
273
|
+
msg: "No IP validation rules provided, using legacy logic",
|
|
274
|
+
data: {
|
|
275
|
+
challengeIp: challengeIpString,
|
|
276
|
+
providedIp: ip,
|
|
277
|
+
distanceKm
|
|
278
|
+
}
|
|
279
|
+
}));
|
|
280
|
+
if (distanceKm !== void 0 && distanceKm > 1e3) {
|
|
281
|
+
const errorMessage = `IP addresses are too far apart: ${distanceKm.toFixed(2)}km (>1000km limit)`;
|
|
282
|
+
logger.info(() => ({
|
|
283
|
+
msg: "IP validation failed - distance too great",
|
|
284
|
+
data: {
|
|
285
|
+
challengeIp: challengeIpString,
|
|
286
|
+
providedIp: ip,
|
|
287
|
+
distanceKm,
|
|
288
|
+
comparison: comparison.comparison
|
|
289
|
+
}
|
|
290
|
+
}));
|
|
291
|
+
return {
|
|
292
|
+
isValid: false,
|
|
293
|
+
errorMessage,
|
|
294
|
+
distanceKm
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
logger.info(() => ({
|
|
298
|
+
msg: "IP addresses differ but within acceptable distance",
|
|
299
|
+
data: {
|
|
300
|
+
challengeIp: challengeIpString,
|
|
301
|
+
providedIp: ip,
|
|
302
|
+
distanceKm,
|
|
303
|
+
comparison: comparison.comparison
|
|
304
|
+
}
|
|
305
|
+
}));
|
|
306
|
+
return {
|
|
307
|
+
isValid: true,
|
|
308
|
+
distanceKm,
|
|
309
|
+
shouldFlag: true
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
const ruleEvaluation = evaluateIpValidationRules(
|
|
313
|
+
comparison,
|
|
314
|
+
ipValidationRules,
|
|
315
|
+
logger
|
|
316
|
+
);
|
|
317
|
+
switch (ruleEvaluation.action) {
|
|
318
|
+
case types.IPValidationAction.Reject:
|
|
319
|
+
return {
|
|
320
|
+
isValid: false,
|
|
321
|
+
errorMessage: ruleEvaluation.errorMessage,
|
|
322
|
+
distanceKm
|
|
323
|
+
};
|
|
324
|
+
case types.IPValidationAction.Flag:
|
|
325
|
+
return {
|
|
326
|
+
isValid: true,
|
|
327
|
+
distanceKm,
|
|
328
|
+
shouldFlag: true,
|
|
329
|
+
errorMessage: ruleEvaluation.errorMessage
|
|
330
|
+
};
|
|
331
|
+
default:
|
|
332
|
+
return {
|
|
333
|
+
isValid: true,
|
|
334
|
+
distanceKm
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
} catch (error) {
|
|
338
|
+
logger.error(() => ({
|
|
339
|
+
msg: "Error during IP distance validation",
|
|
340
|
+
err: error,
|
|
341
|
+
data: { challengeIp: challengeIpAddress.address, providedIp: ip }
|
|
342
|
+
}));
|
|
343
|
+
return {
|
|
344
|
+
isValid: true,
|
|
345
|
+
shouldFlag: true,
|
|
346
|
+
errorMessage: "IP distance validation error"
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
};
|
|
107
350
|
exports.checkIfTaskIsRunning = checkIfTaskIsRunning;
|
|
351
|
+
exports.deepValidateIpAddress = deepValidateIpAddress;
|
|
108
352
|
exports.encodeStringAddress = encodeStringAddress;
|
|
353
|
+
exports.evaluateIpValidationRules = evaluateIpValidationRules;
|
|
109
354
|
exports.getIPAddress = getIPAddress;
|
|
110
355
|
exports.getIPAddressFromBigInt = getIPAddressFromBigInt;
|
|
111
356
|
exports.shuffleArray = shuffleArray;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const node_crypto = require("node:crypto");
|
|
4
|
+
function hashUserAgent(userAgent) {
|
|
5
|
+
const hash = node_crypto.createHash("sha256");
|
|
6
|
+
hash.update(userAgent, "utf8");
|
|
7
|
+
const hashHex = hash.digest("hex");
|
|
8
|
+
return hashHex.substring(0, 32);
|
|
9
|
+
}
|
|
10
|
+
exports.hashUserAgent = hashUserAgent;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IPAddress } from "@prosopo/types";
|
|
2
|
+
import { type CompositeIpAddress } from "@prosopo/types-database";
|
|
3
|
+
export declare const getCompositeIpAddress: (ip: string | IPAddress) => CompositeIpAddress;
|
|
4
|
+
export declare const getIpAddressFromComposite: (compositeIpAddress: CompositeIpAddress) => IPAddress;
|
|
5
|
+
//# sourceMappingURL=compositeIpAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compositeIpAddress.d.ts","sourceRoot":"","sources":["../src/compositeIpAddress.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACN,KAAK,kBAAkB,EAEvB,MAAM,yBAAyB,CAAC;AAOjC,eAAO,MAAM,qBAAqB,OAC7B,MAAM,GAAG,SAAS,KACpB,kBAaF,CAAC;AAuBF,eAAO,MAAM,yBAAyB,uBACjB,kBAAkB,KACpC,SAaF,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { IpAddressType } from "@prosopo/types-database";
|
|
2
|
+
import { getIPAddress } from "@prosopo/util";
|
|
3
|
+
import { Address4, Address6 } from "ip-address";
|
|
4
|
+
const V6_SHIFT = 64n;
|
|
5
|
+
const v6_LOWER_MASK = (1n << V6_SHIFT) - 1n;
|
|
6
|
+
const getCompositeIpAddress = (ip) => {
|
|
7
|
+
let ipAddress;
|
|
8
|
+
try {
|
|
9
|
+
ipAddress = "string" === typeof ip ? getIPAddress(ip) : ip;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
return {
|
|
12
|
+
lower: 0n,
|
|
13
|
+
type: IpAddressType.v4
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return getCompositeFromIpAddress(ipAddress);
|
|
17
|
+
};
|
|
18
|
+
const getCompositeFromIpAddress = (ipAddress) => {
|
|
19
|
+
const numericIp = ipAddress.bigInt();
|
|
20
|
+
if (ipAddress instanceof Address4) {
|
|
21
|
+
return {
|
|
22
|
+
lower: numericIp,
|
|
23
|
+
type: IpAddressType.v4
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
ipAddress;
|
|
27
|
+
return {
|
|
28
|
+
lower: numericIp & v6_LOWER_MASK,
|
|
29
|
+
upper: numericIp >> V6_SHIFT,
|
|
30
|
+
type: IpAddressType.v6
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const getIpAddressFromComposite = (compositeIpAddress) => {
|
|
34
|
+
switch (compositeIpAddress.type) {
|
|
35
|
+
case IpAddressType.v4:
|
|
36
|
+
return Address4.fromBigInt(getBigInt(compositeIpAddress.lower));
|
|
37
|
+
case IpAddressType.v6:
|
|
38
|
+
return Address6.fromBigInt(
|
|
39
|
+
getBigInt(compositeIpAddress.upper) << V6_SHIFT | getBigInt(compositeIpAddress.lower) & v6_LOWER_MASK
|
|
40
|
+
);
|
|
41
|
+
default:
|
|
42
|
+
never();
|
|
43
|
+
return Address4.fromBigInt(0n);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const getBigInt = (number) => BigInt(number || 0n);
|
|
47
|
+
const never = () => {
|
|
48
|
+
throw new Error("Unhandled type");
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
getCompositeIpAddress,
|
|
52
|
+
getIpAddressFromComposite
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compositeIpAddress.js","sourceRoot":"","sources":["../src/compositeIpAddress.ts"],"names":[],"mappings":"AAeA,OAAO,EAEN,aAAa,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,aAAa,GAAG,CAAC,EAAE,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,EAAsB,EACD,EAAE;IACvB,IAAI,SAAoB,CAAC;IAEzB,IAAI,CAAC;QACJ,SAAS,GAAG,QAAQ,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,OAAO;YACN,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,aAAa,CAAC,EAAE;SACtB,CAAC;IACH,CAAC;IAED,OAAO,yBAAyB,CAAC,SAAS,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CACjC,SAAoB,EACC,EAAE;IACvB,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;IAErC,IAAI,SAAS,YAAY,QAAQ,EAAE,CAAC;QACnC,OAAO;YACN,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,aAAa,CAAC,EAAE;SACtB,CAAC;IACH,CAAC;IAED,SAA4B,CAAC;IAE7B,OAAO;QACN,KAAK,EAAE,SAAS,GAAG,aAAa;QAChC,KAAK,EAAE,SAAS,IAAI,QAAQ;QAC5B,IAAI,EAAE,aAAa,CAAC,EAAE;KACtB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACxC,kBAAsC,EAC1B,EAAE;IACd,QAAQ,kBAAkB,CAAC,IAAI,EAAE,CAAC;QACjC,KAAK,aAAa,CAAC,EAAE;YACpB,OAAO,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,KAAK,aAAa,CAAC,EAAE;YACpB,OAAO,QAAQ,CAAC,UAAU,CACzB,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC;gBAChD,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,CACtD,CAAC;QACH;YACC,KAAK,EAAE,CAAC;YACR,OAAO,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,MAAmC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;AAEhF,MAAM,KAAK,GAAG,GAAU,EAAE;IACzB,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACnC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./tasks/index.js";
|
|
2
|
+
export * from "./util.js";
|
|
3
|
+
export * from "./api/block.js";
|
|
4
|
+
export * from "./api/captcha.js";
|
|
5
|
+
export * from "./api/verify.js";
|
|
6
|
+
export * from "./api/ja4Middleware.js";
|
|
7
|
+
export * from "./api/public.js";
|
|
8
|
+
export * from "./api/domainMiddleware.js";
|
|
9
|
+
export * from "./schedulers/captchaScheduler.js";
|
|
10
|
+
export * from "./schedulers/getClientList.js";
|
|
11
|
+
export * from "./api/headerCheckMiddleware.js";
|
|
12
|
+
export * from "./api/admin/createApiAdminRoutesProvider.js";
|
|
13
|
+
export * from "./api/ignoreMiddleware.js";
|
|
14
|
+
export * from "./api/robotsMiddleware.js";
|
|
15
|
+
export * from "./compositeIpAddress.js";
|
|
16
|
+
export * from "./services/ipComparison.js";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./tasks/index.js";
|
|
2
|
-
import { checkIfTaskIsRunning, encodeStringAddress, getIPAddress, getIPAddressFromBigInt, shuffleArray, validateIpAddress } from "./util.js";
|
|
2
|
+
import { checkIfTaskIsRunning, deepValidateIpAddress, encodeStringAddress, evaluateIpValidationRules, getIPAddress, getIPAddressFromBigInt, shuffleArray, validateIpAddress } from "./util.js";
|
|
3
3
|
import { blockMiddleware } from "./api/block.js";
|
|
4
4
|
import { prosopoRouter } from "./api/captcha.js";
|
|
5
5
|
import { prosopoVerifyRouter } from "./api/verify.js";
|
|
@@ -12,18 +12,25 @@ import { headerCheckMiddleware } from "./api/headerCheckMiddleware.js";
|
|
|
12
12
|
import { createApiAdminRoutesProvider } from "./api/admin/createApiAdminRoutesProvider.js";
|
|
13
13
|
import { ignoreMiddleware } from "./api/ignoreMiddleware.js";
|
|
14
14
|
import { robotsMiddleware } from "./api/robotsMiddleware.js";
|
|
15
|
+
import { getCompositeIpAddress, getIpAddressFromComposite } from "./compositeIpAddress.js";
|
|
16
|
+
import { compareIPs } from "./services/ipComparison.js";
|
|
15
17
|
import { Tasks } from "./tasks/tasks.js";
|
|
16
18
|
export {
|
|
17
19
|
DEFAULT_JA4,
|
|
18
20
|
Tasks,
|
|
19
21
|
blockMiddleware,
|
|
20
22
|
checkIfTaskIsRunning,
|
|
23
|
+
compareIPs,
|
|
21
24
|
createApiAdminRoutesProvider,
|
|
25
|
+
deepValidateIpAddress,
|
|
22
26
|
domainMiddleware,
|
|
23
27
|
encodeStringAddress,
|
|
28
|
+
evaluateIpValidationRules,
|
|
24
29
|
getClientList,
|
|
30
|
+
getCompositeIpAddress,
|
|
25
31
|
getIPAddress,
|
|
26
32
|
getIPAddressFromBigInt,
|
|
33
|
+
getIpAddressFromComposite,
|
|
27
34
|
getJA4,
|
|
28
35
|
headerCheckMiddleware,
|
|
29
36
|
ignoreMiddleware,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
|
package/dist/pairs.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pairs.d.ts","sourceRoot":"","sources":["../src/pairs.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,iBAAiB,SAAU,MAAM,EAAE,KAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAWlE,CAAC;AAMF,eAAO,MAAM,sBAAsB,eAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,YActE,CAAC"}
|
package/dist/pairs.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { at } from "@prosopo/util";
|
|
2
|
+
const constructPairList = (list) => {
|
|
3
|
+
if (list.length % 2 !== 0) {
|
|
4
|
+
throw new Error("Invalid pairs length");
|
|
5
|
+
}
|
|
6
|
+
const pairList = [];
|
|
7
|
+
for (let i = 0; i < list.length; i += 2) {
|
|
8
|
+
pairList.push([at(list, i), at(list, i + 1)]);
|
|
9
|
+
}
|
|
10
|
+
return pairList;
|
|
11
|
+
};
|
|
12
|
+
const containsIdenticalPairs = (pairsLists) => {
|
|
13
|
+
const set = /* @__PURE__ */ new Set();
|
|
14
|
+
for (const pairList of pairsLists) {
|
|
15
|
+
for (const pair of pairList) {
|
|
16
|
+
const x = at(pair, 0);
|
|
17
|
+
const y = at(pair, 1);
|
|
18
|
+
const coordString = `${x},${y}`;
|
|
19
|
+
set.add(coordString);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return set.size !== pairsLists.flat().flat().length / 2;
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
constructPairList,
|
|
26
|
+
containsIdenticalPairs
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pairs.js","sourceRoot":"","sources":["../src/pairs.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAKnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAc,EAAsB,EAAE;IAEvE,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAAgC,EAAE,EAAE;IAC1E,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAE9B,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QACnC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACtB,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACtB,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACtB,CAAC;IACF,CAAC;IAGD,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AACzD,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lang.d.ts","sourceRoot":"","sources":["../../src/rules/lang.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,eAAO,MAAM,cAAc,WAClB,mBAAmB,kBACX,MAAM,KACpB,MAeF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lang.js","sourceRoot":"","sources":["../../src/rules/lang.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,cAAc,GAAG,CAC7B,MAA2B,EAC3B,cAAsB,EACb,EAAE;IACX,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,OAAO,EAAE,CAAC;QACb,MAAM,SAAS,GAAG,cAAc;aAC9B,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3C,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;YAC9B,IAAI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { KeyringPair } from "@prosopo/types";
|
|
2
|
+
import { type ProsopoConfigOutput } from "@prosopo/types";
|
|
3
|
+
export declare function storeCaptchasExternally(pair: KeyringPair, cronSchedule: string, config: ProsopoConfigOutput): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=captchaScheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaScheduler.d.ts","sourceRoot":"","sources":["../../src/schedulers/captchaScheduler.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,KAAK,mBAAmB,EAAsB,MAAM,gBAAgB,CAAC;AAK9E,wBAAsB,uBAAuB,CAC5C,IAAI,EAAE,WAAW,EACjB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,mBAAmB,iBA8B3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaScheduler.js","sourceRoot":"","sources":["../../src/schedulers/captchaScheduler.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAA4B,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC5C,IAAiB,EACjB,YAAoB,EACpB,MAA2B;IAE3B,MAAM,GAAG,GAAG,IAAI,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAClD,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;IAEpB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IAE7B,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,WAAW,GAAG,MAAM,oBAAoB,CAC7C,kBAAkB,CAAC,wBAAwB,EAC3C,GAAG,CAAC,KAAK,EAAE,CACX,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YACtB,IAAI,EAAE,EAAE,WAAW,EAAE;YACrB,GAAG,EAAE,GAAG,kBAAkB,CAAC,wBAAwB,kBAAkB,WAAW,EAAE;SAClF,CAAC,CAAC,CAAC;QACJ,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;gBACtB,GAAG,EAAE,GAAG,kBAAkB,CAAC,wBAAwB,WAAW;aAC9D,CAAC,CAAC,CAAC;YACJ,MAAM,KAAK,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBACtE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;oBACvB,GAAG;oBACH,GAAG,EAAE,sCAAsC;iBAC3C,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,KAAK,EAAE,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { KeyringPair } from "@prosopo/types";
|
|
2
|
+
import { type ProsopoConfigOutput } from "@prosopo/types";
|
|
3
|
+
export declare function getClientList(pair: KeyringPair, cronSchedule: string, config: ProsopoConfigOutput): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=getClientList.d.ts.map
|