@prosopo/provider 5.19.2 → 5.19.4
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 +10 -9
- package/.turbo/turbo-build$colon$tsc.log +28 -28
- package/.turbo/turbo-build.log +10 -9
- package/CHANGELOG.md +75 -0
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/handler.d.ts.map +1 -1
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/handler.js +79 -23
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/handler.js.map +1 -1
- package/dist/api/captcha/getPuzzleCaptchaChallenge.d.ts +3 -0
- package/dist/api/captcha/getPuzzleCaptchaChallenge.d.ts.map +1 -1
- package/dist/api/captcha/getPuzzleCaptchaChallenge.js +23 -5
- package/dist/api/captcha/getPuzzleCaptchaChallenge.js.map +1 -1
- package/dist/api/captcha/submitPoWCaptchaSolution.d.ts.map +1 -1
- package/dist/api/captcha/submitPoWCaptchaSolution.js +12 -2
- package/dist/api/captcha/submitPoWCaptchaSolution.js.map +1 -1
- package/dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/handler.cjs +79 -23
- package/dist/cjs/api/captcha/getPuzzleCaptchaChallenge.cjs +22 -3
- package/dist/cjs/api/captcha/submitPoWCaptchaSolution.cjs +12 -2
- package/dist/cjs/tasks/frictionless/frictionlessTasks.cjs +8 -5
- package/dist/cjs/tasks/frictionless/ipMatch.cjs +25 -4
- package/dist/cjs/tasks/puzzle/puzzleRenderer.cjs +17 -8
- package/dist/cjs/utils/devicePlatform.cjs +9 -5
- package/dist/cjs/utils/mobileSignals.cjs +69 -0
- package/dist/tasks/frictionless/frictionlessTasks.d.ts +1 -1
- package/dist/tasks/frictionless/frictionlessTasks.d.ts.map +1 -1
- package/dist/tasks/frictionless/frictionlessTasks.js +9 -6
- package/dist/tasks/frictionless/frictionlessTasks.js.map +1 -1
- package/dist/tasks/frictionless/ipMatch.d.ts +1 -1
- package/dist/tasks/frictionless/ipMatch.d.ts.map +1 -1
- package/dist/tasks/frictionless/ipMatch.js +25 -4
- package/dist/tasks/frictionless/ipMatch.js.map +1 -1
- package/dist/tasks/puzzle/puzzleRenderer.d.ts +8 -1
- package/dist/tasks/puzzle/puzzleRenderer.d.ts.map +1 -1
- package/dist/tasks/puzzle/puzzleRenderer.js +16 -8
- package/dist/tasks/puzzle/puzzleRenderer.js.map +1 -1
- package/dist/tests/integration/webBotAuthAuthenticated.integration.test.js +103 -5
- package/dist/tests/integration/webBotAuthAuthenticated.integration.test.js.map +1 -1
- package/dist/tests/unit/api/captcha/puzzleTouchFloors.unit.test.d.ts +2 -0
- package/dist/tests/unit/api/captcha/puzzleTouchFloors.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/api/captcha/puzzleTouchFloors.unit.test.js +210 -0
- package/dist/tests/unit/api/captcha/puzzleTouchFloors.unit.test.js.map +1 -0
- package/dist/tests/unit/tasks/frictionless/ipMatch.unit.test.js +18 -0
- package/dist/tests/unit/tasks/frictionless/ipMatch.unit.test.js.map +1 -1
- package/dist/tests/unit/tasks/frictionless/routerPuzzleOverrides.unit.test.js +18 -0
- package/dist/tests/unit/tasks/frictionless/routerPuzzleOverrides.unit.test.js.map +1 -1
- package/dist/tests/unit/utils/devicePlatform.unit.test.js +9 -8
- package/dist/tests/unit/utils/devicePlatform.unit.test.js.map +1 -1
- package/dist/tests/unit/utils/mobileSignals.unit.test.d.ts +2 -0
- package/dist/tests/unit/utils/mobileSignals.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/utils/mobileSignals.unit.test.js +161 -0
- package/dist/tests/unit/utils/mobileSignals.unit.test.js.map +1 -0
- package/dist/utils/devicePlatform.d.ts +3 -3
- package/dist/utils/devicePlatform.d.ts.map +1 -1
- package/dist/utils/devicePlatform.js +9 -5
- package/dist/utils/devicePlatform.js.map +1 -1
- package/dist/utils/mobileSignals.d.ts +32 -0
- package/dist/utils/mobileSignals.d.ts.map +1 -0
- package/dist/utils/mobileSignals.js +68 -0
- package/dist/utils/mobileSignals.js.map +1 -0
- package/package.json +17 -17
|
@@ -60,7 +60,7 @@ ViteCommonJSConfig: .
|
|
|
60
60
|
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
61
61
|
Bundle build started
|
|
62
62
|
[2K
|
|
63
|
-
✓
|
|
63
|
+
✓ 137 modules transformed.
|
|
64
64
|
rendering chunks...
|
|
65
65
|
computing gzip size...
|
|
66
66
|
dist/cjs/tasks/index.cjs 0.08 kB │ gzip: 0.07 kB
|
|
@@ -116,7 +116,7 @@ dist/cjs/tasks/audioAlternative.cjs 1
|
|
|
116
116
|
dist/cjs/schedulers/updateSpamEmailDomains.cjs 1.64 kB │ gzip: 0.62 kB
|
|
117
117
|
dist/cjs/utils/honeypot/encoders.cjs 1.66 kB │ gzip: 0.67 kB
|
|
118
118
|
dist/cjs/api/admin/apiReplaceDetectorPoolEndpoint.cjs 1.67 kB │ gzip: 0.71 kB
|
|
119
|
-
dist/cjs/utils/devicePlatform.cjs 1.
|
|
119
|
+
dist/cjs/utils/devicePlatform.cjs 1.71 kB │ gzip: 0.89 kB
|
|
120
120
|
dist/cjs/api/admin/apiGetSessionEndpoint.cjs 1.75 kB │ gzip: 0.82 kB
|
|
121
121
|
dist/cjs/api/ja4Middleware.cjs 1.76 kB │ gzip: 0.79 kB
|
|
122
122
|
dist/cjs/api/adminAuthOptions.cjs 1.77 kB │ gzip: 0.82 kB
|
|
@@ -127,7 +127,6 @@ dist/cjs/api/handshakeTimingMiddleware.cjs 1
|
|
|
127
127
|
dist/cjs/tasks/iconOrder/iconOrderRenderer.cjs 1.95 kB │ gzip: 0.72 kB
|
|
128
128
|
dist/cjs/api/requestBodySummary.cjs 1.96 kB │ gzip: 0.88 kB
|
|
129
129
|
dist/cjs/api/admin/apiClearAllCountersEndpoint.cjs 2.01 kB │ gzip: 0.78 kB
|
|
130
|
-
dist/cjs/tasks/frictionless/ipMatch.cjs 2.03 kB │ gzip: 1.03 kB
|
|
131
130
|
dist/cjs/api/captcha/getAudioCaptchaChallenge.cjs 2.10 kB │ gzip: 0.74 kB
|
|
132
131
|
dist/cjs/tasks/spam/updateSpamEmailDomains.cjs 2.12 kB │ gzip: 0.85 kB
|
|
133
132
|
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/constants.cjs 2.17 kB │ gzip: 0.91 kB
|
|
@@ -141,12 +140,14 @@ dist/cjs/api/captcha/sealedAssetsResolver.cjs 2
|
|
|
141
140
|
dist/cjs/tasks/audioCaptcha/audioTasks.cjs 2.44 kB │ gzip: 0.86 kB
|
|
142
141
|
dist/cjs/api/captcha/interactiveCaptchaSolution.cjs 2.53 kB │ gzip: 0.91 kB
|
|
143
142
|
dist/cjs/api/captcha/getIconOrderCaptchaChallenge.cjs 2.55 kB │ gzip: 0.81 kB
|
|
143
|
+
dist/cjs/utils/mobileSignals.cjs 2.65 kB │ gzip: 0.98 kB
|
|
144
144
|
dist/cjs/utils/dns.cjs 2.66 kB │ gzip: 1.02 kB
|
|
145
145
|
dist/cjs/api/forwardVerify.cjs 2.66 kB │ gzip: 1.12 kB
|
|
146
146
|
dist/cjs/tasks/puzzle/puzzleDifficulty.cjs 2.66 kB │ gzip: 1.10 kB
|
|
147
147
|
dist/cjs/api/captcha/checkSpamEmail.cjs 2.73 kB │ gzip: 0.95 kB
|
|
148
148
|
dist/cjs/tasks/iconOrderCaptcha/iconOrderTasks.cjs 2.75 kB │ gzip: 1.00 kB
|
|
149
149
|
dist/cjs/api/public.cjs 2.79 kB │ gzip: 1.07 kB
|
|
150
|
+
dist/cjs/tasks/frictionless/ipMatch.cjs 2.80 kB │ gzip: 1.36 kB
|
|
150
151
|
dist/cjs/api/captcha/submitImageCaptchaSolution.cjs 3.09 kB │ gzip: 1.06 kB
|
|
151
152
|
dist/cjs/api/admin/apiDnsEventEndpoint.cjs 3.20 kB │ gzip: 1.22 kB
|
|
152
153
|
dist/cjs/tasks/detection/getBotScore.cjs 3.37 kB │ gzip: 1.33 kB
|
|
@@ -162,18 +163,18 @@ dist/cjs/services/ipComparison.cjs 4
|
|
|
162
163
|
dist/cjs/compositeIpAddress.cjs 4.11 kB │ gzip: 1.69 kB
|
|
163
164
|
dist/cjs/api/admin/apiToggleMaintenanceModeEndpoint.cjs 4.12 kB │ gzip: 1.48 kB
|
|
164
165
|
dist/cjs/tasks/spam/checkSpamEmail.cjs 4.14 kB │ gzip: 1.14 kB
|
|
165
|
-
dist/cjs/api/captcha/getPuzzleCaptchaChallenge.cjs 4.16 kB │ gzip: 1.25 kB
|
|
166
166
|
dist/cjs/api/cpuProfiler.cjs 4.21 kB │ gzip: 1.78 kB
|
|
167
167
|
dist/cjs/tasks/tasks.cjs 4.35 kB │ gzip: 1.13 kB
|
|
168
|
-
dist/cjs/tasks/puzzle/puzzleRenderer.cjs 4.38 kB │ gzip: 1.56 kB
|
|
169
168
|
dist/cjs/api/hardBlockVerdictCache.cjs 4.39 kB │ gzip: 1.74 kB
|
|
170
169
|
dist/cjs/api/captcha/trafficFilterRequestTime.cjs 4.41 kB │ gzip: 1.58 kB
|
|
171
170
|
dist/cjs/api/captcha/maintenanceModeResponses.cjs 4.53 kB │ gzip: 0.92 kB
|
|
171
|
+
dist/cjs/tasks/puzzle/puzzleRenderer.cjs 4.56 kB │ gzip: 1.60 kB
|
|
172
172
|
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/accessPolicy.cjs 4.56 kB │ gzip: 1.07 kB
|
|
173
173
|
dist/cjs/pairs.cjs 4.64 kB │ gzip: 1.61 kB
|
|
174
174
|
dist/cjs/tasks/captchaTypeSelection.cjs 4.75 kB │ gzip: 1.75 kB
|
|
175
175
|
dist/cjs/tasks/dnsEvent/enrichDnsEvent.cjs 4.93 kB │ gzip: 1.78 kB
|
|
176
176
|
dist/cjs/index.cjs 5.09 kB │ gzip: 1.06 kB
|
|
177
|
+
dist/cjs/api/captcha/getPuzzleCaptchaChallenge.cjs 5.38 kB │ gzip: 1.60 kB
|
|
177
178
|
dist/cjs/tasks/detection/decoderPool.cjs 5.47 kB │ gzip: 2.06 kB
|
|
178
179
|
dist/cjs/api/captcha.cjs 5.63 kB │ gzip: 1.52 kB
|
|
179
180
|
dist/cjs/util/usageCounters.cjs 5.72 kB │ gzip: 2.03 kB
|
|
@@ -184,7 +185,7 @@ dist/cjs/api/healthzGeo.cjs 7
|
|
|
184
185
|
dist/cjs/api/captcha/getImageCaptchaChallenge.cjs 7.75 kB │ gzip: 2.15 kB
|
|
185
186
|
dist/cjs/tasks/spam/checkTrafficFilter.cjs 8.86 kB │ gzip: 2.87 kB
|
|
186
187
|
dist/cjs/tasks/detection/bundlePool.cjs 9.29 kB │ gzip: 3.38 kB
|
|
187
|
-
dist/cjs/api/captcha/submitPoWCaptchaSolution.cjs 9.
|
|
188
|
+
dist/cjs/api/captcha/submitPoWCaptchaSolution.cjs 9.98 kB │ gzip: 2.88 kB
|
|
188
189
|
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.cjs 10.33 kB │ gzip: 1.82 kB
|
|
189
190
|
dist/cjs/api/startProviderApi.cjs 12.23 kB │ gzip: 3.89 kB
|
|
190
191
|
dist/cjs/tasks/client/clientTasks.cjs 12.31 kB │ gzip: 3.23 kB
|
|
@@ -194,13 +195,13 @@ dist/cjs/api/blacklistRequestInspector.cjs 13
|
|
|
194
195
|
dist/cjs/api/metrics.cjs 13.94 kB │ gzip: 4.32 kB
|
|
195
196
|
dist/cjs/tasks/interactiveCaptcha/interactiveCaptchaManager.cjs 19.37 kB │ gzip: 4.90 kB
|
|
196
197
|
dist/cjs/api/verify.cjs 20.80 kB │ gzip: 3.69 kB
|
|
197
|
-
dist/cjs/tasks/frictionless/frictionlessTasks.cjs 21.
|
|
198
|
-
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/handler.cjs
|
|
198
|
+
dist/cjs/tasks/frictionless/frictionlessTasks.cjs 21.34 kB │ gzip: 5.59 kB
|
|
199
|
+
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/handler.cjs 23.58 kB │ gzip: 5.31 kB
|
|
199
200
|
dist/cjs/tasks/powCaptcha/powTasks.cjs 25.94 kB │ gzip: 6.23 kB
|
|
200
201
|
dist/cjs/tasks/captchaManager.cjs 26.25 kB │ gzip: 7.65 kB
|
|
201
202
|
dist/cjs/tasks/imgCaptcha/imgCaptchaTasks.cjs 28.74 kB │ gzip: 6.51 kB
|
|
202
203
|
|
|
203
|
-
[32m✓ built in
|
|
204
|
+
[32m✓ built in 156ms[39m
|
|
204
205
|
[copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodeBehavior.js to /home/runner/work/captcha/captcha/packages/provider/dist/cjs/tasks/detection/decodeBehavior.js
|
|
205
206
|
[copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodePayload.js to /home/runner/work/captcha/captcha/packages/provider/dist/cjs/tasks/detection/decodePayload.js
|
|
206
207
|
[copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodeSimd.js to /home/runner/work/captcha/captcha/packages/provider/dist/cjs/tasks/detection/decodeSimd.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$ tsc --build --verbose
|
|
2
|
-
10:
|
|
2
|
+
1:10:44 PM - Projects in this build:
|
|
3
3
|
* ../../dev/config/tsconfig.json
|
|
4
4
|
* ../util/tsconfig.json
|
|
5
5
|
* ../locale/tsconfig.json
|
|
@@ -27,57 +27,57 @@ $ tsc --build --verbose
|
|
|
27
27
|
* ../web-bot-auth/tsconfig.json
|
|
28
28
|
* tsconfig.json
|
|
29
29
|
|
|
30
|
-
10:
|
|
30
|
+
1:10:44 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
31
31
|
|
|
32
|
-
10:
|
|
32
|
+
1:10:44 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
33
33
|
|
|
34
|
-
10:
|
|
34
|
+
1:10:44 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
35
35
|
|
|
36
|
-
10:
|
|
36
|
+
1:10:44 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
|
|
37
37
|
|
|
38
|
-
10:
|
|
38
|
+
1:10:44 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
39
39
|
|
|
40
|
-
10:
|
|
40
|
+
1:10:44 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
41
41
|
|
|
42
|
-
10:
|
|
42
|
+
1:10:44 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/tests/loggerBrowser.unit.test.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
43
43
|
|
|
44
|
-
10:
|
|
44
|
+
1:10:44 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/tests/apiRoute.unit.test.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
|
|
45
45
|
|
|
46
|
-
10:
|
|
46
|
+
1:10:44 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
47
47
|
|
|
48
|
-
10:
|
|
48
|
+
1:10:44 PM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/IpInfoService.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
|
|
49
49
|
|
|
50
|
-
10:
|
|
50
|
+
1:10:44 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/redisClient.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
|
|
51
51
|
|
|
52
|
-
10:
|
|
52
|
+
1:10:44 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/ruleRecord.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
|
|
53
53
|
|
|
54
|
-
10:
|
|
54
|
+
1:10:45 PM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/index.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
|
|
55
55
|
|
|
56
|
-
10:
|
|
56
|
+
1:10:45 PM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/unit/captchaLabel.unit.test.ts' is older than output '../database/tsconfig.tsbuildinfo'
|
|
57
57
|
|
|
58
|
-
10:
|
|
58
|
+
1:10:45 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
|
|
59
59
|
|
|
60
|
-
10:
|
|
60
|
+
1:10:45 PM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/tests/typesEnv.test-d.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
|
|
61
61
|
|
|
62
|
-
10:
|
|
62
|
+
1:10:45 PM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/env.ts' is older than output '../env/tsconfig.tsbuildinfo'
|
|
63
63
|
|
|
64
|
-
10:
|
|
64
|
+
1:10:45 PM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/errorHandler.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
|
|
65
65
|
|
|
66
|
-
10:
|
|
66
|
+
1:10:45 PM - Project '../puzzle-assets/tsconfig.json' is up to date because newest input '../puzzle-assets/src/browser.ts' is older than output '../puzzle-assets/tsconfig.tsbuildinfo'
|
|
67
67
|
|
|
68
|
-
10:
|
|
68
|
+
1:10:45 PM - Project '../audio-assets/tsconfig.json' is up to date because newest input '../audio-assets/src/distort.ts' is older than output '../audio-assets/tsconfig.tsbuildinfo'
|
|
69
69
|
|
|
70
|
-
10:
|
|
70
|
+
1:10:45 PM - Project '../captcha-severity/tsconfig.json' is up to date because newest input '../captcha-severity/src/index.ts' is older than output '../captcha-severity/tsconfig.tsbuildinfo'
|
|
71
71
|
|
|
72
|
-
10:
|
|
72
|
+
1:10:45 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
|
|
73
73
|
|
|
74
|
-
10:
|
|
74
|
+
1:10:45 PM - Project '../icon-order-assets/tsconfig.json' is up to date because newest input '../icon-order-assets/src/background.ts' is older than output '../icon-order-assets/tsconfig.tsbuildinfo'
|
|
75
75
|
|
|
76
|
-
10:
|
|
76
|
+
1:10:45 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/productionProviderList.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
|
|
77
77
|
|
|
78
|
-
10:
|
|
78
|
+
1:10:45 PM - Project '../web-bot-auth/tsconfig.json' is up to date because newest input '../web-bot-auth/src/index.ts' is older than output '../web-bot-auth/tsconfig.tsbuildinfo'
|
|
79
79
|
|
|
80
|
-
10:
|
|
80
|
+
1:10:45 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
81
81
|
|
|
82
|
-
10:
|
|
82
|
+
1:10:45 PM - Building project '/home/runner/work/captcha/captcha/packages/provider/tsconfig.json'...
|
|
83
83
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -61,7 +61,7 @@ ViteEsmConfig: .
|
|
|
61
61
|
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
62
62
|
Bundle build started
|
|
63
63
|
[2K
|
|
64
|
-
✓
|
|
64
|
+
✓ 137 modules transformed.
|
|
65
65
|
rendering chunks...
|
|
66
66
|
computing gzip size...
|
|
67
67
|
dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
|
|
@@ -118,10 +118,10 @@ dist/schedulers/updateSpamEmailDomains.js 1.52 k
|
|
|
118
118
|
dist/api/admin/apiReplaceDetectorPoolEndpoint.js 1.57 kB │ gzip: 0.68 kB
|
|
119
119
|
dist/api/ja4Middleware.js 1.59 kB │ gzip: 0.75 kB
|
|
120
120
|
dist/utils/honeypot/encoders.js 1.62 kB │ gzip: 0.67 kB
|
|
121
|
+
dist/utils/devicePlatform.js 1.64 kB │ gzip: 0.87 kB
|
|
121
122
|
dist/api/admin/apiGetSessionEndpoint.js 1.66 kB │ gzip: 0.80 kB
|
|
122
123
|
dist/api/adminAuthOptions.js 1.67 kB │ gzip: 0.79 kB
|
|
123
124
|
dist/tasks/imgCaptcha/imgCaptchaTasksUtils.js 1.67 kB │ gzip: 0.74 kB
|
|
124
|
-
dist/utils/devicePlatform.js 1.68 kB │ gzip: 0.90 kB
|
|
125
125
|
dist/api/admin/apiUpdateDecisionMachineEndpoint.js 1.68 kB │ gzip: 0.58 kB
|
|
126
126
|
dist/utils/honeypot/phraseBank.js 1.69 kB │ gzip: 0.84 kB
|
|
127
127
|
dist/api/handshakeTimingMiddleware.js 1.75 kB │ gzip: 0.69 kB
|
|
@@ -130,7 +130,6 @@ dist/tasks/spam/updateSpamEmailDomains.js 1.87 k
|
|
|
130
130
|
dist/api/captcha/getAudioCaptchaChallenge.js 1.87 kB │ gzip: 0.72 kB
|
|
131
131
|
dist/api/admin/apiClearAllCountersEndpoint.js 1.89 kB │ gzip: 0.76 kB
|
|
132
132
|
dist/api/requestBodySummary.js 1.94 kB │ gzip: 0.88 kB
|
|
133
|
-
dist/tasks/frictionless/ipMatch.js 1.98 kB │ gzip: 1.02 kB
|
|
134
133
|
dist/api/captcha/getFrictionlessCaptchaChallenge/constants.js 1.98 kB │ gzip: 0.89 kB
|
|
135
134
|
dist/api/captcha/signedAssetsResolver.js 2.08 kB │ gzip: 0.98 kB
|
|
136
135
|
dist/migrations/frictionlessLadder.js 2.12 kB │ gzip: 0.93 kB
|
|
@@ -148,7 +147,9 @@ dist/api/captcha/checkSpamEmail.js 2.47 k
|
|
|
148
147
|
dist/tasks/puzzle/puzzleDifficulty.js 2.50 kB │ gzip: 1.09 kB
|
|
149
148
|
dist/api/forwardVerify.js 2.59 kB │ gzip: 1.10 kB
|
|
150
149
|
dist/tasks/iconOrderCaptcha/iconOrderTasks.js 2.59 kB │ gzip: 0.98 kB
|
|
150
|
+
dist/utils/mobileSignals.js 2.60 kB │ gzip: 0.97 kB
|
|
151
151
|
dist/api/captcha/submitImageCaptchaSolution.js 2.69 kB │ gzip: 1.03 kB
|
|
152
|
+
dist/tasks/frictionless/ipMatch.js 2.72 kB │ gzip: 1.34 kB
|
|
152
153
|
dist/api/admin/apiAdminRoutesProvider.js 2.78 kB │ gzip: 0.55 kB
|
|
153
154
|
dist/index.js 2.99 kB │ gzip: 0.82 kB
|
|
154
155
|
dist/api/admin/apiDnsEventEndpoint.js 3.05 kB │ gzip: 1.18 kB
|
|
@@ -160,21 +161,21 @@ dist/api/captcha/getFrictionlessCaptchaChallenge/shortCircuit.js 3.51 k
|
|
|
160
161
|
dist/api/domainMiddleware.js 3.61 kB │ gzip: 1.24 kB
|
|
161
162
|
dist/utils/tarpitPadding.js 3.67 kB │ gzip: 1.51 kB
|
|
162
163
|
dist/tasks/puzzleCaptcha/puzzleTasks.js 3.67 kB │ gzip: 1.18 kB
|
|
163
|
-
dist/api/captcha/getPuzzleCaptchaChallenge.js 3.79 kB │ gzip: 1.22 kB
|
|
164
164
|
dist/tasks/spam/evaluateEmailSpamRules.js 3.84 kB │ gzip: 1.59 kB
|
|
165
165
|
dist/api/admin/apiToggleMaintenanceModeEndpoint.js 3.85 kB │ gzip: 1.44 kB
|
|
166
166
|
dist/compositeIpAddress.js 3.87 kB │ gzip: 1.66 kB
|
|
167
167
|
dist/tasks/tasks.js 3.93 kB │ gzip: 1.07 kB
|
|
168
|
-
dist/tasks/puzzle/puzzleRenderer.js 4.02 kB │ gzip: 1.53 kB
|
|
169
168
|
dist/services/ipComparison.js 4.04 kB │ gzip: 1.21 kB
|
|
170
169
|
dist/tasks/spam/checkSpamEmail.js 4.12 kB │ gzip: 1.12 kB
|
|
171
170
|
dist/api/cpuProfiler.js 4.12 kB │ gzip: 1.77 kB
|
|
171
|
+
dist/tasks/puzzle/puzzleRenderer.js 4.16 kB │ gzip: 1.56 kB
|
|
172
172
|
dist/api/captcha/trafficFilterRequestTime.js 4.20 kB │ gzip: 1.56 kB
|
|
173
173
|
dist/api/hardBlockVerdictCache.js 4.26 kB │ gzip: 1.72 kB
|
|
174
174
|
dist/pairs.js 4.27 kB │ gzip: 1.57 kB
|
|
175
175
|
dist/tasks/captchaTypeSelection.js 4.30 kB │ gzip: 1.72 kB
|
|
176
176
|
dist/api/captcha/getFrictionlessCaptchaChallenge/accessPolicy.js 4.35 kB │ gzip: 1.07 kB
|
|
177
177
|
dist/tasks/dnsEvent/enrichDnsEvent.js 4.79 kB │ gzip: 1.76 kB
|
|
178
|
+
dist/api/captcha/getPuzzleCaptchaChallenge.js 4.92 kB │ gzip: 1.56 kB
|
|
178
179
|
dist/api/captcha.js 5.02 kB │ gzip: 1.44 kB
|
|
179
180
|
dist/tasks/detection/decoderPool.js 5.34 kB │ gzip: 2.02 kB
|
|
180
181
|
dist/api/captcha/interactiveCaptchaChallenge.js 5.47 kB │ gzip: 1.77 kB
|
|
@@ -184,9 +185,9 @@ dist/api/captcha/getPoWCaptchaChallenge.js 6.25 k
|
|
|
184
185
|
dist/api/healthzGeo.js 6.86 kB │ gzip: 2.68 kB
|
|
185
186
|
dist/api/captcha/getImageCaptchaChallenge.js 6.90 kB │ gzip: 2.08 kB
|
|
186
187
|
dist/tasks/spam/checkTrafficFilter.js 8.49 kB │ gzip: 2.84 kB
|
|
187
|
-
dist/api/captcha/submitPoWCaptchaSolution.js 8.72 kB │ gzip: 2.71 kB
|
|
188
188
|
dist/tasks/detection/bundlePool.js 8.86 kB │ gzip: 3.34 kB
|
|
189
189
|
dist/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.js 9.36 kB │ gzip: 1.80 kB
|
|
190
|
+
dist/api/captcha/submitPoWCaptchaSolution.js 9.38 kB │ gzip: 2.83 kB
|
|
190
191
|
dist/api/startProviderApi.js 10.45 kB │ gzip: 3.60 kB
|
|
191
192
|
dist/tasks/client/clientTasks.js 11.83 kB │ gzip: 3.18 kB
|
|
192
193
|
dist/tasks/decisionMachine/decisionMachineRunner.js 12.28 kB │ gzip: 3.85 kB
|
|
@@ -195,13 +196,13 @@ dist/api/blacklistRequestInspector.js 12.97 k
|
|
|
195
196
|
dist/api/metrics.js 13.17 kB │ gzip: 4.27 kB
|
|
196
197
|
dist/tasks/interactiveCaptcha/interactiveCaptchaManager.js 18.40 kB │ gzip: 4.85 kB
|
|
197
198
|
dist/api/verify.js 18.64 kB │ gzip: 3.57 kB
|
|
198
|
-
dist/
|
|
199
|
-
dist/
|
|
199
|
+
dist/tasks/frictionless/frictionlessTasks.js 20.59 kB │ gzip: 5.55 kB
|
|
200
|
+
dist/api/captcha/getFrictionlessCaptchaChallenge/handler.js 21.90 kB │ gzip: 5.20 kB
|
|
200
201
|
dist/tasks/powCaptcha/powTasks.js 24.47 kB │ gzip: 6.18 kB
|
|
201
202
|
dist/tasks/captchaManager.js 25.68 kB │ gzip: 7.58 kB
|
|
202
203
|
dist/tasks/imgCaptcha/imgCaptchaTasks.js 27.18 kB │ gzip: 6.46 kB
|
|
203
204
|
|
|
204
|
-
[32m✓ built in
|
|
205
|
+
[32m✓ built in 152ms[39m
|
|
205
206
|
[copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodeBehavior.js to /home/runner/work/captcha/captcha/packages/provider/dist/tasks/detection/decodeBehavior.js
|
|
206
207
|
[copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodePayload.js to /home/runner/work/captcha/captcha/packages/provider/dist/tasks/detection/decodePayload.js
|
|
207
208
|
[copy-plugin] copying /home/runner/work/captcha/captcha/packages/provider/src/tasks/detection/decodeSimd.js to /home/runner/work/captcha/captcha/packages/provider/dist/tasks/detection/decodeSimd.js
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# @prosopo/provider
|
|
2
2
|
|
|
3
|
+
## 5.19.4
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 5421e87: Follow-up to the mobile puzzle sizing. The easier placement target and larger
|
|
7
|
+
piece now need a device signal behind them, not just the platform the request
|
|
8
|
+
header claims. The difficulty ladder is unchanged.
|
|
9
|
+
|
|
10
|
+
A mobile-carrier address and a small packet size were also counted as two
|
|
11
|
+
separate pieces of evidence when the second mostly follows from the first. They
|
|
12
|
+
now count once between them, which stops a laptop tethered to a phone adding up
|
|
13
|
+
to a phone.
|
|
14
|
+
- a00fb86: Make the puzzle easier to solve on a phone.
|
|
15
|
+
|
|
16
|
+
Two changes. First, how we work out whether the user is on a phone at all: it
|
|
17
|
+
used to be read off the IP's mobile-carrier flag, which says what network the
|
|
18
|
+
address is on and not what device is holding it, so every phone on home Wi-Fi
|
|
19
|
+
or behind a VPN counted as a desktop. It is now weighed across everything the
|
|
20
|
+
request carries — the User-Agent, the `Sec-CH-UA-Mobile` and
|
|
21
|
+
`Sec-CH-UA-Platform` client hints, the carrier flag, the connection's MSS, the
|
|
22
|
+
in-app-browser flag, and the touch readings that arrive with a solved
|
|
23
|
+
challenge. Signals that disagree cancel out, so a desktop browser claiming a
|
|
24
|
+
phone's User-Agent still counts as a desktop, and a touchscreen laptop is no
|
|
25
|
+
longer mistaken for a phone.
|
|
26
|
+
|
|
27
|
+
Second, a phone is never asked for a placement more accurate than a fingertip
|
|
28
|
+
can give, nor handed a piece smaller than a fingertip covers. Both are applied
|
|
29
|
+
when the challenge is cut, so they hold whichever route set the difficulty —
|
|
30
|
+
the site's own setting, a traffic-filter policy, a routing machine, or
|
|
31
|
+
automatic escalation.
|
|
32
|
+
- Updated dependencies [a00fb86]
|
|
33
|
+
- @prosopo/captcha-severity@1.3.2
|
|
34
|
+
|
|
35
|
+
## 5.19.3
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- ebcd4ed: Bound automatic puzzle difficulty escalation, and record the level a session was
|
|
39
|
+
given so it can be read back from the session record.
|
|
40
|
+
- 3c5d196: Make the Web Bot Auth agent pass work end to end. Driving a signing agent through the demo site turned up six things that stopped an allowed agent getting through, or let a blocked one past:
|
|
41
|
+
|
|
42
|
+
- A site set to a fixed captcha type (PoW, image, puzzle, icon order), or a provider with no detector bundles, served its challenge before the signature was checked. A verified agent's Allow and Block rules are now applied first.
|
|
43
|
+
- An agent with an existing challenge session for the same user, IP and site got that session back. A matching Allow rule now replaces it with a fresh authenticated session.
|
|
44
|
+
- An agent whose page sent no detector token failed with "Failed to store session". The session now gets a generated token, the way the other no-detector paths do.
|
|
45
|
+
- A provider that sees clients as IPv4-mapped IPv6 (`::ffff:1.2.3.4`) rejected every verify, because the site forwards the plain `1.2.3.4`. The IP check now treats the two as the same address.
|
|
46
|
+
- Deleting or filtering access rules by `webBotAuthAgent` sent Redis an unescaped URL, which is a query syntax error, so nothing was deleted. Removing an Agent Trust rule in the portal left it in force.
|
|
47
|
+
- The widget issued the token at page load and never refreshed it. In invisible mode it drew the badge and fired the callback before the user did anything; it now draws nothing and issues the token on execute(). In both modes the pass now expires and renews like a solved PoW, so an agent that takes more than three minutes to fill a form no longer fails with "not recent".
|
|
48
|
+
|
|
49
|
+
Rejected signatures are now logged with the reason.
|
|
50
|
+
- Updated dependencies [ebcd4ed]
|
|
51
|
+
- Updated dependencies [b6e9459]
|
|
52
|
+
- Updated dependencies [3c5d196]
|
|
53
|
+
- @prosopo/captcha-severity@1.3.1
|
|
54
|
+
- @prosopo/locale@3.11.1
|
|
55
|
+
- @prosopo/user-access-policy@3.15.4
|
|
56
|
+
- @prosopo/api-express-router@3.2.9
|
|
57
|
+
- @prosopo/common@3.2.3
|
|
58
|
+
- @prosopo/types@5.16.3
|
|
59
|
+
- @prosopo/types-database@5.10.6
|
|
60
|
+
- @prosopo/database@4.2.7
|
|
61
|
+
- @prosopo/api@4.7.3
|
|
62
|
+
- @prosopo/api-route@2.6.64
|
|
63
|
+
- @prosopo/audio-assets@0.2.1
|
|
64
|
+
- @prosopo/datasets@3.2.8
|
|
65
|
+
- @prosopo/env@3.6.77
|
|
66
|
+
- @prosopo/icon-order-assets@0.2.1
|
|
67
|
+
- @prosopo/ipinfo@0.4.21
|
|
68
|
+
- @prosopo/keyring@2.10.8
|
|
69
|
+
- @prosopo/load-balancer@2.11.12
|
|
70
|
+
- @prosopo/logger@2.1.4
|
|
71
|
+
- @prosopo/puzzle-assets@0.2.2
|
|
72
|
+
- @prosopo/redis-client@1.0.41
|
|
73
|
+
- @prosopo/types-env@2.11.23
|
|
74
|
+
- @prosopo/util@3.3.15
|
|
75
|
+
- @prosopo/util-crypto@13.6.0
|
|
76
|
+
- @prosopo/web-bot-auth@0.1.3
|
|
77
|
+
|
|
3
78
|
## 5.19.2
|
|
4
79
|
### Patch Changes
|
|
5
80
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/api/captcha/getFrictionlessCaptchaChallenge/handler.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAEN,KAAK,kBAAkB,EACvB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;8BAoDtD,mBAAmB,0BACA,kBAAkB,WAGpC,OAAO,GAAG,gBAAgB,OAC1B,QAAQ,QACP,YAAY;AAPpB,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/api/captcha/getFrictionlessCaptchaChallenge/handler.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAEN,KAAK,kBAAkB,EACvB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;8BAoDtD,mBAAmB,0BACA,kBAAkB,WAGpC,OAAO,GAAG,gBAAgB,OAC1B,QAAQ,QACP,YAAY;AAPpB,wBA0/BG"}
|
|
@@ -115,6 +115,19 @@ var handler_default = (env, userAccessRulesStorage) => async (req, res, next) =>
|
|
|
115
115
|
tasks.frictionlessManager.setAudioAlternativeEnabled(audioAlternativeEnabled);
|
|
116
116
|
const allowedCaptchaTypes = resolveSiteAllowedCaptchaTypes(clientRecord.settings);
|
|
117
117
|
tasks.frictionlessManager.setAllowedCaptchaTypes(allowedCaptchaTypes);
|
|
118
|
+
const webBotAuth = await verifyWebBotAuth({
|
|
119
|
+
method: req.method,
|
|
120
|
+
url: `https://${req.headers.host ?? ""}${req.originalUrl ?? req.url}`,
|
|
121
|
+
headers: flatten(req.headers)
|
|
122
|
+
}, { allowLocalSigners: process.env.NODE_ENV === "test" || process.env.NODE_ENV === "development" });
|
|
123
|
+
if (!webBotAuth.verified && webBotAuth.reason !== "no-signature-headers") req.logger.info(() => ({
|
|
124
|
+
msg: "Web Bot Auth signature rejected",
|
|
125
|
+
data: {
|
|
126
|
+
reason: webBotAuth.reason,
|
|
127
|
+
signatureAgent: req.headers["signature-agent"]
|
|
128
|
+
}
|
|
129
|
+
}));
|
|
130
|
+
const verifiedSignerUrl = webBotAuth.verified ? webBotAuth.signerUrl : void 0;
|
|
118
131
|
if (dedup) {
|
|
119
132
|
const dedupCountryCode = req.ipInfo && "isValid" in req.ipInfo && req.ipInfo.isValid ? req.ipInfo.countryCode : void 0;
|
|
120
133
|
const dedupAsn = req.ipInfo && "isValid" in req.ipInfo && req.ipInfo.isValid ? req.ipInfo.asnNumber : void 0;
|
|
@@ -122,9 +135,9 @@ var handler_default = (env, userAccessRulesStorage) => async (req, res, next) =>
|
|
|
122
135
|
const dedupFlatHeaders = flatten(req.headers);
|
|
123
136
|
const dedupUserAgent = String(req.headers["user-agent"] ?? "");
|
|
124
137
|
const dedupTrafficPolicies = deriveTrafficPolicies(clientRecord.settings?.trafficFilter);
|
|
125
|
-
const dedupUserScope = getRequestUserScope(dedupFlatHeaders, req.ja4, normalizedIp, user, void 0, void 0, dedupCountryCode, dedupAsn);
|
|
138
|
+
const dedupUserScope = getRequestUserScope(dedupFlatHeaders, req.ja4, normalizedIp, user, void 0, void 0, dedupCountryCode, dedupAsn, verifiedSignerUrl);
|
|
126
139
|
const dedupAccessPolicy = (await tasks.frictionlessManager.getPrioritisedAccessPolicies(userAccessRulesStorage, dapp, dedupUserScope, normalizeHeadersForMatching(req.headers))).find((p) => !p.deferToVerify);
|
|
127
|
-
const dedupConflictsWithPolicy = dedupAccessPolicy !== void 0 && (dedupAccessPolicy.type === AccessPolicyType.Block || dedupAccessPolicy.captchaType !== void 0 && dedupAccessPolicy.captchaType !== dedup.captchaType);
|
|
140
|
+
const dedupConflictsWithPolicy = dedupAccessPolicy !== void 0 && (dedupAccessPolicy.type === AccessPolicyType.Block || dedupAccessPolicy.type === AccessPolicyType.Allow || dedupAccessPolicy.captchaType !== void 0 && dedupAccessPolicy.captchaType !== dedup.captchaType);
|
|
128
141
|
const cachedCaptchaType = dedup.captchaType;
|
|
129
142
|
const dedupRouted = normalizedIp ? await tasks.frictionlessManager.applyRoutingMachine({
|
|
130
143
|
captchaType: cachedCaptchaType,
|
|
@@ -136,7 +149,11 @@ var handler_default = (env, userAccessRulesStorage) => async (req, res, next) =>
|
|
|
136
149
|
ip: normalizedIp,
|
|
137
150
|
...dedupCountryCode && { countryCode: dedupCountryCode },
|
|
138
151
|
score: dedup.session.score,
|
|
139
|
-
platform: derivePlatform(dedupUserAgent, dedup.session.webView, {
|
|
152
|
+
platform: derivePlatform(dedupUserAgent, dedup.session.webView, {
|
|
153
|
+
headers: dedupFlatHeaders,
|
|
154
|
+
...typeof dedupIsMobile === "boolean" && { carrierNetwork: dedupIsMobile },
|
|
155
|
+
...req.tcpMss !== void 0 && { tcpMss: req.tcpMss }
|
|
156
|
+
}),
|
|
140
157
|
...dedup.session.d !== void 0 && { d: dedup.session.d },
|
|
141
158
|
raw: {
|
|
142
159
|
headers: dedupFlatHeaders,
|
|
@@ -240,26 +257,12 @@ var handler_default = (env, userAccessRulesStorage) => async (req, res, next) =>
|
|
|
240
257
|
};
|
|
241
258
|
const refresh = await resolveRefreshLineage(tasks.db, refreshOf, dapp, /* @__PURE__ */ new Date());
|
|
242
259
|
tasks.frictionlessManager.setImageSwitchRequested(isImageSwitchRequestValid(switchToImage, refresh, isPuzzleImageSwitchAvailable(clientRecord.settings)));
|
|
243
|
-
const shortCircuitResponse = await runConfiguredCaptchaTypeShortCircuit(shortCircuitInput, res);
|
|
244
|
-
if (shortCircuitResponse) return shortCircuitResponse;
|
|
245
|
-
const emptyPoolResponse = await runEmptyDetectorPoolPowFallback(shortCircuitInput, res);
|
|
246
|
-
if (emptyPoolResponse) return emptyPoolResponse;
|
|
247
|
-
const lScore = tasks.frictionlessManager.checkLangRules(req.headers["accept-language"] || "");
|
|
248
|
-
const verified = await verifyWebBotAuth({
|
|
249
|
-
method: req.method,
|
|
250
|
-
url: `https://${req.headers.host ?? ""}${req.originalUrl ?? req.url}`,
|
|
251
|
-
headers: flatten(req.headers)
|
|
252
|
-
}, { allowLocalSigners: process.env.NODE_ENV === "test" || process.env.NODE_ENV === "development" });
|
|
253
|
-
const verifiedSignerUrl = verified.verified ? verified.signerUrl : void 0;
|
|
254
260
|
const userScope = getRequestUserScope(flatten(req.headers), req.ja4, normalizedIp, user, void 0, void 0, countryCode, asn, verifiedSignerUrl);
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
const allowingPolicy = accessPolicies.find((p) => !p.deferToVerify && (p.type === AccessPolicyType.Block || p.type === AccessPolicyType.Restrict)) ? void 0 : accessPolicies.find((p) => !p.deferToVerify && p.type === AccessPolicyType.Allow);
|
|
261
|
-
if (allowingPolicy) {
|
|
262
|
-
const authenticatedSession = await tasks.frictionlessManager.createAuthenticatedSession(token, ipAddress, verifiedSignerUrl ?? "", dapp, userSitekeyIpHash, flatHeaders, req.ipInfo && "isValid" in req.ipInfo && req.ipInfo.isValid ? req.ipInfo : void 0, clientSessionId);
|
|
261
|
+
const lookupAccessPolicies = () => tasks.frictionlessManager.getPrioritisedAccessPolicies(userAccessRulesStorage, dapp, userScope, normalizeHeadersForMatching(req.headers));
|
|
262
|
+
const respondIfAllowed = async (accessPolicies) => {
|
|
263
|
+
const allowingPolicy = accessPolicies.find((p) => !p.deferToVerify && (p.type === AccessPolicyType.Block || p.type === AccessPolicyType.Restrict)) ? void 0 : accessPolicies.find((p) => !p.deferToVerify && p.type === AccessPolicyType.Allow);
|
|
264
|
+
if (!allowingPolicy) return null;
|
|
265
|
+
const authenticatedSession = await tasks.frictionlessManager.createAuthenticatedSession(sessionToken, ipAddress, verifiedSignerUrl, dapp, userSitekeyIpHash, flatHeaders, req.ipInfo && "isValid" in req.ipInfo && req.ipInfo.isValid ? req.ipInfo : void 0, clientSessionId);
|
|
263
266
|
req.logger.info(() => ({
|
|
264
267
|
msg: "Frictionless decision",
|
|
265
268
|
data: {
|
|
@@ -279,7 +282,56 @@ var handler_default = (env, userAccessRulesStorage) => async (req, res, next) =>
|
|
|
279
282
|
dns_url: buildDnsEventUrl(authenticatedSession.sessionId),
|
|
280
283
|
...verifiedSignerUrl && { agent: verifiedSignerUrl }
|
|
281
284
|
});
|
|
285
|
+
};
|
|
286
|
+
const signerAccessPolicies = verifiedSignerUrl ? await lookupAccessPolicies() : void 0;
|
|
287
|
+
if (signerAccessPolicies) {
|
|
288
|
+
const signerBlockPolicy = signerAccessPolicies.find((p) => !p.deferToVerify && p.type === AccessPolicyType.Block);
|
|
289
|
+
if (signerBlockPolicy) {
|
|
290
|
+
tasks.frictionlessManager.setSessionParams({
|
|
291
|
+
token: sessionToken,
|
|
292
|
+
score: 0,
|
|
293
|
+
threshold: 0,
|
|
294
|
+
scoreComponents: { baseScore: 0 },
|
|
295
|
+
ipAddress,
|
|
296
|
+
webView: false,
|
|
297
|
+
iFrame: false,
|
|
298
|
+
decryptedHeadHash: "",
|
|
299
|
+
siteKey: dapp,
|
|
300
|
+
ipInfo: req.ipInfo,
|
|
301
|
+
headers: flatHeaders,
|
|
302
|
+
mode: sessionMode
|
|
303
|
+
});
|
|
304
|
+
const blockOutcome = await handleAccessPolicy({
|
|
305
|
+
tasks,
|
|
306
|
+
clientRecord,
|
|
307
|
+
userAccessPolicy: signerBlockPolicy,
|
|
308
|
+
baseBotScore: 0,
|
|
309
|
+
botScore: 0,
|
|
310
|
+
scoreComponents: { baseScore: 0 },
|
|
311
|
+
userSitekeyIpHash,
|
|
312
|
+
dapp,
|
|
313
|
+
ipInfo: req.ipInfo,
|
|
314
|
+
flatHeaders,
|
|
315
|
+
logger: req.logger,
|
|
316
|
+
userScope
|
|
317
|
+
}, res);
|
|
318
|
+
if (blockOutcome.handled) return blockOutcome.response;
|
|
319
|
+
}
|
|
320
|
+
const allowedSignerResponse = await respondIfAllowed(signerAccessPolicies);
|
|
321
|
+
if (allowedSignerResponse) return allowedSignerResponse;
|
|
282
322
|
}
|
|
323
|
+
const shortCircuitResponse = await runConfiguredCaptchaTypeShortCircuit(shortCircuitInput, res);
|
|
324
|
+
if (shortCircuitResponse) return shortCircuitResponse;
|
|
325
|
+
const emptyPoolResponse = await runEmptyDetectorPoolPowFallback(shortCircuitInput, res);
|
|
326
|
+
if (emptyPoolResponse) return emptyPoolResponse;
|
|
327
|
+
const lScore = tasks.frictionlessManager.checkLangRules(req.headers["accept-language"] || "");
|
|
328
|
+
const [decryptedPayload, validation, accessPolicies] = await Promise.all([
|
|
329
|
+
tasks.frictionlessManager.decryptPayload(token, headHash, detectorSessionId),
|
|
330
|
+
tasks.frictionlessManager.isValidRequest(clientRecord, CaptchaType.frictionless, env),
|
|
331
|
+
signerAccessPolicies ?? lookupAccessPolicies()
|
|
332
|
+
]);
|
|
333
|
+
const allowedResponse = await respondIfAllowed(accessPolicies);
|
|
334
|
+
if (allowedResponse) return allowedResponse;
|
|
283
335
|
const { baseBotScore: rawBaseBotScore, timestamp: rawTimestamp, userId: rawUserId, userAgent: rawUserAgent, webView, iFrame, decryptedHeadHash, decryptionFailed: rawDecryptionFailed, triggeredDetectors, shadowDomPenalty, d, bundleId } = decryptedPayload;
|
|
284
336
|
const detectorOverride = process.env.PROSOPO_TEST_FRICTIONLESS_DETECTOR_OVERRIDE === "1";
|
|
285
337
|
const baseBotScore = detectorOverride ? 0 : rawBaseBotScore;
|
|
@@ -356,7 +408,11 @@ var handler_default = (env, userAccessRulesStorage) => async (req, res, next) =>
|
|
|
356
408
|
imageMinRounds: clientRecord.settings.imageMinRounds,
|
|
357
409
|
baseImageRounds: env.config.captchas.solved.count,
|
|
358
410
|
puzzleMaxDifficulty: clientRecord.settings.puzzleMaxDifficulty,
|
|
359
|
-
platform: derivePlatform(requestUserAgent, webView, {
|
|
411
|
+
platform: derivePlatform(requestUserAgent, webView, {
|
|
412
|
+
headers: flatHeaders,
|
|
413
|
+
...typeof ipInfoMobile === "boolean" && { carrierNetwork: ipInfoMobile },
|
|
414
|
+
...req.tcpMss !== void 0 && { tcpMss: req.tcpMss }
|
|
415
|
+
}),
|
|
360
416
|
...d !== void 0 && { d },
|
|
361
417
|
raw: {
|
|
362
418
|
headers: flatHeaders,
|