@prosopo/procaptcha-frictionless 2.12.1 → 2.12.2

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/procaptcha-frictionless@2.12.1 build:cjs
2
+ > @prosopo/procaptcha-frictionless@2.12.2 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -60,6 +60,6 @@ Build end
60
60
  rendering chunks...
61
61
  dist/cjs/index.cjs 0.24 kB
62
62
  dist/cjs/detectorLoader.cjs 1.37 kB
63
- dist/cjs/customDetectBot.cjs 3.05 kB
63
+ dist/cjs/customDetectBot.cjs 3.34 kB
64
64
  dist/cjs/ProcaptchaFrictionless.cjs 7.98 kB
65
- ✓ built in 119ms
65
+ ✓ built in 120ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/procaptcha-frictionless@2.12.1 build:tsc
2
+ > @prosopo/procaptcha-frictionless@2.12.2 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 3:25:20 PM - Projects in this build:
5
+ 11:38:11 AM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../locale/tsconfig.json
8
8
  * ../util/tsconfig.json
@@ -26,49 +26,49 @@
26
26
  * ../procaptcha-react/tsconfig.json
27
27
  * tsconfig.json
28
28
 
29
- 3:25:20 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'
29
+ 11:38:11 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/tsconfig.tsbuildinfo'
30
30
 
31
- 3:25:20 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
31
+ 11:38:11 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
32
32
 
33
- 3:25:20 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
33
+ 11:38:11 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
34
34
 
35
- 3:25:20 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'
35
+ 11:38:11 AM - 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'
36
36
 
37
- 3:25:20 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
37
+ 11:38:11 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/keyring/keyring/types.ts' is older than output '../types/tsconfig.tsbuildinfo'
38
38
 
39
- 3:25:20 PM - Project '../detector/tsconfig.json' is up to date because newest input '../detector/src/index.js' is older than output '../detector/tsconfig.tsbuildinfo'
39
+ 11:38:11 AM - Project '../detector/tsconfig.json' is up to date because newest input '../detector/src/index.js' is older than output '../detector/tsconfig.tsbuildinfo'
40
40
 
41
- 3:25:20 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
41
+ 11:38:11 AM - 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
- 3:25:20 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
43
+ 11:38:11 AM - 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
- 3:25:21 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
45
+ 11:38:11 AM - 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
- 3:25:21 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
47
+ 11:38:11 AM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
48
48
 
49
- 3:25:21 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
49
+ 11:38:11 AM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
50
50
 
51
- 3:25:21 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'
51
+ 11:38:11 AM - 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'
52
52
 
53
- 3:25:21 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/constants.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
53
+ 11:38:11 AM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/index.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
54
54
 
55
- 3:25:21 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
55
+ 11:38:11 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
56
56
 
57
- 3:25:21 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/tsconfig.tsbuildinfo'
57
+ 11:38:11 AM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/index.ts' is older than output '../account/tsconfig.tsbuildinfo'
58
58
 
59
- 3:25:21 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/tests/defaultEvents.test.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
59
+ 11:38:11 AM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/extensionLoader.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
60
60
 
61
- 3:25:21 PM - Project '../procaptcha-pow/tsconfig.json' is up to date because newest input '../procaptcha-pow/src/index.ts' is older than output '../procaptcha-pow/tsconfig.tsbuildinfo'
61
+ 11:38:11 AM - Project '../procaptcha-pow/tsconfig.json' is up to date because newest input '../procaptcha-pow/src/index.ts' is older than output '../procaptcha-pow/tsconfig.tsbuildinfo'
62
62
 
63
- 3:25:21 PM - Project '../procaptcha-puzzle/tsconfig.json' is up to date because newest input '../procaptcha-puzzle/src/index.ts' is older than output '../procaptcha-puzzle/tsconfig.tsbuildinfo'
63
+ 11:38:11 AM - Project '../procaptcha-puzzle/tsconfig.json' is up to date because newest input '../procaptcha-puzzle/src/index.ts' is older than output '../procaptcha-puzzle/tsconfig.tsbuildinfo'
64
64
 
65
- 3:25:21 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/mocks/data/captchas.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
65
+ 11:38:11 AM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/mocks/data/captchas.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
66
66
 
67
- 3:25:21 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/index.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
67
+ 11:38:11 AM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/index.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
68
68
 
69
- 3:25:21 PM - Project '../procaptcha-react/tsconfig.json' is up to date because newest input '../procaptcha-react/src/index.ts' is older than output '../procaptcha-react/tsconfig.tsbuildinfo'
69
+ 11:38:12 AM - Project '../procaptcha-react/tsconfig.json' is up to date because newest input '../procaptcha-react/src/index.ts' is older than output '../procaptcha-react/tsconfig.tsbuildinfo'
70
70
 
71
- 3:25:21 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
71
+ 11:38:12 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
72
72
 
