@prosopo/cli 3.6.32 → 3.6.33

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.32 build:cjs
2
+ > @prosopo/cli@3.6.33 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -56,9 +56,9 @@ ViteCommonJSConfig: .
56
56
  vite v6.4.1 building SSR bundle for production...
57
57
  Bundle build started
58
58
  transforming...
59
- Entry module "src/commands/siteKeyRegister.ts" is using named and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
60
59
  Build end
61
60
  ✓ 20 modules transformed.
61
+ Entry module "src/commands/siteKeyRegister.ts" is using named and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
62
62
  rendering chunks...
63
63
  dist/cjs/commands/version.cjs 0.48 kB
64
64
  dist/cjs/index.cjs 0.73 kB
@@ -80,4 +80,4 @@ rendering chunks...
80
80
  dist/cjs/commands/siteKeyRegister.cjs 3.75 kB
81
81
  dist/cjs/prosopo.config.cjs 5.29 kB
82
82
  dist/cjs/RateLimiter.cjs 5.48 kB
83
- ✓ built in 189ms
83
+ ✓ built in 227ms
@@ -1,8 +1,8 @@
1
1
 
2
- > @prosopo/cli@3.6.32 build:tsc
2
+ > @prosopo/cli@3.6.33 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 10:14:16 AM - Projects in this build:
5
+ 5:18:23 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
- 10:14:16 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'
31
+ 5:18:23 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
- 10:14:16 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/util.ts' is older than output '../locale/tsconfig.tsbuildinfo'
33
+ 5:18:23 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
- 10:14:16 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
35
+ 5:18:23 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
- 10:14:16 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'
37
+ 5:18:23 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
- 10:14:16 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
39
+ 5:18:23 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
- 10:14:16 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
41
+ 5:18:23 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
- 10:14:16 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
43
+ 5:18:23 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
- 10:14:16 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
45
+ 5:18:23 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/index.ts' is older than output '../common/tsconfig.tsbuildinfo'
46
46
 
47
- 10:14:16 AM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/index.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
47
+ 5:18:23 PM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/index.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
48
48
 
49
- 10:14:16 AM - Project '../ipinfo/tsconfig.json' is up to date because newest input '../ipinfo/src/IpInfoService.ts' is older than output '../ipinfo/tsconfig.tsbuildinfo'
49
+ 5:18:23 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
- 10:14:16 AM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
51
+ 5:18:23 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/apiRoutes.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
52
52
 
53
- 10:14:16 AM - 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'
53
+ 5:18:23 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
- 10:14:16 AM - 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'
55
+ 5:18:23 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
- 10:14:16 AM - 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'
57
+ 5:18:23 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
- 10:14:16 AM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/unit/databases/centralDbStreamer.unit.test.ts' is older than output '../database/tsconfig.tsbuildinfo'
59
+ 5:18:23 PM - Project '../database/tsconfig.json' is up to date because newest input '../database/src/tests/integration/ipInfoPersistence.integration.test.ts' is older than output '../database/tsconfig.tsbuildinfo'
60
60
 
61
- 10:14:16 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
61
+ 5:18:23 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
- 10:14:17 AM - 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'
63
+ 5:18:23 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
- 10:14:17 AM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/env.ts' is older than output '../env/tsconfig.tsbuildinfo'
65
+ 5:18:23 PM - Project '../env/tsconfig.json' is up to date because newest input '../env/src/env.ts' is older than output '../env/tsconfig.tsbuildinfo'
66
66
 
67
- 10:14:17 AM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/apiExpressRouterFactory.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
67
+ 5:18:23 PM - Project '../api-express-router/tsconfig.json' is up to date because newest input '../api-express-router/src/apiExpressRouterFactory.ts' is older than output '../api-express-router/tsconfig.tsbuildinfo'
68
68
 
69
- 10:14:17 AM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
69
+ 5:18:23 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/index.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
70
70
 
71
- 10:14:17 AM - 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'
71
+ 5:18:23 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
- 10:14:17 AM - Project '../provider/tsconfig.json' is up to date because newest input '../provider/src/util.ts' is older than output '../provider/tsconfig.tsbuildinfo'
73
+ 5:18:23 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
- 10:14:17 AM - 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'
75
+ 5:18:23 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
- 10:14:17 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
77
+ 5:18:23 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
78
78
 
79
- 10:14:17 AM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
79
+ 5:18:23 PM - Building project '/home/runner/work/captcha/captcha/packages/cli/tsconfig.json'...
80
80
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/cli@3.6.32 build
2
+ > @prosopo/cli@3.6.33 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/cli@3.6.32 build:cross-env
6
+ > @prosopo/cli@3.6.33 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -83,4 +83,4 @@ rendering chunks...
83
83
  dist/commands/siteKeyRegister.js 3.61 kB
84
84
  dist/prosopo.config.js 4.91 kB
85
85
  dist/RateLimiter.js 5.25 kB
86
- ✓ built in 322ms
86
+ ✓ built in 310ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @prosopo/cli
2
2
 
3
+ ## 3.6.33
4
+ ### Patch Changes
5
+
6
+ - b24ea03: Caddy now SNI-routes :443 with caddy-l4. Pixel URL drops the :9362 port; HTTP-01 ACME renewals keep working via auto-managed :80.
7
+ - 3420831: DNS sidecar event merge: atomic dotted-path `$set` so DNS + HTTP legs co-occur on one session (was clobbering: prior projection omitted `dnsEvent`, every write started from `undefined`). Caddy now forwards PROXY-protocol v2 on the `*.t.{domain}` route and the sidecar (≥0.1.6) reads it, so `dnsEvent.peerIp` records the real client IP instead of the docker bridge address.
8
+
3
9
  ## 3.6.32
