@prosopo/provider 5.6.4 → 5.7.0
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 +16 -15
- package/.turbo/turbo-build$colon$tsc.log +28 -25
- package/.turbo/turbo-build.log +17 -16
- package/CHANGELOG.md +140 -0
- package/dist/api/blacklistRequestInspector.d.ts +1 -1
- package/dist/api/blacklistRequestInspector.d.ts.map +1 -1
- package/dist/api/blacklistRequestInspector.js +9 -12
- package/dist/api/blacklistRequestInspector.js.map +1 -1
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/constants.d.ts +0 -1
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/constants.d.ts.map +1 -1
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/constants.js +1 -9
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/constants.js.map +1 -1
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.d.ts.map +1 -1
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.js +1 -49
- package/dist/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.js.map +1 -1
- package/dist/api/captcha/submitPoWCaptchaSolution.d.ts.map +1 -1
- package/dist/api/captcha/submitPoWCaptchaSolution.js +2 -1
- package/dist/api/captcha/submitPoWCaptchaSolution.js.map +1 -1
- package/dist/api/verify.d.ts.map +1 -1
- package/dist/api/verify.js +1 -1
- package/dist/api/verify.js.map +1 -1
- package/dist/cjs/api/blacklistRequestInspector.cjs +8 -11
- package/dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/constants.cjs +0 -9
- package/dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.cjs +0 -48
- package/dist/cjs/api/captcha/submitPoWCaptchaSolution.cjs +3 -2
- package/dist/cjs/api/verify.cjs +1 -1
- package/dist/cjs/tasks/frictionless/frictionlessTasks.cjs +3 -5
- package/dist/cjs/tasks/frictionless/frictionlessTasksUtils.cjs +30 -1
- package/dist/cjs/tasks/imgCaptcha/imgCaptchaTasks.cjs +1 -2
- package/dist/cjs/tasks/puzzle/puzzleDifficulty.cjs +13 -170
- package/dist/cjs/tasks/puzzle/puzzleRenderer.cjs +2 -2
- package/dist/cjs/tasks/spam/checkTrafficFilter.cjs +2 -8
- package/dist/tasks/frictionless/frictionlessTasks.d.ts +1 -2
- package/dist/tasks/frictionless/frictionlessTasks.d.ts.map +1 -1
- package/dist/tasks/frictionless/frictionlessTasks.js +2 -4
- package/dist/tasks/frictionless/frictionlessTasks.js.map +1 -1
- package/dist/tasks/frictionless/frictionlessTasksUtils.d.ts.map +1 -1
- package/dist/tasks/frictionless/frictionlessTasksUtils.js +30 -1
- package/dist/tasks/frictionless/frictionlessTasksUtils.js.map +1 -1
- package/dist/tasks/imgCaptcha/imgCaptchaTasks.d.ts +1 -1
- package/dist/tasks/imgCaptcha/imgCaptchaTasks.d.ts.map +1 -1
- package/dist/tasks/imgCaptcha/imgCaptchaTasks.js +1 -3
- package/dist/tasks/imgCaptcha/imgCaptchaTasks.js.map +1 -1
- package/dist/tasks/puzzle/puzzleDifficulty.d.ts +0 -17
- package/dist/tasks/puzzle/puzzleDifficulty.d.ts.map +1 -1
- package/dist/tasks/puzzle/puzzleDifficulty.js +11 -164
- package/dist/tasks/puzzle/puzzleDifficulty.js.map +1 -1
- package/dist/tasks/puzzle/puzzleRenderer.d.ts.map +1 -1
- package/dist/tasks/puzzle/puzzleRenderer.js +1 -1
- package/dist/tasks/puzzle/puzzleRenderer.js.map +1 -1
- package/dist/tasks/spam/checkTrafficFilter.d.ts +1 -1
- package/dist/tasks/spam/checkTrafficFilter.d.ts.map +1 -1
- package/dist/tasks/spam/checkTrafficFilter.js +3 -9
- package/dist/tasks/spam/checkTrafficFilter.js.map +1 -1
- package/dist/tests/integration/api/admin/apiRegisterSiteKeyEndpoint.integration.test.js +1 -19
- package/dist/tests/integration/api/admin/apiRegisterSiteKeyEndpoint.integration.test.js.map +1 -1
- package/dist/tests/integration/api/admin/apiRegisterSiteKeysEndpoint.integration.test.js +1 -10
- package/dist/tests/integration/api/admin/apiRegisterSiteKeysEndpoint.integration.test.js.map +1 -1
- package/dist/tests/integration/clientSettingsPersistence.integration.test.js +1 -15
- package/dist/tests/integration/clientSettingsPersistence.integration.test.js.map +1 -1
- package/dist/tests/unit/api/blacklistRequestInspector.unit.test.js +35 -0
- package/dist/tests/unit/api/blacklistRequestInspector.unit.test.js.map +1 -1
- package/dist/tests/unit/api/captcha/getFrictionlessCaptchaChallenge/constants.unit.test.js +1 -30
- package/dist/tests/unit/api/captcha/getFrictionlessCaptchaChallenge/constants.unit.test.js.map +1 -1
- package/dist/tests/unit/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.unit.test.js +0 -6
- package/dist/tests/unit/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.unit.test.js.map +1 -1
- package/dist/tests/unit/api/getFrictionlessCaptchaChallenge.unit.test.js +1 -62
- package/dist/tests/unit/api/getFrictionlessCaptchaChallenge.unit.test.js.map +1 -1
- package/dist/tests/unit/tasks/captchaManager.unit.test.js +1 -10
- package/dist/tests/unit/tasks/captchaManager.unit.test.js.map +1 -1
- package/dist/tests/unit/tasks/client/clientTasks.unit.test.js +3 -23
- package/dist/tests/unit/tasks/client/clientTasks.unit.test.js.map +1 -1
- package/dist/tests/unit/tasks/frictionless/frictionlessTasksUtils.unit.test.js +64 -0
- package/dist/tests/unit/tasks/frictionless/frictionlessTasksUtils.unit.test.js.map +1 -1
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.js +10 -10
- package/dist/tests/unit/tasks/imgCaptcha/imgCaptchaTasks.unit.test.js.map +1 -1
- package/dist/tests/unit/tasks/puzzleDifficulty.unit.test.js +2 -53
- package/dist/tests/unit/tasks/puzzleDifficulty.unit.test.js.map +1 -1
- package/package.json +29 -28
- package/dist/api/captcha/contextAwareValidation.d.ts +0 -5
- package/dist/api/captcha/contextAwareValidation.d.ts.map +0 -1
- package/dist/api/captcha/contextAwareValidation.js +0 -45
- package/dist/api/captcha/contextAwareValidation.js.map +0 -1
- package/dist/cjs/api/captcha/contextAwareValidation.cjs +0 -47
- package/dist/tests/unit/api/contextAwareValidation.unit.test.d.ts +0 -2
- package/dist/tests/unit/api/contextAwareValidation.unit.test.d.ts.map +0 -1
- package/dist/tests/unit/api/contextAwareValidation.unit.test.js +0 -105
- package/dist/tests/unit/api/contextAwareValidation.unit.test.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/provider@5.
|
|
2
|
+
> @prosopo/provider@5.7.0 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -22,6 +22,7 @@ ViteCommonJSConfig: .
|
|
|
22
22
|
'/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
|
|
23
23
|
'/home/runner/work/captcha/captcha/packages/types-env/tsconfig.json',
|
|
24
24
|
'/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json',
|
|
25
|
+
'/home/runner/work/captcha/captcha/packages/captcha-severity/tsconfig.json',
|
|
25
26
|
'/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json',
|
|
26
27
|
'/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
|
|
27
28
|
'/home/runner/work/captcha/captcha/packages/puzzle-assets/tsconfig.json'
|
|
@@ -46,6 +47,7 @@ ViteCommonJSConfig: .
|
|
|
46
47
|
'@prosopo/api',
|
|
47
48
|
'@prosopo/types-env',
|
|
48
49
|
'@prosopo/keyring',
|
|
50
|
+
'@prosopo/captcha-severity',
|
|
49
51
|
'@prosopo/datasets',
|
|
50
52
|
'@prosopo/load-balancer',
|
|
51
53
|
'@prosopo/puzzle-assets'
|
|
@@ -55,7 +57,7 @@ ViteCommonJSConfig: .
|
|
|
55
57
|
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
56
58
|
Bundle build started
|
|
57
59
|
[2K
|
|
58
|
-
✓
|
|
60
|
+
✓ 107 modules transformed.
|
|
59
61
|
rendering chunks...
|
|
60
62
|
computing gzip size...
|
|
61
63
|
dist/cjs/tasks/index.cjs 0.08 kB │ gzip: 0.07 kB
|
|
@@ -71,7 +73,6 @@ dist/cjs/utils/hashUserIp.cjs 0
|
|
|
71
73
|
dist/cjs/api/testSiteKey.cjs 0.65 kB │ gzip: 0.32 kB
|
|
72
74
|
dist/cjs/utils/hashUserAgent.cjs 0.66 kB │ gzip: 0.40 kB
|
|
73
75
|
dist/cjs/api/validateAddress.cjs 0.80 kB │ gzip: 0.36 kB
|
|
74
|
-
dist/cjs/tasks/frictionless/frictionlessTasksUtils.cjs 0.85 kB │ gzip: 0.43 kB
|
|
75
76
|
dist/cjs/api/ja4.cjs 0.85 kB │ gzip: 0.47 kB
|
|
76
77
|
dist/cjs/api/dnsEventUrl.cjs 0.85 kB │ gzip: 0.46 kB
|
|
77
78
|
dist/cjs/tasks/dataset/datasetTasks.cjs 0.92 kB │ gzip: 0.41 kB
|
|
@@ -82,6 +83,7 @@ dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/sessionDedup.cjs 1
|
|
|
82
83
|
dist/cjs/tasks/powCaptcha/powTasksUtils.cjs 1.05 kB │ gzip: 0.50 kB
|
|
83
84
|
dist/cjs/api/admin/apiRegisterSiteKeyEndpoint.cjs 1.07 kB │ gzip: 0.48 kB
|
|
84
85
|
dist/cjs/api/admin/apiRegisterSiteKeysEndpoint.cjs 1.14 kB │ gzip: 0.52 kB
|
|
86
|
+
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/constants.cjs 1.15 kB │ gzip: 0.60 kB
|
|
85
87
|
dist/cjs/utils/normalizeRequestIp.cjs 1.16 kB │ gzip: 0.52 kB
|
|
86
88
|
dist/cjs/api/admin/apiRemoveSiteKeysEndpoint.cjs 1.16 kB │ gzip: 0.50 kB
|
|
87
89
|
dist/cjs/api/admin/apiRemoveSiteKeyEndpoint.cjs 1.17 kB │ gzip: 0.50 kB
|
|
@@ -94,7 +96,6 @@ dist/cjs/api/admin/apiRemoveAllDecisionMachinesEndpoint.cjs 1
|
|
|
94
96
|
dist/cjs/tasks/puzzle/backgroundBuffer.cjs 1.37 kB │ gzip: 0.52 kB
|
|
95
97
|
dist/cjs/pairs.cjs 1.39 kB │ gzip: 0.60 kB
|
|
96
98
|
dist/cjs/tasks/dataset/datasetTasksUtils.cjs 1.42 kB │ gzip: 0.49 kB
|
|
97
|
-
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/constants.cjs 1.42 kB │ gzip: 0.66 kB
|
|
98
99
|
dist/cjs/utils/clientMetaData.cjs 1.48 kB │ gzip: 0.72 kB
|
|
99
100
|
dist/cjs/compositeIpAddress.cjs 1.55 kB │ gzip: 0.57 kB
|
|
100
101
|
dist/cjs/tasks/detection/getBotScore.cjs 1.55 kB │ gzip: 0.55 kB
|
|
@@ -112,16 +113,17 @@ dist/cjs/utils/honeypot/phraseBank.cjs 1
|
|
|
112
113
|
dist/cjs/api/handshakeTimingMiddleware.cjs 1.88 kB │ gzip: 0.71 kB
|
|
113
114
|
dist/cjs/api/admin/apiClearAllCountersEndpoint.cjs 2.01 kB │ gzip: 0.78 kB
|
|
114
115
|
dist/cjs/api/captcha/assignDetectorBundle.cjs 2.03 kB │ gzip: 0.86 kB
|
|
115
|
-
dist/cjs/api/captcha/contextAwareValidation.cjs 2.09 kB │ gzip: 0.90 kB
|
|
116
116
|
dist/cjs/tasks/spam/updateSpamEmailDomains.cjs 2.12 kB │ gzip: 0.85 kB
|
|
117
117
|
dist/cjs/tasks/frictionless/routingMachine.cjs 2.17 kB │ gzip: 0.91 kB
|
|
118
118
|
dist/cjs/api/public.cjs 2.18 kB │ gzip: 0.91 kB
|
|
119
119
|
dist/cjs/migrations/frictionlessLadder.cjs 2.19 kB │ gzip: 0.95 kB
|
|
120
120
|
dist/cjs/tasks/puzzle/stratifiedSampler.cjs 2.20 kB │ gzip: 1.08 kB
|
|
121
|
+
dist/cjs/tasks/frictionless/frictionlessTasksUtils.cjs 2.21 kB │ gzip: 1.10 kB
|
|
121
122
|
dist/cjs/tasks/captchaTypeSelection.cjs 2.44 kB │ gzip: 1.04 kB
|
|
122
123
|
dist/cjs/api/admin/apiDnsEventEndpoint.cjs 2.59 kB │ gzip: 1.00 kB
|
|
123
124
|
dist/cjs/utils/dns.cjs 2.66 kB │ gzip: 1.02 kB
|
|
124
125
|
dist/cjs/api/forwardVerify.cjs 2.66 kB │ gzip: 1.12 kB
|
|
126
|
+
dist/cjs/tasks/puzzle/puzzleDifficulty.cjs 2.66 kB │ gzip: 1.10 kB
|
|
125
127
|
dist/cjs/api/captcha/checkSpamEmail.cjs 2.73 kB │ gzip: 0.95 kB
|
|
126
128
|
dist/cjs/api/captcha/submitPuzzleCaptchaSolution.cjs 2.77 kB │ gzip: 0.99 kB
|
|
127
129
|
dist/cjs/api/captcha/maintenanceModeResponses.cjs 2.91 kB │ gzip: 0.77 kB
|
|
@@ -134,7 +136,7 @@ dist/cjs/services/ipComparison.cjs 3
|
|
|
134
136
|
dist/cjs/tasks/spam/evaluateEmailSpamRules.cjs 4.03 kB │ gzip: 1.60 kB
|
|
135
137
|
dist/cjs/tasks/spam/checkSpamEmail.cjs 4.14 kB │ gzip: 1.14 kB
|
|
136
138
|
dist/cjs/api/captcha/trafficFilterRequestTime.cjs 4.17 kB │ gzip: 1.53 kB
|
|
137
|
-
dist/cjs/tasks/puzzle/puzzleRenderer.cjs 4.
|
|
139
|
+
dist/cjs/tasks/puzzle/puzzleRenderer.cjs 4.25 kB │ gzip: 1.51 kB
|
|
138
140
|
dist/cjs/api/hardBlockVerdictCache.cjs 4.27 kB │ gzip: 1.70 kB
|
|
139
141
|
dist/cjs/api/captcha.cjs 4.51 kB │ gzip: 1.40 kB
|
|
140
142
|
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/accessPolicy.cjs 4.56 kB │ gzip: 1.07 kB
|
|
@@ -142,32 +144,31 @@ dist/cjs/tasks/dnsEvent/enrichDnsEvent.cjs 4
|
|
|
142
144
|
dist/cjs/index.cjs 4.85 kB │ gzip: 1.01 kB
|
|
143
145
|
dist/cjs/tasks/tasks.cjs 5.07 kB │ gzip: 1.57 kB
|
|
144
146
|
dist/cjs/util/usageCounters.cjs 5.72 kB │ gzip: 2.03 kB
|
|
145
|
-
dist/cjs/tasks/puzzle/puzzleDifficulty.cjs 5.78 kB │ gzip: 2.05 kB
|
|
146
147
|
dist/cjs/api/captcha/getPoWCaptchaChallenge.cjs 6.65 kB │ gzip: 1.87 kB
|
|
147
148
|
dist/cjs/api/captcha/getImageCaptchaChallenge.cjs 6.98 kB │ gzip: 1.99 kB
|
|
149
|
+
dist/cjs/tasks/spam/checkTrafficFilter.cjs 7.47 kB │ gzip: 2.48 kB
|
|
148
150
|
dist/cjs/api/captcha/getPuzzleCaptchaChallenge.cjs 7.48 kB │ gzip: 2.00 kB
|
|
149
151
|
dist/cjs/api/metrics.cjs 7.51 kB │ gzip: 2.12 kB
|
|
150
|
-
dist/cjs/tasks/spam/checkTrafficFilter.cjs 7.65 kB │ gzip: 2.55 kB
|
|
151
152
|
dist/cjs/tasks/detection/bundlePool.cjs 8.72 kB │ gzip: 3.26 kB
|
|
152
|
-
dist/cjs/api/captcha/submitPoWCaptchaSolution.cjs 8.
|
|
153
|
+
dist/cjs/api/captcha/submitPoWCaptchaSolution.cjs 8.93 kB │ gzip: 2.68 kB
|
|
154
|
+
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.cjs 10.33 kB │ gzip: 1.82 kB
|
|
153
155
|
dist/cjs/api/startProviderApi.cjs 11.62 kB │ gzip: 3.70 kB
|
|
154
156
|
dist/cjs/tasks/client/clientTasks.cjs 11.73 kB │ gzip: 3.04 kB
|
|
155
157
|
dist/cjs/tasks/decisionMachine/decisionMachineRunner.cjs 12.32 kB │ gzip: 3.81 kB
|
|
156
|
-
dist/cjs/api/blacklistRequestInspector.cjs 12.
|
|
157
|
-
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.cjs 12.47 kB │ gzip: 2.26 kB
|
|
158
|
+
dist/cjs/api/blacklistRequestInspector.cjs 12.38 kB │ gzip: 4.27 kB
|
|
158
159
|
dist/cjs/util.cjs 13.25 kB │ gzip: 3.22 kB
|
|
159
|
-
dist/cjs/api/verify.cjs 13.
|
|
160
|
+
dist/cjs/api/verify.cjs 13.81 kB │ gzip: 2.58 kB
|
|
160
161
|
dist/cjs/api/captcha/getFrictionlessCaptchaChallenge/handler.cjs 18.33 kB │ gzip: 4.30 kB
|
|
161
|
-
dist/cjs/tasks/frictionless/frictionlessTasks.cjs 20.
|
|
162
|
+
dist/cjs/tasks/frictionless/frictionlessTasks.cjs 20.29 kB │ gzip: 5.36 kB
|
|
162
163
|
dist/cjs/tasks/captchaManager.cjs 22.33 kB │ gzip: 6.35 kB
|
|
163
164
|
dist/cjs/tasks/puzzleCaptcha/puzzleTasks.cjs 24.03 kB │ gzip: 5.15 kB
|
|
164
165
|
dist/cjs/tasks/powCaptcha/powTasks.cjs 24.84 kB │ gzip: 5.97 kB
|
|
165
|
-
dist/cjs/tasks/imgCaptcha/imgCaptchaTasks.cjs 28.
|
|
166
|
+
dist/cjs/tasks/imgCaptcha/imgCaptchaTasks.cjs 28.20 kB │ gzip: 6.41 kB
|
|
166
167
|
dist/cjs/tasks/detection/decodeBehavior.cjs 32.24 kB │ gzip: 10.32 kB
|
|
167
168
|
dist/cjs/tasks/detection/decodeSimd.cjs 36.03 kB │ gzip: 11.96 kB
|
|
168
169
|
dist/cjs/tasks/detection/decodePayload.cjs 49.79 kB │ gzip: 16.98 kB
|
|
169
170
|
|
|
170
|
-
[32m✓ built in
|
|
171
|
+
[32m✓ built in 209ms[39m
|
|
171
172
|
[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
|
|
172
173
|
[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
|
|
173
174
|
[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,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/provider@5.
|
|
2
|
+
> @prosopo/provider@5.7.0 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
10:40:18 PM - Projects in this build:
|
|
6
6
|
* ../../dev/config/tsconfig.json
|
|
7
7
|
* ../util/tsconfig.json
|
|
8
8
|
* ../logger/tsconfig.json
|
|
@@ -21,54 +21,57 @@
|
|
|
21
21
|
* ../types-env/tsconfig.json
|
|
22
22
|
* ../env/tsconfig.json
|
|
23
23
|
* ../api-express-router/tsconfig.json
|
|
24
|
+
* ../captcha-severity/tsconfig.json
|
|
24
25
|
* ../datasets/tsconfig.json
|
|
25
26
|
* ../load-balancer/tsconfig.json
|
|
26
27
|
* ../puzzle-assets/tsconfig.json
|
|
27
28
|
* tsconfig.json
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
10:40:18 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/vite/NodejsPolarsNativeFilePlugin.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
10:40:18 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
10:40:18 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/logger.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
10:40:18 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/index.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
10:40:18 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
10:40:18 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'
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
10:40:18 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'
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
10:40:18 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/batches.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
10:40:18 PM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/IpInfoService.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
10:40:18 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
10:40:18 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
50
51
|
|
|
51
|
-
|
|
52
|
+
10:40:18 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'
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
10:40:18 PM - Project '../types-database/tsconfig.json' is up to date because newest input '../types-database/src/types/captcha.ts' is older than output '../types-database/tsconfig.tsbuildinfo'
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
10:40:18 PM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/unit/redisCacheEscalation.unit.test.ts' is older than output '../database/tsconfig.tsbuildinfo'
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
10:40:18 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/pair/decode.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
10:40:18 PM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/index.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
10:40:18 PM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/tests/env.maintenance.unit.test.ts' is older than output '../env/tsconfig.tsbuildinfo'
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
10:40:18 PM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/tests/unit/apiExpressRouterFactory.unit.test.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
10:40:18 PM - Project '../captcha-severity/tsconfig.json' is up to date because newest input '../captcha-severity/src/index.test.ts' is older than output '../captcha-severity/tsconfig.tsbuildinfo'
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
10:40:18 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
10:40:18 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/index.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
10:40:18 PM - Project '../puzzle-assets/tsconfig.json' is up to date because newest input '../puzzle-assets/src/background.ts' is older than output '../puzzle-assets/tsconfig.tsbuildinfo'
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
10:40:18 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
75
|
+
|
|
76
|
+
10:40:18 PM - Building project '/home/runner/work/captcha/captcha/packages/provider/tsconfig.json'...
|
|
74
77
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/provider@5.
|
|
2
|
+
> @prosopo/provider@5.7.0 build
|
|
3
3
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/provider@5.
|
|
6
|
+
> @prosopo/provider@5.7.0 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
@@ -26,6 +26,7 @@ ViteEsmConfig: .
|
|
|
26
26
|
'/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
|
|
27
27
|
'/home/runner/work/captcha/captcha/packages/types-env/tsconfig.json',
|
|
28
28
|
'/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json',
|
|
29
|
+
'/home/runner/work/captcha/captcha/packages/captcha-severity/tsconfig.json',
|
|
29
30
|
'/home/runner/work/captcha/captcha/packages/datasets/tsconfig.json',
|
|
30
31
|
'/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
|
|
31
32
|
'/home/runner/work/captcha/captcha/packages/puzzle-assets/tsconfig.json'
|
|
@@ -50,6 +51,7 @@ ViteEsmConfig: .
|
|
|
50
51
|
'@prosopo/api',
|
|
51
52
|
'@prosopo/types-env',
|
|
52
53
|
'@prosopo/keyring',
|
|
54
|
+
'@prosopo/captcha-severity',
|
|
53
55
|
'@prosopo/datasets',
|
|
54
56
|
'@prosopo/load-balancer',
|
|
55
57
|
'@prosopo/puzzle-assets'
|
|
@@ -59,7 +61,7 @@ ViteEsmConfig: .
|
|
|
59
61
|
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
60
62
|
Bundle build started
|
|
61
63
|
[2K
|
|
62
|
-
✓
|
|
64
|
+
✓ 107 modules transformed.
|
|
63
65
|
rendering chunks...
|
|
64
66
|
computing gzip size...
|
|
65
67
|
dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
|
|
@@ -76,7 +78,6 @@ dist/utils/hashUserIp.js 0.52 k
|
|
|
76
78
|
dist/api/testSiteKey.js 0.56 kB │ gzip: 0.30 kB
|
|
77
79
|
dist/utils/hashUserAgent.js 0.63 kB │ gzip: 0.39 kB
|
|
78
80
|
dist/api/validateAddress.js 0.70 kB │ gzip: 0.33 kB
|
|
79
|
-
dist/tasks/frictionless/frictionlessTasksUtils.js 0.79 kB │ gzip: 0.42 kB
|
|
80
81
|
dist/api/dnsEventUrl.js 0.80 kB │ gzip: 0.44 kB
|
|
81
82
|
dist/api/ja4.js 0.80 kB │ gzip: 0.44 kB
|
|
82
83
|
dist/tasks/dataset/datasetTasks.js 0.85 kB │ gzip: 0.39 kB
|
|
@@ -85,6 +86,7 @@ dist/api/headerCheckMiddleware.js 0.91 k
|
|
|
85
86
|
dist/api/captcha/getFrictionlessCaptchaChallenge/honeypotResponse.js 0.95 kB │ gzip: 0.51 kB
|
|
86
87
|
dist/api/admin/apiRegisterSiteKeyEndpoint.js 1.00 kB │ gzip: 0.46 kB
|
|
87
88
|
dist/api/captcha/getFrictionlessCaptchaChallenge/sessionDedup.js 1.01 kB │ gzip: 0.45 kB
|
|
89
|
+
dist/api/captcha/getFrictionlessCaptchaChallenge/constants.js 1.04 kB │ gzip: 0.57 kB
|
|
88
90
|
dist/api/admin/apiRemoveSiteKeysEndpoint.js 1.07 kB │ gzip: 0.48 kB
|
|
89
91
|
dist/api/admin/apiRegisterSiteKeysEndpoint.js 1.08 kB │ gzip: 0.50 kB
|
|
90
92
|
dist/api/admin/apiRemoveSiteKeyEndpoint.js 1.08 kB │ gzip: 0.48 kB
|
|
@@ -96,7 +98,6 @@ dist/schedulers/getClientList.js 1.19 k
|
|
|
96
98
|
dist/tasks/puzzle/backgroundBuffer.js 1.20 kB │ gzip: 0.50 kB
|
|
97
99
|
dist/api/admin/apiGetDecisionMachineEndpoint.js 1.26 kB │ gzip: 0.50 kB
|
|
98
100
|
dist/api/admin/apiRemoveAllDecisionMachinesEndpoint.js 1.27 kB │ gzip: 0.51 kB
|
|
99
|
-
dist/api/captcha/getFrictionlessCaptchaChallenge/constants.js 1.27 kB │ gzip: 0.63 kB
|
|
100
101
|
dist/api/admin/apiRemoveDecisionMachineEndpoint.js 1.29 kB │ gzip: 0.51 kB
|
|
101
102
|
dist/tasks/dataset/datasetTasksUtils.js 1.30 kB │ gzip: 0.48 kB
|
|
102
103
|
dist/compositeIpAddress.js 1.36 kB │ gzip: 0.55 kB
|
|
@@ -118,15 +119,16 @@ dist/tasks/spam/updateSpamEmailDomains.js 1.87 k
|
|
|
118
119
|
dist/api/admin/apiClearAllCountersEndpoint.js 1.89 kB │ gzip: 0.76 kB
|
|
119
120
|
dist/api/public.js 1.90 kB │ gzip: 0.83 kB
|
|
120
121
|
dist/api/captcha/assignDetectorBundle.js 1.90 kB │ gzip: 0.84 kB
|
|
121
|
-
dist/api/captcha/contextAwareValidation.js 1.99 kB │ gzip: 0.88 kB
|
|
122
122
|
dist/migrations/frictionlessLadder.js 2.12 kB │ gzip: 0.93 kB
|
|
123
123
|
dist/tasks/puzzle/stratifiedSampler.js 2.14 kB │ gzip: 1.07 kB
|
|
124
124
|
dist/tasks/frictionless/routingMachine.js 2.16 kB │ gzip: 0.91 kB
|
|
125
|
+
dist/tasks/frictionless/frictionlessTasksUtils.js 2.16 kB │ gzip: 1.09 kB
|
|
125
126
|
dist/api/captcha/maintenanceModeResponses.js 2.16 kB │ gzip: 0.73 kB
|
|
126
127
|
dist/tasks/captchaTypeSelection.js 2.22 kB │ gzip: 1.03 kB
|
|
127
128
|
dist/utils/dns.js 2.36 kB │ gzip: 0.95 kB
|
|
128
129
|
dist/api/admin/apiDnsEventEndpoint.js 2.43 kB │ gzip: 0.96 kB
|
|
129
130
|
dist/api/captcha/checkSpamEmail.js 2.47 kB │ gzip: 0.91 kB
|
|
131
|
+
dist/tasks/puzzle/puzzleDifficulty.js 2.50 kB │ gzip: 1.09 kB
|
|
130
132
|
dist/api/captcha/submitPuzzleCaptchaSolution.js 2.55 kB │ gzip: 0.96 kB
|
|
131
133
|
dist/api/forwardVerify.js 2.59 kB │ gzip: 1.10 kB
|
|
132
134
|
dist/api/captcha/submitImageCaptchaSolution.js 2.59 kB │ gzip: 1.00 kB
|
|
@@ -136,7 +138,7 @@ dist/api/captcha/getFrictionlessCaptchaChallenge/shortCircuit.js 3.39 k
|
|
|
136
138
|
dist/api/domainMiddleware.js 3.52 kB │ gzip: 1.22 kB
|
|
137
139
|
dist/api/rawTlsSignalsMiddleware.js 3.69 kB │ gzip: 1.13 kB
|
|
138
140
|
dist/tasks/spam/evaluateEmailSpamRules.js 3.84 kB │ gzip: 1.59 kB
|
|
139
|
-
dist/tasks/puzzle/puzzleRenderer.js 3.
|
|
141
|
+
dist/tasks/puzzle/puzzleRenderer.js 3.91 kB │ gzip: 1.49 kB
|
|
140
142
|
dist/api/captcha/trafficFilterRequestTime.js 3.94 kB │ gzip: 1.51 kB
|
|
141
143
|
dist/services/ipComparison.js 3.96 kB │ gzip: 1.19 kB
|
|
142
144
|
dist/api/captcha.js 4.05 kB │ gzip: 1.31 kB
|
|
@@ -145,33 +147,32 @@ dist/api/hardBlockVerdictCache.js 4.14 k
|
|
|
145
147
|
dist/api/captcha/getFrictionlessCaptchaChallenge/accessPolicy.js 4.35 kB │ gzip: 1.07 kB
|
|
146
148
|
dist/tasks/tasks.js 4.69 kB │ gzip: 1.51 kB
|
|
147
149
|
dist/tasks/dnsEvent/enrichDnsEvent.js 4.71 kB │ gzip: 1.72 kB
|
|
148
|
-
dist/tasks/puzzle/puzzleDifficulty.js 5.50 kB │ gzip: 2.02 kB
|
|
149
150
|
dist/util/usageCounters.js 5.65 kB │ gzip: 2.01 kB
|
|
150
151
|
dist/api/captcha/getPoWCaptchaChallenge.js 6.02 kB │ gzip: 1.81 kB
|
|
151
152
|
dist/api/captcha/getImageCaptchaChallenge.js 6.28 kB │ gzip: 1.94 kB
|
|
152
153
|
dist/api/captcha/getPuzzleCaptchaChallenge.js 6.77 kB │ gzip: 1.95 kB
|
|
153
154
|
dist/api/metrics.js 6.96 kB │ gzip: 2.09 kB
|
|
154
|
-
dist/tasks/spam/checkTrafficFilter.js 7.
|
|
155
|
+
dist/tasks/spam/checkTrafficFilter.js 7.16 kB │ gzip: 2.45 kB
|
|
155
156
|
dist/tasks/detection/bundlePool.js 8.30 kB │ gzip: 3.21 kB
|
|
156
|
-
dist/api/captcha/submitPoWCaptchaSolution.js 8.
|
|
157
|
+
dist/api/captcha/submitPoWCaptchaSolution.js 8.41 kB │ gzip: 2.63 kB
|
|
158
|
+
dist/api/captcha/getFrictionlessCaptchaChallenge/decisionMachine.js 9.36 kB │ gzip: 1.80 kB
|
|
157
159
|
dist/api/startProviderApi.js 9.93 kB │ gzip: 3.42 kB
|
|
158
160
|
dist/tasks/client/clientTasks.js 11.27 kB │ gzip: 3.00 kB
|
|
159
|
-
dist/api/
|
|
160
|
-
dist/api/blacklistRequestInspector.js 11.85 kB │ gzip: 4.28 kB
|
|
161
|
+
dist/api/blacklistRequestInspector.js 11.79 kB │ gzip: 4.24 kB
|
|
161
162
|
dist/tasks/decisionMachine/decisionMachineRunner.js 11.93 kB │ gzip: 3.75 kB
|
|
162
|
-
dist/api/verify.js 12.
|
|
163
|
+
dist/api/verify.js 12.48 kB │ gzip: 2.48 kB
|
|
163
164
|
dist/util.js 12.57 kB │ gzip: 3.17 kB
|
|
164
165
|
dist/api/captcha/getFrictionlessCaptchaChallenge/handler.js 17.12 kB │ gzip: 4.21 kB
|
|
165
|
-
dist/tasks/frictionless/frictionlessTasks.js 19.
|
|
166
|
+
dist/tasks/frictionless/frictionlessTasks.js 19.77 kB │ gzip: 5.32 kB
|
|
166
167
|
dist/tasks/captchaManager.js 21.82 kB │ gzip: 6.29 kB
|
|
167
168
|
dist/tasks/puzzleCaptcha/puzzleTasks.js 22.62 kB │ gzip: 5.11 kB
|
|
168
169
|
dist/tasks/powCaptcha/powTasks.js 23.47 kB │ gzip: 5.93 kB
|
|
169
|
-
dist/tasks/imgCaptcha/imgCaptchaTasks.js 26.
|
|
170
|
+
dist/tasks/imgCaptcha/imgCaptchaTasks.js 26.67 kB │ gzip: 6.34 kB
|
|
170
171
|
dist/tasks/detection/decodeBehavior.js 32.26 kB │ gzip: 10.34 kB
|
|
171
172
|
dist/tasks/detection/decodeSimd.js 36.06 kB │ gzip: 12.00 kB
|
|
172
173
|
dist/tasks/detection/decodePayload.js 49.69 kB │ gzip: 16.96 kB
|
|
173
174
|
|
|
174
|
-
[32m✓ built in
|
|
175
|
+
[32m✓ built in 143ms[39m
|
|
175
176
|
[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
|
|
176
177
|
[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
|
|
177
178
|
[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,145 @@
|
|
|
1
1
|
# @prosopo/provider
|
|
2
2
|
|
|
3
|
+
## 5.7.0
|
|
4
|
+
### Minor Changes
|
|
5
|
+
|
|
6
|
+
- 8a670d3: Remove the provider-side context validation path.
|
|
7
|
+
|
|
8
|
+
The provider read a per-context baseline out of `clientcontextentropies` on the frictionless path and compared a session's head hash against it. The task that wrote that collection was removed from the provider on 2026-08-21, so the read has returned `undefined` ever since and the branch has been dead in every deployment since then. Computing and applying the baseline now happens off-provider.
|
|
9
|
+
|
|
10
|
+
Removed: `contextAwareValidation.ts`, the decision-machine branch that used it, `getClientContextEntropy` on the provider and its database method, the `clientContextEntropy` table registration, the unused `getRoundsFromSimScore` helper, and the `contextAwareEnabled` parameter threaded into image verification — which logged and then did nothing, its return commented out.
|
|
11
|
+
|
|
12
|
+
Also removes the per-site `settings.contextAware` block that configured it, along with `ContextAwareSchema`, `IContextAware`, `IContexts`, `ContextConfigSchema`, `contextAwareThresholdDefault` and `expandContexts`, the legacy `default`/`webview` context keys and their helpers, and `FrictionlessReason.CONTEXT_AWARE_VALIDATION_FAILED`. The site-key registration CLI no longer writes a `contextAware` default into new sites.
|
|
13
|
+
|
|
14
|
+
`ContextType`, `contextTypeFromSession` and `deviceContextTypes` stay — the off-provider work keys on them. `ClientContextEntropyRecord` and its schema stay for the same reason; only the provider's use of them goes.
|
|
15
|
+
|
|
16
|
+
No behaviour change: every path removed here was already inert.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 7fd6eb2: Add a `browser` match dimension to access rules.
|
|
21
|
+
|
|
22
|
+
Rules can now be scoped to the browser classified server-side from the request
|
|
23
|
+
User-Agent (`chrome`, `safari`, `firefox`, `edge`, `opera`, `samsung_internet`,
|
|
24
|
+
`wechat`, `facebook`, `instagram`, `ie`, `unknown`), mirroring the existing `os`
|
|
25
|
+
dimension. The classifier duplicates `@prosopo/decision-machines`' `uaClassify`
|
|
26
|
+
because the provider request path cannot depend on that package.
|
|
27
|
+
|
|
28
|
+
Also fixes `os` never getting its own probe on the Redis split-query hot path:
|
|
29
|
+
`SCALAR_USER_SCOPE_FIELDS` in `redisRulesSplitQuery` had not been updated when
|
|
30
|
+
the OS dimension landed, so an OS-only rule was reachable only via the
|
|
31
|
+
`no-user-scope` fall-through, competing for that probe's candidate budget
|
|
32
|
+
against genuine client-wide blocks.
|
|
33
|
+
|
|
34
|
+
The Redis index gains a `browser` TAG field. `createRedisIndex` hashes the index
|
|
35
|
+
definition and drops/recreates when the hash changes, so this needs no manual
|
|
36
|
+
migration — verified locally: the index came back carrying `browser` and the
|
|
37
|
+
stored hash moved to match.
|
|
38
|
+
- 424e467: Add `@prosopo/captcha-severity` and use it for the access rules and the traffic filter.
|
|
39
|
+
|
|
40
|
+
"Which captcha challenge is stricter" is one idea with several callers, and each answered it with its own table: the traffic filter combining multiple `challenge` matches on one request (`resolveChallengePolicy`), the access rules breaking ties between equally-specific rules (`ruleHarshness`), and downstream routing consumers. They agreed on the order — image > puzzle > pow > frictionless — but nothing held them to it, and they disagreed on the encoding.
|
|
41
|
+
|
|
42
|
+
The new package has **zero dependencies**, deliberately. Captcha types are string enums, so a plain `string` parameter accepts them without importing `CaptchaType` — and that import would not be free, because it lives in a module that pulls zod in for its schemas. Some consumers bundle this standalone under a hard source-size ceiling that a runtime dependency on the `@prosopo/types` barrel has breached before.
|
|
43
|
+
|
|
44
|
+
Two APIs, because "stricter" means two different things:
|
|
45
|
+
|
|
46
|
+
- `rankCaptchaType` / `isStricterCaptchaType` compare the **type alone**, for callers that choose the type independently of its settings — as the traffic filter does, picking the strictest type and then separately merging the hardest parameters from every matched category.
|
|
47
|
+
- `captchaPolicySeverity` / `isStricterCaptchaPolicy` compare a **whole policy**, type first and its own difficulty setting second, for callers where one complete policy must beat another and a tie on type alone would otherwise be decided by argument order.
|
|
48
|
+
|
|
49
|
+
**Fixes an ordering bug in the access rules.** `ruleHarshness` scored `base + solvedImagesCount` with tiers 10 apart, and `solvedImagesCount` is validated by `imageMaxRoundsFieldSchema` — `number().int().min(2)`, with no upper bound and an `imageMaxRounds` default of 32. A `Restrict[pow]` rule carrying 32 rounds therefore scored 42 and outranked a `Restrict[image]` rule at 30, exactly inverting the intended order; 11 rounds on a puzzle rule was enough to do it. The intra-type component is now clamped below the tier gap, so no setting can lift a rule over a stricter captcha type.
|
|
50
|
+
|
|
51
|
+
One further behaviour change: pow rules now break ties on `powDifficulty` rather than `solvedImagesCount`. Rule authoring drops `solvedImagesCount` for pow, so every pow rule previously scored at the bottom of its tier regardless of difficulty. Image and puzzle both keep `solvedImagesCount` — it is the severity currency they share, which the provider maps onto a puzzle difficulty level via `severityToPuzzleDifficulty` rather than treating as a literal round count.
|
|
52
|
+
- 89dd38a: chore(deps): batch the outstanding dependabot bumps into one upgrade
|
|
53
|
+
|
|
54
|
+
Rolls up dependabot PRs #3112, #3127-#3134 and #3159. Majors: `mongoose`
|
|
55
|
+
8 -> 9, `bson` 6 -> 7, `@noble/curves` 1 -> 2, `@polkadot/util-crypto`
|
|
56
|
+
13 -> 14, `@typegoose/auto-increment` 4 -> 5, `@babel/preset-env` 7 -> 8,
|
|
57
|
+
`@types/jsdom` 21 -> 30, `@types/bcrypt` 5 -> 6, `@actions/github` 6 -> 9,
|
|
58
|
+
`testcontainers` 11 -> 12. The rest are minor/patch.
|
|
59
|
+
|
|
60
|
+
Code changes the majors forced:
|
|
61
|
+
- `@noble/curves` v2 requires `.js` specifiers and renamed the point API,
|
|
62
|
+
so `secp256k1.ProjectivePoint.fromHex(...).toRawBytes()` becomes
|
|
63
|
+
`secp256k1.Point.fromBytes(...).toBytes()`, `RistrettoPoint` becomes
|
|
64
|
+
`ristretto255.Point`, and `abstract/utils` moves to `utils.js`.
|
|
65
|
+
- mongoose 9 drops `RootFilterQuery` (now `QueryFilter`), no longer sets
|
|
66
|
+
`background: true` on schema indexes by default, and no longer declares
|
|
67
|
+
`id` on `Document`, which un-hid a mismatch between
|
|
68
|
+
`updateDappUserCommitment`'s `Hash` parameter and the `string` `id` it
|
|
69
|
+
filters on.
|
|
70
|
+
- mongoose 9 rejects an aggregation-pipeline update (an array) unless the
|
|
71
|
+
call passes `updatePipeline: true`, so the six pipeline writes in
|
|
72
|
+
`ProviderDatabase` now opt in explicitly.
|
|
73
|
+
- mongoose 9's `castUpdate` throws on a `$setOnInsert` key inside `$set`.
|
|
74
|
+
`storeUserImageCaptchaSolution` passed its record straight in as the
|
|
75
|
+
update, and mongoose's `moveImmutableProperties` mutates that object on
|
|
76
|
+
an upsert -- adding the very `$setOnInsert` key the record then carried
|
|
77
|
+
into `CentralDbStreamer.streamImageRecord`. Image records stopped
|
|
78
|
+
reaching the central DB (the streamer is fire-and-forget, so it only
|
|
79
|
+
logged) and signup verification returned 500. The update is now an
|
|
80
|
+
explicit `$set` over a shallow copy.
|
|
81
|
+
- `@prosopo/database` moves from mongodb 6.20 to 7.5 to match the driver
|
|
82
|
+
mongoose 9 pulls, so bson 7 is the only copy resolvable in the package.
|
|
83
|
+
- `vitest`/`@vitest/coverage-v8` go to 4.1.11 alongside dependabot's
|
|
84
|
+
`@vitest/spy` bump; leaving them at 4.1.10 installed a second copy of
|
|
85
|
+
`@vitest/spy` and broke type inference in the provider test utils.
|
|
86
|
+
- 4810cb3: Fix `computeFrictionlessScore` returning `NaN` when `scoreComponents` carries a non-numeric field.
|
|
87
|
+
|
|
88
|
+
The score was summed with `Object.values(...).reduce((acc, val) => acc + val, 0)` over every defined value. `ScoreComponents` also carries two non-numeric diagnostic fields — `triggeredDetectors` (`number[]`) and `shadowDomPenalty` (`boolean`) — and neither has an arithmetic weight anywhere in the scoring path. `+` on an array coerces the accumulator to a string, so any numeric component summed *after* an array turned the running total into string concatenation and the final `Math.min(1, ...)` into `NaN`:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
0.42 + [] -> "0.42"
|
|
92
|
+
"0.42" + 0.3 -> "0.420.3"
|
|
93
|
+
Math.min(1, "0.420.3") -> NaN
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This was reachable in production rather than theoretical. The Mongoose schema declares `triggeredDetectors` as an array path and Mongoose defaults array paths to `[]`, so the field is present on every session read back from the database even when the frictionless handler omitted it; the pow / puzzle / image tasks then spread `dnsAsymmetry` on afterwards, landing it after the array in key order. Every solve-time recompute on a session with `dnsAsymmetry > 0` produced `NaN`.
|
|
97
|
+
|
|
98
|
+
Only numeric values now contribute. `shadowDomPenalty` no longer silently adds a full `1.0` when true. A genuinely numeric `NaN` component still propagates — `typeof NaN === "number"`, so it survives the filter deliberately — because a score that cannot be computed must not read as a low one.
|
|
99
|
+
|
|
100
|
+
The recomputed value is not persisted (neither `sessions` nor `usercommitments` stores it) and no decide rule currently branches on `input.score`, so the impact to date was a `NaN` in the solve-time log line and in `DecisionMachineInput.score`.
|
|
101
|
+
- 3d2176d: Move the puzzle difficulty ladder into `@prosopo/captcha-severity`, so every consumer derives a difficulty from one table.
|
|
102
|
+
|
|
103
|
+
`PUZZLE_DIFFICULTY_LEVELS`, `MAX_AUTO_ESCALATION_LEVEL`, `MIN_DECOY_HOLE_DARKEN_MARGIN`, `clampDifficultyLevel` and `severityToPuzzleDifficulty` lived in `provider/src/tasks/puzzle/puzzleDifficulty.ts`, reachable only from inside the provider — the severity package's own docs described the ladder at length but did not hold it. Anything else that has to answer "what difficulty is this puzzle" had to restate the mapping, and the consumers that author and edit puzzle rules sit outside the provider.
|
|
104
|
+
|
|
105
|
+
They can import it now. The severity package already answers "which of these policies is stricter" off `solvedImagesCount`; the ladder answers what a puzzle policy carrying that number is actually served at, which is the same question one step further in.
|
|
106
|
+
|
|
107
|
+
Sampling a concrete render from a level's bands stays in the provider as `samplePuzzleDifficulty`: it needs `IPuzzleSettings` from `@prosopo/types` and a `node:crypto`-backed sampler, and the severity package's zero-dependency, browser-safe property is load-bearing for consumers that bundle it standalone.
|
|
108
|
+
|
|
109
|
+
Adds `puzzleDifficultyToSeverity`, the inverse of `severityToPuzzleDifficulty`. Writers need that direction — a rule editor turning a chosen difficulty into the field the rule carries, or rule authoring normalising a count inherited from the image path. Each level spans two rounds, so without a canonical value per level a writer picks between numbers that produce the identical puzzle, and the difference survives only to break severity ties arbitrarily. The round-trip is pinned by tests.
|
|
110
|
+
|
|
111
|
+
No behaviour change in the provider: same table, same thresholds, same clamping.
|
|
112
|
+
- Updated dependencies [7fd6eb2]
|
|
113
|
+
- Updated dependencies [424e467]
|
|
114
|
+
- Updated dependencies [1b77849]
|
|
115
|
+
- Updated dependencies [89dd38a]
|
|
116
|
+
- Updated dependencies [80f73c1]
|
|
117
|
+
- Updated dependencies [3d2176d]
|
|
118
|
+
- Updated dependencies [8fce190]
|
|
119
|
+
- Updated dependencies [8a670d3]
|
|
120
|
+
- @prosopo/user-access-policy@3.12.33
|
|
121
|
+
- @prosopo/captcha-severity@1.1.0
|
|
122
|
+
- @prosopo/util-crypto@13.5.31
|
|
123
|
+
- @prosopo/api@4.1.5
|
|
124
|
+
- @prosopo/api-express-router@3.1.81
|
|
125
|
+
- @prosopo/api-route@2.6.57
|
|
126
|
+
- @prosopo/common@3.1.53
|
|
127
|
+
- @prosopo/database@4.0.27
|
|
128
|
+
- @prosopo/datasets@3.1.77
|
|
129
|
+
- @prosopo/env@3.6.50
|
|
130
|
+
- @prosopo/ipinfo@0.3.22
|
|
131
|
+
- @prosopo/keyring@2.9.84
|
|
132
|
+
- @prosopo/load-balancer@2.10.39
|
|
133
|
+
- @prosopo/locale@3.4.1
|
|
134
|
+
- @prosopo/logger@2.0.8
|
|
135
|
+
- @prosopo/redis-client@1.0.34
|
|
136
|
+
- @prosopo/types@5.6.0
|
|
137
|
+
- @prosopo/types-database@5.4.0
|
|
138
|
+
- @prosopo/types-env@2.10.44
|
|
139
|
+
- @prosopo/util@3.3.8
|
|
140
|
+
- @prosopo/native-ja4@0.0.4
|
|
141
|
+
- @prosopo/native-merkle@0.0.4
|
|
142
|
+
|
|
3
143
|
## 5.6.4
|
|
4
144
|
### Patch Changes
|
|
5
145
|
|
|
@@ -4,7 +4,7 @@ import type { IProviderDatabase } from "@prosopo/types-database";
|
|
|
4
4
|
import { type AccessRule, type AccessRulesStorage, type UserScope, type UserScopeRecord } from "@prosopo/user-access-policy";
|
|
5
5
|
import type { NextFunction, Request, Response } from "express";
|
|
6
6
|
import { HardBlockVerdictCache } from "./hardBlockVerdictCache.js";
|
|
7
|
-
export declare const getRequestUserScope: (requestHeaders: Record<string, unknown>, ja4?: string, ip?: string, user?: string, headHash?: string, coords?: string, countryCode?: string, asn?: number) => Pick<UserScopeRecord, "userId" | "ja4Hash" | "userAgent" | "ip" | "headHash" | "coords" | "countryCode" | "asn" | "os">;
|
|
7
|
+
export declare const getRequestUserScope: (requestHeaders: Record<string, unknown>, ja4?: string, ip?: string, user?: string, headHash?: string, coords?: string, countryCode?: string, asn?: number) => Pick<UserScopeRecord, "userId" | "ja4Hash" | "userAgent" | "ip" | "headHash" | "coords" | "countryCode" | "asn" | "os" | "browser">;
|
|
8
8
|
export declare const rankCandidateRules: (rules: AccessRule[], request: UserScope, requestClientId: string | undefined) => AccessRule[];
|
|
9
9
|
export declare const getVerdictCache: () => HardBlockVerdictCache;
|
|
10
10
|
export type GetPrioritisedAccessRuleOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blacklistRequestInspector.d.ts","sourceRoot":"","sources":["../../src/api/blacklistRequestInspector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blacklistRequestInspector.d.ts","sourceRoot":"","sources":["../../src/api/blacklistRequestInspector.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAKN,KAAK,cAAc,EAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAEN,KAAK,UAAU,EACf,KAAK,kBAAkB,EAEvB,KAAK,SAAS,EACd,KAAK,eAAe,EAMpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,EACN,qBAAqB,EAErB,MAAM,4BAA4B,CAAC;AAGpC,eAAO,MAAM,mBAAmB,mBACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QACjC,MAAM,OACP,MAAM,SACJ,MAAM,aACF,MAAM,WACR,MAAM,gBACD,MAAM,QACd,MAAM,KACV,IAAI,CACN,eAAe,EACb,QAAQ,GACR,SAAS,GACT,WAAW,GACX,IAAI,GACJ,UAAU,GACV,QAAQ,GACR,aAAa,GACb,KAAK,GACL,IAAI,GACJ,SAAS,CAoBX,CAAC;AAkLF,eAAO,MAAM,kBAAkB,UACvB,UAAU,EAAE,WACV,SAAS,mBACD,MAAM,GAAG,SAAS,KACjC,UAAU,EAWT,CAAC;AAoCL,eAAO,MAAM,eAAe,QAAO,qBAAqC,CAAC;AAuBzE,MAAM,MAAM,+BAA+B,GAAG;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IAIpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAK1B,eAAe,CAAC,EAAE,MAAM,CAAC;IAIzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,wBAAwB,2BACZ,kBAAkB,aAC/B,SAAS,GAAG,eAAe,aAC3B,MAAM,YACP,+BAA+B,KACvC,OAAO,CAAC,UAAU,EAAE,CAmEtB,CAAC;AAEF,qBAAa,yBAAyB;IAEpC,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,0BAA0B;IAQ3C,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;gBATH,sBAAsB,EAAE,kBAAkB,EAC1C,0BAA0B,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAQ/C,EAAE,CAAC,EAAE,iBAAiB,YAAA;IAG3B,2BAA2B,CACvC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,YAAY,GAChB,OAAO,CAAC,IAAI,CAAC;IA2CH,kBAAkB,CAC9B,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,cAAc,EACvB,eAAe,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,OAAO,CAAC;IAkHnB,OAAO,CAAC,mBAAmB;IAiG3B,SAAS,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAInD,SAAS,CAAC,qBAAqB,CAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC;QACF,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAC3B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;KAC7B;IAcD,SAAS,CAAC,cAAc,CACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,MAAM,GACT,OAAO;CAGV"}
|
|
@@ -3,7 +3,8 @@ import { HardBlockVerdictCache, hardBlockCacheKey } from "./hardBlockVerdictCach
|
|
|
3
3
|
import { recordBlockedRequest } from "./metrics.js";
|
|
4
4
|
import { ApiPrefix, CaptchaStatus, CaptchaType, FrictionlessReason, ResultReason } from "@prosopo/types";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
|
-
import {
|
|
6
|
+
import { captchaPolicySeverity } from "@prosopo/captcha-severity";
|
|
7
|
+
import { AccessPolicyType, FilterScopeMatch, classifyBrowser, classifyOs, describeMatchedRule, makeAccessRuleHash, userScopeInput } from "@prosopo/user-access-policy";
|
|
7
8
|
//#region src/api/blacklistRequestInspector.ts
|
|
8
9
|
var getRequestUserScope = (requestHeaders, ja4, ip, user, headHash, coords, countryCode, asn) => {
|
|
9
10
|
const userAgent = requestHeaders["user-agent"] ? requestHeaders["user-agent"].toString() : void 0;
|
|
@@ -16,7 +17,8 @@ var getRequestUserScope = (requestHeaders, ja4, ip, user, headHash, coords, coun
|
|
|
16
17
|
...coords && { coords },
|
|
17
18
|
...countryCode && { countryCode },
|
|
18
19
|
...typeof asn === "number" && { asn },
|
|
19
|
-
os: classifyOs(userAgent)
|
|
20
|
+
os: classifyOs(userAgent),
|
|
21
|
+
browser: classifyBrowser(userAgent)
|
|
20
22
|
};
|
|
21
23
|
};
|
|
22
24
|
var SCALAR_USER_SCOPE_FIELDS = [
|
|
@@ -28,7 +30,8 @@ var SCALAR_USER_SCOPE_FIELDS = [
|
|
|
28
30
|
"coords",
|
|
29
31
|
"countryCode",
|
|
30
32
|
"asn",
|
|
31
|
-
"os"
|
|
33
|
+
"os",
|
|
34
|
+
"browser"
|
|
32
35
|
];
|
|
33
36
|
var deriveRuleType = (rule) => {
|
|
34
37
|
const fields = [];
|
|
@@ -66,16 +69,9 @@ var ruleSpecificity = (rule, requestClientId) => {
|
|
|
66
69
|
if (ruleHasIpConstraint(rule)) score += 1;
|
|
67
70
|
return score;
|
|
68
71
|
};
|
|
69
|
-
var CAPTCHA_TYPE_HARSHNESS = {
|
|
70
|
-
[CaptchaType.image]: 30,
|
|
71
|
-
[CaptchaType.puzzle]: 20,
|
|
72
|
-
[CaptchaType.pow]: 10,
|
|
73
|
-
[CaptchaType.frictionless]: 0
|
|
74
|
-
};
|
|
75
72
|
var ruleHarshness = (rule) => {
|
|
76
73
|
if (rule.type === AccessPolicyType.Block) return Number.MAX_SAFE_INTEGER;
|
|
77
|
-
|
|
78
|
-
return CAPTCHA_TYPE_HARSHNESS[rule.captchaType] + (rule.solvedImagesCount ?? 0);
|
|
74
|
+
return captchaPolicySeverity(rule);
|
|
79
75
|
};
|
|
80
76
|
/**
|
|
81
77
|
* Rank the candidate rules a single Redis query returned. A rule "applies" iff
|
|
@@ -253,7 +249,8 @@ var BlacklistRequestInspector = class {
|
|
|
253
249
|
userAgent,
|
|
254
250
|
countryCode: ctx.countryCode,
|
|
255
251
|
asn: ctx.asn,
|
|
256
|
-
os: classifyOs(userAgent)
|
|
252
|
+
os: classifyOs(userAgent),
|
|
253
|
+
browser: classifyBrowser(userAgent)
|
|
257
254
|
}
|
|
258
255
|
}
|
|
259
256
|
}));
|