@prosopo/provider 3.13.0 → 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 +120 -0
- package/dist/api/captcha/contextAwareValidation.js +20 -0
- package/dist/api/captcha/getFrictionlessCaptchaChallenge.js +83 -55
- package/dist/cjs/api/captcha/contextAwareValidation.cjs +20 -0
- package/dist/cjs/api/captcha/getFrictionlessCaptchaChallenge.cjs +82 -54
- package/dist/cjs/tasks/client/clientTasks.cjs +72 -8
- package/dist/cjs/tasks/detection/decodePayload.cjs +731 -385
- package/dist/cjs/tasks/frictionless/frictionlessTasks.cjs +9 -4
- package/dist/cjs/tasks/frictionless/frictionlessTasksUtils.cjs +4 -1
- package/dist/tasks/client/clientTasks.js +73 -9
- package/dist/tasks/detection/decodePayload.js +731 -385
- package/dist/tasks/detection/getBotScore.js +2 -2
- package/dist/tasks/frictionless/frictionlessTasks.js +9 -4
- package/dist/tasks/frictionless/frictionlessTasksUtils.js +4 -1
- package/package.json +20 -20
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EgQSunX from "./decodePayload.js";
|
|
2
2
|
const DEFAULT_ENTROPY = 13837;
|
|
3
3
|
const getBotScore = async (payload, headHash, privateKeyString) => {
|
|
4
|
-
const result = await
|
|
4
|
+
const result = await EgQSunX(
|
|
5
5
|
payload,
|
|
6
6
|
headHash,
|
|
7
7
|
privateKeyString
|
|
@@ -247,6 +247,7 @@ class FrictionlessManager extends CaptchaManager {
|
|
|
247
247
|
let webView;
|
|
248
248
|
let iFrame;
|
|
249
249
|
let decryptedHeadHash = "";
|
|
250
|
+
let decryptionFailed = false;
|
|
250
251
|
for (const [keyIndex, key] of decryptKeys.entries()) {
|
|
251
252
|
try {
|
|
252
253
|
this.logger.info(() => ({
|
|
@@ -294,6 +295,7 @@ class FrictionlessManager extends CaptchaManager {
|
|
|
294
295
|
timestamp = 0;
|
|
295
296
|
providerSelectEntropy = DEFAULT_ENTROPY + 1;
|
|
296
297
|
decryptedHeadHash = "";
|
|
298
|
+
decryptionFailed = true;
|
|
297
299
|
}
|
|
298
300
|
}
|
|
299
301
|
}
|
|
@@ -309,6 +311,7 @@ class FrictionlessManager extends CaptchaManager {
|
|
|
309
311
|
timestamp = 0;
|
|
310
312
|
providerSelectEntropy = DEFAULT_ENTROPY - undefinedCount;
|
|
311
313
|
decryptedHeadHash = "";
|
|
314
|
+
decryptionFailed = true;
|
|
312
315
|
}
|
|
313
316
|
this.logger.info(() => ({
|
|
314
317
|
msg: "decryptPayload result",
|
|
@@ -320,7 +323,8 @@ class FrictionlessManager extends CaptchaManager {
|
|
|
320
323
|
userAgent,
|
|
321
324
|
webView,
|
|
322
325
|
iFrame,
|
|
323
|
-
decryptedHeadHash
|
|
326
|
+
decryptedHeadHash,
|
|
327
|
+
decryptionFailed
|
|
324
328
|
}
|
|
325
329
|
}));
|
|
326
330
|
return {
|
|
@@ -331,11 +335,12 @@ class FrictionlessManager extends CaptchaManager {
|
|
|
331
335
|
userAgent,
|
|
332
336
|
webView: webView || false,
|
|
333
337
|
iFrame: iFrame || false,
|
|
334
|
-
decryptedHeadHash
|
|
338
|
+
decryptedHeadHash,
|
|
339
|
+
decryptionFailed
|
|
335
340
|
};
|
|
336
341
|
}
|
|
337
|
-
async
|
|
338
|
-
return this.db.
|
|
342
|
+
async getClientContextEntropy(siteKey, contextType) {
|
|
343
|
+
return this.db.getClientContextEntropy(siteKey, contextType);
|
|
339
344
|
}
|
|
340
345
|
}
|
|
341
346
|
export {
|
|
@@ -6,7 +6,10 @@ const computeFrictionlessScore = (scoreComponents) => {
|
|
|
6
6
|
).toFixed(2)
|
|
7
7
|
);
|
|
8
8
|
};
|
|
9
|
-
const timestampDecayFunction = (timestamp) => {
|
|
9
|
+
const timestampDecayFunction = (timestamp, decryptionFailed) => {
|
|
10
|
+
if (decryptionFailed) {
|
|
11
|
+
return 6;
|
|
12
|
+
}
|
|
10
13
|
const max = (/* @__PURE__ */ new Date()).getTime();
|
|
11
14
|
if (max - timestamp > 36e5) {
|
|
12
15
|
return 12;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/provider",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.7",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "
|
|
9
|
-
"npm": "
|
|
8
|
+
"node": "^24",
|
|
9
|
+
"npm": "^11"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
|
|
@@ -22,23 +22,22 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@noble/hashes": "1.8.0",
|
|
24
24
|
"@polkadot/util": "13.5.7",
|
|
25
|
-
"@prosopo/api": "3.1.
|
|
26
|
-
"@prosopo/api-express-router": "3.0.
|
|
27
|
-
"@prosopo/api-route": "2.6.
|
|
28
|
-
"@prosopo/common": "3.1.
|
|
29
|
-
"@prosopo/
|
|
30
|
-
"@prosopo/
|
|
31
|
-
"@prosopo/
|
|
32
|
-
"@prosopo/
|
|
33
|
-
"@prosopo/
|
|
34
|
-
"@prosopo/
|
|
35
|
-
"@prosopo/
|
|
36
|
-
"@prosopo/types": "
|
|
37
|
-
"@prosopo/types-
|
|
38
|
-
"@prosopo/
|
|
39
|
-
"@prosopo/
|
|
40
|
-
"@prosopo/util": "
|
|
41
|
-
"@prosopo/util-crypto": "13.5.24",
|
|
25
|
+
"@prosopo/api": "3.1.37",
|
|
26
|
+
"@prosopo/api-express-router": "3.0.40",
|
|
27
|
+
"@prosopo/api-route": "2.6.34",
|
|
28
|
+
"@prosopo/common": "3.1.26",
|
|
29
|
+
"@prosopo/database": "3.5.6",
|
|
30
|
+
"@prosopo/datasets": "3.0.49",
|
|
31
|
+
"@prosopo/env": "3.2.28",
|
|
32
|
+
"@prosopo/keyring": "2.8.40",
|
|
33
|
+
"@prosopo/load-balancer": "2.8.13",
|
|
34
|
+
"@prosopo/locale": "3.1.26",
|
|
35
|
+
"@prosopo/types": "3.6.4",
|
|
36
|
+
"@prosopo/types-database": "4.0.6",
|
|
37
|
+
"@prosopo/types-env": "2.7.53",
|
|
38
|
+
"@prosopo/user-access-policy": "3.5.32",
|
|
39
|
+
"@prosopo/util": "3.2.4",
|
|
40
|
+
"@prosopo/util-crypto": "13.5.28",
|
|
42
41
|
"cron": "3.1.7",
|
|
43
42
|
"express": "4.21.2",
|
|
44
43
|
"geolib": "3.3.4",
|
|
@@ -50,6 +49,7 @@
|
|
|
50
49
|
"zod": "3.23.8"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
52
|
+
"@prosopo/config": "3.1.26",
|
|
53
53
|
"@types/node": "22.5.5",
|
|
54
54
|
"@types/uuid": "10.0.0",
|
|
55
55
|
"@vitest/coverage-v8": "3.2.4",
|