4
10
  ### Patch Changes
5
11
 
@@ -1763,7 +1763,7 @@ function O2e(e) {
1763
1763
  }
1764
1764
  return t.sort((n, i) => i.length - n.length), t;
1765
1765
  }
1766
- const b2e = typeof process < "u" ? "3.6.32" : void 0, mye = b2e || "dev", rP = new Array(256), gye = new Array(256 * 256);
1766
+ const b2e = typeof process < "u" ? "3.6.33" : void 0, mye = b2e || "dev", rP = new Array(256), gye = new Array(256 * 256);
1767
1767
  for (let e = 0; e < 256; e++)
1768
1768
  rP[e] = e.toString(16).padStart(2, "0");
1769
1769
  for (let e = 0; e < 256; e++) {
@@ -91527,6 +91527,37 @@ class XM extends Tk {
91527
91527
  });
91528
91528
  }
91529
91529
  }
91530
+ /**
91531
+ * Merge a DNS sidecar observation into the session's `dnsEvent` subdoc
91532
+ * using dotted-path `$set` so DNS-leg and HTTP-leg events on the same
91533
+ * session don't clobber each other. Replaces the prior read-modify-write
91534
+ * pattern that lost half the fields under any race (and 100% of the time
91535
+ * when the read projection didn't include `dnsEvent`).
91536
+ *
91537
+ * `receivedAtIfAbsent` is written only on the first hit for a session
91538
+ * via a `$cond` in an aggregation-pipeline update; later events leave
91539
+ * the original timestamp alone.
91540
+ */
91541
+ async mergeSessionDnsEvent(t, r, n) {
91542
+ const i = {
91543
+ "dnsEvent.receivedAt": {
91544
+ $ifNull: ["$dnsEvent.receivedAt", n]
91545
+ },
91546
+ lastUpdatedTimestamp: /* @__PURE__ */ new Date(),
91547
+ pendingStage: !0
91548
+ };
91549
+ r.resolverIp !== void 0 && (i["dnsEvent.resolverIp"] = r.resolverIp), r.peerIp !== void 0 && (i["dnsEvent.peerIp"] = r.peerIp), r.pathValid !== void 0 && (i["dnsEvent.pathValid"] = r.pathValid);
91550
+ try {
91551
+ return (await this.tables.session.updateOne({ sessionId: t }, [
91552
+ { $set: i }
91553
+ ])).matchedCount > 0;
91554
+ } catch (s) {
91555
+ throw new ur("DATABASE.SESSION_GET_FAILED", {
91556
+ context: { error: s, sessionId: t },
91557
+ logger: this.logger
91558
+ });
91559
+ }
91560
+ }
91530
91561
  /**
91531
91562
  * Get an active session by user IP hash
91532
91563
  * @param userSitekeyIpHash The hash of user, IP and sitekey combination
@@ -116561,9 +116592,13 @@ class uet {
116561
116592
  return j_e;
116562
116593
  }
116563
116594
  }
116564
- const cet = (e, t) => {
116565
- const r = t?.receivedAt ?? /* @__PURE__ */ new Date(), n = { ...t ?? {}, receivedAt: r };
116566
- return e.kind === "dns" ? n.resolverIp = e.src_ip : (n.peerIp = e.src_ip, typeof e.path_valid == "boolean" && (n.pathValid = e.path_valid)), n;
116595
+ const cet = (e) => {
116596
+ if (e.kind === "dns")
116597
+ return { resolverIp: e.src_ip };
116598
+ const t = {
116599
+ peerIp: e.src_ip
116600
+ };
116601
+ return typeof e.path_valid == "boolean" && (t.pathValid = e.path_valid), t;
116567
116602
  };
116568
116603
  class fet {
116569
116604
  constructor(t) {
@@ -116573,19 +116608,21 @@ class fet {
116573
116608
  r = r || Nr("info", import.meta.url);
116574
116609
  const { events: n } = t;
116575
116610
  let i = 0, s = 0;
116576
- for (const o of n) {
116577
- const a = o.jti;
116578
- if (a)
116611
+ const o = /* @__PURE__ */ new Date();
116612
+ for (const a of n) {
116613
+ const u = a.jti;
116614
+ if (u)
116579
116615
  try {
116580
- const u = await this.db.getSessionRecordBySessionId(a);
116581
- if (!u)
116582
- continue;
116583
- const c = cet(o, u.dnsEvent);
116584
- await this.db.updateSessionRecord(a, { dnsEvent: c }), i += 1;
116585
- } catch (u) {
116616
+ const c = cet(a);
116617
+ await this.db.mergeSessionDnsEvent(
116618
+ u,
116619
+ c,
116620
+ o
116621
+ ) && (i += 1);
116622
+ } catch (c) {
116586
116623
  s += 1, r.warn(() => ({
116587
- err: u,
116588
- data: { sessionId: a, kind: o.kind },
116624
+ err: c,
116625
+ data: { sessionId: u, kind: a.kind },
116589
116626
  msg: "Failed to merge DNS event into session"
116590
116627
  }));
116591
116628
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/cli",
3
- "version": "3.6.32",
3
+ "version": "3.6.33",
4
4
  "description": "CLI for Prosopo Provider",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",