@prosopo/procaptcha-frictionless 2.15.1 → 2.16.1

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.15.1 build:cjs
2
+ > @prosopo/procaptcha-frictionless@2.16.1 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -53,15 +53,16 @@ ViteCommonJSConfig: .
53
53
  vite v8.1.5 building ssr environment for production...
54
54
  Bundle build started
55
55
  
56
- 8 modules transformed.
56
+ 9 modules transformed.
57
57
  rendering chunks...
58
58
  computing gzip size...
59
59
  dist/cjs/index.cjs 0.54 kB │ gzip: 0.21 kB
60
- dist/cjs/detectorLoader.cjs 0.62 kB │ gzip: 0.40 kB
61
60
  dist/cjs/frictionlessResultGuard.cjs 1.55 kB │ gzip: 0.80 kB
61
+ dist/cjs/detectorLoader.cjs 1.65 kB │ gzip: 0.90 kB
62
62
  dist/cjs/sessionInvalidatedRecovery.cjs 2.50 kB │ gzip: 1.14 kB
63
+ dist/cjs/AuthenticatedBadge.cjs 2.69 kB │ gzip: 1.08 kB
63
64
  dist/cjs/detectorPrefetch.cjs 2.98 kB │ gzip: 1.35 kB
64
- dist/cjs/customDetectBot.cjs 5.55 kB │ gzip: 1.70 kB
65
- dist/cjs/ProcaptchaFrictionless.cjs 10.03 kB │ gzip: 2.69 kB
65
+ dist/cjs/customDetectBot.cjs 5.60 kB │ gzip: 1.71 kB
66
+ dist/cjs/ProcaptchaFrictionless.cjs 10.75 kB │ gzip: 2.84 kB
66
67
 
67
- ✓ built in 32ms
68
+ ✓ built in 53ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/procaptcha-frictionless@2.15.1 build:tsc
2
+ > @prosopo/procaptcha-frictionless@2.16.1 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 8:02:20 PM - Projects in this build:
5
+ 7:32:20 PM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../locale/tsconfig.json
8
8
  * ../util/tsconfig.json
@@ -25,47 +25,47 @@
25
25
  * ../procaptcha-react/tsconfig.json
26
26
  * tsconfig.json
27
27
 
28
- 8:02:20 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'
28
+ 7:32: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
29
 
30
- 8:02:20 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
30
+ 7:32: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
31
 
32
- 8:02:20 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
32
+ 7:32:20 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/util.ts' is older than output '../util/tsconfig.tsbuildinfo'
33
33
 
34
- 8:02: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'
34
+ 7:32: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
35
 
36
- 8:02:20 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'
36
+ 7:32:20 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'
37
37
 
38
- 8:02:20 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
38
+ 7:32:20 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/tests/apiHarness.ts' is older than output '../api/tsconfig.tsbuildinfo'
39
39
 
40
- 8:02:20 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
40
+ 7:32:20 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/tests/loggerBrowser.unit.test.ts' is older than output '../logger/tsconfig.tsbuildinfo'
41
41
 
42
- 8:02:20 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
42
+ 7:32:20 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/objectUtils.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
43
43
 
44
- 8:02:20 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
44
+ 7:32:20 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
45
45
 
46
- 8:02:20 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
46
+ 7:32:20 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
47
47
 
48
- 8:02:20 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'
48
+ 7:32:20 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'
49
49
 
50
- 8:02:20 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/webComponent/createWidget.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
50
+ 7:32:20 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/webComponent/createWidget.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
51
51
 
52
- 8:02:20 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
52
+ 7:32:20 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.test.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
53
53
 
54
- 8:02:20 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/index.ts' is older than output '../account/tsconfig.tsbuildinfo'
54
+ 7:32:20 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/tests/cryptoWorker.unit.test.ts' is older than output '../account/tsconfig.tsbuildinfo'
55
55
 
56
- 8:02:20 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/clientMetaData.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
56
+ 7:32:20 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/simdReadings.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
57
57
 