73
- 3:25:21 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-frictionless/tsconfig.json'...
73
+ 11:38:12 AM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-frictionless/tsconfig.json'...
74
74
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/procaptcha-frictionless@2.12.1 build
2
+ > @prosopo/procaptcha-frictionless@2.12.2 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/procaptcha-frictionless@2.12.1 build:cross-env
6
+ > @prosopo/procaptcha-frictionless@2.12.2 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -63,6 +63,6 @@ Build end
63
63
  rendering chunks...
64
64
  dist/index.js 0.11 kB
65
65
  dist/detectorLoader.js 0.11 kB
66
- dist/customDetectBot.js 2.87 kB
66
+ dist/customDetectBot.js 3.16 kB
67
67
  dist/ProcaptchaFrictionless.js 6.59 kB
68
- ✓ built in 172ms
68
+ ✓ built in 166ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @prosopo/procaptcha-frictionless
2
2
 
3
+ ## 2.12.2
4
+ ### Patch Changes
5
+
6
+ - 970bca2: feat(provider): record the page URL a frictionless session originated from and require it
7
+
8
+ The frictionless client now reports the page it was rendered on (built from `window.location.origin + pathname`) in the challenge request, and the provider stores it on the session as `currentUrl`. The value is reduced to scheme + host + path on both the client and the provider (`sanitisePageUrl`): the query string, fragment and any embedded `user:pass@` credentials are stripped so URL-borne secrets (tokens, reset codes, session ids) are never persisted. A session whose request carries no usable page URL is treated as a bot signal and forced down the image-captcha path (`FrictionlessReason.MISSING_CURRENT_URL`).
9
+ - Updated dependencies [8986976]
10
+ - Updated dependencies [970bca2]
11
+ - @prosopo/types@4.9.1
12
+ - @prosopo/api@3.5.7
13
+ - @prosopo/common@3.1.42
14
+ - @prosopo/detector@3.5.2
15
+ - @prosopo/procaptcha-common@2.11.2
16
+ - @prosopo/procaptcha-pow@2.10.7
17
+ - @prosopo/procaptcha-puzzle@2.10.22
18
+ - @prosopo/procaptcha-react@2.9.80
19
+
3
20
  ## 2.12.1
4
21
  ### Patch Changes
5
22
 
@@ -4,6 +4,16 @@ const api = require("@prosopo/api");
4
4
  const common = require("@prosopo/common");
5
5
  const procaptchaCommon = require("@prosopo/procaptcha-common");
6
6
  const detectorLoader = require("./detectorLoader.cjs");
