@prosopo/provider 3.13.6 → 3.13.7
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/.turbo/turbo-build$colon$cjs.log +103 -0
- package/.turbo/turbo-build.log +103 -0
- package/CHANGELOG.md +22 -0
- package/dist/api/captcha/contextAwareValidation.js +20 -0
- package/dist/api/captcha/getFrictionlessCaptchaChallenge.js +51 -30
- package/dist/cjs/api/captcha/contextAwareValidation.cjs +20 -0
- package/dist/cjs/api/captcha/getFrictionlessCaptchaChallenge.cjs +50 -29
- package/dist/cjs/tasks/client/clientTasks.cjs +33 -7
- package/dist/cjs/tasks/detection/decodePayload.cjs +731 -385
- package/dist/cjs/tasks/frictionless/frictionlessTasks.cjs +2 -2
- package/dist/tasks/client/clientTasks.js +34 -8
- package/dist/tasks/detection/decodePayload.js +731 -385
- package/dist/tasks/detection/getBotScore.js +2 -2
- package/dist/tasks/frictionless/frictionlessTasks.js +2 -2
- package/package.json +18 -18
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
|
|
2
|
+
> @prosopo/provider@3.13.7 build:cjs
|
|
3
|
+
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
|
+
|
|
5
|
+
ViteCommonJSConfig: .
|
|
6
|
+
{
|
|
7
|
+
tsConfigPaths: [
|
|
8
|
+
'/home/runner/work/captcha/captcha/packages/api-route/tsconfig.json',
|
|
9
|
+
'/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
|
|
10
|
+
'/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
|
|
11
|
+
'/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
|
|
12
|
+
'/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
|
|
13
|
+
'/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
|
|
14
|
+
'/home/runner/work/captcha/captcha/packages/api-express-router/tsconfig.json',
|
|
15
|
+
'/home/runner/work/captcha/captcha/packages/env/tsconfig.json',
|
|
16
|
+
'/home/runner/work/captcha/captcha/packages/database/tsconfig.json',
|
|
17
|
+
'/home/runner/work/captcha/captcha/packages/types-database/tsconfig.json',
|
|
18
|
+
'/home/runner/work/captcha/captcha/packages/user-access-policy/tsconfig.json',
|
|
19
|
+
'/home/runner/work/captcha/captcha/packages/redis-client/tsconfig.json',
|
|
20
|
+
'/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
|
|
21
|
+
'/home/runner/work/captcha/captcha/packages/types-env/tsconfig.json',
|
|
22
|
+
'/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json',
|
|
23
|
+
'/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json',
|
|
24
|
+
'/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json'
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
{
|
|
28
|
+
externals: [
|
|
29
|
+
'@prosopo/api-route',
|
|
30
|
+
'@prosopo/common',
|
|
31
|
+
'@prosopo/locale',
|
|
32
|
+
'@prosopo/types',
|
|
33
|
+
'@prosopo/util',
|
|
34
|
+
'@prosopo/util-crypto',
|
|
35
|
+
'@prosopo/api-express-router',
|
|
36
|
+
'@prosopo/env',
|
|
37
|
+
'@prosopo/database',
|
|
38
|
+
'@prosopo/types-database',
|
|
39
|
+
'@prosopo/user-access-policy',
|
|
40
|
+
'@prosopo/redis-client',
|
|
41
|
+
'@prosopo/api',
|
|
42
|
+
'@prosopo/types-env',
|
|
43
|
+
'@prosopo/keyring',
|
|
44
|
+
'@prosopo/datasets',
|
|
45
|
+
'@prosopo/load-balancer'
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
[36mvite v6.4.1 [32mbuilding SSR bundle for production...[36m[39m
|
|
49
|
+
Bundle build started
|
|
50
|
+
transforming...
|
|
51
|
+
Build end
|
|
52
|
+
[32m✓[39m 49 modules transformed.
|
|
53
|
+
rendering chunks...
|
|
54
|
+
[2mdist/cjs/[22m[36mtasks/index.cjs [39m[1m[2m 0.15 kB[22m[1m[22m
|
|
55
|
+
[2mdist/cjs/[22m[36mutils/hashUserIp.cjs [39m[1m[2m 0.34 kB[22m[1m[22m
|
|
56
|
+
[2mdist/cjs/[22m[36mutils/hashUserAgent.cjs [39m[1m[2m 0.36 kB[22m[1m[22m
|
|
57
|
+
[2mdist/cjs/[22m[36mapi/robotsMiddleware.cjs [39m[1m[2m 0.43 kB[22m[1m[22m
|
|
58
|
+
[2mdist/cjs/[22m[36mrules/lang.cjs [39m[1m[2m 0.48 kB[22m[1m[22m
|
|
59
|
+
[2mdist/cjs/[22m[36mapi/ignoreMiddleware.cjs [39m[1m[2m 0.49 kB[22m[1m[22m
|
|
60
|
+
[2mdist/cjs/[22m[36mapi/admin/createApiAdminRoutesProvider.cjs [39m[1m[2m 0.50 kB[22m[1m[22m
|
|
61
|
+
[2mdist/cjs/[22m[36mapi/block.cjs [39m[1m[2m 0.71 kB[22m[1m[22m
|
|
62
|
+
[2mdist/cjs/[22m[36mapi/captcha/contextAwareValidation.cjs [39m[1m[2m 0.75 kB[22m[1m[22m
|
|
63
|
+
[2mdist/cjs/[22m[36mtasks/imgCaptcha/imgCaptchaTasksUtils.cjs [39m[1m[2m 0.84 kB[22m[1m[22m
|
|
64
|
+
[2mdist/cjs/[22m[36mapi/validateAddress.cjs [39m[1m[2m 0.84 kB[22m[1m[22m
|
|
65
|
+
[2mdist/cjs/[22m[36mpairs.cjs [39m[1m[2m 0.87 kB[22m[1m[22m
|
|
66
|
+
[2mdist/cjs/[22m[36mtasks/frictionless/frictionlessTasksUtils.cjs [39m[1m[2m 0.94 kB[22m[1m[22m
|
|
67
|
+
[2mdist/cjs/[22m[36mtasks/dataset/datasetTasks.cjs [39m[1m[2m 0.96 kB[22m[1m[22m
|
|
68
|
+
[2mdist/cjs/[22m[36mtasks/detection/getBotScore.cjs [39m[1m[2m 1.02 kB[22m[1m[22m
|
|
69
|
+
[2mdist/cjs/[22m[36mapi/headerCheckMiddleware.cjs [39m[1m[2m 1.07 kB[22m[1m[22m
|
|
70
|
+
[2mdist/cjs/[22m[36mtasks/powCaptcha/powTasksUtils.cjs [39m[1m[2m 1.13 kB[22m[1m[22m
|
|
71
|
+
[2mdist/cjs/[22m[36mschedulers/getClientList.cjs [39m[1m[2m 1.21 kB[22m[1m[22m
|
|
72
|
+
[2mdist/cjs/[22m[36mapi/admin/apiAdminRoutesProvider.cjs [39m[1m[2m 1.23 kB[22m[1m[22m
|
|
73
|
+
[2mdist/cjs/[22m[36mschedulers/setClientEntropy.cjs [39m[1m[2m 1.24 kB[22m[1m[22m
|
|
74
|
+
[2mdist/cjs/[22m[36mschedulers/captchaScheduler.cjs [39m[1m[2m 1.28 kB[22m[1m[22m
|
|
75
|
+
[2mdist/cjs/[22m[36mapi/admin/apiUpdateDetectorKeyEndpoint.cjs [39m[1m[2m 1.30 kB[22m[1m[22m
|
|
76
|
+
[2mdist/cjs/[22m[36mapi/admin/apiRegisterSiteKeyEndpoint.cjs [39m[1m[2m 1.33 kB[22m[1m[22m
|
|
77
|
+
[2mdist/cjs/[22m[36mtasks/dataset/datasetTasksUtils.cjs [39m[1m[2m 1.50 kB[22m[1m[22m
|
|
78
|
+
[2mdist/cjs/[22m[36mcompositeIpAddress.cjs [39m[1m[2m 1.70 kB[22m[1m[22m
|
|
79
|
+
[2mdist/cjs/[22m[36mapi/admin/apiToggleMaintenanceModeEndpoint.cjs [39m[1m[2m 1.71 kB[22m[1m[22m
|
|
80
|
+
[2mdist/cjs/[22m[36mapi/public.cjs [39m[1m[2m 1.74 kB[22m[1m[22m
|
|
81
|
+
[2mdist/cjs/[22m[36mapi/captcha.cjs [39m[1m[2m 1.74 kB[22m[1m[22m
|
|
82
|
+
[2mdist/cjs/[22m[36mapi/admin/apiRemoveDetectorKeyEndpoint.cjs [39m[1m[2m 1.82 kB[22m[1m[22m
|
|
83
|
+
[2mdist/cjs/[22m[36mtasks/tasks.cjs [39m[1m[2m 1.91 kB[22m[1m[22m
|
|
84
|
+
[2mdist/cjs/[22m[36mapi/captcha/submitPoWCaptchaSolution.cjs [39m[1m[2m 2.31 kB[22m[1m[22m
|
|
85
|
+
[2mdist/cjs/[22m[36mservices/ipInfo.cjs [39m[1m[2m 2.49 kB[22m[1m[22m
|
|
86
|
+
[2mdist/cjs/[22m[36mapi/captcha/submitImageCaptchaSolution.cjs [39m[1m[2m 2.64 kB[22m[1m[22m
|
|
87
|
+
[2mdist/cjs/[22m[36mindex.cjs [39m[1m[2m 2.69 kB[22m[1m[22m
|
|
88
|
+
[2mdist/cjs/[22m[36mapi/ja4Middleware.cjs [39m[1m[2m 2.72 kB[22m[1m[22m
|
|
89
|
+
[2mdist/cjs/[22m[36mapi/domainMiddleware.cjs [39m[1m[2m 2.89 kB[22m[1m[22m
|
|
90
|
+
[2mdist/cjs/[22m[36mservices/ipComparison.cjs [39m[1m[2m 4.17 kB[22m[1m[22m
|
|
91
|
+
[2mdist/cjs/[22m[36mapi/captcha/getImageCaptchaChallenge.cjs [39m[1m[2m 4.35 kB[22m[1m[22m
|
|
92
|
+
[2mdist/cjs/[22m[36mapi/blacklistRequestInspector.cjs [39m[1m[2m 4.43 kB[22m[1m[22m
|
|
93
|
+
[2mdist/cjs/[22m[36mapi/captcha/getPoWCaptchaChallenge.cjs [39m[1m[2m 4.45 kB[22m[1m[22m
|
|
94
|
+
[2mdist/cjs/[22m[36mtasks/captchaManager.cjs [39m[1m[2m 5.07 kB[22m[1m[22m
|
|
95
|
+
[2mdist/cjs/[22m[36mapi/verify.cjs [39m[1m[2m 6.05 kB[22m[1m[22m
|
|
96
|
+
[2mdist/cjs/[22m[36mtasks/powCaptcha/powTasks.cjs [39m[1m[2m 7.46 kB[22m[1m[22m
|
|
97
|
+
[2mdist/cjs/[22m[36mtasks/frictionless/frictionlessTasks.cjs [39m[1m[2m11.88 kB[22m[1m[22m
|
|
98
|
+
[2mdist/cjs/[22m[36mtasks/client/clientTasks.cjs [39m[1m[2m12.25 kB[22m[1m[22m
|
|
99
|
+
[2mdist/cjs/[22m[36mutil.cjs [39m[1m[2m12.27 kB[22m[1m[22m
|
|
100
|
+
[2mdist/cjs/[22m[36mapi/captcha/getFrictionlessCaptchaChallenge.cjs [39m[1m[2m12.38 kB[22m[1m[22m
|
|
101
|
+
[2mdist/cjs/[22m[36mtasks/imgCaptcha/imgCaptchaTasks.cjs [39m[1m[2m15.66 kB[22m[1m[22m
|
|
102
|
+
[2mdist/cjs/[22m[36mtasks/detection/decodePayload.cjs [39m[1m[2m42.44 kB[22m[1m[22m
|
|
103
|
+
[32m✓ built in 450ms[39m
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
|
|
2
|
+
> @prosopo/provider@3.13.7 build
|
|
3
|
+
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.esm.config.ts --mode $NODE_ENV
|
|
4
|
+
|
|
5
|
+
ViteEsmConfig: .
|
|
6
|
+
{
|
|
7
|
+
tsConfigPaths: [
|
|
8
|
+
'/home/runner/work/captcha/captcha/packages/api-route/tsconfig.json',
|
|
9
|
+
'/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
|
|
10
|
+
'/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
|
|
11
|
+
'/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
|
|
12
|
+
'/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
|
|
13
|
+
'/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
|
|
14
|
+
'/home/runner/work/captcha/captcha/packages/api-express-router/tsconfig.json',
|
|
15
|
+
'/home/runner/work/captcha/captcha/packages/env/tsconfig.json',
|
|
16
|
+
'/home/runner/work/captcha/captcha/packages/database/tsconfig.json',
|
|
17
|
+
'/home/runner/work/captcha/captcha/packages/types-database/tsconfig.json',
|
|
18
|
+
'/home/runner/work/captcha/captcha/packages/user-access-policy/tsconfig.json',
|
|
19
|
+
'/home/runner/work/captcha/captcha/packages/redis-client/tsconfig.json',
|
|
20
|
+
'/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
|
|
21
|
+
'/home/runner/work/captcha/captcha/packages/types-env/tsconfig.json',
|
|
22
|
+
'/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json',
|
|
23
|
+
'/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json',
|
|
24
|
+
'/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json'
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
{
|
|
28
|
+
externals: [
|
|
29
|
+
'@prosopo/api-route',
|
|
30
|
+
'@prosopo/common',
|
|
31
|
+
'@prosopo/locale',
|
|
32
|
+
'@prosopo/types',
|
|
33
|
+
'@prosopo/util',
|
|
34
|
+
'@prosopo/util-crypto',
|
|
35
|
+
'@prosopo/api-express-router',
|
|
36
|
+
'@prosopo/env',
|
|
37
|
+
'@prosopo/database',
|
|
38
|
+
'@prosopo/types-database',
|
|
39
|
+
'@prosopo/user-access-policy',
|
|
40
|
+
'@prosopo/redis-client',
|
|
41
|
+
'@prosopo/api',
|
|
42
|
+
'@prosopo/types-env',
|
|
43
|
+
'@prosopo/keyring',
|
|
44
|
+
'@prosopo/datasets',
|
|
45
|
+
'@prosopo/load-balancer'
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
[36mvite v6.4.1 [32mbuilding SSR bundle for production...[36m[39m
|
|
49
|
+
Bundle build started
|
|
50
|
+
transforming...
|
|
51
|
+
Build end
|
|
52
|
+
[32m✓[39m 49 modules transformed.
|
|
53
|
+
rendering chunks...
|
|
54
|
+
[2mdist/[22m[36mtasks/index.js [39m[1m[2m 0.06 kB[22m[1m[22m
|
|
55
|
+
[2mdist/[22m[36mutils/hashUserIp.js [39m[1m[2m 0.23 kB[22m[1m[22m
|
|
56
|
+
[2mdist/[22m[36mutils/hashUserAgent.js [39m[1m[2m 0.25 kB[22m[1m[22m
|
|
57
|
+
[2mdist/[22m[36mapi/robotsMiddleware.js [39m[1m[2m 0.33 kB[22m[1m[22m
|
|
58
|
+
[2mdist/[22m[36mapi/admin/createApiAdminRoutesProvider.js [39m[1m[2m 0.35 kB[22m[1m[22m
|
|
59
|
+
[2mdist/[22m[36mrules/lang.js [39m[1m[2m 0.38 kB[22m[1m[22m
|
|
60
|
+
[2mdist/[22m[36mapi/ignoreMiddleware.js [39m[1m[2m 0.39 kB[22m[1m[22m
|
|
61
|
+
[2mdist/[22m[36mapi/block.js [39m[1m[2m 0.58 kB[22m[1m[22m
|
|
62
|
+
[2mdist/[22m[36mapi/captcha/contextAwareValidation.js [39m[1m[2m 0.63 kB[22m[1m[22m
|
|
63
|
+
[2mdist/[22m[36mapi/validateAddress.js [39m[1m[2m 0.71 kB[22m[1m[22m
|
|
64
|
+
[2mdist/[22m[36mpairs.js [39m[1m[2m 0.72 kB[22m[1m[22m
|
|
65
|
+
[2mdist/[22m[36mtasks/imgCaptcha/imgCaptchaTasksUtils.js [39m[1m[2m 0.74 kB[22m[1m[22m
|
|
66
|
+
[2mdist/[22m[36mtasks/frictionless/frictionlessTasksUtils.js [39m[1m[2m 0.80 kB[22m[1m[22m
|
|
67
|
+
[2mdist/[22m[36mtasks/dataset/datasetTasks.js [39m[1m[2m 0.85 kB[22m[1m[22m
|
|
68
|
+
[2mdist/[22m[36mapi/admin/apiRegisterSiteKeyEndpoint.js [39m[1m[2m 0.90 kB[22m[1m[22m
|
|
69
|
+
[2mdist/[22m[36mtasks/detection/getBotScore.js [39m[1m[2m 0.91 kB[22m[1m[22m
|
|
70
|
+
[2mdist/[22m[36mapi/headerCheckMiddleware.js [39m[1m[2m 0.92 kB[22m[1m[22m
|
|
71
|
+
[2mdist/[22m[36mapi/admin/apiAdminRoutesProvider.js [39m[1m[2m 0.98 kB[22m[1m[22m
|
|
72
|
+
[2mdist/[22m[36mtasks/powCaptcha/powTasksUtils.js [39m[1m[2m 0.99 kB[22m[1m[22m
|
|
73
|
+
[2mdist/[22m[36mapi/admin/apiRemoveDetectorKeyEndpoint.js [39m[1m[2m 1.09 kB[22m[1m[22m
|
|
74
|
+
[2mdist/[22m[36mschedulers/getClientList.js [39m[1m[2m 1.10 kB[22m[1m[22m
|
|
75
|
+
[2mdist/[22m[36mschedulers/setClientEntropy.js [39m[1m[2m 1.13 kB[22m[1m[22m
|
|
76
|
+
[2mdist/[22m[36mschedulers/captchaScheduler.js [39m[1m[2m 1.16 kB[22m[1m[22m
|
|
77
|
+
[2mdist/[22m[36mapi/admin/apiUpdateDetectorKeyEndpoint.js [39m[1m[2m 1.18 kB[22m[1m[22m
|
|
78
|
+
[2mdist/[22m[36mapi/admin/apiToggleMaintenanceModeEndpoint.js [39m[1m[2m 1.19 kB[22m[1m[22m
|
|
79
|
+
[2mdist/[22m[36mtasks/dataset/datasetTasksUtils.js [39m[1m[2m 1.36 kB[22m[1m[22m
|
|
80
|
+
[2mdist/[22m[36mcompositeIpAddress.js [39m[1m[2m 1.45 kB[22m[1m[22m
|
|
81
|
+
[2mdist/[22m[36mapi/captcha.js [39m[1m[2m 1.57 kB[22m[1m[22m
|
|
82
|
+
[2mdist/[22m[36mapi/public.js [39m[1m[2m 1.60 kB[22m[1m[22m
|
|
83
|
+
[2mdist/[22m[36mtasks/tasks.js [39m[1m[2m 1.78 kB[22m[1m[22m
|
|
84
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m 1.81 kB[22m[1m[22m
|
|
85
|
+
[2mdist/[22m[36mapi/ja4Middleware.js [39m[1m[2m 2.19 kB[22m[1m[22m
|
|
86
|
+
[2mdist/[22m[36mapi/captcha/submitPoWCaptchaSolution.js [39m[1m[2m 2.23 kB[22m[1m[22m
|
|
87
|
+
[2mdist/[22m[36mservices/ipInfo.js [39m[1m[2m 2.39 kB[22m[1m[22m
|
|
88
|
+
[2mdist/[22m[36mapi/captcha/submitImageCaptchaSolution.js [39m[1m[2m 2.52 kB[22m[1m[22m
|
|
89
|
+
[2mdist/[22m[36mapi/domainMiddleware.js [39m[1m[2m 2.72 kB[22m[1m[22m
|
|
90
|
+
[2mdist/[22m[36mservices/ipComparison.js [39m[1m[2m 4.05 kB[22m[1m[22m
|
|
91
|
+
[2mdist/[22m[36mapi/captcha/getImageCaptchaChallenge.js [39m[1m[2m 4.22 kB[22m[1m[22m
|
|
92
|
+
[2mdist/[22m[36mapi/blacklistRequestInspector.js [39m[1m[2m 4.22 kB[22m[1m[22m
|
|
93
|
+
[2mdist/[22m[36mapi/captcha/getPoWCaptchaChallenge.js [39m[1m[2m 4.30 kB[22m[1m[22m
|
|
94
|
+
[2mdist/[22m[36mtasks/captchaManager.js [39m[1m[2m 4.59 kB[22m[1m[22m
|
|
95
|
+
[2mdist/[22m[36mapi/verify.js [39m[1m[2m 5.76 kB[22m[1m[22m
|
|
96
|
+
[2mdist/[22m[36mtasks/powCaptcha/powTasks.js [39m[1m[2m 7.28 kB[22m[1m[22m
|
|
97
|
+
[2mdist/[22m[36mtasks/frictionless/frictionlessTasks.js [39m[1m[2m11.64 kB[22m[1m[22m
|
|
98
|
+
[2mdist/[22m[36mutil.js [39m[1m[2m11.85 kB[22m[1m[22m
|
|
99
|
+
[2mdist/[22m[36mapi/captcha/getFrictionlessCaptchaChallenge.js [39m[1m[2m11.95 kB[22m[1m[22m
|
|
100
|
+
[2mdist/[22m[36mtasks/client/clientTasks.js [39m[1m[2m12.05 kB[22m[1m[22m
|
|
101
|
+
[2mdist/[22m[36mtasks/imgCaptcha/imgCaptchaTasks.js [39m[1m[2m15.41 kB[22m[1m[22m
|
|
102
|
+
[2mdist/[22m[36mtasks/detection/decodePayload.js [39m[1m[2m42.41 kB[22m[1m[22m
|
|
103
|
+
[32m✓ built in 557ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @prosopo/provider
|
|
2
2
|
|
|
3
|
+
## 3.13.7
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 7d5eb3f: bump
|
|
7
|
+
- Updated dependencies [7d5eb3f]
|
|
8
|
+
- @prosopo/api@3.1.37
|
|
9
|
+
- @prosopo/api-express-router@3.0.40
|
|
10
|
+
- @prosopo/api-route@2.6.34
|
|
11
|
+
- @prosopo/common@3.1.26
|
|
12
|
+
- @prosopo/database@3.5.6
|
|
13
|
+
- @prosopo/datasets@3.0.49
|
|
14
|
+
- @prosopo/env@3.2.28
|
|
15
|
+
- @prosopo/keyring@2.8.40
|
|
16
|
+
- @prosopo/load-balancer@2.8.13
|
|
17
|
+
- @prosopo/locale@3.1.26
|
|
18
|
+
- @prosopo/types@3.6.4
|
|
19
|
+
- @prosopo/types-database@4.0.6
|
|
20
|
+
- @prosopo/types-env@2.7.53
|
|
21
|
+
- @prosopo/user-access-policy@3.5.32
|
|
22
|
+
- @prosopo/util@3.2.4
|
|
23
|
+
- @prosopo/util-crypto@13.5.28
|
|
24
|
+
|
|
3
25
|
## 3.13.6
|
|
4
26
|
### Patch Changes
|
|
5
27
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ContextType, contextAwareThresholdDefault } from "@prosopo/types";
|
|
2
|
+
function determineContextType(webView) {
|
|
3
|
+
return webView ? ContextType.Webview : ContextType.Default;
|
|
4
|
+
}
|
|
5
|
+
function getContextThreshold(settings, contextType) {
|
|
6
|
+
const contextAware = settings.contextAware;
|
|
7
|
+
if (contextAware === void 0) {
|
|
8
|
+
return contextAwareThresholdDefault;
|
|
9
|
+
}
|
|
10
|
+
const contexts = contextAware.contexts;
|
|
11
|
+
let contextConfig;
|
|
12
|
+
if (contexts !== void 0) {
|
|
13
|
+
contextConfig = contexts[contextType];
|
|
14
|
+
}
|
|
15
|
+
return contextConfig?.threshold ?? contextAwareThresholdDefault;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
determineContextType,
|
|
19
|
+
getContextThreshold
|
|
20
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProsopoApiError } from "@prosopo/common";
|
|
2
|
-
import { GetFrictionlessCaptchaChallengeRequestBody, ApiParams, CaptchaType } from "@prosopo/types";
|
|
2
|
+
import { GetFrictionlessCaptchaChallengeRequestBody, ApiParams, CaptchaType, ContextType } from "@prosopo/types";
|
|
3
3
|
import { flatten, compareBinaryStrings } from "@prosopo/util";
|
|
4
4
|
import { getCompositeIpAddress } from "../../compositeIpAddress.js";
|
|
5
5
|
import { FrictionlessReason, FrictionlessManager } from "../../tasks/frictionless/frictionlessTasks.js";
|
|
@@ -9,6 +9,7 @@ import { hashUserAgent } from "../../utils/hashUserAgent.js";
|
|
|
9
9
|
import { hashUserIp } from "../../utils/hashUserIp.js";
|
|
10
10
|
import { getMaintenanceMode } from "../admin/apiToggleMaintenanceModeEndpoint.js";
|
|
11
11
|
import { getRequestUserScope } from "../blacklistRequestInspector.js";
|
|
12
|
+
import { determineContextType, getContextThreshold } from "./contextAwareValidation.js";
|
|
12
13
|
import { Tasks } from "../../tasks/tasks.js";
|
|
13
14
|
const DEFAULT_FRICTIONLESS_THRESHOLD = 0.5;
|
|
14
15
|
const getRoundsFromSimScore = (simScore) => {
|
|
@@ -216,36 +217,56 @@ const getFrictionlessCaptchaChallenge = (env, userAccessRulesStorage) => async (
|
|
|
216
217
|
);
|
|
217
218
|
}
|
|
218
219
|
if (clientRecord.settings.contextAware?.enabled) {
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
220
|
+
const contexts = clientRecord.settings.contextAware?.contexts || {};
|
|
221
|
+
const hasDefault = contexts[ContextType.Default] !== void 0;
|
|
222
|
+
const hasWebview = contexts[ContextType.Webview] !== void 0;
|
|
223
|
+
let contextType;
|
|
224
|
+
if (hasDefault && hasWebview) {
|
|
225
|
+
contextType = determineContextType(webView);
|
|
226
|
+
} else if (hasDefault) {
|
|
227
|
+
contextType = ContextType.Default;
|
|
228
|
+
} else if (hasWebview) {
|
|
229
|
+
contextType = ContextType.Webview;
|
|
230
|
+
} else {
|
|
231
|
+
contextType = void 0;
|
|
232
|
+
}
|
|
233
|
+
if (contextType) {
|
|
234
|
+
const clientEntropy = await tasks.frictionlessManager.getClientContextEntropy(
|
|
235
|
+
clientRecord.account,
|
|
236
|
+
contextType
|
|
237
|
+
);
|
|
238
|
+
if (clientEntropy) {
|
|
239
|
+
if (!decryptedHeadHash) {
|
|
240
|
+
tasks.logger.info(() => ({
|
|
241
|
+
msg: "No decryptedHeadHash in session for context aware client"
|
|
242
|
+
}));
|
|
243
|
+
return next(
|
|
244
|
+
new ProsopoApiError("API.BAD_REQUEST", {
|
|
245
|
+
context: {
|
|
246
|
+
code: 400,
|
|
247
|
+
siteKey: dapp,
|
|
248
|
+
user
|
|
249
|
+
},
|
|
250
|
+
i18n: req.i18n,
|
|
251
|
+
logger: req.logger
|
|
252
|
+
})
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
const threshold = getContextThreshold(
|
|
256
|
+
clientRecord.settings,
|
|
257
|
+
contextType
|
|
248
258
|
);
|
|
259
|
+
const sim = compareBinaryStrings(decryptedHeadHash, clientEntropy);
|
|
260
|
+
const isValidContext = sim >= threshold;
|
|
261
|
+
if (!isValidContext) {
|
|
262
|
+
return res.json(
|
|
263
|
+
await tasks.frictionlessManager.sendImageCaptcha({
|
|
264
|
+
solvedImagesCount: getRoundsFromSimScore(sim),
|
|
265
|
+
userSitekeyIpHash,
|
|
266
|
+
reason: FrictionlessReason.CONTEXT_AWARE_VALIDATION_FAILED
|
|
267
|
+
})
|
|
268
|
+
);
|
|
269
|
+
}
|
|
249
270
|
}
|
|
250
271
|
}
|
|
251
272
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const types = require("@prosopo/types");
|
|
4
|
+
function determineContextType(webView) {
|
|
5
|
+
return webView ? types.ContextType.Webview : types.ContextType.Default;
|
|
6
|
+
}
|
|
7
|
+
function getContextThreshold(settings, contextType) {
|
|
8
|
+
const contextAware = settings.contextAware;
|
|
9
|
+
if (contextAware === void 0) {
|
|
10
|
+
return types.contextAwareThresholdDefault;
|
|
11
|
+
}
|
|
12
|
+
const contexts = contextAware.contexts;
|
|
13
|
+
let contextConfig;
|
|
14
|
+
if (contexts !== void 0) {
|
|
15
|
+
contextConfig = contexts[contextType];
|
|
16
|
+
}
|
|
17
|
+
return contextConfig?.threshold ?? types.contextAwareThresholdDefault;
|
|
18
|
+
}
|
|
19
|
+
exports.determineContextType = determineContextType;
|
|
20
|
+
exports.getContextThreshold = getContextThreshold;
|
|
@@ -10,6 +10,7 @@ const hashUserAgent = require("../../utils/hashUserAgent.cjs");
|
|
|
10
10
|
const hashUserIp = require("../../utils/hashUserIp.cjs");
|
|
11
11
|
const apiToggleMaintenanceModeEndpoint = require("../admin/apiToggleMaintenanceModeEndpoint.cjs");
|
|
12
12
|
const blacklistRequestInspector = require("../blacklistRequestInspector.cjs");
|
|
13
|
+
const contextAwareValidation = require("./contextAwareValidation.cjs");
|
|
13
14
|
const tasks = require("../../tasks/tasks.cjs");
|
|
14
15
|
const DEFAULT_FRICTIONLESS_THRESHOLD = 0.5;
|
|
15
16
|
const getRoundsFromSimScore = (simScore) => {
|
|
@@ -217,36 +218,56 @@ const getFrictionlessCaptchaChallenge = (env, userAccessRulesStorage) => async (
|
|
|
217
218
|
);
|
|
218
219
|
}
|
|
219
220
|
if (clientRecord.settings.contextAware?.enabled) {
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
221
|
+
const contexts = clientRecord.settings.contextAware?.contexts || {};
|
|
222
|
+
const hasDefault = contexts[types.ContextType.Default] !== void 0;
|
|
223
|
+
const hasWebview = contexts[types.ContextType.Webview] !== void 0;
|
|
224
|
+
let contextType;
|
|
225
|
+
if (hasDefault && hasWebview) {
|
|
226
|
+
contextType = contextAwareValidation.determineContextType(webView);
|
|
227
|
+
} else if (hasDefault) {
|
|
228
|
+
contextType = types.ContextType.Default;
|
|
229
|
+
} else if (hasWebview) {
|
|
230
|
+
contextType = types.ContextType.Webview;
|
|
231
|
+
} else {
|
|
232
|
+
contextType = void 0;
|
|
233
|
+
}
|
|
234
|
+
if (contextType) {
|
|
235
|
+
const clientEntropy = await tasks$1.frictionlessManager.getClientContextEntropy(
|
|
236
|
+
clientRecord.account,
|
|
237
|
+
contextType
|
|
238
|
+
);
|
|
239
|
+
if (clientEntropy) {
|
|
240
|
+
if (!decryptedHeadHash) {
|
|
241
|
+
tasks$1.logger.info(() => ({
|
|
242
|
+
msg: "No decryptedHeadHash in session for context aware client"
|
|
243
|
+
}));
|
|
244
|
+
return next(
|
|
245
|
+
new common.ProsopoApiError("API.BAD_REQUEST", {
|
|
246
|
+
context: {
|
|
247
|
+
code: 400,
|
|
248
|
+
siteKey: dapp,
|
|
249
|
+
user
|
|
250
|
+
},
|
|
251
|
+
i18n: req.i18n,
|
|
252
|
+
logger: req.logger
|
|
253
|
+
})
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
const threshold = contextAwareValidation.getContextThreshold(
|
|
257
|
+
clientRecord.settings,
|
|
258
|
+
contextType
|
|
249
259
|
);
|
|
260
|
+
const sim = util.compareBinaryStrings(decryptedHeadHash, clientEntropy);
|
|
261
|
+
const isValidContext = sim >= threshold;
|
|
262
|
+
if (!isValidContext) {
|
|
263
|
+
return res.json(
|
|
264
|
+
await tasks$1.frictionlessManager.sendImageCaptcha({
|
|
265
|
+
solvedImagesCount: getRoundsFromSimScore(sim),
|
|
266
|
+
userSitekeyIpHash,
|
|
267
|
+
reason: frictionlessTasks.FrictionlessReason.CONTEXT_AWARE_VALIDATION_FAILED
|
|
268
|
+
})
|
|
269
|
+
);
|
|
270
|
+
}
|
|
250
271
|
}
|
|
251
272
|
}
|
|
252
273
|
}
|
|
@@ -6,6 +6,7 @@ const database = require("@prosopo/database");
|
|
|
6
6
|
const types = require("@prosopo/types");
|
|
7
7
|
const util = require("@prosopo/util");
|
|
8
8
|
const validateAddress = require("../../api/validateAddress.cjs");
|
|
9
|
+
const SAMPLE_SIZE = 100;
|
|
9
10
|
const isValidPrivateKey = (privateKeyString) => {
|
|
10
11
|
const privateKey = Buffer.from(privateKeyString, "base64").toString("ascii");
|
|
11
12
|
try {
|
|
@@ -212,14 +213,39 @@ class ClientTaskManager {
|
|
|
212
213
|
types.ScheduledTaskStatus.Running
|
|
213
214
|
);
|
|
214
215
|
try {
|
|
215
|
-
|
|
216
|
+
let clients = await this.providerDB.getAllClientRecords();
|
|
217
|
+
clients = clients.filter((client) => client.tier !== types.Tier.Free);
|
|
218
|
+
this.logger.info(() => ({
|
|
219
|
+
msg: `Calculating entropies for ${clients.length} clients`
|
|
220
|
+
}));
|
|
216
221
|
for (const client of clients) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
222
|
+
if (client.settings?.contextAware?.enabled) {
|
|
223
|
+
const contextTypes = Object.keys(
|
|
224
|
+
client.settings.contextAware.contexts ?? {}
|
|
225
|
+
);
|
|
226
|
+
for (const contextType of contextTypes) {
|
|
227
|
+
const contextSamples = await this.providerDB.sampleContextEntropy(
|
|
228
|
+
SAMPLE_SIZE,
|
|
229
|
+
client.account,
|
|
230
|
+
contextType
|
|
231
|
+
);
|
|
232
|
+
if (contextSamples.length < SAMPLE_SIZE) {
|
|
233
|
+
this.logger.info(() => ({
|
|
234
|
+
msg: `Skipping ${contextType} entropy calculation for client ${client.account} due to insufficient samples (${contextSamples.length}/${SAMPLE_SIZE})`
|
|
235
|
+
}));
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
const contextAvgEntropy = util.majorityAverage(contextSamples);
|
|
239
|
+
this.logger.info(() => ({
|
|
240
|
+
msg: `Calculated ${contextType} entropy for client ${client.account}: ${contextAvgEntropy}`
|
|
241
|
+
}));
|
|
242
|
+
await this.providerDB.setClientContextEntropy(
|
|
243
|
+
client.account,
|
|
244
|
+
contextType,
|
|
245
|
+
contextAvgEntropy
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
223
249
|
}
|
|
224
250
|
await this.providerDB.updateScheduledTaskStatus(
|
|
225
251
|
taskID,
|