58
- 8:02:20 PM - Project '../procaptcha-pow/tsconfig.json' is up to date because newest input '../procaptcha-pow/src/tests/managerHarness.ts' is older than output '../procaptcha-pow/tsconfig.tsbuildinfo'
58
+ 7:32:20 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'
59
59
 
60
- 8:02:20 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'
60
+ 7:32:20 PM - Project '../procaptcha-puzzle/tsconfig.json' is up to date because newest input '../procaptcha-puzzle/src/tests/managerHarness.ts' is older than output '../procaptcha-puzzle/tsconfig.tsbuildinfo'
61
61
 
62
- 8:02:20 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
62
+ 7:32:20 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'
63
63
 
64
- 8:02:20 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/modules/Manager.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
64
+ 7:32:20 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/modules/Manager.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
65
65
 
66
- 8:02:20 PM - Project '../procaptcha-react/tsconfig.json' is up to date because newest input '../procaptcha-react/src/tests/captchaComponent.unit.test.tsx' is older than output '../procaptcha-react/tsconfig.tsbuildinfo'
66
+ 7:32: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'
67
67
 
68
- 8:02:20 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
68
+ 7:32:21 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
69
69
 
70
- 8:02:20 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-frictionless/tsconfig.json'...
70
+ 7:32:21 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-frictionless/tsconfig.json'...
71
71
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/procaptcha-frictionless@2.15.1 build
2
+ > @prosopo/procaptcha-frictionless@2.16.1 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/procaptcha-frictionless@2.15.1 build:cross-env
6
+ > @prosopo/procaptcha-frictionless@2.16.1 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -57,16 +57,17 @@ ViteEsmConfig: .
57
57
  vite v8.1.5 building ssr environment for production...
58
58
  Bundle build started
59
59
  
60
- 8 modules transformed.
60
+ 9 modules transformed.
61
61
  rendering chunks...
62
62
  computing gzip size...
63
- dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
64
- dist/index.js 0.32 kB │ gzip: 0.15 kB
65
- dist/detectorLoader.js 0.60 kB │ gzip: 0.39 kB
66
- dist/frictionlessResultGuard.js 1.48 kB │ gzip: 0.80 kB
67
- dist/sessionInvalidatedRecovery.js 2.41 kB │ gzip: 1.13 kB
68
- dist/detectorPrefetch.js 2.86 kB │ gzip: 1.32 kB
69
- dist/customDetectBot.js 5.37 kB │ gzip: 1.67 kB
70
- dist/ProcaptchaFrictionless.js 9.36 kB │ gzip: 2.65 kB
63
+ dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
64
+ dist/index.js 0.32 kB │ gzip: 0.15 kB
65
+ dist/frictionlessResultGuard.js 1.48 kB │ gzip: 0.80 kB
66
+ dist/detectorLoader.js 1.63 kB │ gzip: 0.90 kB
67
+ dist/AuthenticatedBadge.js 2.28 kB │ gzip: 1.04 kB
68
+ dist/sessionInvalidatedRecovery.js 2.41 kB │ gzip: 1.13 kB
69
+ dist/detectorPrefetch.js 2.86 kB │ gzip: 1.32 kB
70
+ dist/customDetectBot.js 5.42 kB │ gzip: 1.68 kB
71
+ dist/ProcaptchaFrictionless.js 10.01 kB │ gzip: 2.80 kB
71
72
 
72
- ✓ built in 28ms
73
+ ✓ built in 49ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # @prosopo/procaptcha-frictionless
2
2
 
