@prosopo/cli 3.6.75 → 3.6.77
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/cli@3.6.
|
|
2
|
+
> @prosopo/cli@3.6.77 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -90,4 +90,4 @@ dist/cjs/RateLimiter.cjs 5.41 kB │ gzip: 0.84 kB
|
|
|
90
90
|
[38;5;240m │[0m ╰─────── This `import.meta` will be replaced with an empty object (`{}`) automatically. If this is desired, you can suppress this warning by adding `transform.define: { 'import.meta': {} }`. If `import.meta` needs to be kept as-is, you need to set the output format to `esm`.
|
|
91
91
|
[38;5;246m────╯[0m
|
|
92
92
|
[39m
|
|
93
|
-
[32m✓ built in
|
|
93
|
+
[32m✓ built in 51ms[39m
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/cli@3.6.
|
|
2
|
+
> @prosopo/cli@3.6.77 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
11:41:35 PM - Projects in this build:
|
|
6
6
|
* ../../dev/config/tsconfig.json
|
|
7
7
|
* ../locale/tsconfig.json
|
|
8
8
|
* ../util/tsconfig.json
|
|
@@ -28,53 +28,53 @@
|
|
|
28
28
|
* ../../dev/workspace/tsconfig.json
|
|
29
29
|
* tsconfig.json
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
11:41:35 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'
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
11:41:35 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
11:41:35 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
11:41:35 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'
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
11:41:35 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
11:41:35 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
11:41:35 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
11:41:35 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
11:41:35 PM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/env.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
11:41:35 PM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/IpInfoService.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
11:41:35 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'
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
11:41:35 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'
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
11:41:35 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/transformRule.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
11:41:35 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'
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
11:41:35 PM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/mongoGlobalSetup.ts' is older than output '../database/tsconfig.tsbuildinfo'
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
11:41:35 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
11:41:35 PM - Project '../types-env/tsconfig.json' is up to date because newest input '../types-env/src/env.ts' is older than output '../types-env/tsconfig.tsbuildinfo'
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
11:41:36 PM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/index.ts' is older than output '../env/tsconfig.tsbuildinfo'
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
11:41:36 PM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/middlewares/requestLoggerMiddleware.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
11:41:36 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/dataset.unit.test.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
11:41:36 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
11:41:36 PM - Project '../provider/tsconfig.json' is up to date because newest input '../provider/src/util.ts' is older than output '../provider/tsconfig.tsbuildinfo'
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
11:41:36 PM - Project '../../dev/workspace/tsconfig.json' is up to date because newest input '../../dev/workspace/src/index.ts' is older than output '../../dev/workspace/tsconfig.tsbuildinfo'
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
11:41:36 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
11:41:36 PM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
|
|
80
80
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/cli@3.6.
|
|
2
|
+
> @prosopo/cli@3.6.77 build
|
|
3
3
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/cli@3.6.
|
|
6
|
+
> @prosopo/cli@3.6.77 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
@@ -86,4 +86,4 @@ dist/commands/siteKeyRegister.js 3.30 kB │ gzip: 1.14 kB
|
|
|
86
86
|
dist/prosopo.config.js 4.43 kB │ gzip: 1.47 kB
|
|
87
87
|
dist/RateLimiter.js 5.00 kB │ gzip: 0.84 kB
|
|
88
88
|
|
|
89
|
-
[32m✓ built in
|
|
89
|
+
[32m✓ built in 56ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @prosopo/cli
|
|
2
2
|
|
|
3
|
+
## 3.6.77
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- Updated dependencies [71a5952]
|
|
7
|
+
- Updated dependencies [a66273a]
|
|
8
|
+
- @prosopo/keyring@2.9.62
|
|
9
|
+
- @prosopo/provider@4.15.17
|
|
10
|
+
- @prosopo/env@3.6.22
|
|
11
|
+
|
|
12
|
+
## 3.6.76
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [1e0cf14]
|
|
16
|
+
- @prosopo/api@3.5.21
|
|
17
|
+
- @prosopo/provider@4.15.16
|
|
18
|
+
- @prosopo/env@3.6.21
|
|
19
|
+
|
|
3
20
|
## 3.6.75
|
|
4
21
|
### Patch Changes
|
|
5
22
|
|
|
@@ -1152,7 +1152,7 @@ function Jt(e, t, n) {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
//#endregion
|
|
1154
1154
|
//#region ../util/dist/version.js
|
|
1155
|
-
var Yt = (typeof process < "u" ? "3.6.
|
|
1155
|
+
var Yt = (typeof process < "u" ? "3.6.77" : void 0) || "dev", Xt = Array(256), Zt = Array(256 * 256);
|
|
1156
1156
|
for (let e = 0; e < 256; e++) Xt[e] = e.toString(16).padStart(2, "0");
|
|
1157
1157
|
for (let e = 0; e < 256; e++) {
|
|
1158
1158
|
let t = e << 8;
|
|
@@ -51428,12 +51428,18 @@ var LF = (e) => typeof e == "object" && !!e && "_bsontype" in e && e._bsontype =
|
|
|
51428
51428
|
async saveCaptchas(t, n, r, i = []) {
|
|
51429
51429
|
if (await this.connect(), t.length) {
|
|
51430
51430
|
let n = await this.tables.session.bulkWrite(t.map((t) => {
|
|
51431
|
-
let { _id: n, ...r } = t;
|
|
51432
|
-
return {
|
|
51431
|
+
let { _id: n, ...r } = t, i = e.normaliseDocCompositeIps(r);
|
|
51432
|
+
return { updateOne: {
|
|
51433
|
+
filter: { sessionId: i.sessionId },
|
|
51434
|
+
update: { $set: i },
|
|
51435
|
+
upsert: !0
|
|
51436
|
+
} };
|
|
51433
51437
|
}));
|
|
51434
51438
|
RF.info(() => ({
|
|
51435
51439
|
data: {
|
|
51436
|
-
|
|
51440
|
+
upsertedCount: n.upsertedCount,
|
|
51441
|
+
matchedCount: n.matchedCount,
|
|
51442
|
+
modifiedCount: n.modifiedCount,
|
|
51437
51443
|
totalProcessed: t.length
|
|
51438
51444
|
},
|
|
51439
51445
|
msg: "Mongo Saved Session Events"
|
|
@@ -75739,8 +75745,8 @@ var G2 = async (e, t) => {
|
|
|
75739
75745
|
i18n: n.i18n,
|
|
75740
75746
|
logger: n.logger
|
|
75741
75747
|
}));
|
|
75742
|
-
let c = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, h = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, g = XZ(de(n.headers), n.ja4, o, l,
|
|
75743
|
-
if (!
|
|
75748
|
+
let c = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, h = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, g = d ? await m.db.getSessionRecordBySessionId(d) : void 0, _ = XZ(de(n.headers), n.ja4, o, l, g?.decryptedHeadHash, void 0, c, h), v = (await m.imgCaptchaManager.getPrioritisedAccessPolicies(t, u, _)).find((e) => !e.deferToVerify), { valid: y, reason: b, sessionId: x, solvedImagesCount: S } = await m.imgCaptchaManager.isValidRequest(a, Zp.image, e, d, v, o);
|
|
75749
|
+
if (!y) return i(new Ep(b || "API.BAD_REQUEST", {
|
|
75744
75750
|
context: {
|
|
75745
75751
|
code: 400,
|
|
75746
75752
|
siteKey: u,
|
|
@@ -75749,38 +75755,38 @@ var G2 = async (e, t) => {
|
|
|
75749
75755
|
i18n: n.i18n,
|
|
75750
75756
|
logger: n.logger
|
|
75751
75757
|
}));
|
|
75752
|
-
let
|
|
75753
|
-
solved: { count: Math.min(
|
|
75754
|
-
unsolved: { count:
|
|
75758
|
+
let C = {
|
|
75759
|
+
solved: { count: Math.min(S || v?.solvedImagesCount || e.config.captchas.solved.count, a.settings.imageMaxRounds ?? 32) },
|
|
75760
|
+
unsolved: { count: v?.unsolvedImagesCount || e.config.captchas.unsolved.count }
|
|
75755
75761
|
};
|
|
75756
|
-
|
|
75762
|
+
x && f && await m.frictionlessManager.decryptAndAttachSimdReadingsIfAbsent(x, f, vg.challenge).catch((e) => {
|
|
75757
75763
|
n.logger.warn(() => ({
|
|
75758
75764
|
err: e,
|
|
75759
75765
|
msg: "Failed to patch session with SIMD readings on image challenge"
|
|
75760
75766
|
}));
|
|
75761
75767
|
});
|
|
75762
|
-
let
|
|
75768
|
+
let w = await m.imgCaptchaManager.getRandomCaptchasAndRequestHash(p, l, s, C, a.settings.imageThreshold ?? .8, x, n.ipInfo), T = {
|
|
75763
75769
|
[X.status]: "ok",
|
|
75764
|
-
[X.captchas]:
|
|
75770
|
+
[X.captchas]: w.captchas.map((t) => ({
|
|
75765
75771
|
...t,
|
|
75766
75772
|
target: n.t(`TARGET.${t.target}`),
|
|
75767
75773
|
items: t.items.map((t) => f0(t, e.assetsResolver))
|
|
75768
75774
|
})),
|
|
75769
|
-
[X.requestHash]:
|
|
75770
|
-
[X.timestamp]:
|
|
75771
|
-
[X.signature]: { [X.provider]: { [X.requestHash]:
|
|
75775
|
+
[X.requestHash]: w.requestHash,
|
|
75776
|
+
[X.timestamp]: w.timestamp.toString(),
|
|
75777
|
+
[X.signature]: { [X.provider]: { [X.requestHash]: w.signedRequestHash } }
|
|
75772
75778
|
};
|
|
75773
75779
|
return n.logger.info(() => ({
|
|
75774
75780
|
msg: "Image captcha challenge issued",
|
|
75775
75781
|
data: {
|
|
75776
75782
|
captchaType: Zp.image,
|
|
75777
|
-
requestHash:
|
|
75778
|
-
solvedImagesCount:
|
|
75783
|
+
requestHash: w.requestHash,
|
|
75784
|
+
solvedImagesCount: C.solved.count,
|
|
75779
75785
|
user: l,
|
|
75780
75786
|
dapp: u,
|
|
75781
75787
|
sessionId: d
|
|
75782
75788
|
}
|
|
75783
|
-
})), LZ(Zp.image), r.json(
|
|
75789
|
+
})), LZ(Zp.image), r.json(T);
|
|
75784
75790
|
} catch (e) {
|
|
75785
75791
|
return RZ(Zp.image), n.logger.error(() => ({
|
|
75786
75792
|
err: e,
|
|
@@ -75832,8 +75838,8 @@ var G2 = async (e, t) => {
|
|
|
75832
75838
|
}));
|
|
75833
75839
|
let d = y2(n.ip, n.logger);
|
|
75834
75840
|
d || n.logger.warn(() => ({ msg: "Request missing IP; geoblocking will be skipped" }));
|
|
75835
|
-
let f = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, p = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, m = XZ(de(n.headers), n.ja4, d, o,
|
|
75836
|
-
if (!
|
|
75841
|
+
let f = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, p = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, m = c ? await u.db.getSessionRecordBySessionId(c) : void 0, h = XZ(de(n.headers), n.ja4, d, o, m?.decryptedHeadHash, void 0, f, p), g = (await u.powCaptchaManager.getPrioritisedAccessPolicies(t, s, h)).find((e) => !e.deferToVerify), { valid: _, reason: v, sessionId: y, powDifficulty: b } = await u.powCaptchaManager.isValidRequest(a, Zp.pow, e, c, g, d);
|
|
75842
|
+
if (!_) return i(new Ep(v || "API.BAD_REQUEST", {
|
|
75837
75843
|
context: {
|
|
75838
75844
|
code: 400,
|
|
75839
75845
|
siteKey: s,
|
|
@@ -75842,8 +75848,8 @@ var G2 = async (e, t) => {
|
|
|
75842
75848
|
i18n: n.i18n,
|
|
75843
75849
|
logger: n.logger
|
|
75844
75850
|
}));
|
|
75845
|
-
let
|
|
75846
|
-
if (!
|
|
75851
|
+
let x = n.headers.origin;
|
|
75852
|
+
if (!x) return i(new Ep("API.BAD_REQUEST", {
|
|
75847
75853
|
context: {
|
|
75848
75854
|
error: "Origin header not found",
|
|
75849
75855
|
code: 400,
|
|
@@ -75853,35 +75859,35 @@ var G2 = async (e, t) => {
|
|
|
75853
75859
|
i18n: n.i18n,
|
|
75854
75860
|
logger: n.logger
|
|
75855
75861
|
}));
|
|
75856
|
-
let
|
|
75857
|
-
|
|
75862
|
+
let S = b || g?.powDifficulty || a?.settings?.powDifficulty, C = await u.powCaptchaManager.getPowCaptchaChallenge(o, s, x, S);
|
|
75863
|
+
y && l && await u.frictionlessManager.decryptAndAttachSimdReadingsIfAbsent(y, l, vg.challenge).catch((e) => {
|
|
75858
75864
|
n.logger.warn(() => ({
|
|
75859
75865
|
err: e,
|
|
75860
75866
|
msg: "Failed to patch session with SIMD readings on PoW challenge"
|
|
75861
75867
|
}));
|
|
75862
|
-
}), await u.db.storePowCaptchaRecord(
|
|
75863
|
-
requestedAtTimestamp:
|
|
75868
|
+
}), await u.db.storePowCaptchaRecord(C.challenge, {
|
|
75869
|
+
requestedAtTimestamp: C.requestedAtTimestamp,
|
|
75864
75870
|
userAccount: o,
|
|
75865
75871
|
dappAccount: s
|
|
75866
|
-
},
|
|
75867
|
-
let
|
|
75872
|
+
}, C.difficulty, C.providerSignature, zq(d), de(n.headers), n.ja4, y, void 0, void 0, void 0, n.ipInfo);
|
|
75873
|
+
let w = {
|
|
75868
75874
|
[X.status]: "ok",
|
|
75869
|
-
[X.challenge]:
|
|
75870
|
-
[X.difficulty]:
|
|
75871
|
-
[X.timestamp]:
|
|
75872
|
-
[X.signature]: { [X.provider]: { [X.challenge]:
|
|
75875
|
+
[X.challenge]: C.challenge,
|
|
75876
|
+
[X.difficulty]: C.difficulty,
|
|
75877
|
+
[X.timestamp]: C.requestedAtTimestamp.toString(),
|
|
75878
|
+
[X.signature]: { [X.provider]: { [X.challenge]: C.providerSignature } }
|
|
75873
75879
|
};
|
|
75874
75880
|
return n.logger.info(() => ({
|
|
75875
75881
|
msg: "PoW captcha challenge issued",
|
|
75876
75882
|
data: {
|
|
75877
75883
|
captchaType: Zp.pow,
|
|
75878
|
-
challenge:
|
|
75879
|
-
difficulty:
|
|
75884
|
+
challenge: C.challenge,
|
|
75885
|
+
difficulty: C.difficulty,
|
|
75880
75886
|
user: o,
|
|
75881
75887
|
dapp: s,
|
|
75882
75888
|
session: c
|
|
75883
75889
|
}
|
|
75884
|
-
})), LZ(Zp.pow), r.json(
|
|
75890
|
+
})), LZ(Zp.pow), r.json(w);
|
|
75885
75891
|
} catch (e) {
|
|
75886
75892
|
return RZ(Zp.pow), n.logger.error(() => ({
|
|
75887
75893
|
err: e,
|
|
@@ -75934,8 +75940,8 @@ var G2 = async (e, t) => {
|
|
|
75934
75940
|
}));
|
|
75935
75941
|
let d = y2(n.ip, n.logger);
|
|
75936
75942
|
d || n.logger.warn(() => ({ msg: "Request missing IP; geoblocking will be skipped" }));
|
|
75937
|
-
let f = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, p = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, m = XZ(de(n.headers), n.ja4, d, o,
|
|
75938
|
-
if (!
|
|
75943
|
+
let f = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.countryCode : void 0, p = n.ipInfo && "isValid" in n.ipInfo && n.ipInfo.isValid ? n.ipInfo.asnNumber : void 0, m = c ? await u.db.getSessionRecordBySessionId(c) : void 0, h = XZ(de(n.headers), n.ja4, d, o, m?.decryptedHeadHash, void 0, f, p), g = (await u.puzzleCaptchaManager.getPrioritisedAccessPolicies(t, s, h)).find((e) => !e.deferToVerify), { valid: _, reason: v, sessionId: y } = await u.puzzleCaptchaManager.isValidRequest(a, Zp.puzzle, e, c, g, d);
|
|
75944
|
+
if (!_) return i(new Ep(v || "API.BAD_REQUEST", {
|
|
75939
75945
|
context: {
|
|
75940
75946
|
code: 400,
|
|
75941
75947
|
siteKey: s,
|
|
@@ -75944,8 +75950,8 @@ var G2 = async (e, t) => {
|
|
|
75944
75950
|
i18n: n.i18n,
|
|
75945
75951
|
logger: n.logger
|
|
75946
75952
|
}));
|
|
75947
|
-
let
|
|
75948
|
-
if (!
|
|
75953
|
+
let b = n.headers.origin;
|
|
75954
|
+
if (!b) return i(new Ep("API.BAD_REQUEST", {
|
|
75949
75955
|
context: {
|
|
75950
75956
|
error: "Origin header not found",
|
|
75951
75957
|
code: 400,
|
|
@@ -75955,39 +75961,39 @@ var G2 = async (e, t) => {
|
|
|
75955
75961
|
i18n: n.i18n,
|
|
75956
75962
|
logger: n.logger
|
|
75957
75963
|
}));
|
|
75958
|
-
let
|
|
75959
|
-
|
|
75964
|
+
let x = a?.settings?.puzzleTolerance, S = await u.puzzleCaptchaManager.getPuzzleCaptchaChallenge(o, s, b, x);
|
|
75965
|
+
y && l && await u.frictionlessManager.decryptAndAttachSimdReadingsIfAbsent(y, l, vg.challenge).catch((e) => {
|
|
75960
75966
|
n.logger.warn(() => ({
|
|
75961
75967
|
err: e,
|
|
75962
75968
|
msg: "Failed to patch session with SIMD readings on puzzle challenge"
|
|
75963
75969
|
}));
|
|
75964
|
-
}), await u.db.storePuzzleCaptchaRecord(
|
|
75965
|
-
requestedAtTimestamp:
|
|
75970
|
+
}), await u.db.storePuzzleCaptchaRecord(S.challenge, {
|
|
75971
|
+
requestedAtTimestamp: S.requestedAtTimestamp,
|
|
75966
75972
|
userAccount: o,
|
|
75967
75973
|
dappAccount: s
|
|
75968
|
-
},
|
|
75969
|
-
let
|
|
75974
|
+
}, S.targetX, S.targetY, S.originX, S.originY, S.tolerance, S.providerSignature, zq(d), de(n.headers), n.ja4, y, n.ipInfo);
|
|
75975
|
+
let C = {
|
|
75970
75976
|
[X.status]: "ok",
|
|
75971
|
-
[X.challenge]:
|
|
75972
|
-
[X.targetX]:
|
|
75973
|
-
[X.targetY]:
|
|
75974
|
-
[X.originX]:
|
|
75975
|
-
[X.originY]:
|
|
75976
|
-
[X.tolerance]:
|
|
75977
|
-
[X.timestamp]:
|
|
75978
|
-
[X.signature]: { [X.provider]: { [X.challenge]:
|
|
75977
|
+
[X.challenge]: S.challenge,
|
|
75978
|
+
[X.targetX]: S.targetX,
|
|
75979
|
+
[X.targetY]: S.targetY,
|
|
75980
|
+
[X.originX]: S.originX,
|
|
75981
|
+
[X.originY]: S.originY,
|
|
75982
|
+
[X.tolerance]: S.tolerance,
|
|
75983
|
+
[X.timestamp]: S.requestedAtTimestamp.toString(),
|
|
75984
|
+
[X.signature]: { [X.provider]: { [X.challenge]: S.providerSignature } }
|
|
75979
75985
|
};
|
|
75980
75986
|
return n.logger.info(() => ({
|
|
75981
75987
|
msg: "Puzzle captcha challenge issued",
|
|
75982
75988
|
data: {
|
|
75983
75989
|
captchaType: Zp.puzzle,
|
|
75984
|
-
challenge:
|
|
75985
|
-
tolerance:
|
|
75990
|
+
challenge: S.challenge,
|
|
75991
|
+
tolerance: S.tolerance,
|
|
75986
75992
|
user: o,
|
|
75987
75993
|
dapp: s,
|
|
75988
75994
|
session: c
|
|
75989
75995
|
}
|
|
75990
|
-
})), LZ(Zp.puzzle), r.json(
|
|
75996
|
+
})), LZ(Zp.puzzle), r.json(C);
|
|
75991
75997
|
} catch (e) {
|
|
75992
75998
|
return RZ(Zp.puzzle), n.logger.error(() => ({
|
|
75993
75999
|
err: e,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/cli",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.77",
|
|
4
4
|
"description": "CLI for Prosopo Provider",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@polkadot/types-codec": "16.4.9",
|
|
35
|
-
"@prosopo/api": "3.5.
|
|
35
|
+
"@prosopo/api": "3.5.21",
|
|
36
36
|
"@prosopo/common": "3.1.48",
|
|
37
37
|
"@prosopo/logger": "2.0.4",
|
|
38
38
|
"@prosopo/dotenv": "3.0.50",
|
|
39
|
-
"@prosopo/env": "3.6.
|
|
40
|
-
"@prosopo/keyring": "2.9.
|
|
39
|
+
"@prosopo/env": "3.6.22",
|
|
40
|
+
"@prosopo/keyring": "2.9.62",
|
|
41
41
|
"@prosopo/locale": "3.2.8",
|
|
42
|
-
"@prosopo/provider": "4.15.
|
|
42
|
+
"@prosopo/provider": "4.15.17",
|
|
43
43
|
"@prosopo/types": "4.10.0",
|
|
44
44
|
"@prosopo/util": "3.3.5",
|
|
45
45
|
"@prosopo/workspace": "3.2.0",
|