@lenne.tech/nest-server 12.4.0 → 12.6.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/.claude/rules/configurable-features.md +2 -1
- package/.claude/rules/testing.md +5 -4
- package/CLAUDE.md +4 -0
- package/FRAMEWORK-API.md +2 -1
- package/dist/core/common/helpers/config-endpoint.helper.d.ts +3 -0
- package/dist/core/common/helpers/config-endpoint.helper.js +17 -0
- package/dist/core/common/helpers/config-endpoint.helper.js.map +1 -0
- package/dist/core/common/helpers/redact-secrets.helper.d.ts +3 -0
- package/dist/core/common/helpers/redact-secrets.helper.js +72 -0
- package/dist/core/common/helpers/redact-secrets.helper.js.map +1 -0
- package/dist/core/common/interfaces/server-options.interface.d.ts +1 -0
- package/dist/core/common/services/config.service.d.ts +3 -0
- package/dist/core/common/services/config.service.js +17 -3
- package/dist/core/common/services/config.service.js.map +1 -1
- package/dist/core/common/services/rate-limit-store.d.ts +1 -0
- package/dist/core/common/services/rate-limit-store.js +3 -3
- package/dist/core/common/services/rate-limit-store.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth-api.middleware.d.ts +1 -0
- package/dist/core/modules/better-auth/core-better-auth-api.middleware.js +23 -0
- package/dist/core/modules/better-auth/core-better-auth-api.middleware.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth-email-verification.service.d.ts +31 -1
- package/dist/core/modules/better-auth/core-better-auth-email-verification.service.js +96 -14
- package/dist/core/modules/better-auth/core-better-auth-email-verification.service.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth-openapi.helper.js +8 -1
- package/dist/core/modules/better-auth/core-better-auth-openapi.helper.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth-verification-link.helper.d.ts +3 -0
- package/dist/core/modules/better-auth/core-better-auth-verification-link.helper.js +29 -0
- package/dist/core/modules/better-auth/core-better-auth-verification-link.helper.js.map +1 -0
- package/dist/core/modules/better-auth/core-better-auth.controller.d.ts +8 -0
- package/dist/core/modules/better-auth/core-better-auth.controller.js +51 -0
- package/dist/core/modules/better-auth/core-better-auth.controller.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth.module.d.ts +1 -0
- package/dist/core/modules/better-auth/core-better-auth.module.js +10 -1
- package/dist/core/modules/better-auth/core-better-auth.module.js.map +1 -1
- package/dist/core/modules/hub/core-hub.service.js +1 -13
- package/dist/core/modules/hub/core-hub.service.js.map +1 -1
- package/dist/core/modules/hub/helpers/hub-mask.helper.d.ts +1 -1
- package/dist/core/modules/hub/helpers/hub-mask.helper.js +1 -42
- package/dist/core/modules/hub/helpers/hub-mask.helper.js.map +1 -1
- package/dist/core/modules/system-setup/core-system-setup.service.d.ts +59 -2
- package/dist/core/modules/system-setup/core-system-setup.service.js +157 -28
- package/dist/core/modules/system-setup/core-system-setup.service.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/server/server.controller.d.ts +1 -1
- package/dist/server/server.controller.js +2 -2
- package/dist/server/server.controller.js.map +1 -1
- package/migration-guides/12.4.x-to-12.5.x.md +136 -0
- package/migration-guides/12.5.x-to-12.6.x.md +213 -0
- package/package.json +5 -4
- package/src/core/common/helpers/config-endpoint.helper.ts +56 -0
- package/src/core/common/helpers/redact-secrets.helper.ts +175 -0
- package/src/core/common/interfaces/server-options.interface.ts +26 -5
- package/src/core/common/services/config.service.ts +41 -3
- package/src/core/common/services/rate-limit-store.ts +9 -3
- package/src/core/modules/better-auth/README.md +27 -0
- package/src/core/modules/better-auth/core-better-auth-api.middleware.ts +33 -0
- package/src/core/modules/better-auth/core-better-auth-email-verification.service.ts +218 -35
- package/src/core/modules/better-auth/core-better-auth-openapi.helper.ts +8 -1
- package/src/core/modules/better-auth/core-better-auth-verification-link.helper.ts +53 -0
- package/src/core/modules/better-auth/core-better-auth.controller.ts +61 -0
- package/src/core/modules/better-auth/core-better-auth.module.ts +18 -2
- package/src/core/modules/hub/README.md +3 -1
- package/src/core/modules/hub/core-hub.service.ts +4 -20
- package/src/core/modules/hub/helpers/hub-mask.helper.ts +4 -92
- package/src/core/modules/system-setup/README.md +20 -4
- package/src/core/modules/system-setup/core-system-setup.service.ts +290 -45
- package/src/index.ts +2 -0
- package/src/server/server.controller.ts +7 -2
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export * from './core/common/filters/http-exception-log.filter.js';
|
|
|
24
24
|
export * from './core/common/filters/mongoose-cast-error.filter.js';
|
|
25
25
|
export * from './core/common/helpers/common.helper.js';
|
|
26
26
|
export * from './core/common/helpers/config.helper.js';
|
|
27
|
+
export * from './core/common/helpers/config-endpoint.helper.js';
|
|
27
28
|
export * from './core/common/helpers/content-disposition.helper.js';
|
|
28
29
|
export * from './core/common/helpers/context.helper.js';
|
|
29
30
|
export * from './core/common/helpers/cookies.helper.js';
|
|
@@ -44,6 +45,7 @@ export * from './core/common/helpers/meta.helper.js';
|
|
|
44
45
|
export * from './core/common/helpers/model.helper.js';
|
|
45
46
|
export * from './core/common/helpers/outbound-url.helper.js';
|
|
46
47
|
export * from './core/common/helpers/process-diagnostics.helper.js';
|
|
48
|
+
export * from './core/common/helpers/redact-secrets.helper.js';
|
|
47
49
|
export * from './core/common/helpers/register-enum.helper.js';
|
|
48
50
|
export * from './core/common/helpers/scim.helper.js';
|
|
49
51
|
export * from './core/common/helpers/service.helper.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AAKjC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,oDAAoD,CAAC;AACnE,cAAc,4DAA4D,CAAC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AAC;AAC5E,cAAc,yDAAyD,CAAC;AACxE,cAAc,0DAA0D,CAAC;AACzE,cAAc,8DAA8D,CAAC;AAM7E,cAAc,kDAAkD,CAAC;AACjE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAClE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AAMnE,cAAc,6BAA6B,CAAC;AAM5C,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mDAAmD,CAAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAM7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sDAAsD,CAAC;AACrE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uEAAuE,CAAC;AAMtF,cAAc,uBAAuB,CAAC"}
|
|
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { Controller, Get, Render } from '@nestjs/common';
|
|
11
|
-
import { ConfigService, RoleEnum, Roles } from '../index.js';
|
|
11
|
+
import { ConfigService, configEndpointResponse, RoleEnum, Roles } from '../index.js';
|
|
12
12
|
let ServerController = class ServerController {
|
|
13
13
|
configService;
|
|
14
14
|
constructor(configService) {
|
|
@@ -20,7 +20,7 @@ let ServerController = class ServerController {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
config() {
|
|
23
|
-
return
|
|
23
|
+
return configEndpointResponse();
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.controller.js","sourceRoot":"","sources":["../../src/server/server.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"server.controller.js","sourceRoot":"","sources":["../../src/server/server.controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAI9E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACL;IAAtB,YAAsB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAKtD,IAAI;QACF,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC;IASD,MAAM;QACJ,OAAO,sBAAsB,EAAE,CAAC;IAClC,CAAC;CACF,CAAA;AAhBC;IAHC,GAAG,EAAE;IACL,MAAM,CAAC,OAAO,CAAC;IACf,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;;;;4CAK1B;AASD;IAFC,GAAG,CAAC,QAAQ,CAAC;IACb,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;;;;8CAGrB;AArBU,gBAAgB;IAF5B,UAAU,EAAE;IACZ,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;qCAEiB,aAAa;GADvC,gBAAgB,CAsB5B"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Migration Guide: 12.4.x → 12.5.x
|
|
2
|
+
|
|
3
|
+
## 12.5.0 contains breaking changes
|
|
4
|
+
|
|
5
|
+
The version number moves only the MINOR digit (the MAJOR follows NestJS). Read §1 before you update: a project's
|
|
6
|
+
`GET /config` answers 404 in deployed environments from now on — once the project's controller uses the core's
|
|
7
|
+
`configEndpointResponse()`, which this guide asks for.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
| Category | Details |
|
|
12
|
+
|---|---|
|
|
13
|
+
| **Breaking Changes** | `GET /config` via `configEndpointResponse()` answers only in `local`, `ci` and `e2e` unless `configEndpoint` opens it, and always redacted (§1) |
|
|
14
|
+
| **New Features** | `redactSecrets()`, `ConfigService.getRedactedConfig()`, `configEndpointResponse()`, `isConfigEndpointEnabled()`, the `configEndpoint` setting (§1) |
|
|
15
|
+
| **Bugfixes** | `GET /config` of a project created before the starter redacted returned every secret of the deployment to administrators (§1). The `ConfigService` debug output (`warn: true`) printed the configuration unredacted (§2). `ConfigService#mergeProperty(key, value)` merged nothing (§3) |
|
|
16
|
+
| **Migration Effort** | One line in the project's `ServerController` (§1). Nothing else |
|
|
17
|
+
|
|
18
|
+
## Quick Migration
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @lenne.tech/nest-server@12.5.0
|
|
22
|
+
pnpm run update # nest-server-starter based projects: aligns the pins the framework raised
|
|
23
|
+
pnpm run build
|
|
24
|
+
pnpm test
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual, then apply §1 to `src/server/server.controller.ts`.
|
|
28
|
+
|
|
29
|
+
## 1. `GET /config`: redacted by the core, closed in deployed environments
|
|
30
|
+
|
|
31
|
+
The route lives in project code — the starter's `ServerController`. Until the starter redacted it (October 2026) it
|
|
32
|
+
returned `configFastButReadOnly` as it is: the database URI with its password, the JWT and Better-Auth secrets, the
|
|
33
|
+
mail password, API keys. Every project created before that still does, and an administrator account — or a stolen
|
|
34
|
+
administrator session — was enough to read them.
|
|
35
|
+
|
|
36
|
+
**What the core now provides:**
|
|
37
|
+
|
|
38
|
+
- `redactSecrets(value, extraSecretKeys?)` — the framework's one masker (moved from the Hub, where it stays available
|
|
39
|
+
as `maskConfigDeep`). It masks by key name — `secret`, `password`, `token` and `credential` anywhere in the name,
|
|
40
|
+
names ending in `pass` or `key` (`smtpPass`, `signingKey`), `encryption`, `dsn`, `salt`, … — masks the password of a
|
|
41
|
+
connection URI and every secret-named query parameter of a URI, keeps only scheme, host and port of an address under
|
|
42
|
+
a key ending in `url`, `uri`, `endpoint` or `webhook` (a webhook carries its secret in the path), works through nested
|
|
43
|
+
values, and masks EVERYTHING below a secret-named key except booleans.
|
|
44
|
+
- `ConfigService.getRedactedConfig()` — the running configuration through `redactSecrets()`, with the framework's
|
|
45
|
+
secret fields and your `security.secretFields`. The Hub config panel shows the same view.
|
|
46
|
+
- `configEndpointResponse()` — the body of `GET /config`: the redacted configuration, or a 404 where the endpoint is
|
|
47
|
+
closed.
|
|
48
|
+
- `configEndpoint` — whether it answers:
|
|
49
|
+
|
|
50
|
+
| `configEndpoint` | `local` / `ci` / `e2e` | every other environment (`develop`, `test`, `production`, …) |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| not set | answers | **404** |
|
|
53
|
+
| `true` | answers | answers |
|
|
54
|
+
| `false` | 404 | 404 |
|
|
55
|
+
|
|
56
|
+
A value that is not a boolean counts as not set. Environment variable: `NSC__CONFIG_ENDPOINT=true`.
|
|
57
|
+
|
|
58
|
+
**What to do** — in `src/server/server.controller.ts`, replace the body of the `config()` handler:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// Before (verbatim configuration, or the starter's own redact-secrets.util.ts)
|
|
62
|
+
@Get('config')
|
|
63
|
+
@Roles(RoleEnum.ADMIN)
|
|
64
|
+
config() {
|
|
65
|
+
return JSON.parse(JSON.stringify(this.configService.configFastButReadOnly));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// After
|
|
69
|
+
import { configEndpointResponse } from '@lenne.tech/nest-server';
|
|
70
|
+
|
|
71
|
+
@Get('config')
|
|
72
|
+
@Roles(RoleEnum.ADMIN)
|
|
73
|
+
config() {
|
|
74
|
+
return configEndpointResponse();
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
A starter-based project that already redacts with `src/server/common/utils/redact-secrets.util.ts` can delete that
|
|
79
|
+
file: the core's key pattern is a superset of that util's, and the core also masks what the util let through (values
|
|
80
|
+
nested below a secret-named key, a password passed as a URI query parameter). One difference you will see: the util
|
|
81
|
+
blanked a whole URL, the core keeps its scheme, host and port.
|
|
82
|
+
|
|
83
|
+
**Who calls `/config`?** No frontend or script of the lenne.Tech stack does; it is an administrator's debugging aid.
|
|
84
|
+
**If your project's own admin UI or tooling reads `/config` on a deployed stage, switch it back on there explicitly:**
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
NSC__CONFIG_ENDPOINT=true # or configEndpoint: true in config.env.ts for that environment
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The endpoint then answers in that environment again, and the answer stays redacted: secret values read `***`, every
|
|
91
|
+
other setting is unchanged. An admin UI that displayed secrets from `/config` gets `***` for them from now on — that is
|
|
92
|
+
the point of this change.
|
|
93
|
+
|
|
94
|
+
**The status codes:** without a session the route's `@Roles(ADMIN)` still answers 401; an administrator gets 404
|
|
95
|
+
where the endpoint is closed, so it reads like a route that does not exist.
|
|
96
|
+
|
|
97
|
+
## 2. The `ConfigService` debug output is redacted
|
|
98
|
+
|
|
99
|
+
`new ConfigService(config, { warn: true })`, `mergeConfig(…, { warn: true })` and `setConfig(…, { warn: true })` print
|
|
100
|
+
the merged configuration — an opt-in debugging aid since 12.0.0. That output now goes through the same redaction, so
|
|
101
|
+
a debug session no longer writes the deployment's secrets to a log.
|
|
102
|
+
|
|
103
|
+
## 3. `ConfigService#mergeProperty(key, value)` merges the value
|
|
104
|
+
|
|
105
|
+
The instance method forwarded its `options` in place of `value` to the static one, so it merged `undefined`. It now
|
|
106
|
+
merges the value as its signature says. `ConfigService.mergeProperty()` (static) was not affected.
|
|
107
|
+
|
|
108
|
+
## Compatibility Notes
|
|
109
|
+
|
|
110
|
+
| Pattern | Status |
|
|
111
|
+
|---|---|
|
|
112
|
+
| A `ServerController` returning `configFastButReadOnly` | Still unredacted until you apply §1 — the core cannot reach a route in project code |
|
|
113
|
+
| `configEndpointResponse()` in `local` / `ci` / `e2e` | Answers as before, redacted |
|
|
114
|
+
| E2E suites reading `/config` (`NODE_ENV=e2e`) | Unchanged, apart from masked secret values |
|
|
115
|
+
| `maskConfigDeep` (Hub) | Still exported, now the same function as `redactSecrets` — values below a secret-named key keep their structure (masked) and booleans stay visible |
|
|
116
|
+
| Health check, `/meta`, error responses | Unchanged — they carry no configuration |
|
|
117
|
+
|
|
118
|
+
## Troubleshooting
|
|
119
|
+
|
|
120
|
+
| Symptom | Cause | Fix |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| `GET /config` answers 404 for an administrator | Deployed environment without `configEndpoint` | `NSC__CONFIG_ENDPOINT=true` on that stage, if you need it |
|
|
123
|
+
| A value you need reads `***` | Its key matches a secret pattern | Read it from the environment of the deployment; `/config` never shows secrets |
|
|
124
|
+
| A secret under an unusual key appears in plain text | No pattern matches it | Add the key to `security.secretFields` |
|
|
125
|
+
|
|
126
|
+
## Module Documentation
|
|
127
|
+
|
|
128
|
+
- [Hub README](../src/core/modules/hub/README.md) — the config panel uses the same redaction
|
|
129
|
+
- `.claude/rules/configurable-features.md` — "Config Endpoint" row
|
|
130
|
+
|
|
131
|
+
## References
|
|
132
|
+
|
|
133
|
+
- `src/core/common/helpers/redact-secrets.helper.ts` — `redactSecrets()`, `FRAMEWORK_SECRET_FIELDS`
|
|
134
|
+
- `src/core/common/helpers/config-endpoint.helper.ts` — `isConfigEndpointEnabled()`, `configEndpointResponse()`
|
|
135
|
+
- `src/core/common/services/config.service.ts` — `getRedactedConfig()`
|
|
136
|
+
- `src/server/server.controller.ts` — the reference controller
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Migration Guide: 12.5.x → 12.6.x
|
|
2
|
+
|
|
3
|
+
## 12.6.0 contains breaking changes
|
|
4
|
+
|
|
5
|
+
The version number moves only the MINOR digit (the MAJOR follows NestJS). Two changes can stop something that worked:
|
|
6
|
+
|
|
7
|
+
- Read §1 if your project has an email-verification page: the link in the verification mail no longer carries the
|
|
8
|
+
address (`&email=`), so a page that offers "send a new email" only when `?email=` is present stops offering it until
|
|
9
|
+
it uses the new endpoint. The nuxt-base-starter page follows in its release after 12.6.0 (lock-step); until a project
|
|
10
|
+
has taken that over, §1 applies to the starter's page too.
|
|
11
|
+
- Read §3 if your project is based on nest-server-starter: from its 12.6.0 release on, a `NODE_ENV` without a block in
|
|
12
|
+
`src/config.env.ts` or an empty one no longer starts, and the required-variable check runs for every environment
|
|
13
|
+
that is not local.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
| Category | Details |
|
|
18
|
+
|---|---|
|
|
19
|
+
| **Breaking Changes** | The verification link carries the token only and sealed, no `email` parameter (§1). Starter: a `NODE_ENV` without a block in `config.env.ts`, or an empty one, no longer starts; the required-variable check covers every non-local environment (§3) |
|
|
20
|
+
| **New Features** | `POST /iam/resend-verification-email`: a new verification mail for the token of a link, an expired one included; `resendVerificationByToken` in `GET /iam/features` (§1) |
|
|
21
|
+
| **Bugfixes** | A system setup killed halfway (SIGKILL, OOM) left a user without the admin role and the setup locked for good; the next boot now finishes it (§2) |
|
|
22
|
+
| **Migration Effort** | One change on the verification page (§1), or taking over the `verify-email` page of the nuxt-base-starter release that follows 12.6.0. Starter-based projects: check the boot line of every stage before taking over the starter change (§3) |
|
|
23
|
+
|
|
24
|
+
## Quick Migration
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm add @lenne.tech/nest-server@12.6.0
|
|
28
|
+
pnpm run update # nest-server-starter based projects
|
|
29
|
+
pnpm run build
|
|
30
|
+
pnpm test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual.
|
|
34
|
+
|
|
35
|
+
## 1. The verification link carries no address — resend with the token
|
|
36
|
+
|
|
37
|
+
**Why:** the address stood in the URL of the mail, in the browser history and in every access log of the app.
|
|
38
|
+
|
|
39
|
+
**What changed:** `buildFrontendVerificationUrl()` builds `<callbackURL>?token=…` and nothing else, and the token is
|
|
40
|
+
sealed: Better-Auth's own token is a readable JWT with the address and the user id in it, so the link carries it
|
|
41
|
+
encrypted. Pass it on unchanged — `GET /iam/verify-email?token=…` opens it before Better-Auth verifies, and a plain
|
|
42
|
+
token from a mail sent before the update still works. Do not decode the token on the page: there is nothing to read
|
|
43
|
+
any more. Instead of the address, a page sends the token of the link to a new endpoint:
|
|
44
|
+
|
|
45
|
+
```http
|
|
46
|
+
POST /iam/resend-verification-email
|
|
47
|
+
Content-Type: application/json
|
|
48
|
+
|
|
49
|
+
{ "token": "<the token of the link, also when it has expired>" }
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
| Answer | When |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `200 { "email": "k***@example.com", "success": true }` | the token carries Better-Auth's signature (expired or not). A new mail goes out only to an existing, unverified account; the answer is the same either way |
|
|
55
|
+
| `200 { "email": null, "success": true }` | the token is invalid, forged or missing its claims |
|
|
56
|
+
| `400` | no `token` in the body |
|
|
57
|
+
| `429 LTNS_0020` | more than 3 requests with valid tokens for one address (every link for it counts together), or more than 10 invalid tokens from one client address, within an hour |
|
|
58
|
+
|
|
59
|
+
The endpoint never verifies, signs in or creates a session. `GET /iam/features` reports
|
|
60
|
+
`resendVerificationByToken: true` while email verification is enabled.
|
|
61
|
+
|
|
62
|
+
**Your page (if it is not the current nuxt-base-starter one):**
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
// Before: the button needed the address from the URL
|
|
66
|
+
const email = route.query.email as string | undefined;
|
|
67
|
+
async function resend() {
|
|
68
|
+
await $fetch('/iam/send-verification-email', { body: { email }, method: 'POST' });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// After: the token of the (expired) link is enough
|
|
72
|
+
const token = route.query.token as string | undefined;
|
|
73
|
+
async function resend() {
|
|
74
|
+
const { email } = await $fetch<{ email: null | string; success: boolean }>('/iam/resend-verification-email', {
|
|
75
|
+
body: { token },
|
|
76
|
+
method: 'POST',
|
|
77
|
+
});
|
|
78
|
+
// Show `email` (masked) as "a new mail is on its way to k***@example.com"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Keep an address field only as the fallback for a page opened without a token, or for a server that does not report
|
|
83
|
+
`resendVerificationByToken`. A project that overrides `buildFrontendVerificationUrl()` and still appends the address
|
|
84
|
+
should stop doing so.
|
|
85
|
+
|
|
86
|
+
### The development log line of auth links
|
|
87
|
+
|
|
88
|
+
Verification and password-reset links are printed to stdout only in `local`, `ci` and `e2e` now. `LT_LOG_AUTH_URLS=1`
|
|
89
|
+
no longer opens the line in any other environment: an environment name says nothing reliable about whether it is a
|
|
90
|
+
laptop, and the line carries a live token. `LT_LOG_AUTH_URLS=0` still suppresses it. The line reads
|
|
91
|
+
`[<LABEL>] User: <masked>, UserKey: <16 hex>, URL: <url>`; `UserKey` is the first 16 hex characters of SHA-256 over
|
|
92
|
+
the trimmed, lower-cased address. A test helper that found its token by decoding the JWT in the URL (the token is
|
|
93
|
+
sealed now) matches its line by `UserKey` instead.
|
|
94
|
+
|
|
95
|
+
The process's `NODE_ENV` must agree: it is unset (the `local` default — set but empty does not count) or itself
|
|
96
|
+
`local`, `ci` or `e2e`.
|
|
97
|
+
`getEnvironmentConfig()` answers a `NODE_ENV` that has no block in `config.env.ts` with the `local` block, so such a
|
|
98
|
+
stage used to claim `env: 'local'` and print the links. It prints nothing now — but it still runs on the `local`
|
|
99
|
+
block. Look for the boot line `Configured for: local (requested: <NODE_ENV>)`; if a deployed stage shows it, give
|
|
100
|
+
that `NODE_ENV` a block of its own. A starter-based project refuses to start in that state from the starter's 12.6.0
|
|
101
|
+
release on (§3).
|
|
102
|
+
|
|
103
|
+
## 2. An interrupted initial-admin setup is finished at the next boot
|
|
104
|
+
|
|
105
|
+
No action needed. The admin role is now written together with the user, and with `systemSetup.initialAdmin` set, the
|
|
106
|
+
boot finishes a setup that was killed halfway, for that address only:
|
|
107
|
+
|
|
108
|
+
- an administrator without any login account gets the configured password;
|
|
109
|
+
- the leftover of an older version (no role, no administrator in the system, and no account or only a credential
|
|
110
|
+
account with the configured password) gets the role.
|
|
111
|
+
|
|
112
|
+
A user with another password, a social account, a second account or a legacy password (`users.password`) is never
|
|
113
|
+
touched, and the anonymous `POST /system-setup/init` still refuses once users exist. Remove the `initialAdmin`
|
|
114
|
+
variables after the first deployment to close this path too.
|
|
115
|
+
|
|
116
|
+
## 3. Starter: a NODE_ENV without a block in `config.env.ts`, or an empty one, no longer starts
|
|
117
|
+
|
|
118
|
+
From the nest-server-starter release 12.6.0 on, a starter-based project refuses to start when `NODE_ENV` names an
|
|
119
|
+
environment that has no block in `src/config.env.ts`:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
NODE_ENV='staging' has no block in src/config.env.ts (known: local, e2e, ci, develop, test, production, preview). Use one of them, or add a block for this env to the matrix.
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
An empty `NODE_ENV` — set to `''` or to spaces only — is refused the same way:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
NODE_ENV is set but empty (""). Set one of local, e2e, ci, develop, test, production, preview, or leave NODE_ENV unset to run locally.
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Until now `getEnvironmentConfig()` answered such a `NODE_ENV` with the `local` block (`config[env] || config.local`).
|
|
132
|
+
A stage started with `NODE_ENV=development`, `dev`, `staging` or `preview` therefore ran on the local baseline: public
|
|
133
|
+
dummy secrets, the anonymous `POST /system-setup/init`, an open `GET /config`. The required-variable check never ran,
|
|
134
|
+
because it keys on the resolved env and the local block carries `env: 'local'` whatever `NODE_ENV` asked for. An empty
|
|
135
|
+
`NODE_ENV` landed there too, through `NODE_ENV || 'local'`; a typical source is `NODE_ENV=${NODE_ENV}` in a compose file
|
|
136
|
+
on a host that does not set the variable. Only an unset `NODE_ENV` still means `local`.
|
|
137
|
+
|
|
138
|
+
The same starter release makes two more changes:
|
|
139
|
+
|
|
140
|
+
- The required-variable check runs for every env that is not local (`local`, `ci`, `e2e`), not only for `develop`,
|
|
141
|
+
`test` and `production`.
|
|
142
|
+
- The starter gains a `preview` block on the deployed baseline, because the lt CLI writes `migrate:preview:up` into
|
|
143
|
+
every project.
|
|
144
|
+
|
|
145
|
+
**Am I affected?**
|
|
146
|
+
|
|
147
|
+
- **A stage on an env without a block.** Its boot log shows `Configured for: local (requested: <NODE_ENV>)`.
|
|
148
|
+
- **A stage or job on `NODE_ENV=preview`.** It ran on the local block too (same boot line), `migrate:preview:up`
|
|
149
|
+
included. After the takeover it runs on the new `preview` block.
|
|
150
|
+
- **A block of your own besides `develop`, `test` and `production`**, for example `staging`. Its boot line looks
|
|
151
|
+
correct (`Configured for: staging`), but the required-variable check never ran for it. Now it does.
|
|
152
|
+
- **A stage whose `NODE_ENV` is empty.** With `NODE_ENV=` its boot log shows a plain `Configured for: local`, without
|
|
153
|
+
a `(requested: …)` part, because the empty value is read as `local`; with spaces only it shows
|
|
154
|
+
`Configured for: local (requested: )`. Check the container's environment rather than the log line alone.
|
|
155
|
+
|
|
156
|
+
**What to do, before taking over the starter change:**
|
|
157
|
+
|
|
158
|
+
- For a stage on an env without a block, either set `NODE_ENV` to an env the matrix has (`develop`, `test`,
|
|
159
|
+
`production`, `preview`), or add a block next to the others:
|
|
160
|
+
`staging: deployedConfig('staging', { brandSuffix: 'Staging' }),`
|
|
161
|
+
- Any stage that moves off the local block, including one already on `NODE_ENV=preview`, needs every variable
|
|
162
|
+
`.env.example` lists as required — and so does its `migrate:<env>:up` job, which loads the same config. On a fresh
|
|
163
|
+
instance it also needs a first-admin route: the anonymous setup page is closed on every deployed block, so set
|
|
164
|
+
`NSC__SYSTEM_SETUP__INITIAL_ADMIN__*`.
|
|
165
|
+
- For a block of your own, check that its stage sets every required variable. Otherwise it stops with
|
|
166
|
+
`Missing required environment variables for NODE_ENV='<env>'`.
|
|
167
|
+
- Give an empty `NODE_ENV` a real value: set it on the host, or write it literally in the compose file
|
|
168
|
+
(`NODE_ENV=production`). Do not pass through a host variable that may be missing.
|
|
169
|
+
- On a developer machine, a shell that exports such a `NODE_ENV` (for example `development`) now stops `pnpm start`
|
|
170
|
+
and `lt dev up` at their migrate step, which inherits the shell environment. Unset the variable or set it to `local`.
|
|
171
|
+
|
|
172
|
+
A project that keeps its own `config.env.ts` can copy the two checks in front of `getEnvironmentConfig()` and the
|
|
173
|
+
`!isLocalEnv(resolved.env)` condition from `src/config.env.ts` of nest-server-starter (PRs
|
|
174
|
+
[#59](https://github.com/lenneTech/nest-server-starter/pull/59) and
|
|
175
|
+
[#60](https://github.com/lenneTech/nest-server-starter/pull/60)). The first refuses an empty `NODE_ENV`
|
|
176
|
+
(`requestedEnv !== undefined && !requestedEnv.trim()`), the second one without a block
|
|
177
|
+
(`Object.hasOwn(config, requestedEnv)`). The condition alone catches neither, because the resolved env is then
|
|
178
|
+
`local`. Copying only the check from #59 leaves `NODE_ENV=` on the local block.
|
|
179
|
+
|
|
180
|
+
## Compatibility Notes
|
|
181
|
+
|
|
182
|
+
| Pattern | Status |
|
|
183
|
+
|---|---|
|
|
184
|
+
| nuxt-base-starter `verify-email` page of the release that follows 12.6.0 | Uses the new endpoint |
|
|
185
|
+
| A page that reads the token's JWT payload (for example to show the address) | Gets nothing: the token is sealed. Use the masked `email` of the resend answer |
|
|
186
|
+
| A page that reads `route.query.email` for its resend button | Shows no button for an expired link until it uses the token (§1) |
|
|
187
|
+
| `POST /iam/send-verification-email` with `{ email }` | Unchanged — still the fallback when the user types the address |
|
|
188
|
+
| A project subclass of `CoreBetterAuthEmailVerificationService` | `buildFrontendVerificationUrl(token)` takes one argument; a second one is ignored |
|
|
189
|
+
| `systemSetup.initialAdmin` left set on a running deployment | Read at every boot; changes nothing for a finished setup (§2) |
|
|
190
|
+
|
|
191
|
+
## Troubleshooting
|
|
192
|
+
|
|
193
|
+
| Symptom | Cause | Fix |
|
|
194
|
+
|---|---|---|
|
|
195
|
+
| Expired link, no "send a new email" button | The page still waits for `?email=` | Send the token to `POST /iam/resend-verification-email` (§1) |
|
|
196
|
+
| The resend answers 200 but no mail arrives | The account is verified or unknown, the resend cooldown is active, or email verification is off | Intended: the answer never says which. Check the server log at debug level |
|
|
197
|
+
| `429` on the resend | 3 requests with valid links for one address, or 10 invalid tokens from one client address, in an hour | Wait, or sign in and request a new mail |
|
|
198
|
+
| Log line `Finished an interrupted initial-admin setup` | A previous setup was killed halfway | Nothing to do; the administrator can sign in |
|
|
199
|
+
| `NODE_ENV='<env>' has no block in src/config.env.ts` at startup (starter-based project) | The stage ran on the `local` block until now | Set `NODE_ENV` to an env the matrix has, or add a block for it (§3) |
|
|
200
|
+
| `NODE_ENV is set but empty ("")` at startup (starter-based project) | The variable is set to an empty value, often `NODE_ENV=${NODE_ENV}` in a compose file on a host without it | Set a value, or remove the assignment for a local run (§3) |
|
|
201
|
+
| `Missing required environment variables for NODE_ENV='<env>'` after the starter update | The check now covers every non-local env, `preview` and own blocks included | Set the variables `.env.example` lists as required (§3) |
|
|
202
|
+
|
|
203
|
+
## Module Documentation
|
|
204
|
+
|
|
205
|
+
- [Better-Auth README](../src/core/modules/better-auth/README.md) — "Email Verification"
|
|
206
|
+
- [System Setup README](../src/core/modules/system-setup/README.md) — "Security" and "Troubleshooting"
|
|
207
|
+
|
|
208
|
+
## References
|
|
209
|
+
|
|
210
|
+
- `src/core/modules/better-auth/core-better-auth-email-verification.service.ts` — `buildFrontendVerificationUrl()`,
|
|
211
|
+
`resendVerificationByToken()`
|
|
212
|
+
- `src/core/modules/better-auth/core-better-auth.controller.ts` — `resendVerificationEmail()`, `getFeatures()`
|
|
213
|
+
- `src/core/modules/system-setup/core-system-setup.service.ts` — `resumeInterruptedInitialAdmin()`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.6.0",
|
|
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": [
|
|
@@ -34,14 +34,15 @@
|
|
|
34
34
|
"check": "node scripts/check.mjs",
|
|
35
35
|
"check:consumer": "node scripts/check-consumer.mjs",
|
|
36
36
|
"check:esm": "node scripts/check-esm-core.mjs",
|
|
37
|
-
"check:fix": "pnpm install && pnpm run spectaql:sync && pnpm audit --fix && pnpm run check:overrides && pnpm peers check && pnpm run format && pnpm run lint:fix && pnpm run typecheck:tests && pnpm run typecheck:vendor && pnpm run check:esm && pnpm run check:swc-tdz && pnpm test && pnpm run build && pnpm run check:manifest && pnpm run check:without-mongodb && pnpm run check:server-start",
|
|
37
|
+
"check:fix": "pnpm install && pnpm run spectaql:sync && pnpm audit --fix && pnpm run check:overrides && pnpm peers check && pnpm run format && pnpm run lint:fix && pnpm run typecheck:tests && pnpm run typecheck:vendor && pnpm run check:vendor-lint && pnpm run check:esm && pnpm run check:swc-tdz && pnpm test && pnpm run build && pnpm run check:manifest && pnpm run check:without-mongodb && pnpm run check:server-start",
|
|
38
38
|
"check:manifest": "node scripts/check-package-manifest.mjs",
|
|
39
39
|
"check:mutations": "node scripts/check-mutations.mjs",
|
|
40
|
-
"check:naf": "pnpm install && pnpm run spectaql:sync && pnpm run check:overrides && pnpm peers check && pnpm run format && pnpm run lint:fix && pnpm run typecheck:tests && pnpm run typecheck:vendor && pnpm run check:esm && pnpm run check:swc-tdz && pnpm test && pnpm run build && pnpm run check:manifest && pnpm run check:without-mongodb && pnpm run check:server-start",
|
|
40
|
+
"check:naf": "pnpm install && pnpm run spectaql:sync && pnpm run check:overrides && pnpm peers check && pnpm run format && pnpm run lint:fix && pnpm run typecheck:tests && pnpm run typecheck:vendor && pnpm run check:vendor-lint && pnpm run check:esm && pnpm run check:swc-tdz && pnpm test && pnpm run build && pnpm run check:manifest && pnpm run check:without-mongodb && pnpm run check:server-start",
|
|
41
41
|
"check:overrides": "node scripts/check-overrides.mjs",
|
|
42
|
-
"check:raw": "pnpm install --frozen-lockfile && pnpm run spectaql:sync && pnpm audit && pnpm run check:overrides && pnpm peers check && pnpm run format:check && pnpm run lint && pnpm run typecheck:tests && pnpm run typecheck:vendor && pnpm run check:esm && pnpm run check:swc-tdz && pnpm test && pnpm run build && pnpm run check:manifest && pnpm run check:without-mongodb && pnpm run check:server-start",
|
|
42
|
+
"check:raw": "pnpm install --frozen-lockfile && pnpm run spectaql:sync && pnpm audit && pnpm run check:overrides && pnpm peers check && pnpm run format:check && pnpm run lint && pnpm run typecheck:tests && pnpm run typecheck:vendor && pnpm run check:vendor-lint && pnpm run check:esm && pnpm run check:swc-tdz && pnpm test && pnpm run build && pnpm run check:manifest && pnpm run check:without-mongodb && pnpm run check:server-start",
|
|
43
43
|
"check:server-start": "cross-env NODE_ENV=local node scripts/check-server-start.mjs --entry=dist/main.js --port-env=NSC__PORT --ready=\"Server starte[dt] at\" --path=/",
|
|
44
44
|
"check:swc-tdz": "nest build -b swc -p tsconfig.swc-tdz.json && node scripts/check-swc-tdz.mjs",
|
|
45
|
+
"check:vendor-lint": "node scripts/check-vendor-lint.mjs",
|
|
45
46
|
"check:without-mongodb": "node scripts/check-without-mongodb.mjs --dist",
|
|
46
47
|
"check:without-mongodb:package": "node scripts/check-without-mongodb.mjs --package",
|
|
47
48
|
"cnaf": "pnpm run check:naf",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NotFoundException } from '@nestjs/common';
|
|
2
|
+
|
|
3
|
+
import type { IServerOptions } from '../interfaces/server-options.interface.js';
|
|
4
|
+
import { ConfigService } from '../services/config.service.js';
|
|
5
|
+
import { isLocalEnv } from './cookies.helper.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Whether a project's `GET /config` may answer (`configEndpoint`, 12.5.0+).
|
|
9
|
+
*
|
|
10
|
+
* | `configEndpoint` | `local` / `ci` / `e2e` | every other environment (`develop`, `test`, `production`, …) |
|
|
11
|
+
* |------------------|------------------------|---------------------------------------------------------------|
|
|
12
|
+
* | not set | answers | **404** |
|
|
13
|
+
* | `true` | answers | answers |
|
|
14
|
+
* | `false` | 404 | 404 |
|
|
15
|
+
*
|
|
16
|
+
* Answering always means the REDACTED configuration ({@link configEndpointResponse}). A value that is not a boolean
|
|
17
|
+
* (the string `'true'` from `NEST_SERVER_CONFIG`) counts as not set, so a string cannot open the endpoint by
|
|
18
|
+
* truthiness. The environment is the configured `env`, else `NODE_ENV`, compared with {@link isLocalEnv}.
|
|
19
|
+
*
|
|
20
|
+
* @param config - defaults to the running configuration
|
|
21
|
+
* @since 12.5.0
|
|
22
|
+
*/
|
|
23
|
+
export function isConfigEndpointEnabled(
|
|
24
|
+
config: Partial<IServerOptions> | undefined = ConfigService.configFastButReadOnly,
|
|
25
|
+
): boolean {
|
|
26
|
+
const setting = config?.configEndpoint;
|
|
27
|
+
if (setting === true || setting === false) {
|
|
28
|
+
return setting;
|
|
29
|
+
}
|
|
30
|
+
return isLocalEnv(config?.env ?? process.env.NODE_ENV);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The body of a project's `GET /config`: the redacted configuration, or a 404 where `configEndpoint` keeps the
|
|
35
|
+
* endpoint closed ({@link isConfigEndpointEnabled}).
|
|
36
|
+
*
|
|
37
|
+
* 404 rather than 403, so a closed endpoint reads like one that does not exist. The route's own `@Roles(ADMIN)`
|
|
38
|
+
* still runs first, so an anonymous caller keeps getting 401.
|
|
39
|
+
*
|
|
40
|
+
* ```typescript
|
|
41
|
+
* @Get('config')
|
|
42
|
+
* @Roles(RoleEnum.ADMIN)
|
|
43
|
+
* config() {
|
|
44
|
+
* return configEndpointResponse();
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @throws NotFoundException when the endpoint is closed in this environment
|
|
49
|
+
* @since 12.5.0
|
|
50
|
+
*/
|
|
51
|
+
export function configEndpointResponse(): Record<string, unknown> {
|
|
52
|
+
if (!isConfigEndpointEnabled(ConfigService.configFastButReadOnly)) {
|
|
53
|
+
throw new NotFoundException();
|
|
54
|
+
}
|
|
55
|
+
return ConfigService.getRedactedConfig();
|
|
56
|
+
}
|