@prosopo/procaptcha-frictionless 2.22.3 → 2.23.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 +2 -2
- package/.turbo/turbo-build$colon$esm.log +3 -3
- package/.turbo/turbo-build$colon$tsc.log +25 -25
- package/CHANGELOG.md +39 -0
- package/dist/cjs/customDetectBot.cjs +15 -18
- package/dist/esm/customDetectBot.js +15 -19
- package/dist/tsc/customDetectBot.d.ts +2 -1
- package/dist/tsc/customDetectBot.d.ts.map +1 -1
- package/dist/tsc/customDetectBot.js +20 -26
- package/dist/tsc/customDetectBot.js.map +1 -1
- package/dist/tsc/tests/dnsBeacons.test.d.ts +2 -0
- package/dist/tsc/tests/dnsBeacons.test.d.ts.map +1 -0
- package/dist/tsc/tests/dnsBeacons.test.js +51 -0
- package/dist/tsc/tests/dnsBeacons.test.js.map +1 -0
- package/dist/types/customDetectBot.d.ts +2 -1
- package/dist/types/customDetectBot.d.ts.map +1 -1
- package/dist/types/tests/dnsBeacons.test.d.ts +2 -0
- package/dist/types/tests/dnsBeacons.test.d.ts.map +1 -0
- package/package.json +10 -10
|
@@ -64,7 +64,7 @@ dist/cjs/sessionInvalidatedRecovery.cjs 2.50 kB │ gzip: 1.14 kB
|
|
|
64
64
|
dist/cjs/frictionlessResultGuard.cjs 2.78 kB │ gzip: 1.42 kB
|
|
65
65
|
dist/cjs/detectorPrefetch.cjs 3.59 kB │ gzip: 1.57 kB
|
|
66
66
|
dist/cjs/authenticatedBadge.cjs 3.81 kB │ gzip: 1.45 kB
|
|
67
|
-
dist/cjs/customDetectBot.cjs 6.
|
|
67
|
+
dist/cjs/customDetectBot.cjs 6.96 kB │ gzip: 2.09 kB
|
|
68
68
|
dist/cjs/procaptchaFrictionless.cjs 14.20 kB │ gzip: 3.90 kB
|
|
69
69
|
|
|
70
|
-
[32m✓ built in
|
|
70
|
+
[32m✓ built in 49ms[39m
|
|
@@ -25,6 +25,7 @@ ViteEsmConfig: .
|
|
|
25
25
|
'/home/runner/work/captcha/captcha/packages/logger/tsconfig.json'
|
|
26
26
|
]
|
|
27
27
|
}
|
|
28
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
28
29
|
{
|
|
29
30
|
externals: [
|
|
30
31
|
'@prosopo/api',
|
|
@@ -50,7 +51,6 @@ ViteEsmConfig: .
|
|
|
50
51
|
'@prosopo/logger'
|
|
51
52
|
]
|
|
52
53
|
}
|
|
53
|
-
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
54
54
|
[36mvite v8.1.6 [32mbuilding ssr environment for production...[36m[39m
|
|
55
55
|
Bundle build started
|
|
56
56
|
[2K
|
|
@@ -65,7 +65,7 @@ dist/esm/sessionInvalidatedRecovery.js 2.41 kB │ gzip: 1.13 kB
|
|
|
65
65
|
dist/esm/frictionlessResultGuard.js 2.71 kB │ gzip: 1.41 kB
|
|
66
66
|
dist/esm/authenticatedBadge.js 3.30 kB │ gzip: 1.42 kB
|
|
67
67
|
dist/esm/detectorPrefetch.js 3.46 kB │ gzip: 1.54 kB
|
|
68
|
-
dist/esm/customDetectBot.js 6.
|
|
68
|
+
dist/esm/customDetectBot.js 6.70 kB │ gzip: 2.06 kB
|
|
69
69
|
dist/esm/procaptchaFrictionless.js 13.49 kB │ gzip: 3.87 kB
|
|
70
70
|
|
|
71
|
-
[32m✓ built in
|
|
71
|
+
[32m✓ built in 48ms[39m
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$ tsc --build --verbose
|
|
2
|
-
|
|
2
|
+
10:59:40 AM - Projects in this build:
|
|
3
3
|
* ../../dev/config/tsconfig.json
|
|
4
4
|
* ../util/tsconfig.json
|
|
5
5
|
* ../locale/tsconfig.json
|
|
@@ -24,51 +24,51 @@ $ tsc --build --verbose
|
|
|
24
24
|
* ../procaptcha-react/tsconfig.json
|
|
25
25
|
* tsconfig.json
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
10:59:40 AM - 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/dist/tsc/tsconfig.tsbuildinfo'
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
10:59:40 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/dist/tsc/tsconfig.tsbuildinfo'
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
10:59:40 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/dist/tsc/tsconfig.tsbuildinfo'
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
10:59:40 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/dist/tsc/tsconfig.tsbuildinfo'
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
10:59:40 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/types.test-d.ts' is older than output '../types/dist/tsc/tsconfig.tsbuildinfo'
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
10:59:40 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/dist/tsc/tsconfig.tsbuildinfo'
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
10:59:40 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/objectUtils.unit.test.ts' is older than output '../common/dist/tsc/tsconfig.tsbuildinfo'
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
10:59:40 AM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/dist/tsc/tsconfig.tsbuildinfo'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
10:59:40 AM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.test.ts' is older than output '../fingerprint/dist/tsc/tsconfig.tsbuildinfo'
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
10:59:40 AM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/dist/tsc/tsconfig.tsbuildinfo'
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
10:59:40 AM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/webComponent/createWidget.ts' is older than output '../widget-skeleton/dist/tsc/tsconfig.tsbuildinfo'
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
10:59:40 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.test.ts' is older than output '../keyring/dist/tsc/tsconfig.tsbuildinfo'
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
10:59:40 AM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/workers/cryptoWorker.ts' is older than output '../account/dist/tsc/tsconfig.tsbuildinfo'
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
10:59:40 AM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/usageBeacon.ts' is older than output '../procaptcha-common/dist/tsc/tsconfig.tsbuildinfo'
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
10:59:40 AM - Project '../procaptcha-audio/tsconfig.json' is up to date because newest input '../procaptcha-audio/src/errorSites.ts' is older than output '../procaptcha-audio/dist/tsc/tsconfig.tsbuildinfo'
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
10:59:40 AM - Project '../procaptcha-icon-order/tsconfig.json' is up to date because newest input '../procaptcha-icon-order/src/tests/iconOrderCanvas.unit.test.ts' is older than output '../procaptcha-icon-order/dist/tsc/tsconfig.tsbuildinfo'
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
10:59:40 AM - Project '../procaptcha-pow/tsconfig.json' is up to date because newest input '../procaptcha-pow/src/custom.d.ts' is older than output '../procaptcha-pow/dist/tsc/tsconfig.tsbuildinfo'
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
10:59:40 AM - Project '../procaptcha-puzzle/tsconfig.json' is up to date because newest input '../procaptcha-puzzle/src/tests/invisibleCanvasVisibility.unit.test.ts' is older than output '../procaptcha-puzzle/dist/tsc/tsconfig.tsbuildinfo'
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
10:59:40 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/logger.ts' is older than output '../logger/dist/tsc/tsconfig.tsbuildinfo'
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
10:59:40 AM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/captcha.unit.test.ts' is older than output '../datasets/dist/tsc/tsconfig.tsbuildinfo'
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
10:59:40 AM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/index.ts' is older than output '../procaptcha/dist/tsc/tsconfig.tsbuildinfo'
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
10:59:40 AM - Project '../procaptcha-react/tsconfig.json' is up to date because newest input '../procaptcha-react/src/errorSites.ts' is older than output '../procaptcha-react/dist/tsc/tsconfig.tsbuildinfo'
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
10:59:40 AM - Project 'tsconfig.json' is out of date because output file 'dist/tsc/tsconfig.tsbuildinfo' does not exist
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
10:59:40 AM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-frictionless/tsconfig.json'...
|
|
74
74
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @prosopo/procaptcha-frictionless
|
|
2
2
|
|
|
3
|
+
## 2.23.0
|
|
4
|
+
### Minor Changes
|
|
5
|
+
|
|
6
|
+
- ae0fc8d: The frictionless response carries a second observation URL, `dns_asset_url`, on the same per-session host as `dns_url`. The widget loads it as an image after sending the existing `dns_url` request.
|
|
7
|
+
|
|
8
|
+
The DNS sidecar reports the hit like any other. The provider recognises the asset URL's path and records `dnsEvent.assetSeen: true` on the session, leaving the main beacon's `peerIp` and `pathValid` untouched. The sidecar needs no change.
|
|
9
|
+
|
|
10
|
+
The two beacon requests now go through one function in the widget, instead of the same `fetch` being copied in two places.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [ae0fc8d]
|
|
15
|
+
- Updated dependencies [77fdb57]
|
|
16
|
+
- @prosopo/types@5.23.0
|
|
17
|
+
- @prosopo/api@4.8.5
|
|
18
|
+
- @prosopo/common@3.3.2
|
|
19
|
+
- @prosopo/fingerprint@2.8.9
|
|
20
|
+
- @prosopo/procaptcha-audio@0.2.16
|
|
21
|
+
- @prosopo/procaptcha-common@2.22.3
|
|
22
|
+
- @prosopo/procaptcha-icon-order@0.2.16
|
|
23
|
+
- @prosopo/procaptcha-pow@2.14.5
|
|
24
|
+
- @prosopo/procaptcha-puzzle@2.17.15
|
|
25
|
+
- @prosopo/procaptcha-react@2.14.16
|
|
26
|
+
|
|
27
|
+
## 2.22.4
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [8bf0957]
|
|
31
|
+
- @prosopo/types@5.22.0
|
|
32
|
+
- @prosopo/api@4.8.4
|
|
33
|
+
- @prosopo/common@3.3.2
|
|
34
|
+
- @prosopo/fingerprint@2.8.8
|
|
35
|
+
- @prosopo/procaptcha-audio@0.2.15
|
|
36
|
+
- @prosopo/procaptcha-common@2.22.2
|
|
37
|
+
- @prosopo/procaptcha-icon-order@0.2.15
|
|
38
|
+
- @prosopo/procaptcha-pow@2.14.4
|
|
39
|
+
- @prosopo/procaptcha-puzzle@2.17.14
|
|
40
|
+
- @prosopo/procaptcha-react@2.14.15
|
|
41
|
+
|
|
3
42
|
## 2.22.3
|
|
4
43
|
### Patch Changes
|
|
5
44
|
|
|
@@ -49,6 +49,18 @@ var getCurrentPageUrls = () => {
|
|
|
49
49
|
iframeUrl: local
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
+
var sendDnsBeacons = ({ dns_url, dns_asset_url }) => {
|
|
53
|
+
try {
|
|
54
|
+
if (dns_url) fetch(dns_url, {
|
|
55
|
+
method: "GET",
|
|
56
|
+
mode: "no-cors",
|
|
57
|
+
credentials: "omit",
|
|
58
|
+
keepalive: true,
|
|
59
|
+
cache: "no-store"
|
|
60
|
+
}).catch(() => void 0);
|
|
61
|
+
if (dns_asset_url && typeof Image === "function") new Image().src = dns_asset_url;
|
|
62
|
+
} catch {}
|
|
63
|
+
};
|
|
52
64
|
var withTimeout = async (promise, ms) => {
|
|
53
65
|
let timeoutId;
|
|
54
66
|
const timeoutPromise = new Promise((_, reject) => {
|
|
@@ -117,15 +129,7 @@ var customDetectBot = async (config, container, restartFn, retryContext, refresh
|
|
|
117
129
|
const { currentUrl: fallbackUrl, iframeUrl: fallbackIframeUrl } = getCurrentPageUrls();
|
|
118
130
|
const fallbackFingerprintProof = await fingerprintProofIfReady();
|
|
119
131
|
const captcha = await withTimeout(providerApi.getFrictionlessCaptcha(void 0, void 0, config.account.address, userAccount.account.address, config.mode, void 0, void 0, fallbackUrl, fallbackIframeUrl, clientSessionId, refreshOf, switchToImage, fallbackFingerprintProof, widgetSlot), 1e4);
|
|
120
|
-
|
|
121
|
-
fetch(captcha.dns_url, {
|
|
122
|
-
method: "GET",
|
|
123
|
-
mode: "no-cors",
|
|
124
|
-
credentials: "omit",
|
|
125
|
-
keepalive: true,
|
|
126
|
-
cache: "no-store"
|
|
127
|
-
}).catch(() => void 0);
|
|
128
|
-
} catch {}
|
|
132
|
+
sendDnsBeacons(captcha);
|
|
129
133
|
return {
|
|
130
134
|
captchaType: captcha.captchaType,
|
|
131
135
|
sessionId: captcha.sessionId,
|
|
@@ -145,15 +149,7 @@ var customDetectBot = async (config, container, restartFn, retryContext, refresh
|
|
|
145
149
|
const captchaPromise = providerApi.getFrictionlessCaptcha(detectionResult.token, detectionResult.encryptHeadHash, config.account.address, userAccount.account.address, config.mode, void 0, detectorSessionId, currentUrl, iframeUrl, clientSessionId, refreshOf, switchToImage, fingerprintProof, widgetSlot);
|
|
146
150
|
if (detectionResult.getSimdReadings) detectionResult.getSimdReadings(6e4).catch(() => void 0);
|
|
147
151
|
const captcha = await withTimeout(captchaPromise, 1e4);
|
|
148
|
-
|
|
149
|
-
fetch(captcha.dns_url, {
|
|
150
|
-
method: "GET",
|
|
151
|
-
mode: "no-cors",
|
|
152
|
-
credentials: "omit",
|
|
153
|
-
keepalive: true,
|
|
154
|
-
cache: "no-store"
|
|
155
|
-
}).catch(() => void 0);
|
|
156
|
-
} catch {}
|
|
152
|
+
sendDnsBeacons(captcha);
|
|
157
153
|
return {
|
|
158
154
|
captchaType: captcha.captchaType,
|
|
159
155
|
sessionId: captcha.sessionId,
|
|
@@ -176,4 +172,5 @@ var customDetectBot = async (config, container, restartFn, retryContext, refresh
|
|
|
176
172
|
};
|
|
177
173
|
//#endregion
|
|
178
174
|
exports.default = customDetectBot;
|
|
175
|
+
exports.sendDnsBeacons = sendDnsBeacons;
|
|
179
176
|
exports.withTimeout = withTimeout;
|
|
@@ -49,6 +49,18 @@ var getCurrentPageUrls = () => {
|
|
|
49
49
|
iframeUrl: local
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
+
var sendDnsBeacons = ({ dns_url, dns_asset_url }) => {
|
|
53
|
+
try {
|
|
54
|
+
if (dns_url) fetch(dns_url, {
|
|
55
|
+
method: "GET",
|
|
56
|
+
mode: "no-cors",
|
|
57
|
+
credentials: "omit",
|
|
58
|
+
keepalive: true,
|
|
59
|
+
cache: "no-store"
|
|
60
|
+
}).catch(() => void 0);
|
|
61
|
+
if (dns_asset_url && typeof Image === "function") new Image().src = dns_asset_url;
|
|
62
|
+
} catch {}
|
|
63
|
+
};
|
|
52
64
|
var withTimeout = async (promise, ms) => {
|
|
53
65
|
let timeoutId;
|
|
54
66
|
const timeoutPromise = new Promise((_, reject) => {
|
|
@@ -116,15 +128,7 @@ var customDetectBot = async (config, container, restartFn, retryContext, refresh
|
|
|
116
128
|
const { currentUrl: fallbackUrl, iframeUrl: fallbackIframeUrl } = getCurrentPageUrls();
|
|
117
129
|
const fallbackFingerprintProof = await fingerprintProofIfReady();
|
|
118
130
|
const captcha = await withTimeout(providerApi.getFrictionlessCaptcha(void 0, void 0, config.account.address, userAccount.account.address, config.mode, void 0, void 0, fallbackUrl, fallbackIframeUrl, clientSessionId, refreshOf, switchToImage, fallbackFingerprintProof, widgetSlot), 1e4);
|
|
119
|
-
|
|
120
|
-
fetch(captcha.dns_url, {
|
|
121
|
-
method: "GET",
|
|
122
|
-
mode: "no-cors",
|
|
123
|
-
credentials: "omit",
|
|
124
|
-
keepalive: true,
|
|
125
|
-
cache: "no-store"
|
|
126
|
-
}).catch(() => void 0);
|
|
127
|
-
} catch {}
|
|
131
|
+
sendDnsBeacons(captcha);
|
|
128
132
|
return {
|
|
129
133
|
captchaType: captcha.captchaType,
|
|
130
134
|
sessionId: captcha.sessionId,
|
|
@@ -144,15 +148,7 @@ var customDetectBot = async (config, container, restartFn, retryContext, refresh
|
|
|
144
148
|
const captchaPromise = providerApi.getFrictionlessCaptcha(detectionResult.token, detectionResult.encryptHeadHash, config.account.address, userAccount.account.address, config.mode, void 0, detectorSessionId, currentUrl, iframeUrl, clientSessionId, refreshOf, switchToImage, fingerprintProof, widgetSlot);
|
|
145
149
|
if (detectionResult.getSimdReadings) detectionResult.getSimdReadings(6e4).catch(() => void 0);
|
|
146
150
|
const captcha = await withTimeout(captchaPromise, 1e4);
|
|
147
|
-
|
|
148
|
-
fetch(captcha.dns_url, {
|
|
149
|
-
method: "GET",
|
|
150
|
-
mode: "no-cors",
|
|
151
|
-
credentials: "omit",
|
|
152
|
-
keepalive: true,
|
|
153
|
-
cache: "no-store"
|
|
154
|
-
}).catch(() => void 0);
|
|
155
|
-
} catch {}
|
|
151
|
+
sendDnsBeacons(captcha);
|
|
156
152
|
return {
|
|
157
153
|
captchaType: captcha.captchaType,
|
|
158
154
|
sessionId: captcha.sessionId,
|
|
@@ -174,4 +170,4 @@ var customDetectBot = async (config, container, restartFn, retryContext, refresh
|
|
|
174
170
|
};
|
|
175
171
|
};
|
|
176
172
|
//#endregion
|
|
177
|
-
export { customDetectBot as default, withTimeout };
|
|
173
|
+
export { customDetectBot as default, sendDnsBeacons, withTimeout };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BotDetectionFunction } from "@prosopo/types";
|
|
1
|
+
import type { BotDetectionFunction, GetFrictionlessCaptchaResponse } from "@prosopo/types";
|
|
2
|
+
export declare const sendDnsBeacons: ({ dns_url, dns_asset_url, }: Pick<GetFrictionlessCaptchaResponse, "dns_url" | "dns_asset_url">) => void;
|
|
2
3
|
export declare const withTimeout: <T>(promise: Promise<T>, ms: number) => Promise<T>;
|
|
3
4
|
declare const customDetectBot: BotDetectionFunction;
|
|
4
5
|
export default customDetectBot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../../src/customDetectBot.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EACX,oBAAoB,
|
|
1
|
+
{"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../../src/customDetectBot.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EACX,oBAAoB,EACpB,8BAA8B,EAG9B,MAAM,gBAAgB,CAAC;AA4FxB,eAAO,MAAM,cAAc,gCAGxB,IAAI,CAAC,8BAA8B,EAAE,SAAS,GAAG,eAAe,CAAC,KAAG,IAiBtE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,CAAC,WACzB,OAAO,CAAC,CAAC,CAAC,MACf,MAAM,KACR,OAAO,CAAC,CAAC,CA0BX,CAAC;AAoBF,QAAA,MAAM,eAAe,EAAE,oBA+OtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -44,6 +44,24 @@ const getCurrentPageUrls = () => {
|
|
|
44
44
|
}
|
|
45
45
|
return { currentUrl: local, iframeUrl: local };
|
|
46
46
|
};
|
|
47
|
+
export const sendDnsBeacons = ({ dns_url, dns_asset_url, }) => {
|
|
48
|
+
try {
|
|
49
|
+
if (dns_url) {
|
|
50
|
+
void fetch(dns_url, {
|
|
51
|
+
method: "GET",
|
|
52
|
+
mode: "no-cors",
|
|
53
|
+
credentials: "omit",
|
|
54
|
+
keepalive: true,
|
|
55
|
+
cache: "no-store",
|
|
56
|
+
}).catch(() => undefined);
|
|
57
|
+
}
|
|
58
|
+
if (dns_asset_url && typeof Image === "function") {
|
|
59
|
+
new Image().src = dns_asset_url;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
}
|
|
64
|
+
};
|
|
47
65
|
export const withTimeout = async (promise, ms) => {
|
|
48
66
|
let timeoutId;
|
|
49
67
|
const timeoutPromise = new Promise((_, reject) => {
|
|
@@ -127,19 +145,7 @@ const customDetectBot = async (config, container, restartFn, retryContext, refre
|
|
|
127
145
|
const { currentUrl: fallbackUrl, iframeUrl: fallbackIframeUrl } = getCurrentPageUrls();
|
|
128
146
|
const fallbackFingerprintProof = await fingerprintProofIfReady();
|
|
129
147
|
const captcha = await withTimeout(providerApi.getFrictionlessCaptcha(undefined, undefined, config.account.address, userAccount.account.address, config.mode, undefined, undefined, fallbackUrl, fallbackIframeUrl, clientSessionId, refreshOf, switchToImage, fallbackFingerprintProof, widgetSlot), 10000);
|
|
130
|
-
|
|
131
|
-
try {
|
|
132
|
-
void fetch(captcha.dns_url, {
|
|
133
|
-
method: "GET",
|
|
134
|
-
mode: "no-cors",
|
|
135
|
-
credentials: "omit",
|
|
136
|
-
keepalive: true,
|
|
137
|
-
cache: "no-store",
|
|
138
|
-
}).catch(() => undefined);
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
}
|
|
142
|
-
}
|
|
148
|
+
sendDnsBeacons(captcha);
|
|
143
149
|
return {
|
|
144
150
|
captchaType: captcha.captchaType,
|
|
145
151
|
sessionId: captcha.sessionId,
|
|
@@ -162,19 +168,7 @@ const customDetectBot = async (config, container, restartFn, retryContext, refre
|
|
|
162
168
|
void detectionResult.getSimdReadings(60_000).catch(() => undefined);
|
|
163
169
|
}
|
|
164
170
|
const captcha = await withTimeout(captchaPromise, 10000);
|
|
165
|
-
|
|
166
|
-
try {
|
|
167
|
-
void fetch(captcha.dns_url, {
|
|
168
|
-
method: "GET",
|
|
169
|
-
mode: "no-cors",
|
|
170
|
-
credentials: "omit",
|
|
171
|
-
keepalive: true,
|
|
172
|
-
cache: "no-store",
|
|
173
|
-
}).catch(() => undefined);
|
|
174
|
-
}
|
|
175
|
-
catch {
|
|
176
|
-
}
|
|
177
|
-
}
|
|
171
|
+
sendDnsBeacons(captcha);
|
|
178
172
|
return {
|
|
179
173
|
captchaType: captcha.captchaType,
|
|
180
174
|
sessionId: captcha.sessionId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customDetectBot.js","sourceRoot":"","sources":["../../src/customDetectBot.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACN,2BAA2B,EAC3B,sBAAsB,EACtB,mBAAmB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,eAAe,EACf,iCAAiC,EACjC,UAAU,EACV,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"customDetectBot.js","sourceRoot":"","sources":["../../src/customDetectBot.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAA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CAAC;IACF,IAAI,eAAe,CAAC,eAAe,EAAE,CAAC;QAGrC,KAAK,eAAe,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IAEzD,cAAc,CAAC,OAAO,CAAC,CAAC;IAExB,OAAO;QACN,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,WAAW,EAAE,WAAW;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,yBAAyB,EAAE,OAAO,CAAC,yBAAyB;QAE5D,kBAAkB,EAAE,eAAe,CAAC,YAAY;QAChD,kBAAkB,EAAE,eAAe,CAAC,YAAY;QAChD,kBAAkB,EAAE,eAAe,CAAC,YAAY;QAChD,kBAAkB,EAAE,eAAe,CAAC,aAAa;QACjD,gBAAgB,EAAE,eAAe,CAAC,eAAe;QACjD,qBAAqB,EAAE,eAAe,CAAC,qBAAqB;QAC5D,kBAAkB,EAAE,eAAe,CAAC,kBAAkB;QACtD,eAAe,EAAE,eAAe,CAAC,eAAe;KAChD,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dnsBeacons.test.d.ts","sourceRoot":"","sources":["../../../src/tests/dnsBeacons.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { sendDnsBeacons } from "../customDetectBot.js";
|
|
3
|
+
class RecordingImage {
|
|
4
|
+
set src(value) {
|
|
5
|
+
RecordingImage.sources.push(value);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
RecordingImage.sources = [];
|
|
9
|
+
const stubBeaconGlobals = () => {
|
|
10
|
+
const fetchMock = vi.fn((_input, _init) => Promise.resolve(new Response()));
|
|
11
|
+
vi.stubGlobal("fetch", fetchMock);
|
|
12
|
+
vi.stubGlobal("Image", RecordingImage);
|
|
13
|
+
RecordingImage.sources = [];
|
|
14
|
+
return fetchMock;
|
|
15
|
+
};
|
|
16
|
+
describe("sendDnsBeacons", () => {
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
vi.unstubAllGlobals();
|
|
19
|
+
});
|
|
20
|
+
it("fetches the DNS URL and loads the asset URL as an image", () => {
|
|
21
|
+
const fetchMock = stubBeaconGlobals();
|
|
22
|
+
sendDnsBeacons({
|
|
23
|
+
dns_url: "https://s1.px.example.com/a.gif?sid=s1",
|
|
24
|
+
dns_asset_url: "https://s1.px.example.com/b.png?sid=s1",
|
|
25
|
+
});
|
|
26
|
+
expect(fetchMock).toHaveBeenCalledTimes(1);
|
|
27
|
+
expect(fetchMock.mock.calls[0]?.[0]).toBe("https://s1.px.example.com/a.gif?sid=s1");
|
|
28
|
+
expect(RecordingImage.sources).toEqual([
|
|
29
|
+
"https://s1.px.example.com/b.png?sid=s1",
|
|
30
|
+
]);
|
|
31
|
+
});
|
|
32
|
+
it("sends nothing when the provider sent no URLs", () => {
|
|
33
|
+
const fetchMock = stubBeaconGlobals();
|
|
34
|
+
sendDnsBeacons({});
|
|
35
|
+
expect(fetchMock).not.toHaveBeenCalled();
|
|
36
|
+
expect(RecordingImage.sources).toEqual([]);
|
|
37
|
+
});
|
|
38
|
+
it("still fetches the DNS URL from a provider that sends no asset URL", () => {
|
|
39
|
+
const fetchMock = stubBeaconGlobals();
|
|
40
|
+
sendDnsBeacons({ dns_url: "https://s1.px.example.com/a.gif?sid=s1" });
|
|
41
|
+
expect(fetchMock).toHaveBeenCalledTimes(1);
|
|
42
|
+
expect(RecordingImage.sources).toEqual([]);
|
|
43
|
+
});
|
|
44
|
+
it("never throws when the fetch itself throws", () => {
|
|
45
|
+
vi.stubGlobal("fetch", vi.fn(() => {
|
|
46
|
+
throw new Error("blocked");
|
|
47
|
+
}));
|
|
48
|
+
expect(() => sendDnsBeacons({ dns_url: "https://s1.px.example.com/a.gif" })).not.toThrow();
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=dnsBeacons.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dnsBeacons.test.js","sourceRoot":"","sources":["../../../src/tests/dnsBeacons.test.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,cAAc;IAEnB,IAAI,GAAG,CAAC,KAAa;QACpB,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AAHM,sBAAO,GAAa,EAAE,CAAC;AAM/B,MAAM,iBAAiB,GAAG,GAA6B,EAAE;IACxD,MAAM,SAAS,GAAG,EAAE,CAAC,EAAE,CACtB,CAAC,MAAyB,EAAE,KAAmB,EAAqB,EAAE,CACrE,OAAO,CAAC,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC,CAChC,CAAC;IACF,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAClC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IACvC,cAAc,CAAC,OAAO,GAAG,EAAE,CAAC;IAC5B,OAAO,SAAS,CAAC;AAClB,CAAC,CAAC;AAEF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC/B,SAAS,CAAC,GAAG,EAAE;QACd,EAAE,CAAC,gBAAgB,EAA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,OAAO,EACP,EAAE,CAAC,EAAE,CAAC,GAAsB,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC,CACF,CAAC;QAEF,MAAM,CAAC,GAAG,EAAE,CACX,cAAc,CAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC,CAC9D,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BotDetectionFunction } from "@prosopo/types";
|
|
1
|
+
import type { BotDetectionFunction, GetFrictionlessCaptchaResponse } from "@prosopo/types";
|
|
2
|
+
export declare const sendDnsBeacons: ({ dns_url, dns_asset_url, }: Pick<GetFrictionlessCaptchaResponse, "dns_url" | "dns_asset_url">) => void;
|
|
2
3
|
export declare const withTimeout: <T>(promise: Promise<T>, ms: number) => Promise<T>;
|
|
3
4
|
declare const customDetectBot: BotDetectionFunction;
|
|
4
5
|
export default customDetectBot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../../src/customDetectBot.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EACX,oBAAoB,
|
|
1
|
+
{"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../../src/customDetectBot.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EACX,oBAAoB,EACpB,8BAA8B,EAG9B,MAAM,gBAAgB,CAAC;AA4FxB,eAAO,MAAM,cAAc,gCAGxB,IAAI,CAAC,8BAA8B,EAAE,SAAS,GAAG,eAAe,CAAC,KAAG,IAiBtE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,CAAC,WACzB,OAAO,CAAC,CAAC,CAAC,MACf,MAAM,KACR,OAAO,CAAC,CAAC,CA0BX,CAAC;AAoBF,QAAA,MAAM,eAAe,EAAE,oBA+OtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dnsBeacons.test.d.ts","sourceRoot":"","sources":["../../../src/tests/dnsBeacons.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/procaptcha-frictionless",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"> 0.5%, last 2 versions, not dead"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@prosopo/api": "4.8.
|
|
25
|
+
"@prosopo/api": "4.8.5",
|
|
26
26
|
"@prosopo/common": "3.3.2",
|
|
27
|
-
"@prosopo/fingerprint": "2.8.
|
|
27
|
+
"@prosopo/fingerprint": "2.8.9",
|
|
28
28
|
"@prosopo/locale": "3.13.2",
|
|
29
|
-
"@prosopo/procaptcha-audio": "0.2.
|
|
30
|
-
"@prosopo/procaptcha-common": "2.22.
|
|
31
|
-
"@prosopo/procaptcha-icon-order": "0.2.
|
|
32
|
-
"@prosopo/procaptcha-pow": "2.14.
|
|
33
|
-
"@prosopo/procaptcha-puzzle": "2.17.
|
|
34
|
-
"@prosopo/procaptcha-react": "2.14.
|
|
35
|
-
"@prosopo/types": "5.
|
|
29
|
+
"@prosopo/procaptcha-audio": "0.2.16",
|
|
30
|
+
"@prosopo/procaptcha-common": "2.22.3",
|
|
31
|
+
"@prosopo/procaptcha-icon-order": "0.2.16",
|
|
32
|
+
"@prosopo/procaptcha-pow": "2.14.5",
|
|
33
|
+
"@prosopo/procaptcha-puzzle": "2.17.15",
|
|
34
|
+
"@prosopo/procaptcha-react": "2.14.16",
|
|
35
|
+
"@prosopo/types": "5.23.0",
|
|
36
36
|
"@prosopo/widget-skeleton": "2.10.5",
|
|
37
37
|
"dotenv": "18.0.8"
|
|
38
38
|
},
|