@lenne.tech/nest-server 12.12.0 → 12.12.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.
- package/.claude/rules/configurable-features.md +1 -1
- package/.claude/rules/testing.md +3 -3
- package/FRAMEWORK-API.md +1 -1
- package/dist/core/common/helpers/cookies.helper.js +5 -2
- package/dist/core/common/helpers/cookies.helper.js.map +1 -1
- package/dist/core/modules/migrate/cli/migrate-cli.js +19 -1
- package/dist/core/modules/migrate/cli/migrate-cli.js.map +1 -1
- package/dist/core/modules/throttler/core-throttler.constants.d.ts +1 -0
- package/dist/core/modules/throttler/core-throttler.constants.js +24 -0
- package/dist/core/modules/throttler/core-throttler.constants.js.map +1 -1
- package/docs/REQUEST-LIFECYCLE.md +1 -1
- package/migration-guides/12.11.x-to-12.12.x.md +5 -0
- package/migration-guides/12.12.0-to-12.12.1.md +100 -0
- package/package.json +1 -1
- package/src/core/common/helpers/cookies.helper.ts +12 -2
- package/src/core/modules/migrate/README.md +3 -1
- package/src/core/modules/migrate/cli/migrate-cli.ts +31 -1
- package/src/core/modules/throttler/README.md +8 -0
- package/src/core/modules/throttler/core-throttler.constants.ts +38 -0
|
@@ -303,7 +303,7 @@ This pattern is currently applied to:
|
|
|
303
303
|
| SMTP TLS Mode | `email.smtp.secure` + `SMTP_REQUIRE_TLS` | Derived from the port | **`secure` follows `SMTP_PORT` unless set to `'true'`/`'false'`.** It is not an independent setting: 465 negotiates TLS immediately, everything else upgrades via STARTTLS. The production profile shipped 587 + `secure: true` — a pair that cannot connect — so a deployment configuring only host and credentials sent NO mail, invisibly, because authentication mail is not awaited. Only the two canonical values override; anything else defers to the port, which is the only rule under which no input produces an unconnectable pair. `requireTLS` defaults to **true**: `secure: false` alone means opportunistic STARTTLS, and an on-path attacker stripping the capability line gets credentials and a live reset link in plaintext. `EmailService` warns once when the resolved pair cannot connect — reported, not overruled. Implementation: `config.helper.ts` → `resolveSmtpSecure()` / `isImpossibleSmtpTlsCombination()` |
|
|
304
304
|
| Mail Reply-To | `email.defaultReplyTo` | Explicit Value — absent = no header | **Absent → no `Reply-To` header, exactly as before (12.3.2+).** A string (an address, or `"Name" <address>`) becomes the Reply-To of every mail `EmailService.sendMail()` sends; a call overrides it with `replyTo`, and `replyTo: false` (or `''`) sends that one mail without it. Env: `NSC__EMAIL__DEFAULT_REPLY_TO`. A value that is not a string is ignored with one warning — a misconfigured default must not stop password-reset or verification mail. SMTP path only (`email.smtp`, nodemailer, Hub capture unaffected): Brevo and Mailjet templates carry their own reply-to. Pinned by `tests/unit/email-smtp-roundtrip.spec.ts` (Reply-To block, real SMTP). Implementation: `common/services/email.service.ts` → `resolveReplyTo()` |
|
|
305
305
|
| Auth Mail App Name | `betterAuth.emailVerification.appName` | Explicit Value — absent = the `package.json` name | **Absent or empty → the formatted `name` of the working directory's `package.json` (`my-app` → `My App`, `'Nest Server'` without one), exactly as before (12.8.3+).** A string becomes the application name in the verification and password-reset mails: the subject (`<appName> - Verify your email address`, `<appName> - Reset your password`), the EJS variable `appName` and the Brevo parameter `appName`; trimmed. Env: `NSC__BETTER_AUTH__EMAIL_VERIFICATION__APP_NAME`. Exists because in a monorepo the working directory is the API package, whose name (`api`) became the subject of every auth mail; before, only an override of `getAppName()` changed it, which still works and wins. A value that is not a string is ignored with one warning — a misconfigured name must not stop an auth mail. Mails only: authenticator apps read `twoFactor.appName`, passkey prompts `passkey.rpName`. **With verification switched off it needs `enabled: false` beside it** (`{ enabled: false, appName }`, or `NSC__BETTER_AUTH__EMAIL_VERIFICATION__ENABLED=false` next to the variable): `emailVerification: false` keeps no settings, and an object without `enabled: false` — what the variable alone makes of `false` — switches verification on, so every unverified user's sign-in answers 401. The reset mail goes through this service with verification off too. Pinned by `tests/unit/better-auth-mail-app-name.spec.ts` (mutation `mail-app-name-config-ignored`). Implementation: `core-better-auth-email-verification.service.ts` → `resolveAppName()` |
|
|
306
|
-
| Rate Limit for Project Routes | `throttler` | Boolean Shorthand + Presence Implies Enabled — absent = off | **Absent → no guard, no storage, no table (12.12.0, DEV-4431).** `true` / `{}` registers `CoreThrottlerModule` FIRST in `CoreModule`'s imports, so `CoreThrottlerGuard` (`@nestjs/throttler`'s `ThrottlerGuard`, request resolved through `resolveGuardRequest()`) is the first global guard: an over-limit client gets 429, `Retry-After` and `#LTNS_0020` before the role guards authenticate it. Defaults: `limit: 10`, `ttl: 60000` (ms, `@nestjs/throttler`'s unit), `blockDuration: ttl`, `routes: 'decorated'` (only routes whose method or controller carries `@Throttle()`, by the throttlers it names — implemented as a per-throttler `skipIf`; `'all'` limits every route unless `@SkipThrottle()`), `setHeaders: true`, `ipv6SubnetPrefix: 64`; `throttlers: [{ name, limit, ttl, blockDuration }]` replaces the `default` throttler. An invalid number → its default with a warning (Family C: never "no limit", never `0`, which would refuse everything). `storage`: unset → `'redis'` with `redis`, else `'memory'` (`@nestjs/throttler`'s `ThrottlerStorageService`); `'database'` → the framework model `CoreThrottlerCounter` (table `throttler_counters`) through `CorePersistenceModule.forFeature()`, a fixed window per throttler and client counted with ONE atomic `updateOne` per step, exact across replicas without Redis; `'redis'` → one Lua script per hit. An explicit storage that cannot work (`'redis'` without `redis`, `'database'` with `database: false`, an unknown name) stops the boot; an unreachable Redis / database falls back to memory, logged once per transition — never 500, never "allowed". Counted per `request.ip`, so the trust-proxy boot warning lists `throttler` too; a request without an address (a GraphQL operation over the WebSocket, an HTTP request whose client already closed the connection) per signed-in user, else by the WebSocket's upgrade address, else in one shared bucket — never uncounted (mutation `throttler-skips-addressless-request`). `@Throttle` / `@SkipThrottle` are re-exported from `@lenne.tech/nest-server`; a project must not import `ThrottlerModule` itself. Guard override: `CoreModule.forRoot(env, { throttler: { guard } })`. Pinned by `tests/unit/throttler.spec.ts` and `tests/throttler.e2e-spec.ts` (mutations `throttler-*`). Implementation: `src/core/modules/throttler/` |
|
|
306
|
+
| Rate Limit for Project Routes | `throttler` | Boolean Shorthand + Presence Implies Enabled — absent = off | **Absent → no guard, no storage, no table (12.12.0, DEV-4431).** `true` / `{}` registers `CoreThrottlerModule` FIRST in `CoreModule`'s imports, so `CoreThrottlerGuard` (`@nestjs/throttler`'s `ThrottlerGuard`, request resolved through `resolveGuardRequest()`) is the first global guard: an over-limit client gets 429, `Retry-After` and `#LTNS_0020` before the role guards authenticate it. Defaults: `limit: 10`, `ttl: 60000` (ms, `@nestjs/throttler`'s unit), `blockDuration: ttl`, `routes: 'decorated'` (only routes whose method or controller carries `@Throttle()`, by the throttlers it names — implemented as a per-throttler `skipIf`; `'all'` limits every route unless `@SkipThrottle()`), `setHeaders: true`, `ipv6SubnetPrefix: 64`; `throttlers: [{ name, limit, ttl, blockDuration }]` replaces the `default` throttler. An invalid number → its default with a warning (Family C: never "no limit", never `0`, which would refuse everything). `storage`: unset → `'redis'` with `redis`, else `'memory'` (`@nestjs/throttler`'s `ThrottlerStorageService`); `'database'` → the framework model `CoreThrottlerCounter` (table `throttler_counters`) through `CorePersistenceModule.forFeature()`, a fixed window per throttler and client counted with ONE atomic `updateOne` per step, exact across replicas without Redis; `'redis'` → one Lua script per hit. An explicit storage that cannot work (`'redis'` without `redis`, `'database'` with `database: false`, an unknown name) stops the boot; an unreachable Redis / database falls back to memory, logged once per transition — never 500, never "allowed". Counted per `request.ip`, so the trust-proxy boot warning lists `throttler` too; a request without an address (a GraphQL operation over the WebSocket, an HTTP request whose client already closed the connection) per signed-in user, else by the WebSocket's upgrade address, else in one shared bucket — never uncounted (mutation `throttler-skips-addressless-request`). With `setHeaders` on, `buildCorsConfig()` lists `Retry-After` and `X-RateLimit-*` (suffix `-<name>` for a named throttler, `throttlerResponseHeaders()`) in `exposedHeaders` since 12.12.1, so an app on another origin can read the wait time (mutation `cors-hides-rate-limit-headers`). `@Throttle` / `@SkipThrottle` are re-exported from `@lenne.tech/nest-server`; a project must not import `ThrottlerModule` itself. Guard override: `CoreModule.forRoot(env, { throttler: { guard } })`. Pinned by `tests/unit/throttler.spec.ts` and `tests/throttler.e2e-spec.ts` (mutations `throttler-*`). Implementation: `src/core/modules/throttler/` |
|
|
307
307
|
| Audit Log | `auditLog` | Boolean Shorthand + Presence Implies Enabled — absent = off | **Absent → no model, no route, no listener; a write costs one `undefined` check (12.12.0, DEV-4432).** `true` / `{}` registers `CoreAuditLogModule`; its service registers itself in `common/persistence/audit-log.registry.ts`, and `CrudService.create()` / `update()` / `delete()` (variants included, `CoreUserService.create()` too) report each successful write of a model whose class carries `@Audited()` or whose name is in `models` — action, model, record id, user (`serviceOptions.currentUser`, else the request's), time and the field NAMES (create: what the input set; update: what changed, compared before and after the merge, bookkeeping fields excluded; an update that changed nothing leaves no entry). Never a value — the model has no field for one. `CoreAuditLogService.record()` logs a project's own actions (restore); `importEntries()` takes entries of another system (keeps `at`, drops every other field). Model `CoreAuditLogEntry` (table `audit_log_entries`), not tenant-scoped. `retentionDays` (365; `false` keeps; invalid → 365): hourly purge on one replica (`LeasedInterval`, `frameworkJobLeaseStore()`: Redis → SQL lease table → `cron-locks`), 1000 per batch. `GET /audit-log` (`path`), `ADMIN` plus `roles` (global, `@SkipTenantCheck()`). Not logged: writes past `CrudService` (data store, Mongoose, `pushToArray`). Overrides: `{ auditLog: { controller, service } }`. Pinned by `tests/audit-log.e2e-spec.ts` (mutations `audit-log-*`). Implementation: `src/core/modules/audit-log/` |
|
|
308
308
|
| Mail Outbox | `mailOutbox` | Boolean Shorthand + Presence Implies Enabled — absent = off | **Absent → `EmailService` sends directly, as before (12.12.0, DEV-4433).** `true` / `{}` registers `CoreMailOutboxModule`; its service registers itself in `common/services/mail-outbox.registry.ts` and `EmailService.sendMail()` stores the rendered mail (after the templates, the production `jsonTransport` guard and the Hub capture) and answers `{ accepted, messageId, outboxId, queued: true, rejected }`; Better-Auth's SMTP auth mails take the same path. Delivery at once and every `pollIntervalSeconds` (10) on every replica; a mail is CLAIMED with one atomic `updateOne` (pending and due, or a claim older than `lockSeconds`, 900), so exactly one replica sends it, with the same Message-ID on every attempt. Failure → retry after `retryDelaySeconds` (30) doubled per attempt up to `maxRetryDelaySeconds` (3600); after `maxAttempts` (10) `failed`, logged as an error with the recipient masked. A delivered mail loses its content at once (`mail: null`); `retention.sentDays` (7) / `retention.failedDays` (30), `false` keeps, hourly purge under a lease. At least once: a replica dying between the server's accept and the record leaves a claim another replica takes over. Not through the outbox: a call with its own `smtp` (credentials are never stored), Brevo / Mailjet templates. Model `CoreMailOutboxEntry` (table `mail_outbox`). `GET /mail-outbox` (no content), `POST /mail-outbox/:id/retry`; `ADMIN` plus `roles`. Overrides: `{ mailOutbox: { controller, service } }`. Pinned by `tests/mail-outbox.e2e-spec.ts` and `tests/unit/audit-log-outbox.spec.ts` (mutations `mail-outbox-*`). Implementation: `src/core/modules/mail-outbox/` |
|
|
309
309
|
| Legacy Auth Rate Limiting | `auth.rateLimit` | Presence Implies Enabled | `max: 10`, `windowSeconds: 60`. Counters live in a `RateLimitStore`: `RedisRateLimitStore` when `redis` is configured (limit enforced EXACTLY across replicas instead of `max × replicas`), else `InMemoryRateLimitStore` (previous behavior). On a Redis outage it degrades to the in-memory counter and logs once per transition — never a 500, never "allowed". `check()` / `reset()` / `clear()` are ASYNC since 11.33.0; `getStats().activeEntries` is `-1` on the Redis store |
|
package/.claude/rules/testing.md
CHANGED
|
@@ -413,7 +413,7 @@ pnpm run check:mutations -- --id=<id> # one mutation
|
|
|
413
413
|
pnpm run check:mutations -- --list # the registry, without running anything
|
|
414
414
|
pnpm run check:mutations -- --allow-dirty # when the fix and its evidence share a working tree
|
|
415
415
|
pnpm run check:mutations -- --jobs=4 # N mutations at a time (default: 2, or 4 on >=12 cores)
|
|
416
|
-
pnpm run check:mutations -- --no-infra # only the
|
|
416
|
+
pnpm run check:mutations -- --no-infra # only the 531 that need no MongoDB
|
|
417
417
|
pnpm run check:mutations -- --since=<ref> # only mutations touching files changed since <ref>
|
|
418
418
|
pnpm run check:mutations -- --shard=2/4 # this job's quarter of the selection (CI splits the full run)
|
|
419
419
|
```
|
|
@@ -433,7 +433,7 @@ when the registry, a vitest config or a setup file changed, since those can move
|
|
|
433
433
|
commit, and in CI alongside the publish without blocking it. The price of caching is a cache that
|
|
434
434
|
has to model each spec's full dependency closure correctly, and getting that wrong produces a stale
|
|
435
435
|
PASS for a test that has since gone vacuous — exactly what the gate is there to prevent. Bad trade
|
|
436
|
-
at
|
|
436
|
+
at 789 mutations.
|
|
437
437
|
|
|
438
438
|
**Decided 2026-10-03 (repo owner): keep the full run.** Measured at 128 mutations, the CI job for
|
|
439
439
|
11.41.6 took **14 minutes**. The trigger to revisit is that wall time, not the mutation count —
|
|
@@ -506,7 +506,7 @@ exactly the environment where the answer matters.
|
|
|
506
506
|
|
|
507
507
|
Worth knowing before optimising the wrong thing: the specs behind all 258 e2e mutations add up to
|
|
508
508
|
**~40 seconds**. The step takes ~740s. The remaining ~700s is paying vitest's startup — process
|
|
509
|
-
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation,
|
|
509
|
+
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation, 789 times.
|
|
510
510
|
That work is largely single-threaded I/O and barely scales with cores: the full registry measures
|
|
511
511
|
**744s on a 12-core laptop and 777s on a 4-vCPU CI runner**.
|
|
512
512
|
|
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-
|
|
3
|
+
> Auto-generated from source code as of 2026-11-30 (v12.12.1)
|
|
4
4
|
> File: `FRAMEWORK-API.md` — compact, machine-readable API surface for Claude Code
|
|
5
5
|
|
|
6
6
|
## CoreModule.forRoot()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { throttlerResponseHeaders } from '../../modules/throttler/core-throttler.constants.js';
|
|
1
2
|
const IS_PRODUCTION_NODE_ENV = process.env.NODE_ENV === 'production';
|
|
2
3
|
export function isProductionLikeEnv(env) {
|
|
3
4
|
if (env === 'production' || env === 'staging')
|
|
@@ -167,8 +168,10 @@ export function buildCorsConfig(options) {
|
|
|
167
168
|
return {};
|
|
168
169
|
}
|
|
169
170
|
const corsObj = typeof options?.cors === 'object' ? options.cors : {};
|
|
171
|
+
const exposed = throttlerResponseHeaders(options?.throttler);
|
|
172
|
+
const withExposedHeaders = (cors) => exposed.length ? { ...cors, exposedHeaders: exposed } : cors;
|
|
170
173
|
if (corsObj.allowAll) {
|
|
171
|
-
return { credentials: true, origin: true };
|
|
174
|
+
return withExposedHeaders({ credentials: true, origin: true });
|
|
172
175
|
}
|
|
173
176
|
const { appUrl, baseUrl } = resolveServerUrls({
|
|
174
177
|
appUrl: options?.appUrl,
|
|
@@ -186,7 +189,7 @@ export function buildCorsConfig(options) {
|
|
|
186
189
|
}
|
|
187
190
|
const uniqueOrigins = [...new Set(origins)];
|
|
188
191
|
if (uniqueOrigins.length > 0) {
|
|
189
|
-
return { credentials: true, origin: uniqueOrigins };
|
|
192
|
+
return withExposedHeaders({ credentials: true, origin: uniqueOrigins });
|
|
190
193
|
}
|
|
191
194
|
return {};
|
|
192
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/cookies.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cookies.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/cookies.helper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AAW/F,MAAM,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC;AAerE,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,IAAI,GAAG,KAAK,YAAY,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC3D,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAmCD,MAAM,UAAU,2BAA2B,CAAC,GAAY,EAAE,OAAgB;IACxE,OAAO;QACL,QAAQ,EAAE,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AO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5C,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,kBAAkB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;IAC1E,CAAC;IAGD,OAAO,EAAE,CAAC;AACZ,CAAC;AA6BD,MAAM,UAAU,uBAAuB,CAAC,aAEvC;IACC,OAAO,iBAAiB,CAAC;QACvB,MAAM,EAAE,aAAa,CAAC,kBAAkB,CAAS,QAAQ,CAAC;QAC1D,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAS,SAAS,CAAC;QAC5D,YAAY,EAAE,aAAa,CAAC,kBAAkB,CAAU,mBAAmB,CAAC;QAC5E,GAAG,EAAE,aAAa,CAAC,kBAAkB,CAAS,KAAK,CAAC;KACrD,CAAC,CAAC,MAAM,CAAC;AACZ,CAAC"}
|
|
@@ -19,10 +19,28 @@ export function vendoredFrameworkSpecifier(migrationsDir, cwd = process.cwd(), c
|
|
|
19
19
|
return undefined;
|
|
20
20
|
}
|
|
21
21
|
const absoluteMigrationsDir = path.resolve(cwd, migrationsDir);
|
|
22
|
-
const relativePath = path.relative(absoluteMigrationsDir, coreRoot).split(path.sep).join('/');
|
|
22
|
+
const relativePath = path.relative(absoluteMigrationsDir, sourceCoreRoot(coreRoot)).split(path.sep).join('/');
|
|
23
23
|
const directory = relativePath.startsWith('.') ? relativePath : `./${relativePath}`;
|
|
24
24
|
return isEsModuleScope(absoluteMigrationsDir) ? `${directory}/index.js` : directory;
|
|
25
25
|
}
|
|
26
|
+
function sourceCoreRoot(coreRoot) {
|
|
27
|
+
if (fs.existsSync(path.join(coreRoot, 'index.ts'))) {
|
|
28
|
+
return coreRoot;
|
|
29
|
+
}
|
|
30
|
+
const segments = coreRoot.split(path.sep);
|
|
31
|
+
for (let index = segments.length - 1; index >= 0; index--) {
|
|
32
|
+
if (segments[index] !== 'dist') {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
for (const replacement of [[], ['src']]) {
|
|
36
|
+
const candidate = [...segments.slice(0, index), ...replacement, ...segments.slice(index + 1)].join(path.sep);
|
|
37
|
+
if (candidate && fs.existsSync(path.join(candidate, 'index.ts'))) {
|
|
38
|
+
return candidate;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return coreRoot;
|
|
43
|
+
}
|
|
26
44
|
function isEsModuleScope(directory) {
|
|
27
45
|
for (let dir = directory;; dir = path.dirname(dir)) {
|
|
28
46
|
const manifest = path.join(dir, 'package.json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-cli.js","sourceRoot":"","sources":["../../../../../src/core/modules/migrate/cli/migrate-cli.ts"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAMpF,SAAS,kBAAkB,CAAC,YAAoB;IAC9C,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;AAC/E,CAAC;AAYD,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AAwBpD,MAAM,UAAU,0BAA0B,CACxC,aAAqB,EACrB,MAAc,OAAO,CAAC,GAAG,EAAE,EAC3B,WAAmB,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,I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_KINDS = ['database', 'memory', 'redis'];
|
|
11
|
+
const THROTTLER_RESPONSE_HEADERS = ['Retry-After', 'X-RateLimit-Limit', 'X-RateLimit-Remaining', 'X-RateLimit-Reset'];
|
|
12
|
+
export function throttlerResponseHeaders(config) {
|
|
13
|
+
if (config === undefined || config === null || config === false) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
if (config !== true && (typeof config !== 'object' || config.enabled === false)) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
const settings = (config === true ? {} : config);
|
|
20
|
+
if (settings.setHeaders === false) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const names = Array.isArray(settings.throttlers) && settings.throttlers.length
|
|
24
|
+
? settings.throttlers.map((entry) => typeof entry?.name === 'string' && entry.name.trim() ? entry.name.trim() : THROTTLER_DEFAULTS.name)
|
|
25
|
+
: [THROTTLER_DEFAULTS.name];
|
|
26
|
+
const headers = new Set();
|
|
27
|
+
for (const name of names) {
|
|
28
|
+
const suffix = name === THROTTLER_DEFAULTS.name ? '' : `-${name}`;
|
|
29
|
+
for (const header of THROTTLER_RESPONSE_HEADERS) {
|
|
30
|
+
headers.add(`${header}${suffix}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return [...headers];
|
|
34
|
+
}
|
|
11
35
|
//# sourceMappingURL=core-throttler.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-throttler.constants.js","sourceRoot":"","sources":["../../../../src/core/modules/throttler/core-throttler.constants.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAG9D,MAAM,CAAC,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAMhE,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AAG1D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAEhC,KAAK,EAAE,EAAE;IAET,IAAI,EAAE,SAAS;IAEf,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AClC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,KAAK,GACT,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM;QAC9D,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAqC,EAAE,EAAE,CAChE,OAAO,KAAK,EAAE,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CACnG;QACH,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,IAAI,KAAK,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QAClE,KAAK,MAAM,MAAM,IAAI,0BAA0B,EAAE,CAAC;YAChD,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -122,7 +122,7 @@ JWT-based authentication for existing projects:
|
|
|
122
122
|
| **Tenant Plugin Safety Net** | Mongoose tenant plugin refuses a tenant-schema access without valid tenant context: 401 for a client operation nobody is signed in to (an expired session included — 12.11.3), 403 for a signed-in caller and for server work. Its post hooks (`find`, `findOne`, `findOneAnd*`) additionally check every RETURNED row (`assertRowsInTenantScope()`): a row of a tenant outside the caller's scope withholds the whole result with 403. The decisions live in `common/persistence/policies/tenant.policy.ts`, which every data store shares |
|
|
123
123
|
| **Data Store** | `DataStore<T>` (`common/persistence/`) is the database-neutral port below the CrudService pipeline; every `ModuleService` has one (`this.dataStore`, derived from `mainDbModel`, or passed as `dataStore`). On MongoDB it runs through Mongoose model methods, so every plugin fires. On PostgreSQL (`SqlDataStore`, phase 1) the same pipeline runs on plain records: before every statement the store applies the policies the plugins call (tenant filter and stamping, safety net, audit, password, role guard, system roles), the statement runs in its own transaction with the request's tenant scope so FORCED row-level security binds it (a query without a scope fails with 42501 → 403), and every returned row passes the tenant row check. References populate with one batched `id $in` read through the target model's store. Mongoose-only APIs (`aggregate`, `getModel`, native collection/connection) refuse on a SQL-stored model, and so does the Mongoose model itself (every data method of a model routed to SQL throws a named error). Since phase 2 the core's own models — users, tenant memberships, API tokens — are registered this way and their services run on the routed store; the port gained `updateOne` / `deleteOne` (atomic first match), `updateMany`, `deleteMany` and `updateById(…, { timestamps: false })`. Since phase 3 Better-Auth follows the user model: with the users on a SQL source (PostgreSQL; MySQL / MariaDB since 12.1.1) it runs its own Kysely adapter on that source's application pool, one `users` row per user, and the framework's reads of Better-Auth's data (session lookup by token in the middleware, token service, JWKS, passkey challenge mappings, e-mail-verified hook, user mapper, system setup, migration status, the MCP OAuth subject's roles) go through `BetterAuthSqlStore` — see `.claude/rules/better-auth.md` §11. Since phase 4 the AI module (eleven models, MCP OAuth clients, codes and refresh tokens) and the S3 / filesystem file metadata (`fileMetadataCollection()`, used by the file service, the TUS hand-off and the Hub) follow their routed store too; the port gained `sum()` and `find(…, { exclude })`, and an expiry sweep removes expired rows of TTL models and expired Better-Auth sessions on SQL, where no TTL index does. `CorePersistenceModule.forFeature()` + `@InjectStore()` register and inject the store; the `database` configuration routes each model to its source. Since phase 5 (12.1.0) MongoDB's libraries are optional peers: the core reaches them through `common/persistence/mongo/` (decorators that record the declaration and apply `@nestjs/mongoose`'s where installed, tokens, ObjectIds, GridFS), `CoreModule` connects MongoDB only when a source uses it, `forFeature()` provides the model tokens itself (a stand-in that refuses data access where no MongoDB is connected), and `database: false` runs without any database; the port gained `find(…, { sample })`, and the SQL update compiler skips a field given as `undefined` as Mongoose does |
|
|
124
124
|
| **API Tokens** | `apiTokens` config (opt-in): USER tokens act as their user without global roles; TENANT tokens (multi-tenancy only) act with the lowest tenant role in their own tenant. `CoreApiTokenMiddleware` authenticates `Authorization: Bearer` / `x-api-key`; every guard denies a token unless the route declares `@ApiTokenScopes()`. Signed short-lived assertions for embedded pages. See `src/core/modules/api-token/README.md` |
|
|
125
|
-
| **Rate limit for project routes** | `throttler` config (opt-in, 12.12.0, DEV-4431) on top of `@nestjs/throttler`: `CoreThrottlerGuard` is registered as the FIRST global guard, so an over-limit client gets 429 + `Retry-After` (`#LTNS_0020`) before authentication runs — also on a route that would answer it 401. It resolves the request like the role guards (`resolveGuardRequest()`: REST, GraphQL over HTTP, agent calls in a request); only a call without any request (a request-less agent call) is not counted. Counted per `request.ip` (follows `trustProxy`, IPv6 by /64); a request without an address — a GraphQL operation over the WebSocket, an HTTP request whose client already closed the connection — per signed-in user, else by the WebSocket's upgrade address, else in one shared bucket, never uncounted. `routes: 'decorated'` (default) limits only routes whose method or controller carries `@Throttle()`; `'all'` every route unless `@SkipThrottle()`. Counters in memory, Redis (default with `redis`) or the project's database through the persistence layer (`storage: 'database'`, MongoDB or SQL, exact across replicas); an outage of the shared store falls back to memory. See `src/core/modules/throttler/README.md` |
|
|
125
|
+
| **Rate limit for project routes** | `throttler` config (opt-in, 12.12.0, DEV-4431) on top of `@nestjs/throttler`: `CoreThrottlerGuard` is registered as the FIRST global guard, so an over-limit client gets 429 + `Retry-After` (`#LTNS_0020`) before authentication runs — also on a route that would answer it 401. It resolves the request like the role guards (`resolveGuardRequest()`: REST, GraphQL over HTTP, agent calls in a request); only a call without any request (a request-less agent call) is not counted. Counted per `request.ip` (follows `trustProxy`, IPv6 by /64); a request without an address — a GraphQL operation over the WebSocket, an HTTP request whose client already closed the connection — per signed-in user, else by the WebSocket's upgrade address, else in one shared bucket, never uncounted. `routes: 'decorated'` (default) limits only routes whose method or controller carries `@Throttle()`; `'all'` every route unless `@SkipThrottle()`. Counters in memory, Redis (default with `redis`) or the project's database through the persistence layer (`storage: 'database'`, MongoDB or SQL, exact across replicas); an outage of the shared store falls back to memory. CORS exposes `Retry-After` and `X-RateLimit-*` (`buildCorsConfig()`, 12.12.1), so an app on another origin can read the wait time. See `src/core/modules/throttler/README.md` |
|
|
126
126
|
|
|
127
127
|
### Data & CRUD
|
|
128
128
|
|
|
@@ -143,6 +143,10 @@ core. In an ES module project (`"type": "module"`, the starter's format since 12
|
|
|
143
143
|
directory (`'../src/core'`), which ESM does not resolve: `migrate up` stopped with `ERR_UNSUPPORTED_DIR_IMPORT`. New
|
|
144
144
|
migrations now import `'../src/core/index.js'`, also with `--sql`. CommonJS projects keep `'../src/core'`.
|
|
145
145
|
|
|
146
|
+
Until 12.12.1 a migration created while a build lay in `dist/` imported the build instead, `'../dist/src/core/index.js'`:
|
|
147
|
+
`bin/migrate.js` runs the compiled CLI then, and the path was computed from its location. Since 12.12.1 it always names
|
|
148
|
+
the source core. Change such an import to `'../src/core/index.js'`.
|
|
149
|
+
|
|
146
150
|
Migrations created before keep their import. Fix one that fails by hand:
|
|
147
151
|
|
|
148
152
|
```typescript
|
|
@@ -167,6 +171,7 @@ import { runSqlMigration } from '../src/core/index.js';
|
|
|
167
171
|
| Symptom | Cause | Fix |
|
|
168
172
|
|---------|-------|-----|
|
|
169
173
|
| Every client gets 429 at once behind a reverse proxy | `trustProxy` unset: every request comes from the proxy | Set `trustProxy` to the number of proxies |
|
|
174
|
+
| An app on another origin sees the 429 but cannot read `Retry-After` | the CORS options do not expose it (12.12.0) | 12.12.1 exposes the rate limit headers through `buildCorsConfig()`; a `main.ts` building its own CORS options lists them in `exposedHeaders` |
|
|
170
175
|
| Boot error `throttler.storage is 'redis', but redis is not configured` | explicit storage without its backend | Configure `redis` or choose another storage |
|
|
171
176
|
| A route with `@Throttle()` is not limited | decorator imported from a second copy of `@nestjs/throttler` | Import it from `@lenne.tech/nest-server` |
|
|
172
177
|
| No audit entries for a model | the model is neither `@Audited()` nor in `auditLog.models`, or the write bypasses `CrudService` | Add it, or call `record()` |
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Migration Guide: 12.12.0 → 12.12.1
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
| Category | Details |
|
|
6
|
+
|---|---|
|
|
7
|
+
| **Breaking Changes** | None |
|
|
8
|
+
| **New Features** | None |
|
|
9
|
+
| **Bugfixes** | `migrate create` writes the source core into a new migration while a build lies in `dist/` (§1); with `throttler` configured, CORS exposes the rate limit headers to an app on another origin (§2) |
|
|
10
|
+
| **Security** | None |
|
|
11
|
+
| **Migration Effort** | Package update. A vendor-mode project changes the import of a migration created under 12.12.0 while a build was present; a project that builds its CORS options itself in `main.ts` lists the rate limit headers there |
|
|
12
|
+
|
|
13
|
+
## Quick Migration
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @lenne.tech/nest-server@12.12.1
|
|
17
|
+
pnpm run update # nest-server-starter based projects
|
|
18
|
+
pnpm run build
|
|
19
|
+
pnpm test
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual.
|
|
23
|
+
|
|
24
|
+
## 1. Bugfix: `migrate create` imports the source core, also while a build exists
|
|
25
|
+
|
|
26
|
+
**No action needed** in npm mode. A vendor-mode project checks the migrations it created under 12.12.0 (and before)
|
|
27
|
+
while a build lay in `dist/`.
|
|
28
|
+
|
|
29
|
+
In a vendor-mode project, `migrate create` writes the relative path to the vendored core into the new migration
|
|
30
|
+
(`'../src/core/index.js'` in an ES module project, `'../src/core'` in a CommonJS project). `bin/migrate.js` prefers the
|
|
31
|
+
compiled CLI in `dist/` when a build exists, and the path was computed from the CLI's own location. Such a migration
|
|
32
|
+
therefore imported the build output, `'../dist/src/core/index.js'`: it failed in a fresh checkout without a build, and
|
|
33
|
+
after the project's build it pointed at `dist/dist/src/core`.
|
|
34
|
+
|
|
35
|
+
Since 12.12.1 the path always names the source core (`<project>/src/core`), for a build in `dist/src/core` and in
|
|
36
|
+
`dist/core` alike. Only where no source core with an `index.ts` lies beside the build (a deployed image) does the CLI
|
|
37
|
+
keep the core it runs from. Find and fix the migrations written with the build path:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
grep -rln "dist/src/core" migrations/
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
// Before (created while a build existed)
|
|
45
|
+
import { getDb } from '../dist/src/core/index.js';
|
|
46
|
+
|
|
47
|
+
// After
|
|
48
|
+
import { getDb } from '../src/core/index.js';
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 2. Bugfix: an app on another origin can read the rate limit headers
|
|
52
|
+
|
|
53
|
+
**No action needed** for a project whose `main.ts` calls `app.enableCors(buildCorsConfig(envConfig))`, as the
|
|
54
|
+
nest-server-starter does: REST and GraphQL share that configuration.
|
|
55
|
+
|
|
56
|
+
The rate limit of 12.12.0 (`throttler`) answers `429` with `Retry-After` and sets `X-RateLimit-Limit`,
|
|
57
|
+
`X-RateLimit-Remaining` and `X-RateLimit-Reset` on every limited response. A browser hides every response header but a
|
|
58
|
+
short safe list from a script on another origin, so an app on its own host (`app.example.com` calling
|
|
59
|
+
`api.example.com`) saw the `429` but not how long to wait.
|
|
60
|
+
|
|
61
|
+
Since 12.12.1 `buildCorsConfig()` lists these headers in `exposedHeaders` while `throttler` is configured, each with
|
|
62
|
+
`-<name>` for a throttler other than `default` (the names `@nestjs/throttler` sets). Nothing changes with `throttler`
|
|
63
|
+
unset, `{ enabled: false }` or `setHeaders: false`, and the allowed origins and credentials stay exactly as before.
|
|
64
|
+
`throttlerResponseHeaders(config)` returns the list.
|
|
65
|
+
|
|
66
|
+
A project that builds its CORS options itself adds them:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { throttlerResponseHeaders } from '@lenne.tech/nest-server';
|
|
70
|
+
|
|
71
|
+
app.enableCors({
|
|
72
|
+
credentials: true,
|
|
73
|
+
exposedHeaders: throttlerResponseHeaders(envConfig.throttler),
|
|
74
|
+
origin: ['https://app.example.com'],
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Compatibility Notes
|
|
79
|
+
|
|
80
|
+
| Pattern | Status |
|
|
81
|
+
|---|---|
|
|
82
|
+
| npm mode | Unchanged (`migrate create` keeps `@lenne.tech/nest-server`) |
|
|
83
|
+
| Vendor mode, `migrate create` without a build | Unchanged |
|
|
84
|
+
| Vendor mode, `migrate create` with a build in `dist/` | Writes the source core instead of the build |
|
|
85
|
+
| No `throttler` | CORS unchanged |
|
|
86
|
+
| `throttler` with `buildCorsConfig()` in `main.ts` | `Access-Control-Expose-Headers` lists the rate limit headers |
|
|
87
|
+
| Own CORS options in `main.ts` | Unchanged until the project adds `exposedHeaders` |
|
|
88
|
+
|
|
89
|
+
## Troubleshooting
|
|
90
|
+
|
|
91
|
+
| Symptom | Cause | Fix |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| `migrate up` fails with `Cannot find module '../dist/src/core/index.js'` | the migration was created by 12.12.0 or earlier while a build existed | Change the import to `'../src/core/index.js'` (`'../src/core'` in a CommonJS project) |
|
|
94
|
+
| The app shows the `429` but cannot read `Retry-After` | the project builds its own CORS options | Add `exposedHeaders: throttlerResponseHeaders(envConfig.throttler)` |
|
|
95
|
+
|
|
96
|
+
## Module Documentation
|
|
97
|
+
|
|
98
|
+
- `src/core/modules/migrate/README.md`: framework import in vendor-mode migrations
|
|
99
|
+
- `src/core/modules/throttler/README.md`: "Reading the headers from another origin"
|
|
100
|
+
- `src/core/common/helpers/cookies.helper.ts`: `buildCorsConfig()`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "12.12.
|
|
3
|
+
"version": "12.12.1",
|
|
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": [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Response } from 'express';
|
|
2
2
|
|
|
3
3
|
import type { ICookiesConfig, ICorsConfig, IServerOptions } from '../interfaces/server-options.interface.js';
|
|
4
|
+
import { throttlerResponseHeaders } from '../../modules/throttler/core-throttler.constants.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Module-scoped cache of `process.env.NODE_ENV === 'production'`.
|
|
@@ -561,6 +562,10 @@ export function resolveServerUrls(input: {
|
|
|
561
562
|
* `appUrl`/`baseUrl` are resolved via {@link resolveServerUrls}, the same function BetterAuth
|
|
562
563
|
* uses, so all three CORS layers (GraphQL, REST, BetterAuth `trustedOrigins`) agree.
|
|
563
564
|
*
|
|
565
|
+
* With `throttler` configured (12.12.0+) the config also carries `exposedHeaders`: `Retry-After` and `X-RateLimit-*`
|
|
566
|
+
* (`throttlerResponseHeaders()`). A browser hides response headers outside a short safe list from a script on another
|
|
567
|
+
* origin, so an app on its own host saw the 429 but not how long to wait.
|
|
568
|
+
*
|
|
564
569
|
* Used by both:
|
|
565
570
|
* - `CoreModule.buildCorsConfig()` for GraphQL (Apollo) CORS
|
|
566
571
|
* - `main.ts` reference implementation for REST (Express) CORS
|
|
@@ -589,9 +594,14 @@ export function buildCorsConfig(options: Partial<IServerOptions>): Record<string
|
|
|
589
594
|
|
|
590
595
|
const corsObj = typeof options?.cors === 'object' ? options.cors : {};
|
|
591
596
|
|
|
597
|
+
// Response headers a script on the app's origin must be able to read (the rate limit's wait time)
|
|
598
|
+
const exposed = throttlerResponseHeaders(options?.throttler);
|
|
599
|
+
const withExposedHeaders = (cors: Record<string, unknown>): Record<string, unknown> =>
|
|
600
|
+
exposed.length ? { ...cors, exposedHeaders: exposed } : cors;
|
|
601
|
+
|
|
592
602
|
// allowAll → mirror request origin (explicit opt-in for dev/test)
|
|
593
603
|
if (corsObj.allowAll) {
|
|
594
|
-
return { credentials: true, origin: true };
|
|
604
|
+
return withExposedHeaders({ credentials: true, origin: true });
|
|
595
605
|
}
|
|
596
606
|
|
|
597
607
|
// Build origin list from the shared URL resolution (appUrl auto-derived from baseUrl,
|
|
@@ -618,7 +628,7 @@ export function buildCorsConfig(options: Partial<IServerOptions>): Record<string
|
|
|
618
628
|
const uniqueOrigins = [...new Set(origins)];
|
|
619
629
|
|
|
620
630
|
if (uniqueOrigins.length > 0) {
|
|
621
|
-
return { credentials: true, origin: uniqueOrigins };
|
|
631
|
+
return withExposedHeaders({ credentials: true, origin: uniqueOrigins });
|
|
622
632
|
}
|
|
623
633
|
|
|
624
634
|
// No origins resolvable → return empty (secure default — no open CORS with credentials)
|
|
@@ -532,7 +532,9 @@ directory to the vendored core (e.g. `'../src/core'`). It does so only when the
|
|
|
532
532
|
project and the core it runs from has its own `index`; in npm mode the template is written unchanged. In an ES module
|
|
533
533
|
project (`"type": "module"` in the package scope of the migrations directory) the path names the entry file,
|
|
534
534
|
`'../src/core/index.js'`, because ESM resolves no directory (12.12.0; before, `migrate up` stopped with
|
|
535
|
-
`ERR_UNSUPPORTED_DIR_IMPORT`). The same applies to `migrate create --sql`.
|
|
535
|
+
`ERR_UNSUPPORTED_DIR_IMPORT`). The same applies to `migrate create --sql`. The path always names the source core, also
|
|
536
|
+
while a build lies in `dist/`: `bin/migrate.js` then runs the compiled CLI, and until 12.12.1 the path was computed from
|
|
537
|
+
its location, so such a migration imported `'../dist/src/core/index.js'`.
|
|
536
538
|
|
|
537
539
|
### TypeScript Loader
|
|
538
540
|
|
|
@@ -68,6 +68,10 @@ const FRAMEWORK_PACKAGE = '@lenne.tech/nest-server';
|
|
|
68
68
|
* `index.ts` of a source run. A CommonJS project keeps the directory, so its migrations stay as they
|
|
69
69
|
* were — a loader that maps no `.js` to `.ts` under `require()` (ts-node) keeps working there.
|
|
70
70
|
*
|
|
71
|
+
* The path always names the SOURCE core (`<project>/src/core`), also when this CLI runs compiled: `bin/migrate.js`
|
|
72
|
+
* prefers a build in `dist/`, and its location (`dist/src/core`) put `'../dist/src/core/index.js'` into every migration
|
|
73
|
+
* created while a build was present (`sourceCoreRoot()`).
|
|
74
|
+
*
|
|
71
75
|
* @param migrationsDir - Directory the migration is written to, absolute or relative to `cwd`
|
|
72
76
|
* @param cwd - Project directory the package is resolved from
|
|
73
77
|
* @param coreRoot - Root of the core this CLI belongs to
|
|
@@ -87,11 +91,37 @@ export function vendoredFrameworkSpecifier(
|
|
|
87
91
|
return undefined;
|
|
88
92
|
}
|
|
89
93
|
const absoluteMigrationsDir = path.resolve(cwd, migrationsDir);
|
|
90
|
-
const relativePath = path.relative(absoluteMigrationsDir, coreRoot).split(path.sep).join('/');
|
|
94
|
+
const relativePath = path.relative(absoluteMigrationsDir, sourceCoreRoot(coreRoot)).split(path.sep).join('/');
|
|
91
95
|
const directory = relativePath.startsWith('.') ? relativePath : `./${relativePath}`;
|
|
92
96
|
return isEsModuleScope(absoluteMigrationsDir) ? `${directory}/index.js` : directory;
|
|
93
97
|
}
|
|
94
98
|
|
|
99
|
+
/**
|
|
100
|
+
* The source core a compiled core was built from: `<project>/dist/src/core` → `<project>/src/core` (the layout
|
|
101
|
+
* `lt fullstack convert-mode` builds), `<project>/dist/core` → `<project>/src/core` (a build with `rootDir: 'src'`).
|
|
102
|
+
* A migration lives next to the sources, imports the source core, and is compiled together with it, so the relative
|
|
103
|
+
* path also holds in the build. Without a source core with an `index.ts` beside the build (a deployed image), the core
|
|
104
|
+
* this CLI runs from is the answer.
|
|
105
|
+
*/
|
|
106
|
+
function sourceCoreRoot(coreRoot: string): string {
|
|
107
|
+
if (fs.existsSync(path.join(coreRoot, 'index.ts'))) {
|
|
108
|
+
return coreRoot;
|
|
109
|
+
}
|
|
110
|
+
const segments = coreRoot.split(path.sep);
|
|
111
|
+
for (let index = segments.length - 1; index >= 0; index--) {
|
|
112
|
+
if (segments[index] !== 'dist') {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
for (const replacement of [[], ['src']]) {
|
|
116
|
+
const candidate = [...segments.slice(0, index), ...replacement, ...segments.slice(index + 1)].join(path.sep);
|
|
117
|
+
if (candidate && fs.existsSync(path.join(candidate, 'index.ts'))) {
|
|
118
|
+
return candidate;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return coreRoot;
|
|
123
|
+
}
|
|
124
|
+
|
|
95
125
|
/**
|
|
96
126
|
* Whether files in `directory` are ES modules: the `type` of the nearest `package.json` above it, as Node decides.
|
|
97
127
|
* No `package.json`, or one that cannot be read, means CommonJS (Node's default).
|
|
@@ -68,6 +68,14 @@ Caddy, nginx or an ingress without `trustProxy`, every request arrives from the
|
|
|
68
68
|
bucket** — the boot warns about exactly that. Trusting more hops than exist lets a client pick a fresh bucket per
|
|
69
69
|
request. IPv6 addresses are counted by their /64 (`ipv6SubnetPrefix`).
|
|
70
70
|
|
|
71
|
+
## Reading the headers from another origin
|
|
72
|
+
|
|
73
|
+
A browser hides every response header but a short safe list from a script on another origin. With `throttler`
|
|
74
|
+
configured, `buildCorsConfig()` lists `Retry-After` and `X-RateLimit-Limit` / `-Remaining` / `-Reset` (with `-<name>`
|
|
75
|
+
for a throttler other than `default`) in `Access-Control-Expose-Headers` (12.12.1), so an app on its own host can show
|
|
76
|
+
how long to wait. REST takes it from the project's `enableCors(buildCorsConfig(…))` in `main.ts`, GraphQL from
|
|
77
|
+
`CoreModule`. A project that builds its CORS options itself adds them there; `setHeaders: false` sends and exposes none.
|
|
78
|
+
|
|
71
79
|
## Order with the role guards
|
|
72
80
|
|
|
73
81
|
The rate limit guard is registered as the **first** global guard, so an over-limit client is refused before
|
|
@@ -31,3 +31,41 @@ export const THROTTLER_DEFAULTS = {
|
|
|
31
31
|
|
|
32
32
|
/** The storages a project can choose (`throttler.storage`) */
|
|
33
33
|
export const THROTTLER_STORAGE_KINDS = ['database', 'memory', 'redis'] as const;
|
|
34
|
+
|
|
35
|
+
/** The headers `@nestjs/throttler` sets per throttler: `Retry-After` on a refusal, `X-RateLimit-*` on every response */
|
|
36
|
+
const THROTTLER_RESPONSE_HEADERS = ['Retry-After', 'X-RateLimit-Limit', 'X-RateLimit-Remaining', 'X-RateLimit-Reset'];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The response headers the rate limit of a `throttler` configuration sets, as `@nestjs/throttler` names them: each with
|
|
40
|
+
* `-<name>` for a throttler other than `default`. Empty while `throttler` is off or `setHeaders: false`.
|
|
41
|
+
*
|
|
42
|
+
* `buildCorsConfig()` lists them in `Access-Control-Expose-Headers`: a browser hides every response header but a few
|
|
43
|
+
* from a script on another origin, so an app on its own host saw the 429 but not how long to wait. The names follow
|
|
44
|
+
* `resolveThrottlerConfig()` (a trimmed `name`, else `default`) without its warnings, because CORS is built before it.
|
|
45
|
+
*/
|
|
46
|
+
export function throttlerResponseHeaders(config: unknown): string[] {
|
|
47
|
+
if (config === undefined || config === null || config === false) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
if (config !== true && (typeof config !== 'object' || (config as { enabled?: unknown }).enabled === false)) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
const settings = (config === true ? {} : config) as { setHeaders?: unknown; throttlers?: unknown };
|
|
54
|
+
if (settings.setHeaders === false) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
const names =
|
|
58
|
+
Array.isArray(settings.throttlers) && settings.throttlers.length
|
|
59
|
+
? settings.throttlers.map((entry: { name?: unknown } | undefined) =>
|
|
60
|
+
typeof entry?.name === 'string' && entry.name.trim() ? entry.name.trim() : THROTTLER_DEFAULTS.name,
|
|
61
|
+
)
|
|
62
|
+
: [THROTTLER_DEFAULTS.name];
|
|
63
|
+
const headers = new Set<string>();
|
|
64
|
+
for (const name of names) {
|
|
65
|
+
const suffix = name === THROTTLER_DEFAULTS.name ? '' : `-${name}`;
|
|
66
|
+
for (const header of THROTTLER_RESPONSE_HEADERS) {
|
|
67
|
+
headers.add(`${header}${suffix}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return [...headers];
|
|
71
|
+
}
|