3
+ ## 2.16.1
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [0c1f301]
7
+ - Updated dependencies [32d286d]
8
+ - @prosopo/types@5.8.1
9
+ - @prosopo/api@4.2.1
10
+ - @prosopo/procaptcha-common@2.13.2
11
+ - @prosopo/procaptcha-pow@2.12.2
12
+ - @prosopo/procaptcha-puzzle@2.12.2
13
+ - @prosopo/procaptcha-react@2.10.3
14
+
15
+ ## 2.16.0
16
+ ### Minor Changes
17
+
18
+ - af267c2: Web Bot Auth verifier and an authenticated frictionless flow for pre-verified agents.
19
+
20
+ **`@prosopo/web-bot-auth`** — a new package: an RFC 9421 HTTP Message Signatures verifier built on `@noble/curves/ed25519`, with no Cloudflare dependency. It parses `Signature-Agent` in both its bare-string and dictionary forms, resolves the signer's JWKS at `/.well-known/http-message-signatures-directory` honouring the response's cache-control TTL, and verifies the Ed25519 signature over the RFC 9421 signature base.
21
+
22
+ **Provider fast path.** `/captcha/frictionless` returns `captchaType: authenticated` when a non-`deferToVerify` `AccessPolicyType.Allow` rule matches the request's user scope, and writes a session with `serverChecked: false`, `agent: true` and the issuing IP frozen for verify-time binding. Decrypt, bot score and the decision machine are all skipped. A verified `Signature-Agent` is one way to qualify — the userScope gains a `webBotAuthAgent` field, set only when signature verification succeeded so a rule scoped to a signer can never be matched by a spoofed header — but an IP CIDR, JA4, user agent, ASN or country rule qualifies the same way. A `Block` or `Restrict` on the same match set always wins, because severity outranks Allow.
23
+
24
+ **`/client/authenticated/verify`.** A separate router with mandatory IP binding — the operator must forward the client IP (`API.AUTHENTICATED_IP_REQUIRED`) and it must match the one the session was issued to (`API.AUTHENTICATED_IP_MISMATCH`), so a leaked token cannot be replayed from elsewhere. Single use is enforced through `serverChecked`, and `captchaType` is checked so an ordinary captcha token cannot be redeemed on this route. `clientSessionId` correlation goes through the same `isClientSessionMismatch` helper as pow / image / puzzle, so the authenticated path cannot drift from the others.
25
+
26
+ **Surface.** `AccessPolicyType.Allow` and `CaptchaType.authenticated`; `webBotAuthAgent` on the user scope (indexed, normalised at parse time to a lowercase scheme+host with no trailing slash); `Session.agent` / `Session.webBotAuthAgent` for the Traffic view's "pre-verified pass" filter; `submitAuthenticatedCaptchaVerify` on `ProviderApi` and the matching branch in `@prosopo/server.verifyProvider`; `AuthenticatedBadge` and a dispatch branch in `procaptcha-frictionless`.
27
+
28
+ Three fixes the new end-to-end coverage turned up, each of which broke the flow outright:
29
+
30
+ - `ipMatchesSession` compared the operator's parsed IP against the session's composite halves with `===`. A session read back from Mongo carries BSON (`Decimal128`, or `Long` on pre-migration records), not the `bigint` the type claims, so the comparison was false for every session that had been through the database — every legitimate redemption was rejected as `API.AUTHENTICATED_IP_MISMATCH`. Both halves are now normalised before comparison, and an unparseable half fails closed rather than defaulting to `0n`, so garbage still cannot match garbage.
31
+ - `serverChecked` was never written onto the authenticated session, so "never set" and "consumed" were distinguishable only by an absence. It is now written as `false` at issuance.
32
+ - `serverChecked` was missing from `SESSION_PROJECTION`. Left out, the single-use check reads `undefined` and an authenticated token verifies an unlimited number of times.
33
+
34
+ ### Patch Changes
35
+
36
+ - 6c5b82f: Fall back to a `data:` URL when `blob:` is blocked, so a CSP that permits one scheme keeps the detector.
37
+
38
+ `DetectorLoaderFromScript` imported the provider-served module text from a blob URL only. `blob:` and `data:` are gated by different CSP directives and sites commonly allow one without the other — a `script-src` of `*` matches neither, and a policy listing `data:` for scripts with `blob:` only under `worker-src` blocks the blob path outright. On such an origin the import threw, the caller fell through to its no-detector path, and the session sent no detector session id, no token and no head hash, so the provider recorded `MISSING_TOKEN` and served a challenge the session could not pass frictionlessly.
39
+
40
+ - Percent-encoding rather than base64: the module is several hundred KB and `btoa(String.fromCharCode(...bytes))` overflows the call stack at that size.
41
+ - The blob URL is revoked on every path, including when its own import fails.
42
+ - `/* webpackIgnore: true */` sits alongside `/* @vite-ignore */`. Neither is redundant — `@vite-ignore` stops Vite analysing a non-literal specifier, `webpackIgnore` stops webpack rewriting it into a context module that cannot resolve a blob or data URL at runtime.
43
+ - The import is injected as `ModuleImporter` so the fallback is testable without a real dynamic import.
44
+
45
+ Known gap, not addressed here: `removeComments` in the shared build config strips both pragmas from `dist/`, so consumers bundling this package from npm still receive a bare `import(url)`. Emitting comments would leak source comments into shipped output, so that needs a mechanism which does not rely on a comment surviving compilation.
46
+ - Updated dependencies [929d99b]
47
+ - Updated dependencies [934fa5d]
48
+ - Updated dependencies [27f525e]
49
+ - Updated dependencies [af267c2]
50
+ - @prosopo/types@5.8.0
51
+ - @prosopo/api@4.2.0
52
+ - @prosopo/procaptcha-common@2.13.1
53
+ - @prosopo/procaptcha-pow@2.12.1
54
+ - @prosopo/procaptcha-puzzle@2.12.1
55
+ - @prosopo/procaptcha-react@2.10.2
56
+
3
57
  ## 2.15.1
