@lenne.tech/nest-server 12.6.7 → 12.6.8
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/.claude/rules/testing.md +3 -3
- package/FRAMEWORK-API.md +1 -1
- package/dist/core/common/filters/http-exception-log.filter.js +4 -3
- package/dist/core/common/filters/http-exception-log.filter.js.map +1 -1
- package/migration-guides/12.6.7-to-12.6.8.md +69 -0
- package/package.json +5 -5
- package/src/core/common/filters/http-exception-log.filter.ts +7 -3
package/.claude/rules/testing.md
CHANGED
|
@@ -410,7 +410,7 @@ pnpm run check:mutations -- --id=<id> # one mutation
|
|
|
410
410
|
pnpm run check:mutations -- --list # the registry, without running anything
|
|
411
411
|
pnpm run check:mutations -- --allow-dirty # when the fix and its evidence share a working tree
|
|
412
412
|
pnpm run check:mutations -- --jobs=4 # N mutations at a time (default: 2, or 4 on >=12 cores)
|
|
413
|
-
pnpm run check:mutations -- --no-infra # only the
|
|
413
|
+
pnpm run check:mutations -- --no-infra # only the 385 that need no MongoDB
|
|
414
414
|
pnpm run check:mutations -- --since=<ref> # only mutations touching files changed since <ref>
|
|
415
415
|
pnpm run check:mutations -- --shard=2/4 # this job's quarter of the selection (CI splits the full run)
|
|
416
416
|
```
|
|
@@ -430,7 +430,7 @@ when the registry, a vitest config or a setup file changed, since those can move
|
|
|
430
430
|
commit, and in CI alongside the publish without blocking it. The price of caching is a cache that
|
|
431
431
|
has to model each spec's full dependency closure correctly, and getting that wrong produces a stale
|
|
432
432
|
PASS for a test that has since gone vacuous — exactly what the gate is there to prevent. Bad trade
|
|
433
|
-
at
|
|
433
|
+
at 615 mutations.
|
|
434
434
|
|
|
435
435
|
**Decided 2026-10-03 (repo owner): keep the full run.** Measured at 128 mutations, the CI job for
|
|
436
436
|
11.41.6 took **14 minutes**. The trigger to revisit is that wall time, not the mutation count —
|
|
@@ -503,7 +503,7 @@ exactly the environment where the answer matters.
|
|
|
503
503
|
|
|
504
504
|
Worth knowing before optimising the wrong thing: the specs behind all 230 e2e mutations add up to
|
|
505
505
|
**~40 seconds**. The step takes ~740s. The remaining ~700s is paying vitest's startup — process
|
|
506
|
-
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation,
|
|
506
|
+
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation, 615 times.
|
|
507
507
|
That work is largely single-threaded I/O and barely scales with cores: the full registry measures
|
|
508
508
|
**744s on a 12-core laptop and 777s on a 4-vCPU CI runner**.
|
|
509
509
|
|
package/FRAMEWORK-API.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lenne.tech/nest-server — Framework API Reference
|
|
2
2
|
|
|
3
|
-
> Auto-generated from source code as of 2026-11-09 (v12.6.
|
|
3
|
+
> Auto-generated from source code as of 2026-11-09 (v12.6.8)
|
|
4
4
|
> File: `FRAMEWORK-API.md` — compact, machine-readable API surface for Claude Code
|
|
5
5
|
|
|
6
6
|
## CoreModule.forRoot()
|
|
@@ -16,9 +16,10 @@ let HttpExceptionLogFilter = class HttpExceptionLogFilter {
|
|
|
16
16
|
const ctx = host.switchToHttp();
|
|
17
17
|
const res = ctx.getResponse();
|
|
18
18
|
const status = exception.getStatus();
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const body = { ...exception };
|
|
20
|
+
delete body.options;
|
|
21
|
+
delete body.cause;
|
|
22
|
+
res.status(status).json(exception instanceof ServiceUnavailableException ? body.response : body);
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
HttpExceptionLogFilter = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-exception-log.filter.js","sourceRoot":"","sources":["../../../../src/core/common/filters/http-exception-log.filter.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAEL,KAAK,EAEL,aAAa,EACb,MAAM,EACN,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AASxB,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAGtD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAIjC,KAAK,CAAC,SAAwB,EAAE,IAAmB;QAEjD,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAGvC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAkB,CAAC;QAC5C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QAGD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAY,CAAC;QACxC,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"http-exception-log.filter.js","sourceRoot":"","sources":["../../../../src/core/common/filters/http-exception-log.filter.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAEL,KAAK,EAEL,aAAa,EACb,MAAM,EACN,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AASxB,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAGtD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAIjC,KAAK,CAAC,SAAwB,EAAE,IAAmB;QAEjD,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAGvC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAkB,CAAC;QAC5C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QAGD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAY,CAAC;QACxC,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,EAAE,CAAC;QAIrC,MAAM,IAAI,GAA4B,EAAE,GAAG,SAAS,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC;QAClB,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,2BAA2B,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACnG,CAAC;CACF,CAAA;AA1BY,sBAAsB;IADlC,KAAK,CAAC,aAAa,CAAC;GACR,sBAAsB,CA0BlC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Migration Guide: 12.6.7 → 12.6.8
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
| Category | Details |
|
|
6
|
+
|---|---|
|
|
7
|
+
| **Breaking Changes** | None for the application. The minimum versions of the optional peers rise: mongodb `>= 7.8.0`, mongoose `>= 9.12.0` (§1) |
|
|
8
|
+
| **New Features** | None |
|
|
9
|
+
| **Bugfixes** | Security: mongodb 7.8.0 closes GHSA-77w5-j825-v4qm (`timeoutMS`) and a flaw in the host-name check of SRV lookups (`mongodb+srv://`) (§1). Error responses of `HttpExceptionLogFilter` no longer contain `options` / `cause` (§2) |
|
|
10
|
+
| **Migration Effort** | `pnpm run update`. A project that pins mongoose / mongodb itself — vendored cores included — raises them (§1) |
|
|
11
|
+
|
|
12
|
+
12.6.8 is a security patch for 12.6.7 (`latest-12.6`). Besides the dependency update, one framework fix: error responses no longer carry `options` / `cause` (§2).
|
|
13
|
+
The mongoose / mongodb update also ships in 12.8.4 (`latest`); both changes ship in 12.8.5 (`latest`) and 11.46.1 (`latest-11`).
|
|
14
|
+
|
|
15
|
+
## Quick Migration
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add @lenne.tech/nest-server@12.6.8
|
|
19
|
+
pnpm run update # nest-server-starter based projects
|
|
20
|
+
pnpm run build
|
|
21
|
+
pnpm test
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual, and raise mongoose / mongodb in the project's own
|
|
25
|
+
`package.json` (§1).
|
|
26
|
+
|
|
27
|
+
## 1. mongoose 9.12.0 and mongodb 7.8.0 (security)
|
|
28
|
+
|
|
29
|
+
mongoose 9.12.0 moves to the mongodb driver 7.8.0. That driver closes two flaws present in every earlier 7.x:
|
|
30
|
+
|
|
31
|
+
- **GHSA-77w5-j825-v4qm / CVE-2026-119179** (high): with `timeoutMS`, a connection-pool desynchronization after an
|
|
32
|
+
operation timeout could hand one user's data to another. Only projects that set `timeoutMS` themselves are affected —
|
|
33
|
+
the framework never sets it. Since 7.8.0 `timeoutMS` is a no-op; use `serverSelectionTimeoutMS`, `socketTimeoutMS`,
|
|
34
|
+
`waitQueueTimeoutMS` and `maxTimeMS` instead.
|
|
35
|
+
- **SRV host-name verification** (mongodb `>= 3.3.3 < 7.8.0`, no GHSA): a host returned by the SRV lookup of a
|
|
36
|
+
`mongodb+srv://` URL was not verified properly, so whoever controlled the DNS answer could redirect the driver to a
|
|
37
|
+
host outside your domain. Projects with `mongodb://host1,host2` URLs are not affected.
|
|
38
|
+
|
|
39
|
+
Neither appears in `pnpm audit`, so the update is the only signal.
|
|
40
|
+
|
|
41
|
+
**What changed:** the optional peers now require mongodb `>= 7.8.0` and mongoose `>= 9.12.0` (before: `>= 7.7.0` /
|
|
42
|
+
`>= 9.11.4`). mongoose 9.11 pins the driver to `~7.7`, so raising mongodb alone leaves mongoose's own copy vulnerable —
|
|
43
|
+
raise both.
|
|
44
|
+
|
|
45
|
+
**What to do:** nest-server-starter based projects get both through `pnpm run update`. A project that pins mongoose and
|
|
46
|
+
mongodb itself — every vendor-mode project on MongoDB does — sets them to `9.12.0` / `7.8.0`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm add mongoose@9.12.0 mongodb@7.8.0
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 2. Error responses no longer contain `options` / `cause`
|
|
53
|
+
|
|
54
|
+
`HttpExceptionLogFilter` (registered by nest-server-starter's `main.ts` while `logExceptions` is on, its default)
|
|
55
|
+
answered a REST request with every field of the exception — including `options` and the `cause` the throwing code
|
|
56
|
+
passed (`new BadRequestException('…', { cause: dbError })`). An internal error message, a query or a connection
|
|
57
|
+
string could reach the client that way. Error responses now leave `options` and `cause` out; `response`, `status`,
|
|
58
|
+
`message` and `name` stay as before, so frontends reading them need no change. The cause is still logged.
|
|
59
|
+
|
|
60
|
+
## Troubleshooting
|
|
61
|
+
|
|
62
|
+
| Symptom | Cause | Fix |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| Peer warning for mongoose / mongodb | The project pins 9.11 / 7.7 | `pnpm add mongoose@9.12.0 mongodb@7.8.0` |
|
|
65
|
+
| Operations no longer time out after `timeoutMS` | `timeoutMS` is a no-op since mongodb 7.8.0 | `serverSelectionTimeoutMS`, `socketTimeoutMS`, `maxTimeMS` |
|
|
66
|
+
|
|
67
|
+
## References
|
|
68
|
+
|
|
69
|
+
- `package.json` — `peerDependencies` (mongodb, mongoose)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Server framework in TypeScript on top of NestJS: GraphQL and REST APIs on MongoDB, PostgreSQL, MySQL or MariaDB, with authentication, field-level permissions, multi-tenancy, offline sync and an AI assistant.",
|
|
6
6
|
"keywords": [
|
|
@@ -164,8 +164,8 @@
|
|
|
164
164
|
"drizzle-orm": "1.0.0-rc.5",
|
|
165
165
|
"ioredis": ">=5.0.0 <7",
|
|
166
166
|
"kysely": ">=0.29.0 <0.30.0",
|
|
167
|
-
"mongodb": ">=7.
|
|
168
|
-
"mongoose": ">=9.
|
|
167
|
+
"mongodb": ">=7.8.0 <8",
|
|
168
|
+
"mongoose": ">=9.12.0 <10",
|
|
169
169
|
"mysql2": ">=3.24.6 <4",
|
|
170
170
|
"pg": ">=8.23.0 <9",
|
|
171
171
|
"typeorm": ">=1.1.0 <2"
|
|
@@ -256,8 +256,8 @@
|
|
|
256
256
|
"drizzle-orm": "1.0.0-rc.5",
|
|
257
257
|
"ioredis": "6.0.0",
|
|
258
258
|
"kysely": "0.29.8",
|
|
259
|
-
"mongodb": "7.
|
|
260
|
-
"mongoose": "9.
|
|
259
|
+
"mongodb": "7.8.0",
|
|
260
|
+
"mongoose": "9.12.0",
|
|
261
261
|
"mysql2": "3.24.6",
|
|
262
262
|
"nodemon": "3.1.14",
|
|
263
263
|
"otpauth": "9.6.0",
|
|
@@ -35,8 +35,12 @@ export class HttpExceptionLogFilter implements ExceptionFilter {
|
|
|
35
35
|
const ctx = host.switchToHttp();
|
|
36
36
|
const res = ctx.getResponse<Response>();
|
|
37
37
|
const status = exception.getStatus();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
// The exception's own fields, minus what it carries for the log: `options` and the `cause` passed to it (an
|
|
39
|
+
// internal error, a query, a connection string) must never reach the client. The shape the frontends read
|
|
40
|
+
// (response, status, message, name) is unchanged.
|
|
41
|
+
const body: Record<string, unknown> = { ...exception };
|
|
42
|
+
delete body.options;
|
|
43
|
+
delete body.cause;
|
|
44
|
+
res.status(status).json(exception instanceof ServiceUnavailableException ? body.response : body);
|
|
41
45
|
}
|
|
42
46
|
}
|