7
+ const getCurrentPageUrl = () => {
8
+ if (typeof window === "undefined" || !window.location) {
9
+ return void 0;
10
+ }
11
+ const { origin, pathname } = window.location;
12
+ if (!origin || origin === "null") {
13
+ return void 0;
14
+ }
15
+ return `${origin}${pathname || ""}`;
16
+ };
7
17
  const withTimeout = async (promise, ms) => {
8
18
  let timeoutId;
9
19
  const timeoutPromise = new Promise((_, reject) => {
@@ -55,7 +65,8 @@ const customDetectBot = async (config, container, restartFn) => {
55
65
  config.account.address,
56
66
  userAccount.account.address,
57
67
  config.mode,
58
- void 0
68
+ void 0,
69
+ getCurrentPageUrl()
59
70
  );
60
71
  if (detectionResult.getSimdReadings) {
61
72
  void detectionResult.getSimdReadings(6e4).catch(() => void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACX,oBAAoB,EAEpB,MAAM,gBAAgB,CAAC;AAIxB,eAAO,MAAM,WAAW,GAAU,CAAC,WACzB,OAAO,CAAC,CAAC,CAAC,MACf,MAAM,KACR,OAAO,CAAC,CAAC,CAoBX,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,oBAkGtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACX,oBAAoB,EAEpB,MAAM,gBAAgB,CAAC;AAsBxB,eAAO,MAAM,WAAW,GAAU,CAAC,WACzB,OAAO,CAAC,CAAC,CAAC,MACf,MAAM,KACR,OAAO,CAAC,CAAC,CAoBX,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,oBAmGtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -2,6 +2,16 @@ import { ProviderApi } from "@prosopo/api";
2
2
  import { ProsopoEnvError } from "@prosopo/common";
3
3
  import { ExtensionLoader, getProcaptchaRandomActiveProvider, pickIpMode } from "@prosopo/procaptcha-common";
4
4
  import { DetectorLoader } from "./detectorLoader.js";
5
+ const getCurrentPageUrl = () => {
6
+ if (typeof window === "undefined" || !window.location) {
7
+ return void 0;
8
+ }
9
+ const { origin, pathname } = window.location;
10
+ if (!origin || origin === "null") {
11
+ return void 0;
12
+ }
13
+ return `${origin}${pathname || ""}`;
14
+ };
5
15
  const withTimeout = async (promise, ms) => {
6
16
  let timeoutId;
7
17
  const timeoutPromise = new Promise((_, reject) => {
@@ -53,7 +63,8 @@ const customDetectBot = async (config, container, restartFn) => {
53
63
  config.account.address,
54
64
  userAccount.account.address,
55
65
  config.mode,
56
- void 0
66
+ void 0,
67
+ getCurrentPageUrl()
57
68
  );
58
69
  if (detectionResult.getSimdReadings) {
59
70
  void detectionResult.getSimdReadings(6e4).catch(() => void 0);
@@ -1 +1 @@
1
- {"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O,EAAE,CAAC;QACrB,IAAI,CAAC;YACJ,KAAK,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE;gBAC3B,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,MAAM;gBACnB,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,UAAU;aACjB,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACF,CAAC;IAED,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;QAEd,kBAAkB,EAAE,eAAe,CAAC,YAAY;QAChD,kBAAkB,EAAE,eAAe,CAAC,YAAY;QAChD,kBAAkB,EAAE,eAAe,CAAC,YAAY;QAChD,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/procaptcha-frictionless",
3
- "version": "2.12.1",
3
+ "version": "2.12.2",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -30,15 +30,15 @@
30
30
  },
31
31
  "browserslist": ["> 0.5%, last 2 versions, not dead"],
32
32
  "dependencies": {
33
- "@prosopo/api": "3.5.6",
34
- "@prosopo/common": "3.1.41",
35
- "@prosopo/detector": "3.5.1",
33
+ "@prosopo/api": "3.5.7",
34
+ "@prosopo/common": "3.1.42",
35
+ "@prosopo/detector": "3.5.2",
36
36
  "@prosopo/locale": "3.2.5",
37
- "@prosopo/procaptcha-common": "2.11.1",
38
- "@prosopo/procaptcha-pow": "2.10.6",
39
- "@prosopo/procaptcha-puzzle": "2.10.21",
40
- "@prosopo/procaptcha-react": "2.9.79",
41
- "@prosopo/types": "4.9.0",
37
+ "@prosopo/procaptcha-common": "2.11.2",
38
+ "@prosopo/procaptcha-pow": "2.10.7",
39
+ "@prosopo/procaptcha-puzzle": "2.10.22",
40
+ "@prosopo/procaptcha-react": "2.9.80",
41
+ "@prosopo/types": "4.9.1",
42
42
  "@prosopo/widget-skeleton": "2.8.4",
43
43
  "dotenv": "16.4.5",
44
44
  "react": "18.3.1"
@@ -26,6 +26,24 @@ import type {
26
26
  import type { BotDetectionFunctionResult } from "@prosopo/types";
27
27
  import { DetectorLoader } from "./detectorLoader.js";
28
28
 
29
+ // The page the widget is rendered on, reduced to origin + path. Deliberately
30
+ // built from `origin` + `pathname` (never `href`) so the query string,
31
+ // fragment, and any embedded `user:pass@` credentials never leave the browser
32
+ // — sites routinely carry tokens / session ids / reset codes in those parts.
33
+ // Returns undefined in non-browser contexts (SSR / tests) or for opaque
34
+ // origins; the provider then treats the session as having no page URL and
35
+ // forces an image captcha.
36
+ const getCurrentPageUrl = (): string | undefined => {
37
+ if (typeof window === "undefined" || !window.location) {
38
+ return undefined;
39
+ }
40
+ const { origin, pathname } = window.location;
41
+ if (!origin || origin === "null") {
42
+ return undefined;
43
+ }
44
+ return `${origin}${pathname || ""}`;
45
+ };
46
+
29
47
  export const withTimeout = async <T>(
30
48
  promise: Promise<T>,
31
49
  ms: number,
@@ -108,6 +126,7 @@ const customDetectBot: BotDetectionFunction = async (
108
126
  userAccount.account.address,
109
127
  config.mode,
110
128
  undefined,
129
+ getCurrentPageUrl(),
111
130
  );
112
131
  if (detectionResult.getSimdReadings) {
113
132
  // Fire-and-forget: triggers the memoised prefetch inside the catcher
@@ -93,7 +93,7 @@ describe("customDetectBot SIMD deferral", () => {
93
93
 
94
94
  expect(mocks.getFrictionlessCaptcha).toHaveBeenCalledTimes(1);
95
95
  const args = mocks.getFrictionlessCaptcha.mock.calls[0];
96
- // args: token, headHash, dappAccount, userAccount, mode, simdReadings
96
+ // args: token, headHash, dappAccount, userAccount, mode, simdReadings, currentUrl
97
97
  expect(args?.[5]).toBeUndefined();
98
98
  });
99
99