4
58
  ### Patch Changes
5
59
 
@@ -0,0 +1,12 @@
1
+ import { type Account, type ProcaptchaCallbacks, type RandomProvider } from "@prosopo/types";
2
+ import { type FC } from "react";
3
+ export type AuthenticatedBadgeProps = {
4
+ sessionId: string;
5
+ agent?: string;
6
+ dapp: string;
7
+ userAccount: Account;
8
+ provider: RandomProvider;
9
+ callbacks: ProcaptchaCallbacks;
10
+ };
11
+ export declare const AuthenticatedBadge: FC<AuthenticatedBadgeProps>;
12
+ //# sourceMappingURL=AuthenticatedBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthenticatedBadge.d.ts","sourceRoot":"","sources":["../src/AuthenticatedBadge.tsx"],"names":[],"mappings":"AA4BA,OAAO,EACN,KAAK,OAAO,EAGZ,KAAK,mBAAmB,EACxB,KAAK,cAAc,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,uBAAuB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,mBAAmB,CAAC;CAC/B,CAAC;AAWF,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAoF1D,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { getDefaultEvents } from "@prosopo/procaptcha-common";
2
+ import { ApiParams, CaptchaType, encodeProcaptchaOutput } from "@prosopo/types";
3
+ import { useEffect, useRef } from "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/AuthenticatedBadge.tsx
6
+ var displayHost = (agent) => {
7
+ if (!agent) return "unknown";
8
+ try {
9
+ return new URL(agent).hostname;
10
+ } catch {
11
+ return agent;
12
+ }
13
+ };
14
+ var AuthenticatedBadge = ({ sessionId, agent, dapp, userAccount, provider, callbacks }) => {
15
+ const emittedRef = useRef(false);
16
+ useEffect(() => {
17
+ if (emittedRef.current) return;
18
+ emittedRef.current = true;
19
+ const events = getDefaultEvents(callbacks);
20
+ const token = encodeProcaptchaOutput({
21
+ [ApiParams.providerUrl]: provider.provider.url,
22
+ [ApiParams.user]: userAccount.account.address,
23
+ [ApiParams.dapp]: dapp,
24
+ [ApiParams.commitmentId]: sessionId,
25
+ [ApiParams.timestamp]: Date.now().toString(),
26
+ [ApiParams.signature]: {
27
+ [ApiParams.provider]: {},
28
+ [ApiParams.user]: {}
29
+ },
30
+ [ApiParams.captchaType]: CaptchaType.authenticated
31
+ });
32
+ events.onHuman(token);
33
+ }, [
34
+ sessionId,
35
+ dapp,
36
+ userAccount,
37
+ provider,
38
+ callbacks
39
+ ]);
40
+ return /* @__PURE__ */ jsxs("div", {
41
+ style: {
42
+ display: "inline-flex",
43
+ alignItems: "center",
44
+ gap: 8,
45
+ padding: "8px 12px",
46
+ borderRadius: 6,
47
+ background: "#eef2ff",
48
+ border: "1px solid #c7d2fe",
49
+ color: "#3730a3",
50
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
51
+ fontSize: 13,
52
+ lineHeight: 1.4
53
+ },
54
+ role: "status",
55
+ "aria-label": "Verified agent",
56
+ children: [/* @__PURE__ */ jsxs("svg", {
57
+ width: "16",
58
+ height: "16",
59
+ viewBox: "0 0 24 24",
60
+ fill: "none",
61
+ stroke: "currentColor",
62
+ strokeWidth: "2.5",
63
+ strokeLinecap: "round",
64
+ strokeLinejoin: "round",
65
+ "aria-hidden": "true",
66
+ children: [/* @__PURE__ */ jsx("title", { children: "Verified" }), /* @__PURE__ */ jsx("path", { d: "M20 6L9 17l-5-5" })]
67
+ }), /* @__PURE__ */ jsx("span", { children: agent ? /* @__PURE__ */ jsxs(Fragment, { children: [
68
+ /* @__PURE__ */ jsx("strong", { children: "Verified agent" }),
69
+ ": ",
70
+ displayHost(agent)
71
+ ] }) : /* @__PURE__ */ jsx("strong", { children: "Trusted request" }) })]
72
+ });
73
+ };
74
+ //#endregion
75
+ export { AuthenticatedBadge };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthenticatedBadge.js","sourceRoot":"","sources":["../src/AuthenticatedBadge.tsx"],"names":[],"mappings":";AA2BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAEN,SAAS,EACT,WAAW,EAGX,sBAAsB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAW,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAWnD,MAAM,WAAW,GAAG,CAAC,KAAc,EAAU,EAAE;IAC9C,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,IAAI,CAAC;QACJ,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAgC,CAAC,EAC/D,SAAS,EACT,KAAK,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,SAAS,GACT,EAAE,EAAE;IAKJ,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEjC,SAAS,CAA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ACF,gBAAgB,aAE3B,eACC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,uCAAuB,EACvB,eAAM,CAAC,EAAC,iBAAiB,GAAG,IACvB,EACN,yBACE,KAAK,CAAC,CAAC,CAAC,CACR,8BACC,8CAA+B,QAAG,WAAW,CAAC,KAAK,CAAC,IAClD,CACH,CAAC,CAAC,CAAC,CAKH,+CAAgC,CAChC,GACK,IACF,CACN,CAAC;AACH,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProcaptchaFrictionless.d.ts","sourceRoot":"","sources":["../src/ProcaptchaFrictionless.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAMN,KAAK,2BAA2B,EAGhC,MAAM,gBAAgB,CAAC;AAsExB,eAAO,MAAM,sBAAsB,gEAOhC,2BAA2B,gCAoa7B,CAAC"}
1
+ {"version":3,"file":"ProcaptchaFrictionless.d.ts","sourceRoot":"","sources":["../src/ProcaptchaFrictionless.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAMN,KAAK,2BAA2B,EAGhC,MAAM,gBAAgB,CAAC;AAuExB,eAAO,MAAM,sBAAsB,gEAOhC,2BAA2B,gCA6b7B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { AuthenticatedBadge } from "./AuthenticatedBadge.js";
1
2
  import customDetectBot from "./customDetectBot.js";
2
3
  import { evaluateFrictionlessResult } from "./frictionlessResultGuard.js";
3
4
  import { consumeRetryMountProps, handleSessionInvalidated, normaliseRetryCoords } from "./sessionInvalidatedRecovery.js";
@@ -100,7 +101,21 @@ var ProcaptchaFrictionless = ({ config, callbacks, restart, i18n, detectBot = cu
100
101
  const startCoords = escalationCoords ?? retryStartCoords;
101
102
  mountCountRef.current += 1;
102
103
  const mountKey = mountCountRef.current;
103
- if (captchaType === CaptchaType.image) {
104
+ if (captchaType === CaptchaType.authenticated) {
105
+ if (!frictionlessState.sessionId) {
106
+ events.onError(/* @__PURE__ */ new Error("authenticated captcha response missing sessionId — provider is misbehaving"));
107
+ fallOverWithStyle();
108
+ return;
109
+ }
110
+ setComponentToRender(/* @__PURE__ */ jsx(AuthenticatedBadge, {
111
+ sessionId: frictionlessState.sessionId,
112
+ agent: frictionlessState.agent,
113
+ dapp: config.account.address ?? "",
114
+ userAccount: frictionlessState.userAccount,
115
+ provider: frictionlessState.provider,
116
+ callbacks
117
+ }));
118
+ } else if (captchaType === CaptchaType.image) {
104
119
  const Procaptcha = await ProcaptchaLoader();
105
120
  setComponentToRender(/* @__PURE__ */ jsx(Procaptcha, {
106
121
  config,
@@ -172,7 +187,8 @@ var ProcaptchaFrictionless = ({ config, callbacks, restart, i18n, detectBot = cu
172
187
  deviceCapability: result.deviceCapability,
173
188
  encryptBehavioralData: result.encryptBehavioralData,
174
189
  getSimdReadings: result.getSimdReadings,
175
- hp: result.hp
190
+ hp: result.hp,
191
+ agent: result.agent
176
192
  };
177
193
  await renderForCaptchaType(result.captchaType, frictionlessState);
178
194
  stateRef.current = {
@@ -1 +1 @@
1
- {"version":3,"file":"ProcaptchaFrictionless.js","sourceRoot":"","sources":["../src/ProcaptchaFrictionless.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACN,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,WAAW,EAGX,sBAAsB,EACtB,sBAAsB,EAGtB,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,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CACH,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,75 @@
1
+ let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
2
+ let _prosopo_types = require("@prosopo/types");
3
+ let react = require("react");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ //#region src/AuthenticatedBadge.tsx
6
+ var displayHost = (agent) => {
7
+ if (!agent) return "unknown";
8
+ try {
9
+ return new URL(agent).hostname;
10
+ } catch {
11
+ return agent;
12
+ }
13
+ };
14
+ var AuthenticatedBadge = ({ sessionId, agent, dapp, userAccount, provider, callbacks }) => {
15
+ const emittedRef = (0, react.useRef)(false);
16
+ (0, react.useEffect)(() => {
17
+ if (emittedRef.current) return;
18
+ emittedRef.current = true;
19
+ const events = (0, _prosopo_procaptcha_common.getDefaultEvents)(callbacks);
20
+ const token = (0, _prosopo_types.encodeProcaptchaOutput)({
21
+ [_prosopo_types.ApiParams.providerUrl]: provider.provider.url,
22
+ [_prosopo_types.ApiParams.user]: userAccount.account.address,
23
+ [_prosopo_types.ApiParams.dapp]: dapp,
24
+ [_prosopo_types.ApiParams.commitmentId]: sessionId,
25
+ [_prosopo_types.ApiParams.timestamp]: Date.now().toString(),
26
+ [_prosopo_types.ApiParams.signature]: {
27
+ [_prosopo_types.ApiParams.provider]: {},
28
+ [_prosopo_types.ApiParams.user]: {}
29
+ },
30
+ [_prosopo_types.ApiParams.captchaType]: _prosopo_types.CaptchaType.authenticated
31
+ });
32
+ events.onHuman(token);
33
+ }, [
34
+ sessionId,
35
+ dapp,
36
+ userAccount,
37
+ provider,
38
+ callbacks
39
+ ]);
40
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
41
+ style: {
42
+ display: "inline-flex",
43
+ alignItems: "center",
44
+ gap: 8,
45
+ padding: "8px 12px",
46
+ borderRadius: 6,
47
+ background: "#eef2ff",
48
+ border: "1px solid #c7d2fe",
49
+ color: "#3730a3",
50
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
51
+ fontSize: 13,
52
+ lineHeight: 1.4
53
+ },
54
+ role: "status",
55
+ "aria-label": "Verified agent",
56
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
57
+ width: "16",
58
+ height: "16",
59
+ viewBox: "0 0 24 24",
60
+ fill: "none",
61
+ stroke: "currentColor",
62
+ strokeWidth: "2.5",
63
+ strokeLinecap: "round",
64
+ strokeLinejoin: "round",
65
+ "aria-hidden": "true",
66
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("title", { children: "Verified" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M20 6L9 17l-5-5" })]
67
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: agent ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
68
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "Verified agent" }),
69
+ ": ",
70
+ displayHost(agent)
71
+ ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "Trusted request" }) })]
72
+ });
73
+ };
74
+ //#endregion
75
+ exports.AuthenticatedBadge = AuthenticatedBadge;
@@ -1,3 +1,4 @@
1
+ const require_AuthenticatedBadge = require("./AuthenticatedBadge.cjs");
1
2
  const require_customDetectBot = require("./customDetectBot.cjs");
2
3
  const require_frictionlessResultGuard = require("./frictionlessResultGuard.cjs");
3
4
  const require_sessionInvalidatedRecovery = require("./sessionInvalidatedRecovery.cjs");
@@ -100,7 +101,21 @@ var ProcaptchaFrictionless = ({ config, callbacks, restart, i18n, detectBot = re
100
101
  const startCoords = escalationCoords ?? retryStartCoords;
101
102
  mountCountRef.current += 1;
102
103
  const mountKey = mountCountRef.current;
103
- if (captchaType === _prosopo_types.CaptchaType.image) {
104
+ if (captchaType === _prosopo_types.CaptchaType.authenticated) {
105
+ if (!frictionlessState.sessionId) {
106
+ events.onError(/* @__PURE__ */ new Error("authenticated captcha response missing sessionId — provider is misbehaving"));
107
+ fallOverWithStyle();
108
+ return;
109
+ }
110
+ setComponentToRender(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AuthenticatedBadge.AuthenticatedBadge, {
111
+ sessionId: frictionlessState.sessionId,
112
+ agent: frictionlessState.agent,
113
+ dapp: config.account.address ?? "",
114
+ userAccount: frictionlessState.userAccount,
115
+ provider: frictionlessState.provider,
116
+ callbacks
117
+ }));
118
+ } else if (captchaType === _prosopo_types.CaptchaType.image) {
104
119
  const Procaptcha = await ProcaptchaLoader();
105
120
  setComponentToRender(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Procaptcha, {
106
121
  config,
@@ -172,7 +187,8 @@ var ProcaptchaFrictionless = ({ config, callbacks, restart, i18n, detectBot = re
172
187
  deviceCapability: result.deviceCapability,
173
188
  encryptBehavioralData: result.encryptBehavioralData,
174
189
  getSimdReadings: result.getSimdReadings,
175
- hp: result.hp
190
+ hp: result.hp,
191
+ agent: result.agent
176
192
  };
177
193
  await renderForCaptchaType(result.captchaType, frictionlessState);
178
194
  stateRef.current = {
@@ -109,7 +109,8 @@ var customDetectBot = async (config, container, restartFn, retryContext) => {
109
109
  status: captcha.status,
110
110
  userAccount,
111
111
  error: captcha.error,
112
- hp: captcha.hp
112
+ hp: captcha.hp,
113
+ agent: captcha.agent
113
114
  };
114
115
  }
115
116
  const detectionResult = await providerDetect(container, restartFn, () => ext.getAccount(config));
@@ -135,6 +136,7 @@ var customDetectBot = async (config, container, restartFn, retryContext) => {
135
136
  userAccount,
136
137
  error: captcha.error,
137
138
  hp: captcha.hp,
139
+ agent: captcha.agent,
138
140
  behaviorCollector1: detectionResult.mouseTracker,
139
141
  behaviorCollector2: detectionResult.touchTracker,
140
142
  behaviorCollector3: detectionResult.clickTracker,
@@ -1,20 +1,49 @@
1
1
  //#region src/detectorLoader.ts
2
+ var blobAttempt = (script) => {
3
+ const url = URL.createObjectURL(new Blob([script], { type: "text/javascript" }));
4
+ return {
5
+ url,
6
+ release: () => URL.revokeObjectURL(url)
7
+ };
8
+ };
9
+ var dataAttempt = (script) => ({
10
+ url: `data:text/javascript;charset=utf-8,${encodeURIComponent(script)}`,
11
+ release: () => void 0
12
+ });
13
+ var defaultImporter = (url) => import(
14
+ /* @vite-ignore */
15
+ /* webpackIgnore: true */
16
+ url
17
+ );
2
18
  /**
3
- * Loads a detector from a provider-served obfuscated ESM string (the per-session
4
- * pool bundle). Evaluated via a blob URL — the served module is self-contained
5
- * (no imports), so dynamic `import()` of the blob yields its default export.
19
+ * Loads a detector from a provider-served obfuscated ESM string (the
20
+ * per-session pool bundle). The module is self-contained, so a dynamic
21
+ * `import()` yields its default export.
22
+ *
23
+ * A blob URL is tried first, then a `data:` URL. The two are gated by
24
+ * different CSP directives and sites commonly allow one without the other — a
25
+ * `script-src` of `*` matches neither, and a policy listing `data:` for
26
+ * scripts and `blob:` only for workers blocks the blob path outright. Without
27
+ * the fallback every session on such a site loses the detector, sends an empty
28
+ * token, and can never pass frictionlessly.
29
+ *
30
+ * A blocked attempt logs a CSP violation before the import rejects. That noise
31
+ * is the cost of recovering the session.
6
32
  */
7
- var DetectorLoaderFromScript = async (script) => {
8
- const blob = new Blob([script], { type: "text/javascript" });
9
- const url = URL.createObjectURL(blob);
10
- try {
11
- return (await import(
12
- /* @vite-ignore */
13
- url
14
- )).default;
15
- } finally {
16
- URL.revokeObjectURL(url);
33
+ var DetectorLoaderFromScript = async (script, importModule = defaultImporter) => {
34
+ let lastError = /* @__PURE__ */ new Error("no loader attempt ran");
35
+ for (const build of [blobAttempt, dataAttempt]) {
36
+ let attempt;
37
+ try {
38
+ attempt = build(script);
39
+ return (await importModule(attempt.url)).default;
40
+ } catch (err) {
41
+ lastError = err;
42
+ } finally {
43
+ attempt?.release();
44
+ }
17
45
  }
46
+ throw lastError;
18
47
  };
19
48
  //#endregion
20
49
  exports.DetectorLoaderFromScript = DetectorLoaderFromScript;
@@ -1 +1 @@
1
- {"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACX,oBAAoB,EAGpB,MAAM,gBAAgB,CAAC;AAyFxB,eAAO,MAAM,WAAW,GAAU,CAAC,WACzB,OAAO,CAAC,CAAC,CAAC,MACf,MAAM,KACR,OAAO,CAAC,CAAC,CAoBX,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,oBAqOtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACX,oBAAoB,EAGpB,MAAM,gBAAgB,CAAC;AAyFxB,eAAO,MAAM,WAAW,GAAU,CAAC,WACzB,OAAO,CAAC,CAAC,CAAC,MACf,MAAM,KACR,OAAO,CAAC,CAAC,CAoBX,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,oBAuOtB,CAAC;AAEF,eAAe,eAAe,CAAC"}