@lenne.tech/nest-server 12.10.0 → 12.11.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/better-auth.md +19 -0
- package/.claude/rules/configurable-features.md +12 -10
- package/.claude/rules/package-management.md +10 -8
- package/.claude/rules/role-system.md +4 -1
- package/.claude/rules/testing.md +4 -4
- package/CLAUDE.md +5 -0
- package/FRAMEWORK-API.md +2 -1
- package/dist/core/common/decorators/unified-field.decorator.js +5 -2
- package/dist/core/common/decorators/unified-field.decorator.js.map +1 -1
- package/dist/core/common/helpers/config.helper.js +31 -9
- package/dist/core/common/helpers/config.helper.js.map +1 -1
- package/dist/core/common/helpers/graceful-shutdown.helper.js +3 -1
- package/dist/core/common/helpers/graceful-shutdown.helper.js.map +1 -1
- package/dist/core/common/helpers/graphql-upload.helper.d.ts +2 -0
- package/dist/core/common/helpers/graphql-upload.helper.js +31 -0
- package/dist/core/common/helpers/graphql-upload.helper.js.map +1 -1
- package/dist/core/common/helpers/graphql-ws-connection.helper.d.ts +8 -3
- package/dist/core/common/helpers/graphql-ws-connection.helper.js +44 -0
- package/dist/core/common/helpers/graphql-ws-connection.helper.js.map +1 -1
- package/dist/core/common/helpers/http-stream-auth.helper.d.ts +13 -0
- package/dist/core/common/helpers/http-stream-auth.helper.js +90 -0
- package/dist/core/common/helpers/http-stream-auth.helper.js.map +1 -0
- package/dist/core/common/helpers/redact-secrets.helper.js +7 -2
- package/dist/core/common/helpers/redact-secrets.helper.js.map +1 -1
- package/dist/core/common/helpers/shutdown-state.helper.d.ts +3 -0
- package/dist/core/common/helpers/shutdown-state.helper.js +11 -0
- package/dist/core/common/helpers/shutdown-state.helper.js.map +1 -0
- package/dist/core/common/interfaces/cron-job-config-with-utc-offset.interface.d.ts +1 -1
- package/dist/core/common/interfaces/cron-job-config.interface.d.ts +1 -1
- package/dist/core/common/interfaces/server-options.interface.d.ts +14 -0
- package/dist/core/common/plugins/complexity.plugin.js +73 -9
- package/dist/core/common/plugins/complexity.plugin.js.map +1 -1
- package/dist/core/common/services/core-cron-jobs.service.d.ts +13 -0
- package/dist/core/common/services/core-cron-jobs.service.js +129 -4
- package/dist/core/common/services/core-cron-jobs.service.js.map +1 -1
- package/dist/core/modules/better-auth/better-auth.config.js +48 -4
- package/dist/core/modules/better-auth/better-auth.config.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth-jwt-session.cache.d.ts +8 -0
- package/dist/core/modules/better-auth/core-better-auth-jwt-session.cache.js +47 -0
- package/dist/core/modules/better-auth/core-better-auth-jwt-session.cache.js.map +1 -0
- package/dist/core/modules/better-auth/core-better-auth-models.d.ts +1 -0
- package/dist/core/modules/better-auth/core-better-auth-models.js +7 -0
- package/dist/core/modules/better-auth/core-better-auth-models.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth-sign-in-factors.helper.d.ts +11 -0
- package/dist/core/modules/better-auth/core-better-auth-sign-in-factors.helper.js +62 -0
- package/dist/core/modules/better-auth/core-better-auth-sign-in-factors.helper.js.map +1 -0
- package/dist/core/modules/better-auth/core-better-auth-user.mapper.d.ts +1 -0
- package/dist/core/modules/better-auth/core-better-auth-user.mapper.js +28 -1
- package/dist/core/modules/better-auth/core-better-auth-user.mapper.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth.controller.js +2 -1
- package/dist/core/modules/better-auth/core-better-auth.controller.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth.middleware.js +2 -2
- package/dist/core/modules/better-auth/core-better-auth.middleware.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth.resolver.js +1 -0
- package/dist/core/modules/better-auth/core-better-auth.resolver.js.map +1 -1
- package/dist/core/modules/better-auth/core-better-auth.service.d.ts +10 -0
- package/dist/core/modules/better-auth/core-better-auth.service.js +105 -19
- package/dist/core/modules/better-auth/core-better-auth.service.js.map +1 -1
- package/dist/core/modules/health-check/core-health-check-readiness.controller.d.ts +6 -0
- package/dist/core/modules/health-check/core-health-check-readiness.controller.js +36 -0
- package/dist/core/modules/health-check/core-health-check-readiness.controller.js.map +1 -0
- package/dist/core/modules/health-check/core-health-check.helpers.d.ts +10 -0
- package/dist/core/modules/health-check/core-health-check.helpers.js +31 -0
- package/dist/core/modules/health-check/core-health-check.helpers.js.map +1 -0
- package/dist/core/modules/health-check/core-health-check.module.d.ts +9 -0
- package/dist/core/modules/health-check/core-health-check.module.js +13 -2
- package/dist/core/modules/health-check/core-health-check.module.js.map +1 -1
- package/dist/core/modules/health-check/core-health-check.service.d.ts +8 -1
- package/dist/core/modules/health-check/core-health-check.service.js +66 -29
- package/dist/core/modules/health-check/core-health-check.service.js.map +1 -1
- package/dist/core/modules/sync/core-sync.service.d.ts +2 -0
- package/dist/core/modules/sync/core-sync.service.js +11 -1
- package/dist/core/modules/sync/core-sync.service.js.map +1 -1
- package/dist/core.module.js +5 -1
- package/dist/core.module.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/main.js.map +1 -1
- package/docs/REQUEST-LIFECYCLE.md +18 -6
- package/docs/offline-sync-protocol.md +5 -3
- package/migration-guides/12.10.0-to-12.10.1.md +182 -0
- package/migration-guides/12.10.x-to-12.11.x.md +295 -0
- package/package.json +17 -17
- package/src/core/common/decorators/unified-field.decorator.ts +14 -4
- package/src/core/common/helpers/config.helper.ts +55 -8
- package/src/core/common/helpers/graceful-shutdown.helper.ts +10 -3
- package/src/core/common/helpers/graphql-upload.helper.ts +93 -0
- package/src/core/common/helpers/graphql-ws-connection.helper.ts +99 -4
- package/src/core/common/helpers/http-stream-auth.helper.ts +197 -0
- package/src/core/common/helpers/redact-secrets.helper.ts +22 -3
- package/src/core/common/helpers/shutdown-state.helper.ts +28 -0
- package/src/core/common/interfaces/cron-job-config-with-utc-offset.interface.ts +1 -1
- package/src/core/common/interfaces/cron-job-config.interface.ts +1 -1
- package/src/core/common/interfaces/server-options.interface.ts +113 -1
- package/src/core/common/plugins/complexity.plugin.ts +150 -9
- package/src/core/common/services/core-cron-jobs.service.ts +241 -14
- package/src/core/modules/better-auth/INTEGRATION-CHECKLIST.md +26 -10
- package/src/core/modules/better-auth/README.md +37 -8
- package/src/core/modules/better-auth/better-auth.config.ts +83 -12
- package/src/core/modules/better-auth/core-better-auth-api.middleware.ts +1 -1
- package/src/core/modules/better-auth/core-better-auth-jwt-session.cache.ts +104 -0
- package/src/core/modules/better-auth/core-better-auth-models.ts +5 -0
- package/src/core/modules/better-auth/core-better-auth-sign-in-factors.helper.ts +105 -0
- package/src/core/modules/better-auth/core-better-auth-user.mapper.ts +37 -1
- package/src/core/modules/better-auth/core-better-auth.controller.ts +6 -3
- package/src/core/modules/better-auth/core-better-auth.middleware.ts +4 -3
- package/src/core/modules/better-auth/core-better-auth.module.ts +1 -1
- package/src/core/modules/better-auth/core-better-auth.resolver.ts +1 -0
- package/src/core/modules/better-auth/core-better-auth.service.ts +160 -27
- package/src/core/modules/health-check/core-health-check-readiness.controller.ts +27 -0
- package/src/core/modules/health-check/core-health-check.helpers.ts +65 -0
- package/src/core/modules/health-check/core-health-check.module.ts +37 -2
- package/src/core/modules/health-check/core-health-check.service.ts +154 -59
- package/src/core/modules/sync/README.md +18 -6
- package/src/core/modules/sync/core-sync.service.ts +35 -6
- package/src/core.module.ts +9 -1
- package/src/index.ts +4 -0
- package/src/main.ts +2 -1
|
@@ -663,6 +663,24 @@ boot (one row, ownership, a second boot, the system setup), `tests/persistence-m
|
|
|
663
663
|
MariaDB boot on a database in the server's default collation, and the `iam-*` cases of the core module matrix the
|
|
664
664
|
security rules on every database.
|
|
665
665
|
|
|
666
|
+
## 12. A Better-Auth JWT is bound to its session (12.11.0)
|
|
667
|
+
|
|
668
|
+
The JWT carries the id of the session it was issued from (`sid`, `definePayload` in `buildPlugins()`), and
|
|
669
|
+
`CoreBetterAuthService.verifyJwtToken()` accepts it only while that session exists, belongs to the token's `sub` and has
|
|
670
|
+
not expired (`isJwtSessionLive()`). Before, a JWT was checked on signature and expiry alone and outlived a sign-out by
|
|
671
|
+
up to 15 minutes; a JWT client's `POST /iam/sign-out` read the cookie alone and ended no session, and the middleware
|
|
672
|
+
handed Better-Auth the user's NEWEST session for a JWT request.
|
|
673
|
+
|
|
674
|
+
| Rule | Why |
|
|
675
|
+
|---|---|
|
|
676
|
+
| Every JWT verification goes through `verifyJwtToken()` | it is the one place with the session check; a second `jwtVerify()` of a login JWT would accept a signed-out session's token |
|
|
677
|
+
| The session of a JWT request is `getJwtSession(payload)` — by `sid`, never "the user's active session" | a sign-out or a plugin route acts on the JWT's own session |
|
|
678
|
+
| A session deleted outside Better-Auth's adapter is caught by the cache interval only (`jwtSessionCacheTtlMs`, 10 s) | the immediate forget runs from Better-Auth's `session.delete` hook (`wsSessionRevocationPlugin()`); delete through Better-Auth |
|
|
679
|
+
| The cache lives in the import-free leaf `core-better-auth-jwt-session.cache.ts`, bounded, keyed by session id and checked against the user | config, service and user mapper reach it without importing each other; an entry never vouches for another user |
|
|
680
|
+
| After a session rotation the answer's `token` is the JWT of the NEW session | the old JWT names a deleted session and answers 401 |
|
|
681
|
+
|
|
682
|
+
Pinned by `tests/unit/better-auth-jwt-session-binding.spec.ts` and `tests/better-auth-jwt-session.e2e-spec.ts`.
|
|
683
|
+
|
|
666
684
|
## Summary
|
|
667
685
|
|
|
668
686
|
| Principle | Requirement |
|
|
@@ -680,3 +698,4 @@ security rules on every database.
|
|
|
680
698
|
| Request path under the base path | `CoreBetterAuthPathGuardMiddleware` refuses a non-canonical path first; checks match whole segments of the canonical path (§9) |
|
|
681
699
|
| Direct `api.*` calls | Hand Better-Auth the request (CSRF headers only) + `asResponse: false`, or its login-CSRF check is skipped (§10) |
|
|
682
700
|
| SQL source | Better-Auth follows the users table; the framework reaches its data through `BetterAuthSqlStore`, ids stay strings (§11) |
|
|
701
|
+
| JWT | Bound to its session (`sid`), verified in `verifyJwtToken()` only, resolved by `getJwtSession()` (§12) |
|
|
@@ -305,12 +305,13 @@ This pattern is currently applied to:
|
|
|
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
306
|
| 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 |
|
|
307
307
|
| BetterAuth Rate Limiting | `betterAuth.rateLimit` | Presence Implies Enabled | `max: 10`, `windowSeconds: 60`. Same `RateLimitStore` selection, degradation and async signatures as the Legacy Auth row (namespace `better-auth`) |
|
|
308
|
-
| BetterAuth JWT Plugin | `betterAuth.jwt` | Boolean Shorthand | `expiresIn: '15m'` |
|
|
309
|
-
| BetterAuth 2FA Plugin | `betterAuth.twoFactor` | Boolean Shorthand | `appName: 'Nest Server'` |
|
|
310
|
-
| BetterAuth Passkey Plugin | `betterAuth.passkey` | Boolean Shorthand | `rpName: 'Nest Server'` |
|
|
308
|
+
| BetterAuth JWT Plugin | `betterAuth.jwt` | Boolean Shorthand | `expiresIn: '15m'`. **Since 12.11.0 a JWT is bound to the session it was issued from** (claim `sid`, `definePayload` in `buildPlugins()`): `verifyJwtToken()` accepts it only while that session exists, belongs to the token's `sub` and has not expired — asked through Better-Auth's adapter by id (the user's session list where sessions live only in `secondaryStorage`), cached 10 s (`jwtSessionCacheTtlMs`, protected) in the import-free leaf `core-better-auth-jwt-session.cache.ts` (10,000 entries max), and forgotten at once when Better-Auth deletes the session (`wsSessionRevocationPlugin()` → `jwtSessionEnded()`), on every replica over the user mapper's Redis invalidation channel (`{ sessionId }`). A JWT without `sid` is refused; a failed lookup refuses and is not cached. The middleware hands Better-Auth's plugin routes the JWT's OWN session (`getJwtSession()`), and `POST /iam/sign-out` revokes it — before, the user's newest session, and a JWT client's sign-out read the cookie alone and ended nothing. After a session rotation (first `verify-totp` while enabling 2FA) the answer's token is the JWT of the new session. Pinned by `tests/unit/better-auth-jwt-session-binding.spec.ts` and `tests/better-auth-jwt-session.e2e-spec.ts` (mutations `jwt-session-*`, `jwt-payload-without-session-id`, `jwt-middleware-newest-session`, `jwt-sign-out-reads-cookie-only`) |
|
|
309
|
+
| BetterAuth 2FA Plugin | `betterAuth.twoFactor` | Boolean Shorthand | `appName: 'Nest Server'`. On unless `false` / `{ enabled: false }` — **since 12.11.0 off while sign-in runs through a provider alone — `emailAndPassword.enabled: false` and no plugin of the project with a `/sign-in/…` route (`username()` / `phoneNumber()` keep it on, they need it) — unless switched on with `true` / `{ enabled: true }`** (an object without `enabled: true` does not count; the boot warns then). Mutation `iam-sign-in-factors-ignore-plugin-sign-in` pins the plugin exception. One rule for plugin registration and the service flags: `core-better-auth-sign-in-factors.helper.ts`; the boot names what it switched off. Pinned by `tests/unit/better-auth-sso-only-sign-in.spec.ts` (mutation `iam-sign-in-factors-ignore-password-off`) |
|
|
310
|
+
| BetterAuth Passkey Plugin | `betterAuth.passkey` | Boolean Shorthand | `rpName: 'Nest Server'`. Same rule as 2FA since 12.11.0: off while sign-in runs through a provider alone unless `passkey: true` / `{ enabled: true }` — a passkey registered after a provider sign-in kept its owner signed in after the provider withdrew the assignment. The routes answer 404 then, for stored passkeys too |
|
|
311
|
+
| BetterAuth Session Lifetime | `betterAuth.session` | Explicit Value — absent = Better-Auth's defaults | **12.11.0+.** `expiresInHours` → Better-Auth's `session.expiresIn` (default 168 h = 7 days), `extendOnUse: false` → `session.disableSessionRefresh` (default: extended once a day of use, so a session used daily never ends). A fixed lifetime makes a withdrawal at a sign-in provider take effect after `expiresInHours` at the latest. An `expiresInHours` that is not a positive finite number is ignored with a warning — never unlimited. `betterAuth.options.session` is merged over it key by key. Implementation: `resolveSessionOptions()` in `better-auth.config.ts`; pinned by `tests/unit/better-auth-sso-only-sign-in.spec.ts` |
|
|
311
312
|
| BetterAuth Cross-Subdomain Cookies | `betterAuth.crossSubDomainCookies` | Boolean Shorthand | `domain: auto (appUrl → baseUrl without api. prefix)` |
|
|
312
313
|
| BetterAuth Disable Sign-Up | `betterAuth.emailAndPassword.disableSignUp` | Explicit Boolean | `false` (sign-up enabled). `true` also removes `POST /iam/sign-up/email` from the document `setupSwagger()` builds — the route answers `SIGNUP_DISABLED` to every caller then, so documenting it only misleads. The rule is `CoreBetterAuthService.isSignUpEnabled()`'s (`=== true`); a project controller extending `CoreBetterAuthController` that overrides `signUp` is covered, and so is the route Better-Auth generates for it. **Since 12.3.0 it closes social sign-up too:** Better-Auth reads the flag for `/sign-up/email` only and decides a social sign-up per provider, so `buildSocialProviders()` hands every provider it as `disableSignUp` — a first social sign-in of an unknown user is refused (`error=signup_disabled` on the callback, 401 on `/sign-in/social` with an `idToken`), existing users keep signing in. `socialProviders.<name>.disableSignUp` is the deliberate exception per provider (`false` opens, `true` closes only that one); only a boolean counts there, any other value follows the global flag, so a string from `NEST_SERVER_CONFIG` cannot open a closed registration. Plugins a project adds through `betterAuth.plugins` are not covered (they need their own sign-up option, `magicLink({ disableSignUp: true })`); `betterAuth.options.plugins` would replace the framework's own plugins and is not the place for them. Pinned by `tests/unit/better-auth-social-sign-up.spec.ts` against the REAL `createBetterAuthInstance()`, including Better-Auth's own `/sign-in/social` handler (mutations `iam-social-sign-up-ignores-disable-sign-up`, `iam-social-sign-up-string-opens`). Implementation: `switchedOffBetterAuthPaths()` in `core-better-auth-openapi.helper.ts`, applied by `swagger.helper.ts`; `buildSocialProviders()` in `better-auth.config.ts` |
|
|
313
|
-
| BetterAuth Social Provider Options | `betterAuth.socialProviders.<name>.*` | Pass-through — the provider is on with `clientId` + `clientSecret`, `enabled: false` switches it off | **Since 12.10.0 every option a project sets on a provider reaches Better-Auth's provider unchanged**: `tenantId`, `scope`, `disableDefaultScope`, `prompt`, `disableProfilePhoto`, `mapProfileToUser`, `overrideUserInfoOnSignIn`, Google's `hd` / `accessType`, and so on. Up to 12.9.4 `buildSocialProviders()` handed each provider `clientId`, `clientSecret` and `disableSignUp` only and dropped the rest without a warning, so a Microsoft sign-in ran against `common` (accounts of every organization and personal Microsoft accounts) with Better-Auth's default scope (`User.Read`, `offline_access`: a Graph access and refresh token in `account`). The only way round, `betterAuth.options.socialProviders`, replaced the whole block: the provider left `GET /iam/features` and `emailAndPassword.disableSignUp` no longer closed it. `enabled` is the framework's own switch and is not handed on. `clientId`, `clientSecret` and the computed `disableSignUp` are written AFTER the project's options, so a raw `disableSignUp` (a string from `NEST_SERVER_CONFIG`) cannot replace the sign-up decision of the Disable Sign-Up row. `scope` given as a string is split on commas and whitespace (`splitScopeList()`), because `NSC__…__SCOPE` arrives as one: the `NSC__*` reader converts only `true`, `false` and numbers, and Better-Auth spreads `scope` into its list, one scope per character for a string. A `scope` that is neither a string nor a list (the object indexed `…__SCOPE__0` variables build, the `0` an empty `…__SCOPE=` becomes) is dropped with ONE error per provider at boot, never converted: Better-Auth spread an object into a `TypeError` on every `/sign-in/social`; without it the provider asks for its default scopes, and with `disableDefaultScope: true` for none, which the error says the provider will refuse. A list comes from `config.env.ts` or `NEST_SERVER_CONFIG`. Unset `tenantId` → `common`. Functions (`mapProfileToUser`) only from `config.env.ts`. Pinned by `tests/unit/better-auth-social-provider-options.spec.ts` against the REAL `createBetterAuthInstance()`, including the authorization URL from Better-Auth's own `/sign-in/social` handler and a configuration built by `getEnvironmentObject()` from `NSC__*` variables alone (mutations `iam-social-provider-options-dropped`, `iam-social-provider-options-override-sign-up`). Implementation: `buildSocialProviders()`, `splitScopeList()` and `malformedScopeMessage()` in `better-auth.config.ts`; documented in `src/core/modules/better-auth/README.md` → "Social providers" |
|
|
314
|
+
| BetterAuth Social Provider Options | `betterAuth.socialProviders.<name>.*` | Pass-through — the provider is on with `clientId` + `clientSecret`, `enabled: false` switches it off | **Since 12.10.0 every option a project sets on a provider reaches Better-Auth's provider unchanged**: `tenantId`, `scope`, `disableDefaultScope`, `prompt`, `disableProfilePhoto`, `mapProfileToUser`, `overrideUserInfoOnSignIn`, Google's `hd` / `accessType`, and so on. Up to 12.9.4 `buildSocialProviders()` handed each provider `clientId`, `clientSecret` and `disableSignUp` only and dropped the rest without a warning, so a Microsoft sign-in ran against `common` (accounts of every organization and personal Microsoft accounts) with Better-Auth's default scope (`User.Read`, `offline_access`: a Graph access and refresh token in `account`). The only way round, `betterAuth.options.socialProviders`, replaced the whole block: the provider left `GET /iam/features` and `emailAndPassword.disableSignUp` no longer closed it. `enabled` is the framework's own switch and is not handed on. `clientId`, `clientSecret` and the computed `disableSignUp` are written AFTER the project's options, so a raw `disableSignUp` (a string from `NEST_SERVER_CONFIG`) cannot replace the sign-up decision of the Disable Sign-Up row. `scope` given as a string is split on commas and whitespace (`splitScopeList()`), because `NSC__…__SCOPE` arrives as one: the `NSC__*` reader converts only `true`, `false` and numbers, and Better-Auth spreads `scope` into its list, one scope per character for a string. A `scope` that is neither a string nor a list (the object indexed `…__SCOPE__0` variables build, the `0` an empty `…__SCOPE=` becomes) is dropped with ONE error per provider at boot, never converted: Better-Auth spread an object into a `TypeError` on every `/sign-in/social`; without it the provider asks for its default scopes, and with `disableDefaultScope: true` for none, which the error says the provider will refuse. A list comes from `config.env.ts` or `NEST_SERVER_CONFIG`. Unset `tenantId` → `common`. Functions (`mapProfileToUser`) only from `config.env.ts`. Pinned by `tests/unit/better-auth-social-provider-options.spec.ts` against the REAL `createBetterAuthInstance()`, including the authorization URL from Better-Auth's own `/sign-in/social` handler and a configuration built by `getEnvironmentObject()` from `NSC__*` variables alone (mutations `iam-social-provider-options-dropped`, `iam-social-provider-options-override-sign-up`). Implementation: `buildSocialProviders()`, `splitScopeList()` and `malformedScopeMessage()` in `better-auth.config.ts`; documented in `src/core/modules/better-auth/README.md` → "Social providers" **Since 12.11.0 `disableIdTokenSignIn` is `true` for every provider unless the project sets `false`** (native apps, Google One Tap): a client-submitted id token (`/sign-in/social` / `/link-social` with `idToken`) is checked by Better-Auth on signature, audience and expiry only, so one kept from an earlier sign-in signed its owner in again for its lifetime after the provider withdrew the assignment (mutation `iam-id-token-sign-in-open-by-default`) |
|
|
314
315
|
| BetterAuth OAuth Error URL | `betterAuth.errorUrl` | Explicit Value with derived default | **`<appUrl>/auth/login` since 12.10.0**, handed to Better-Auth as `onAPIError.errorURL`. Before, nest-server set none, so an OAuth flow that failed without an error URL of its own landed on Better-Auth's built-in English "Error" page on the API host (HTTP 200, no way back into the app). Measured against Microsoft Entra ID: a user who took more than ten minutes on the provider's sign-in page came back with an expired state, and the request's `errorCallbackURL` travels inside that state. Readers in better-auth 1.7.x: the OAuth callback (missing, unreadable, expired or mismatched state; a malformed callback request; through `parseState()` every later failure of a flow started without `errorCallbackURL`), `handleOAuthUserInfo()`'s `internal_server_error` (also on `idToken` sign-in), `GET <basePath>/error` (forwards `error` and the raw `error_description` instead of rendering), and the `oauthProxy()` plugin. None appends a path; Better-Auth only adds query parameters (`appendQueryParams()`). The app URL comes from `resolveServerUrls()` like `trustedOrigins` (explicit `appUrl` → localhost default in `local` / `ci` / `e2e` → derived from `baseUrl` unless `cors.deriveAppUrl: false`); none resolves → Better-Auth's page, never a guessed host. An absolute `http(s)` URL is used as it is, a path with one leading `/` against the app URL (no app URL → warning, Better-Auth's page), `false` keeps Better-Auth's page; anything else (another scheme, `//host`, `/\host`, a non-string such as the `0` an empty `NSC__BETTER_AUTH__ERROR_URL=` becomes) is refused with ONE warning and Better-Auth's page: a misconfiguration neither stops the boot nor redirects anywhere nobody chose. `betterAuth.options.onAPIError` is MERGED, not replaced (like `logger` and `emailAndPassword`): its `errorURL` wins when set, its other keys (`onError`, `throw`, `customizeDefaultErrorPage`) keep the derived URL; with an error URL Better-Auth's page is never shown, so a project that customized it sets `errorUrl: false`. A login page maps the `error` code to its own text and never renders `error_description`, which anyone can set through a link to `<basePath>/error`. Pinned by `tests/unit/better-auth-error-url.spec.ts` against the REAL `createBetterAuthInstance()`, including Better-Auth's own handler for `GET <basePath>/callback/microsoft` without state and `GET <basePath>/error` (mutations `iam-oauth-error-url-not-derived`, `iam-oauth-error-url-options-replace`). Implementation: `resolveErrorUrl()` in `better-auth.config.ts`; documented in `src/core/modules/better-auth/README.md` → "Where a failed sign-in lands" |
|
|
315
316
|
| BetterAuth Auto Sign-In After Verification | `betterAuth.emailVerification.autoSignInAfterVerification` | Explicit Boolean — **safe default** | **`false` since 12.3.0** (was `true`, against Better-Auth's own default). With it on, `GET /iam/verify-email` creates a session for the account the link belongs to in WHATEVER browser opens it. The link is a bearer credential that travels by mail: someone who signs up with their own address and forwards the unopened link has the recipient's browser signed in to their account, and what the recipient enters there (payment data, documents, messages) lands with them — login CSRF, the same class §10 of `.claude/rules/better-auth.md` closes for sign-in. Off, the user verifies and then signs in once. Matched with `=== true` in BOTH places that read it — `better-auth.config.ts` (what Better-Auth receives) and `CoreBetterAuthEmailVerificationService.shouldAutoSignIn()` (what a project asks) — so a truthy non-boolean (the string `"true"` in `NEST_SERVER_CONFIG`; `NSC__*` already coerces `true`) cannot switch it on, and the two cannot disagree. Pinned by `tests/unit/better-auth-auto-sign-in.spec.ts` against the REAL `createBetterAuthInstance()` (mutations `iam-auto-sign-in-after-verification-default-on`, `iam-auto-sign-in-service-default-on`) |
|
|
316
317
|
| BetterAuth Native Password Reset | `betterAuth.emailAndPassword.passwordReset` | Explicit Boolean | **`true` — ON by default, and there is no other off switch.** Better-Auth treats the PRESENCE of an `emailAndPassword.sendResetPassword` hook as the enable flag, and `CoreBetterAuthModule` always injects one (delegating to `CoreBetterAuthEmailVerificationService.sendPasswordResetEmail()`). So `POST /iam/request-password-reset` is a live, **unauthenticated**, token-minting, mail-sending endpoint on every deployment — before 11.36.1 it answered `RESET_PASSWORD_DISABLED` because no hook was wired. Set `false` to withhold the hook and restore that refusal, for deployments whose reset policy is support-mediated or SSO-primary. **Two things bound the abuse and both need checking:** a per-ADDRESS cooldown in the mailer (reuses `emailVerification.resendCooldownSeconds`, own namespace so a pending verification mail cannot block a reset), and the IP-axis `betterAuth.rateLimit` in front of the route — which is OFF unless configured. `/request-password-reset` is in `strictEndpoints`, so it gets the halved limit. Implementation: `better-auth.config.ts` (graft), `core-better-auth-email-verification.service.ts` (delivery) **Swagger (11.42.9):** `false` also removes `/request-password-reset`, `/reset-password` and `/reset-password/{token}` from the document `setupSwagger()` builds — without the hook no token can be minted, so none of them can succeed |
|
|
@@ -328,13 +329,13 @@ This pattern is currently applied to:
|
|
|
328
329
|
| Mongoose CastError Filter | `security.mongooseCastErrorFilter` | Explicit Boolean — **safe default** | **`true` since 11.42.16.** `MongooseCastErrorFilter`, registered by `CoreModule` as `APP_FILTER` (so `main.ts` and `Test.createTestingModule()` setups need nothing). A malformed id reached Mongoose and its `CastError` — not an `HttpException` — escaped every `@Catch(HttpException)` filter, so `GET /users/<malformed-id>` and every other `:id` route answered **500**. The filter decides by WHERE the failing value came from: a route parameter or a top-level GraphQL argument → **404** `ErrorCode.RESOURCE_NOT_FOUND` (answered like an unknown id); the query string, an update or filter body, or a nested GraphQL input → **400** `ErrorCode.INVALID_FIELD_FORMAT [<path>]`; a value the request does not contain (a broken stored id, a server-computed value) → **stays a 500**, with Nest's own body and log line (context `ExceptionsHandler`), because that is a data or code defect monitoring must keep seeing — relabelling it as a client error is the mistake the refusal tests pin (mutations `cast-error-server-value-relabelled-*`). Only primitives and arrays of primitives (`$in`) are matched: an object cast as a whole yields no candidates, so its inner strings cannot match the body by coincidence. Never sends the Mongoose message (it names the model). REST bodies use the `HttpExceptionLogFilter` shape (`{ ...exception }`). A project's own catch-all filter via `app.useGlobalFilters()` is consulted first and wins. Covers casts Mongoose raises while running a QUERY or an UPDATE (`findById`, filters, `findByIdAndUpdate` — `CrudService.update()`). NOT covered, both stay a 500: a malformed id in a document being CREATED (`save()` / `create()` / `insertMany()` — `CrudService.create()`), which Mongoose reports as a `ValidationError` wrapping the CastError (validate in the input: `validator: () => [IsMongoId()]`); and a `BSONError` from `new Types.ObjectId(bad)`, which carries no value (check the id in the service, `CoreFileService.isMalformedFileId()`). `false` restores the 500. Implementation: `common/filters/mongoose-cast-error.filter.ts` |
|
|
329
330
|
| Primitive Parameter Types | `security.mapAndValidatePipe.rejectObjectsForPrimitiveTypes` | Explicit Boolean — **safe default** | **`true` since 12.8.0 (DEV-4144).** `MapAndValidatePipe` answers 400 `#LTNS_0306 [<parameter>]` when a request value is a PLAIN OBJECT where the route declares `string`, `number` or `boolean` (`@Body('token') token: string`, `@Query(…)`, `@Param(…)`; metatype `String` / `Number` / `Boolean`). Before, the pipe returned basic-type values unchecked — the declared type is erased at runtime — so `{ "token": { "$ne": null } }` reached the service as a MongoDB operator (DEV-4143: a reset token that set somebody else's password). `null` and arrays pass on purpose (clearing an optional field; a repeated query key). NOT covered, guard at the query with `isQueryableString()`: a class-typed parameter whose DTO field has no type validator (`isAny`, a custom `validator` that does not check the type), `any`, a UNION the compiler emits as `Object` (`tsc` with `strictNullChecks` does so for `string | undefined`; SWC and `tsc` without it emit `String`, then it is covered), a NUMBER at a `string` parameter (passes on purpose; MySQL / MariaDB compare it numerically), a value a project reads from `req.body` / `req.query` itself, and a value that reaches an aggregation pipeline. Only an explicit `false` switches it off; with `security.mapAndValidatePipe: false` the whole pipe — this check included — is off. Pinned by `tests/unit/primitive-param-objects.spec.ts` (mutation `primitive-param-object-accepted`) and `tests/primitive-param-objects.e2e-spec.ts` (mutation `primitive-param-object-reaches-route`). Implementation: `common/pipes/map-and-validate.pipe.ts` → `receivesObjectForPrimitive()` |
|
|
330
331
|
| String Cookies Only | `security.stringCookiesOnly` | Explicit Boolean — **safe default** | **`true` since 12.8.0 (DEV-4144).** `StringCookiesMiddleware` (registered by `CoreModule` for all routes, right after the request context) removes every non-string value from `req.cookies`, and from `req.signedCookies` everything but strings and `false` (cookie-parser's invalid-signature marker). cookie-parser turns a cookie value starting with `j:` into the parsed JSON, so `iam.session_token=j:{"$ne":null}` arrived as an object (DEV-4138); on MySQL / MariaDB a number (`j:7`) is compared numerically. The framework writes only string cookies. Only an explicit `false` switches it off — for a project that writes `res.cookie(name, object)` and reads the object back. Pinned by `tests/unit/primitive-param-objects.spec.ts` (mutation `object-cookie-kept`) and `tests/primitive-param-objects.e2e-spec.ts` (mutation `string-cookies-middleware-not-registered`). Implementation: `common/middlewares/string-cookies.middleware.ts` |
|
|
331
|
-
| Config Endpoint | `configEndpoint` | Explicit Boolean with DERIVED default | **Unset → a project's `GET /config` answers only in `local` / `ci` / `e2e` (`isLocalEnv()`), 404 everywhere else (12.5.0+)**; `true` answers everywhere, `false` nowhere; a non-boolean value counts as not set (`NSC__CONFIG_ENDPOINT=true`). The route lives in project code (the starter's `ServerController`) and returns `configEndpointResponse()`, which throws `NotFoundException` when closed (404, as if the route did not exist; the route's `@Roles(ADMIN)` still answers 401 first) and otherwise the REDACTED configuration (`ConfigService.getRedactedConfig()`). Before 12.5.0 the starter's endpoint returned the database URI, auth secrets and mail password to every administrator, and projects created before the starter redacted kept doing so. Redaction is the one framework masker `redactSecrets()` (`common/helpers/redact-secrets.helper.ts`, moved from the Hub where it remains as `maskConfigDeep`): key patterns (`secret`/`password`/`token`/`credential` anywhere in the name, names ending in `pass` or `key`, `encryption`, `dsn`, `salt`, … — a superset of the pattern the starter used before), the password of a connection URI and secret-named URI query parameters, scheme + host + port only for an address under a key ending in `url`/`uri`/`endpoint`/`webhook` (a webhook carries its secret in the path), nested values; below a secret-named key EVERYTHING is masked except booleans; plus `FRAMEWORK_SECRET_FIELDS` and `security.secretFields`. The Hub config panel and the `ConfigService` `warn: true` debug output use the same view. Implementation: `common/helpers/config-endpoint.helper.ts` |
|
|
332
|
+
| Config Endpoint | `configEndpoint` | Explicit Boolean with DERIVED default | **Unset → a project's `GET /config` answers only in `local` / `ci` / `e2e` (`isLocalEnv()`), 404 everywhere else (12.5.0+)**; `true` answers everywhere, `false` nowhere; a non-boolean value counts as not set (`NSC__CONFIG_ENDPOINT=true`). The route lives in project code (the starter's `ServerController`) and returns `configEndpointResponse()`, which throws `NotFoundException` when closed (404, as if the route did not exist; the route's `@Roles(ADMIN)` still answers 401 first) and otherwise the REDACTED configuration (`ConfigService.getRedactedConfig()`). Before 12.5.0 the starter's endpoint returned the database URI, auth secrets and mail password to every administrator, and projects created before the starter redacted kept doing so. Redaction is the one framework masker `redactSecrets()` (`common/helpers/redact-secrets.helper.ts`, moved from the Hub where it remains as `maskConfigDeep`): key patterns (`secret`/`password`/`token`/`credential` anywhere in the name, names ending in `pass` or `key`, `encryption`, `dsn`, `salt`, … — a superset of the pattern the starter used before; `pfx` / `pkcs12` since 12.10.1), every string or `Buffer` holding a PEM private key whatever its key is called (12.10.1 — a certificate login keeps certificate and key in one PEM under `certificate`, which reached `GET /config` in clear text before; a certificate alone stays readable), the password of a connection URI and secret-named URI query parameters, scheme + host + port only for an address under a key ending in `url`/`uri`/`endpoint`/`webhook` (a webhook carries its secret in the path), nested values; below a secret-named key EVERYTHING is masked except booleans; plus `FRAMEWORK_SECRET_FIELDS` and `security.secretFields`. The Hub config panel and the `ConfigService` `warn: true` debug output use the same view. Implementation: `common/helpers/config-endpoint.helper.ts` |
|
|
332
333
|
| Secret Fields Removal | `security.secretFields` | Array | `['password', 'verificationToken', ...]`. A project list is a UNION with the defaults (it can add, never remove). `CheckSecurityInterceptor` strips each field under its SQL column name too since 12.3.1 (`passwordResetToken` and `password_reset_token`): a row read through `store.native()` / `store.raw()` carries snake_case columns, and a route returning it unchanged used to hand every secret but `password` to the client. Pinned by `tests/unit/check-security-secret-columns.spec.ts` (mutation `secret-columns-not-stripped`) |
|
|
333
334
|
| Data Sources | `database` | Explicit Value — absent = today's `mongoose` config | **Absent → the `mongoose` configuration is the only data source, exactly as before; nothing SQL is loaded or installed.** A URL string (`'postgres://…'`) sets the default source (driver from the scheme, `sqlEngine` defaults to `typeorm`; `kysely` and `drizzle` are the alternatives — optional peers, each with `pg`); an object adds `ownerUrl` (default source), `sources` (name → URL or `{ url, ownerUrl, sqlEngine }`) and per-model exceptions (`models`); `false` means no database. Precedence for a model: `database.models` > the `dataSource` of a `CorePersistenceModule.forFeature()` definition > `@PersistedModel({ dataSource })` (read from the definition's `model:` class, otherwise from the decorated class named like the model; two such classes naming different sources refuse to guess) > default. When `database` sets a default and the project ALSO configures `mongoose` explicitly, that MongoDB becomes the source `mongoose` — only the project's own `mongoose` counts, because `CoreModule.forRoot()` always merges a fallback URI. **Since phase 1 (DEV-3829) PostgreSQL sources are wired**: only models registered with `CorePersistenceModule.forFeature()` are routed — **since phase 2 (DEV-3830) that includes the core's own models**: the user model (the reference `UserModule`), tenant memberships and API tokens, whose services switch to the routed store (a service that only received `@InjectModel()` follows its model's store; the Mongoose model of a model routed to SQL refuses every data access with a named error, so a direct `mainDbModel` call cannot split a model's data). **Since phase 3 (DEV-3831) Better-Auth follows the user model**: with the user model (table `users`) on a SQL source, Better-Auth runs its built-in Kysely adapter on that source's application pool — ONE `users` row per user shared with the user model (Better-Auth's own columns `name`, `email_verified`, `image` beside the framework's; its required ones are added nullable, so a row the user model writes alone stays valid), snake_case tables (`session`, `account`, `verification`, `jwks`, `two_factor`, `passkey`), ObjectId-hex ids. Its schema is applied as the OWNER at boot, under the same schema lock and grants as the framework's tables; without `ownerUrl` the application role only verifies and the boot stops while Better-Auth's migrations are pending. The framework's own reads and writes of Better-Auth's data follow it (session lookup by token, token service, JWKS, passkey challenge mappings — as Better-Auth verification values —, the e-mail-verified hook, user mapper, system setup, migration status — counted in SQL —, the MCP OAuth subject's roles); the MongoDB boot steps (indices, account-issuer backfill) are skipped there. Nothing is copied from MongoDB: a project that moves its users brings them over itself. **Since phase 4 (DEV-3832) the remaining core persistence follows too**: the AI module's eleven models and the three MCP OAuth stores (clients, codes, refresh tokens) are registered through `CorePersistenceModule.forFeature()` and run on their routed store (one code path; an upsert is update-then-insert with a retry on a duplicate, `sum()` replaces the budget aggregation, `find(…, { exclude })` the `-field` projection); the S3 and filesystem file metadata are two framework models (`CoreS3File`, `CoreFilesystemFile`, tables `s3_files` / `filesystem_files`) read and written through `fileMetadataCollection()` by the file service, the TUS hand-off and the Hub — GridFS stays MongoDB-only. A collection name with a hyphen becomes a table with an underscore. A TTL (`expires`, `index: { expireAfterSeconds }`) is a plain index on SQL; an **expiry sweep** (`scheduleExpirySweep()`, every 15 min, one replica per interval through a lease in the default SQL source's `lt_locks`, fail-open) deletes the expired rows of every routed TTL model, and — with Better-Auth on SQL — expired sessions and verification values. Nothing relies on it for correctness: every reader checks the expiry (an MCP authorization code older than ten minutes is refused on read on both databases). MongoDB keeps its TTL indexes and gets no sweep. The framework's leases (system-setup claim, cron, migrations) live in the default source: on MongoDB in the 12.0.0 documents (a rolling deploy with older replicas shares them), on SQL in `lt_locks`, namespaced, swept an hour after expiry. With `healthCheck.configs.database` every SQL source answers as `<key>:<source>`; `createMigrationStore(<owner URL>)` keeps the migration state in `lt_migrations` with an advisory run lock, on the first SQL engine installed (the CLI cannot read `database.sqlEngine`), and the Hub refuses to run migrations while that table is empty and the MongoDB collection is not (a `migrate.js` still writing MongoDB); the Hub's Persistence panel shows the routing. a SQL model's table is migrated as the OWNER (`ownerUrl`) when its store is created — without `ownerUrl` the application role only verifies and the boot stops while changes are pending; ONE owner connection per source, released once the application is bootstrapped — and the boot refuses an application role that is superuser, has `BYPASSRLS`, owns (or inherits the owner of) a framework table or may `TRUNCATE` it. Two roles in every environment (plan §3.9). Changes the framework never applies on its own (type change, new unique index, rename collision) stop the boot with the suggested statements; `migrate create <name> --sql` + `runSqlMigration()` apply them after review. **Since phase 5 (DEV-3833, 12.1.0) MongoDB is optional**: `mongoose`, `@nestjs/mongoose` and `mongodb` are optional peers, loaded through `common/persistence/mongo/mongo-packages.ts`; `CoreModule` connects MongoDB only when a source uses it (`usesMongoDb()` — `mongoose` configured explicitly, `database` naming MongoDB, or `database` absent), otherwise `@InjectConnection()` receives `null` and a model token without a connection is a stand-in that refuses data access. A configured MongoDB feature without the packages fails the boot with `MongoPackagesMissingError`. `database: false` runs a service without any database: a registered model's store refuses with the reason, Better-Auth is refused at boot. Proven by `pnpm run check:without-mongodb` (dist, packages hidden) and `check:without-mongodb:package` (the tarball installed without them, publish path). **Since phase 6 (DEV-3848) MySQL 8.4 and MariaDB 11.8 sources are wired** (`mysql://`, `mariadb://` — the scheme must name the server the URL reaches): `mysql2` is an optional peer beside the engine, all three engines run on one pool the framework creates (strict session with backslash escapes, UTC), `MysqlDataStore` writes the statements, the owner grants the application account `SELECT, INSERT, UPDATE, DELETE` on the database once and the boot refuses an application account that may alter, drop, index, trigger or grant; leases, migration state (`createMigrationStore()` / `runSqlMigration()` under `GET_LOCK`), the expiry sweep, health check and Hub work there. **Neither database has row-level security**: tenant isolation is the store's, the boot warns once per source, and native / raw access on a tenant table must filter by tenant itself. **Since 12.1.1 (DEV-3904) Better-Auth runs there too**: its Kysely adapter on the source's `mysql2` pool (the promise wrapper — Better-Auth builds `MysqlDialect` from it), its migrations as the owner under `GET_LOCK`, with the database's default collation switched to `utf8mb4_bin` while it creates a table and restored (`withFrameworkDefaultCollation()`; only on such a run and with a 5 s lock wait, because `ALTER DATABASE` locks every table) — Better-Auth names no collation, and MariaDB refuses a foreign key to `users.id` across collations; the database-level grant covers its tables. 12.1.0 refused it at boot. An indexed text field is `varchar(255)` (longer: 400); a DDL run is not transactional. Still refused with a named `DataSourceConfigError`: a second MongoDB source, and an `ownerUrl` without `url` — what `NSC__DATABASE__OWNER_URL` leaves of a `database` given as a URL string, because the environment merge replaces the string with an object (write `database: { url }`, or set `NSC__DATABASE__URL` too). An update path the model does not declare is dropped on SQL as by MongoDB's strict mode (`CrudService.update()` adds `updatedBy` to every update with a current user). URLs appear in errors and logs as scheme + host only. Implementation: `common/persistence/data-source.config.ts`, `data-source.runtime.ts`, `sql/` (db-agnostic plan §3.9) |
|
|
334
335
|
| Multi-Tenancy | `multiTenancy` | Presence Implies Enabled | **`excludeSchemas` is an OFF SWITCH for isolation, per model** — a listed schema gets no tenant filter at all; since 11.35.0 the plugin WARNS once per model when the excluded schema declares `tenantId` (i.e. was built for isolation). The framework's own docs recommended `['User', 'Session']` until then; that is withdrawn — it is only right for the global-user model. Since 11.35.0 GraphQL operations over the WEBSOCKET also run inside a `RequestContext` (`CoreModule` installs a context-aware `execute`/`subscribe` pair inside `subscriptions`, where `ApolloDriver` forwards it): the tenant comes from the handshake header validated against an active membership, else from the subscriber's memberships, and an unresolvable tenant leaves the safety net to refuse the read rather than returning everything. `headerName: 'x-tenant-id'`, `membershipModel: 'TenantMember'`, `adminBypass: true`, `excludeSchemas: []`, `roleHierarchy: { member: 1, manager: 2, owner: 3 }`, `cacheTtlMs: 30000` (0 disables, process-local). System roles (`S_EVERYONE`, `S_USER`, `S_VERIFIED`) are checked as OR alternatives before real roles; method-level system roles take precedence; membership validated for context when system role grants access + header present. Hierarchy roles use level comparison, normal roles use exact match. Use `DefaultHR` or `createHierarchyRoles()` for type-safe role constants. Bypass: `RequestContext.runWithBypassTenantGuard()`. Cache invalidation: `invalidateUser(userId)` / `invalidateAll()` are **instance** methods on the singleton `CoreTenantGuard` — inject it and call `this.tenantGuard?.invalidateUser(userId)`, never `CoreTenantGuard.invalidateUser(...)` (there is no static). With `redis` configured, both additionally BROADCAST the invalidation to every replica (`<keyPrefix>:tenant-cache:invalidate` pub/sub); without Redis they clear the local process only, so other replicas stay stale until `cacheTtlMs`. A received broadcast clears locally without re-publishing. **`isTenantActive` (11.42.0)**: optional hook `(tenantId, { connection, store }) => boolean \| Promise<boolean>`, absent = every tenant active (no change). `store(modelName)` (12.x, db-agnostic) is the data store of a model registered with `CorePersistenceModule.forFeature()`, wherever `database` routes it, and THROWS for any other model — an `undefined` would read as "active" in a hook written with `?.` and open every deactivated tenant. Asked AFTER the membership check on every path that establishes a tenant: 403 on header paths and for tenant API tokens, no enrichment on `S_EVERYONE`, dropped from the header-less tenant list, no tenant for a NEW WebSocket subscription, and since 11.42.3 an OPEN one is closed with 4403 on `invalidateTenant()` (or at its next event once `graphQl.subscriptionRevalidationMs` has passed — see the GraphQL Subscription Re-check row); an admin under `adminBypass` is exempt (someone must be able to switch it back on). Only `false` deactivates. Cached for `cacheTtlMs`; `invalidateTenant(tenantId)` clears and broadcasts (`{ scope: 'tenant' }`) — since 12.3.0 together with the tenant's cached memberships and every cached tenant list holding it, so memberships removed without `invalidateUser()` (a deleted tenant) stop counting at once rather than after `cacheTtlMs` (a tenant switched off through `isTenantActive` was already refused at once, its answer being cleared). **Removing a tenant (12.3.0)**: `CoreTenantService.purgeTenantData(tenantId, { dryRun?, exclude? })` first ends every way in — the memberships (`deleteAllMembers()`) and the tenant's API tokens, which need no member — then deletes, in batches of 1000 ids, every registered model with a `tenantId` path (MongoDB and SQL), the core references without one (the AI settings with `scope: 'tenant'`) and the AI connections — one only this tenant could use is deleted, from a shared one the tenant is removed (an empty `tenantIds` means every tenant). `excludeSchemas` and `exclude` are left out, so are users and files; the protected `purgeTenantRecords()` is where a project adds its own references. A function, so `config.env.ts` only — not reachable through `NSC__*`. **`adminBypass: false` (11.42.0)** additionally withholds two things that went around it: `CoreUserService.update()` refuses changing another account's e-mail or password (`assertCredentialChangeAllowed()`, administrator targets included — promote-then-change — system work without a current user exempt), and the AI tool registry grants no ADMIN bypass |
|
|
335
|
-
| GraphQL Subscription Re-check | `graphQl.subscriptionRevalidationMs` | Numeric — `0` = STRICTEST, `false` = off, invalid → default (a fifth shape: Family C's "invalid never means unbounded", but `0` asks for MORE checking, not less) | **30000 since 11.42.3.** Before, a WebSocket was authorized once, at the handshake, and every event and operation on it ran on that snapshot until the client reconnected. Every connection a `CoreModule` `onConnect` accepts is now registered (`registerWsConnection()`) and re-checked — at once when an invalidation names it (`CoreTenantGuard.invalidateUser()` / `invalidateTenant()` / `invalidateAll()`, `CoreUserService.setRoles()` and role/verification `update()`s, the legacy password reset, and Better-Auth deleting a session through `wsSessionRevocationPlugin()`), and otherwise before the next event or operation once the last check is older than this value. The check re-runs the handshake's own authentication (session store, Better-Auth JWT signature/expiry, or for legacy tokens `CoreAuthService.verifyJwt()` — signature/expiry, verified on the WebSocket since 11.42.3 — plus the device binding) and the tenant resolution; any difference in user id, roles, verification state or tenant scope closes the socket with **4403**, which the graphql-ws client retries — the user continues with current rights or is refused at the handshake. `0` re-checks on every event and operation (one session lookup each); `false` switches only the TIME-based check off, invalidations still apply. Process-local registry: an invalidation reaches other replicas only where a Redis broadcast carries it — the tenant guard's (memberships, tenants) and, since 12.1.1, the Better-Auth user mapper's (`invalidateUserCache()`: roles and verification of IAM users); everything else is bounded by the interval. A project that replaces `onConnect` through `graphQl.driver.subscriptions` must call `registerWsConnection()` itself to keep this. Implementation: `common/helpers/graphql-ws-connection.helper.ts` |
|
|
336
|
+
| GraphQL Subscription Re-check | `graphQl.subscriptionRevalidationMs` | Numeric — `0` = STRICTEST, `false` = off, invalid → default (a fifth shape: Family C's "invalid never means unbounded", but `0` asks for MORE checking, not less) | **30000 since 11.42.3.** Before, a WebSocket was authorized once, at the handshake, and every event and operation on it ran on that snapshot until the client reconnected. Every connection a `CoreModule` `onConnect` accepts is now registered (`registerWsConnection()`) and re-checked — at once when an invalidation names it (`CoreTenantGuard.invalidateUser()` / `invalidateTenant()` / `invalidateAll()`, `CoreUserService.setRoles()` and role/verification `update()`s, the legacy password reset, and Better-Auth deleting a session through `wsSessionRevocationPlugin()`), and otherwise before the next event or operation once the last check is older than this value. The check re-runs the handshake's own authentication (session store, Better-Auth JWT signature/expiry, or for legacy tokens `CoreAuthService.verifyJwt()` — signature/expiry, verified on the WebSocket since 11.42.3 — plus the device binding) and the tenant resolution; any difference in user id, roles, verification state or tenant scope closes the socket with **4403**, which the graphql-ws client retries — the user continues with current rights or is refused at the handshake. `0` re-checks on every event and operation (one session lookup each); `false` switches only the TIME-based check off, invalidations still apply. Process-local registry: an invalidation reaches other replicas only where a Redis broadcast carries it — the tenant guard's (memberships, tenants) and, since 12.1.1, the Better-Auth user mapper's (`invalidateUserCache()`: roles and verification of IAM users); everything else is bounded by the interval. A project that replaces `onConnect` through `graphQl.driver.subscriptions` must call `registerWsConnection()` itself to keep this. An HTTP stream (SSE) of a project's own registers with `registerHttpStream()` (12.11.0): re-checked in place like a WebSocket when its Better-Auth credential can be run again, ended on every re-check otherwise. Implementation: `common/helpers/graphql-ws-connection.helper.ts` |
|
|
336
337
|
| API Tokens | `apiTokens` | Boolean Shorthand + Presence Implies Enabled — absent = off | `prefix: 'ltt'`, `scopes: []` (vocabulary; empty = no token creatable, boot warning), `manageRole`: highest hierarchy role, `maxAssertionLifetimeSeconds: 900` (invalid → default, never unbounded — Family C), `rateLimit: { max: 600, windowSeconds: 60 }` per token (**on by default**, `false` disables; Redis-shared when configured), `userTokens: true`, `tenantTokens: true` (effective only with `multiTenancy`), `encryptionKey` → `SECRETS_ENCRYPTION_KEY` → dev default (boot FAILS in production/staging). Top-level, NOT under `multiTenancy`: user tokens must work without it. **Deny by default**: every guard refuses a token on a route without `@ApiTokenScopes()`, public routes included, via ONE shared function (`enforceApiTokenRoute`) called BEFORE each guard's public-route shortcut. USER tokens act as their user with global roles REMOVED (no admin bypass); TENANT tokens act with the lowest hierarchy role in their own tenant, and a route guarded ONLY by `S_SELF` / `S_CREATOR` refuses them (a tenant token is nobody's self — skipping those roles would grant for any target). A tenant token depends on no member, so it outlives an off-boarded or deleted tenant until the project calls `deleteAllForTenant()` or `CoreTenantService.purgeTenantData()`. The boot refuses a hierarchy in which that lowest role reaches `manageRole`. A prefixed credential that fails answers 401 on every route (not anonymous); `CoreBetterAuthMiddleware` skips prefixed credentials entirely, cookie fallback included. A password reset that ends the user's sessions ends their USER tokens too (legacy reset always; IAM reset while `betterAuth.emailAndPassword.revokeSessionsOnPasswordReset` is on), wired through `core-api-token.registry.ts` so neither reset path imports the optional module. Implementation: `src/core/modules/api-token/` |
|
|
337
|
-
| Offline Sync | `sync` | Boolean Shorthand + Presence Implies Enabled — absent = off | **Absent → nothing registered**: no route, no infrastructure model, no listener on the write paths. `true` / `{}` enables `GET /sync/{model}` (pull) and `POST /sync/{model}` (push) for every model whose CrudService carries `@SyncService({ model, createInput, updateInput })` and whose model is declared with `@PersistedModel({ sync: { roles, strategy } })`. Defaults: `path: 'sync'`, `pull: { defaultLimit: 200, maxLimit: 1000 (ceiling 1000), maxBytes: 1048576 }`, `push: { maxItems: 100 }`, `retention: { mutationsDays: 30, tombstonesDays: 90 }`, `hints: { debounceMs: 250 }`, `rateLimit: { pull: { max: 120, windowSeconds: 60 }, push: { max: 60, windowSeconds: 60 } }` per user (`false` switches both or one off; Redis-shared when configured). `cursorSecret` → `SECRETS_ENCRYPTION_KEY` → development default (boot FAILS in production/staging); changing it answers every cursor `410 invalid`. `pull.windowSeconds` (MongoDB only) overrides the derived window W: replica set or sharded — the server's `transactionLifetimeLimitSeconds` (60 when unreadable) + 30, standalone — 30; it must cover the longest time a write takes from its stamp until it is visible, a smaller one loses changes for good. **Operation roles are the model's** (`sync.roles.pull/create/update/delete`): the roles a project puts on its own routes never reach `/sync`, and an operation without roles is ADMIN only (boot warning). Every pull and push runs through the model's CrudService (`process()`, `securityCheck()`, tenant policy, RLS). Without `X-Tenant-Id` a request spans the caller's memberships. Cookie pushes need `Content-Type: application/json`; while cookies are in use `Sec-Fetch-Site: cross-site` and an untrusted `Origin` answer 403. API tokens are refused unless a project controller releases a scope. Error codes `LTNS_0700`–`LTNS_0799`. **Hints (12.x, DEV-3902)**: `GET /sync/hints` (Server-Sent Events, event `change`, `?models=` narrows) and the GraphQL subscription `syncHint(models)` tell a client "pull now" — payload `{ model, at }` only, never content or ids. Sent from `CrudService.create()` / `update()` / `delete()` of a synchronized model (`CoreSyncService.notifyChange()` for a write past the CrudService), at most one per model and tenant per `hints.debounceMs`; received only by a subscriber with the model's pull roles and access to the tenant. With `redis` every replica's subscribers receive them (`<keyPrefix>:sync:hints`), without it only this replica's. A stream is registered like a WebSocket (`registerWsConnection()`) and ENDS on every invalidation or re-check
|
|
338
|
+
| Offline Sync | `sync` | Boolean Shorthand + Presence Implies Enabled — absent = off | **Absent → nothing registered**: no route, no infrastructure model, no listener on the write paths. `true` / `{}` enables `GET /sync/{model}` (pull) and `POST /sync/{model}` (push) for every model whose CrudService carries `@SyncService({ model, createInput, updateInput })` and whose model is declared with `@PersistedModel({ sync: { roles, strategy } })`. Defaults: `path: 'sync'`, `pull: { defaultLimit: 200, maxLimit: 1000 (ceiling 1000), maxBytes: 1048576 }`, `push: { maxItems: 100 }`, `retention: { mutationsDays: 30, tombstonesDays: 90 }`, `hints: { debounceMs: 250 }`, `rateLimit: { pull: { max: 120, windowSeconds: 60 }, push: { max: 60, windowSeconds: 60 } }` per user (`false` switches both or one off; Redis-shared when configured). `cursorSecret` → `SECRETS_ENCRYPTION_KEY` → development default (boot FAILS in production/staging); changing it answers every cursor `410 invalid`. `pull.windowSeconds` (MongoDB only) overrides the derived window W: replica set or sharded — the server's `transactionLifetimeLimitSeconds` (60 when unreadable) + 30, standalone — 30; it must cover the longest time a write takes from its stamp until it is visible, a smaller one loses changes for good. **Operation roles are the model's** (`sync.roles.pull/create/update/delete`): the roles a project puts on its own routes never reach `/sync`, and an operation without roles is ADMIN only (boot warning). Every pull and push runs through the model's CrudService (`process()`, `securityCheck()`, tenant policy, RLS). Without `X-Tenant-Id` a request spans the caller's memberships. Cookie pushes need `Content-Type: application/json`; while cookies are in use `Sec-Fetch-Site: cross-site` and an untrusted `Origin` answer 403. API tokens are refused unless a project controller releases a scope. Error codes `LTNS_0700`–`LTNS_0799`. **Hints (12.x, DEV-3902)**: `GET /sync/hints` (Server-Sent Events, event `change`, `?models=` narrows) and the GraphQL subscription `syncHint(models)` tell a client "pull now" — payload `{ model, at }` only, never content or ids. Sent from `CrudService.create()` / `update()` / `delete()` of a synchronized model (`CoreSyncService.notifyChange()` for a write past the CrudService), at most one per model and tenant per `hints.debounceMs`; received only by a subscriber with the model's pull roles and access to the tenant. With `redis` every replica's subscribers receive them (`<keyPrefix>:sync:hints`), without it only this replica's. A stream is registered like a WebSocket (`registerWsConnection()`). Opened with a Better-Auth credential (session cookie, bearer session token or JWT, `lt-jwt-token` cookie) it is re-checked IN PLACE since 12.11.0 — the credential and the tenant resolution run again (`createHttpStreamReauthenticator()`, `recheckHttpStreamInPlace()`), unchanged rights keep the stream open and the hint is delivered without a reconnect, changed rights close it; switched only when the credential, run once at open, answers the guards' user with the same fingerprint and tenant scope. Otherwise (legacy JWT, API token) it ENDS on every invalidation or re-check and the client reconnects with its current rights. `CoreSyncService.recheckHintStreamInPlace()` is the override point. `hints: false` switches both channels off, `hints.sse` / `hints.graphql: false` one; no hint is a correctness signal — a missed one is caught by the next pull. **Tombstone purge**: tombstones older than `retention.tombstonesDays` (90; `false` keeps them for good, an invalid value → 90) are hard-deleted every hour on one replica (lease: Redis → the default SQL source's `lt_locks` → `cron-locks`), after the retention horizon moved past them — a client whose cursor predates the horizon answers `410 horizon`. `purgeTombstones()` runs it by hand. **Data migrations** of a synchronized table go through `runSqlMigration()` with `{ syncUpdate: { table, set, where } }`, which raises `version` and numbers the rows like a store write. **Client duties** (delete local data on logout and account switch, no token in `localStorage`, no cached API responses): `src/core/modules/sync/SECURITY.md`; reference test clients (PWA on IndexedDB, Node on SQLite) in `tests/clients/`. Overrides: `CoreModule.forRoot(env, { sync: { controller, hintsController, resolver, service } })` — the hints route is a controller of its own, registered before the pull route, because a project controller re-declaring `pull()` (`@Get(':model')`) would otherwise read `hints` as a model name. The purge deletes in batches of 1000 by id (one `DELETE … WHERE deleted_at < ?` locks every row it scans on MySQL / MariaDB). Implementation: `src/core/modules/sync/` (README, INTEGRATION-CHECKLIST), protocol `docs/offline-sync-protocol.md` |
|
|
338
339
|
| BetterAuth Tenant Skip | `betterAuth.skipTenantCheck` | Explicit Boolean | `true` (default). When `true` and no `X-Tenant-Id` header is sent, IAM endpoints (controller + resolver) skip `CoreTenantGuard` tenant validation. When header IS present, normal membership validation runs regardless. Set `false` for tenant-aware auth scenarios (subdomain-based, invite links, SSO per tenant) |
|
|
339
340
|
| Debug Process Input | `debugProcessInput` | Explicit Boolean | `false` (default). When `true`, logs a debug message when `prepareInput()` changes the input type during `process()`. Has performance cost due to `JSON.stringify` on every `process()` call — enable only for debugging |
|
|
340
341
|
| JSONTransport Production Guard | `email.smtp` with `jsonTransport` | Runtime Guard | Throws `Error` when `email.smtp` has a truthy `jsonTransport` property in `production` or `staging` environments (read from config `env` field). JSONTransport silently discards all outgoing mail — the guard prevents accidental misconfiguration that causes password-reset, 2FA, and verification emails to vanish. Use `{ jsonTransport: true }` only in CI/e2e/local environments |
|
|
@@ -347,9 +348,9 @@ This pattern is currently applied to:
|
|
|
347
348
|
| S3 Connection Pool & Download Guard | `s3.maxSockets`, `s3.connectionTimeoutMs`, `s3.socketTimeoutMs`, `s3.downloadIdleTimeoutMs`; `file.downloadIdleTimeoutMs`, `file.downloadCaching` | Numeric — invalid → default, never off (Family C without opt-out) + Explicit Enum | **12.8.9, after a production outage**: S3 downloads delivered with a bare `stream.pipe(res)` kept their sockets when clients aborted; after 50 the SDK's pool was full, every S3 request waited forever (health check green), heap OOM hours later. Since then: `CoreS3Service` builds its client with OWN agents (`maxSockets` **200**, keep-alive), `connectionTimeout` **15 000** per attempt (the SDK starts it when the request is CREATED, so it also bounds the wait for a free socket — a short value fails healthy downloads under load; the SDK retries a timed-out attempt, 3 attempts in all, so a download that gets no socket answers **503** + `Retry-After: 5` after about 46 s — keep 3 × the value below the reverse proxy's read timeout, commonly 60 s), `socketTimeout` **120 000** (inactivity backstop for every request, uploads and copies included). The SDK's `requestTimeout` stops at the headers and its socket timeout destroys the body WITH an error (a process crash without a listener), so the real guard is `guardIdleStream()` (`common/helpers/idle-stream.helper.ts`): every stream from `getObject()` (`s3.downloadIdleTimeoutMs`, 30 000) and from `CoreFileService.getFileStream()` / `getFileStreamByName()` (`file.downloadIdleTimeoutMs`, 30 000 — GridFS cursors, file handles) is destroyed after that long WITHOUT READ PROGRESS, measured on the consumer side (`_read`) and at the source; a slow reader that keeps reading is never cut off; code that opens a stream and reads it LATE (an archive appending every file first) breaks — per call `downloadIdleTimeoutMs: false` (`FileServiceOptions`) / `getObject(key, { idleTimeoutMs: false })` opts out. `pipeFileToResponse()` destroys the source when the client goes — the response's `close`, the request's `close` (before its end and while the response is unfinished — Node closes a request whose body was read to the end by itself, a POST export stays deliverable) or the socket's `end`/`close`: measured under a k6 abort storm, about one in six aborted downloads never got a `close` on the response and reported it only through the request or the socket — and at once when it had ALREADY gone (`isResponseGone()`: response destroyed/closed OR request destroyed before its end OR socket destroyed; a client that gave up while waiting for a socket — the avalanche path); the routes pass an `abortSignal` (`downloadAbortSignal()`, exported: the same client-gone signals) down to `GetObjectCommand` and open the stream through `openDownloadStream()` (exported since 12.9.2 for a project's own routes): no store request for a gone client, `RESPONSE_GONE` instead of an ERROR when the store request failed because the client left (an aborted S3 request rejects with `AbortError`), a late stream destroyed, `TimeoutError` → 503 + `Retry-After`. An exhausted pool is logged as an ERROR once per minute with numbers (`getSocketPoolStats()` exposes them); deliberately NOT a health-check failure. `file.downloadCaching`: `'none'` (default, `private, no-store`) or `'revalidate'` (`private, no-cache` — the browser revalidates every use, `304` after the rights check without a store read); both send a WEAK `ETag` `W/"<id>"` (bytes under an id never change, but a `compression` middleware sends a gzip and an identity representation of the same file — RFC 9110 §8.8.3 forbids one strong validator for both; `If-None-Match` compares weakly) and `Content-Length`. The reference `src/main.ts` uses `compression.filter` (no gzip for JPEG/PNG/PDF/ZIP). Pinned by `tests/unit/idle-stream.spec.ts`, `tests/unit/core-file.controller.spec.ts`, `tests/unit/download-idle-opt-out.spec.ts` and `tests/s3-download-resilience.e2e-spec.ts` (real RustFS: dropped streams, abort storm with bare `pipe()`, clients giving up while waiting, 500 parallel downloads with `maxSockets: 4`, slow reader; mutations `idle-guard-*`, `s3-get-object-*`, `pipe-file-to-response-*`, `download-route-keeps-late-stream`, `file-stream-drops-idle-opt-out`). Implementation: `core-s3.service.ts`, `core-file.controller.ts`, `core-file.service.ts` |
|
|
348
349
|
| TUS S3 Staging | `tus.s3Staging` | Explicit Boolean (default ON when S3 configured) | `true` when `s3` is configured, otherwise inert. Stages in-progress uploads in `s3.stagingBucket` via `@tus/s3-store` instead of `tus.uploadDir` on local disk, so resumable uploads survive replica restarts and need no sticky sessions. Set `false` to force local disk. Missing OPTIONAL peer `@tus/s3-store` → warning + fall back to local disk (NOT a boot failure). **Give the staging bucket a lifecycle rule expiring incomplete multipart uploads** — the framework's own expiration cleanup is skipped in S3 mode (S3 is the right place for that policy), so aborted uploads otherwise accumulate parts nothing removes |
|
|
349
350
|
| TUS Configuration Source, Path & Extensions | `tus` (server config) / `TusModule.forRoot({ config })` | Enabled by Default + explicit-config-wins | **Since 11.42.9 `TusModule.forRoot()` without `config` reads the server config's `tus` key** (`ConfigService.get('tus')`, the zero-config rule `CoreBetterAuthModule.forRoot()` follows); an explicit `config` wins. Before, the key was never read: `tus: false`, `allowedTypes`, `maxSize`, `roles` in `config.env.ts` did nothing — real projects had upload restrictions they believed were enforced. **`path`** has three readings (`applyPath()`): unset → follows the controller's route; a new route (`/uploads`) → mounts the registered controller there (writes `PATH_METADATA`, config wins like the roles; the declared route is remembered per class and restored by a later `forRoot()` without `path`); a path ENDING with the controller's route (`/api/tus`, `/files/tus`) → the PUBLIC URL: the controller stays and upload URLs use it. The third reading is load-bearing: it was the only working setting under a global prefix or a prefix-stripping proxy before 11.42.9, and treating it as a route doubled the prefix (`/api/api/tus`, 404 on every upload — caught in the second pre-release review). The upload URL (`Location`) is built from the path the creation request arrived at (`uploadCollectionPath(req)`), or from `path` when that is longer and ends with it (proxy strip); `@tus/server` built it from `path` alone, which broke every resume below a global prefix, a URI version or a project route. **`relativeLocation`** (new): the framework owns `generateUrl`, which takes precedence over `@tus/server`'s option of that name, so it is honoured from `tus.relativeLocation` AND from the tus server's own options (a vendored core may pass it there). **Extensions**: `@tus/server` consults no flag, so `creation`, `creationWithUpload` and `termination` are enforced by `CoreTusService` — the store's advertised `extensions` are narrowed, and `assertExtensionEnabled()` answers 501 inside the server's `onIncomingRequest` / `onUploadCreate` options (not in the overridable hook, so an override without `super` cannot reopen it). `checksum` / `concatenation` have no effect: neither built-in store supports them. `configure(false)` now yields a DISABLED config (before it kept the defaults and started a tus server behind a module with no endpoint). Implementation: `tus.module.ts`, `core-tus.service.ts` |
|
|
350
|
-
| Health Check | `healthCheck` | Presence Implies Enabled | Absent → no endpoints. Any object registers `GET /health-check` + the `healthCheck` query; **`enabled: false` leaves them out (honoured since 11.42.9 — before, it was declared and ignored)**. Individual checks under `configs.*` each have their own `enabled`. Implementation: `core.module.ts` |
|
|
351
|
-
| Cron Job Deduplication | per job: `distributed` in `CronJobConfig` | Explicit Boolean | **`true` when `redis` is configured, otherwise `false`** — a single-replica project that upgrades must not silently gain a `cron-locks` collection, a lease write per tick, and a new way for a tick to be skipped. A Redis-less multi-replica fleet opts in per job with `distributed: true` (lease in the SQL lease table of the default source, else in MongoDB). Mechanism: BullMQ job scheduler when Redis + the OPTIONAL peer `bullmq` are present AND `cronTime` is a string without `utcOffset`; otherwise local timer + lease (Redis `SET NX`, else the SQL lease table of the default source (`lt_locks`), else a TTL-indexed `cron-locks` document). Tick lease TTL 3600 s. **Leases fail open** — an unreachable lease store runs the tick everywhere rather than stopping all scheduled work fleet-wide. **`runOnInit` (default `true`) deduplicates over a FIXED per-job key with a 300 s TTL**, because replicas do not share a boot instant: replicas booting within 5 min run the startup tick once between them, and a replica restarting inside that window SKIPS its startup tick — set `distributed: false` on jobs whose `runOnInit` work is per-process (warming a process-local cache). No constructor change needed: `CoreModule` fills `core-cron-jobs.registry.ts` via `CoreCronJobsInitializer` and `CoreCronJobs` reads it lazily; explicit `{ connection, redisService }` in `CoreCronJobsOptions` wins. With neither source it warns once and every replica runs every tick. **A BullMQ schedule lost in Redis comes back (12.1.1+)**: `upsertJobScheduler` writes it once at bootstrap, and a Redis restart without persistence, a FLUSHDB or an eviction removed it with nothing re-registering it, so no replica ran the job until the next deploy. `restoreBullSchedulers()` now runs after every `ready` of the queue connection and every `bullSchedulerCheckIntervalMs` (protected, 60000; `0` switches only the timer off) and registers the schedules the queue's listing (`getJobSchedulers()`) no longer contains, with a warning — the listing, because `getJobScheduler()` does not exist before bullmq 5.23 and answers a deleted scheduler with an object up to 5.40.2, both inside the peer range. Only MISSING ones: an upsert of an existing scheduler removes its last planned job even when it is due and waits for a free worker, so a blind periodic upsert would drop that tick. A scheduler `removeStaleBullSchedulers()` removed on purpose carries a `cron-scheduler-removed:<job>` key, so a replica of the previous version still running in a rolling deploy does not bring it back (a job moved to a local timer would otherwise run twice per tick); the next BullMQ registration of that job deletes the key, and a real data loss takes it along. Only the schedule comes back (no second `runOnInit`, no second registry entry); a tick that fell due while it was missing is not run. **Since 12.1.1 (DEV-3896)**: (1) a timer job's tick lease is keyed on the tick's SCHEDULED instant, captured from `nextDate()` when the job is armed and after each scheduled fire, and moved forward through the schedule to the last instant at or before the fire when the job did not fire for a while (stopped and started in the Hub; not for a `utcOffset` job) — cron 4 sets `lastDate()` to the moment its timer fired, so two replicas firing on either side of a second boundary computed different keys and both ran the tick. A fire that does not advance `lastDate()` is a manual run (the Hub's "Run now") with a key of its own, also on a job stopped in the Hub. (2) `runParallel: false` (or `1`) holds across replicas for a distributed job, in timer and BullMQ mode: the run holds a `<job>:running` lease (60 s, renewed every 20 s, released in `finally`; Redis — owner-checked renew and release —, else the SQL lease table, else `cron-locks`), and a replica that finds it held skips its tick; fail-open like the tick lease. A run that never ends therefore holds the job on EVERY replica while its process lives, not only on its own. A larger `runParallel` stays per process. (3) A failed TTL index on `cron-locks` is tried again on the next tick instead of being cached as done. (4) Without `redis`, startup logs ONE info line naming the jobs that run on every replica because they did not set `distributed` (silent with `log: false`, and for jobs that set `distributed: false`). (5) BullMQ scheduler jobs carry `bullJobOptions` (protected): `attempts: 1` — a failed tick is not repeated, as with the local timer —, `removeOnComplete: { count: 100 }`, `removeOnFail: { count: 500 }`; before, every completed and failed tick stayed in Redis for good. Existing schedulers get them at the next bootstrap, which upserts every scheduler — after `trimBullJobBacklog()` has removed the backlog an earlier version kept, oldest first, 1000 jobs per `clean()` call: BullMQ trims by `count` in one Lua call without a limit, and the first tick under the new options would otherwise delete the whole backlog at once (measured 2 s for 300k jobs, 4.4 s for 700k, with Redis answering nobody) |
|
|
352
|
-
| Shutdown Delay | `shutdownDelayMs` | Numeric Sentinel — Family B (`0` = off) | `0` (default, no delay, no log). Waits N ms **in the SIGTERM/SIGINT handler, before `close()` is entered**, so a load balancer can finish deregistering while the instance
|
|
351
|
+
| Health Check | `healthCheck` | Presence Implies Enabled | Absent → no endpoints. Any object registers `GET /health-check` + the `healthCheck` query; **`enabled: false` leaves them out (honoured since 11.42.9 — before, it was declared and ignored)**. Individual checks under `configs.*` each have their own `enabled`. **Readiness (12.11.0): `healthCheck.readiness`, Boolean Shorthand + Presence Implies Enabled — absent = no readiness route, the health check exactly as before.** `true` / `{}` registers `GET /health-check/ready` (public, REST only, its own controller `CoreHealthCheckReadinessController`, so without it the route does not exist: 404) with the default checks `['database', 'build']`; `readiness.checks` lists the checks of `configs` it runs (`database` — MongoDB ping and every SQL source —, `memoryHeap`, `memoryRss`, `storage`, `build`; a comma-separated string as `NSC__HEALTH_CHECK__READINESS__CHECKS` gives it; unknown names ignored with one warning; not a list or string → the defaults; `[]` → only project indicators), with key, thresholds and options from `configs.<check>` and whatever `configs.<check>.enabled` says (that flag decides for liveness). `false` / `{ enabled: false }` registers nothing. 200 while every check is up, 503 when one is down, and `shutting_down` from the first shutdown signal on when `installGracefulShutdown()` handles it (it marks the shutdown before its `shutdownDelayMs` wait — `shutdown-state.helper.ts`, mutations `readiness-ignores-shutdown`, `graceful-shutdown-skips-drain-mark`); Terminus' own state alone comes only inside `app.close()`. **Project checks**: extend `CoreHealthCheckService`, override the protected `additionalHealthIndicators(kind: 'liveness' \| 'readiness')` (default `[]`, may be async) and return Terminus indicators; register the subclass with `CoreModule.forRoot(env, { healthCheck: { service } })` (`readinessController` replaces the readiness controller). `CoreHealthCheckModule` imported as it is stays the pre-12.11.0 module; `CoreHealthCheckModule.forRoot()` adds the readiness controller and the service override (a dynamic module extends the static metadata, so the liveness controller is never registered twice). Pinned by `tests/unit/health-check-readiness.spec.ts`, `tests/unit/core-module-signatures.spec.ts`. Implementation: `core.module.ts`, `modules/health-check/` (`resolveHealthCheckReadiness()` in `core-health-check.helpers.ts`) |
|
|
352
|
+
| Cron Job Deduplication | per job: `distributed` in `CronJobConfig` | Explicit Boolean | **`true` when `redis` is configured, otherwise `false`** — a single-replica project that upgrades must not silently gain a `cron-locks` collection, a lease write per tick, and a new way for a tick to be skipped. A Redis-less multi-replica fleet opts in per job with `distributed: true` (lease in the SQL lease table of the default source, else in MongoDB). Mechanism: BullMQ job scheduler when Redis + the OPTIONAL peer `bullmq` are present AND `cronTime` is a string without `utcOffset`; otherwise local timer + lease (Redis `SET NX`, else the SQL lease table of the default source (`lt_locks`), else a TTL-indexed `cron-locks` document). Tick lease TTL 3600 s. **Leases fail open** — an unreachable lease store runs the tick everywhere rather than stopping all scheduled work fleet-wide. **`runOnInit` (default `true`) deduplicates over a FIXED per-job key with a 300 s TTL**, because replicas do not share a boot instant: replicas booting within 5 min run the startup tick once between them, and a replica restarting inside that window SKIPS its startup tick — set `distributed: false` on jobs whose `runOnInit` work is per-process (warming a process-local cache). No constructor change needed: `CoreModule` fills `core-cron-jobs.registry.ts` via `CoreCronJobsInitializer` and `CoreCronJobs` reads it lazily; explicit `{ connection, redisService }` in `CoreCronJobsOptions` wins. With neither source it warns once and every replica runs every tick. **A BullMQ schedule lost in Redis comes back (12.1.1+)**: `upsertJobScheduler` writes it once at bootstrap, and a Redis restart without persistence, a FLUSHDB or an eviction removed it with nothing re-registering it, so no replica ran the job until the next deploy. `restoreBullSchedulers()` now runs after every `ready` of the queue connection and every `bullSchedulerCheckIntervalMs` (protected, 60000; `0` switches only the timer off) and registers the schedules the queue's listing (`getJobSchedulers()`) no longer contains, with a warning — the listing, because `getJobScheduler()` does not exist before bullmq 5.23 and answers a deleted scheduler with an object up to 5.40.2, both inside the peer range. Only MISSING ones: an upsert of an existing scheduler removes its last planned job even when it is due and waits for a free worker, so a blind periodic upsert would drop that tick. A scheduler `removeStaleBullSchedulers()` removed on purpose carries a `cron-scheduler-removed:<job>` key, so a replica of the previous version still running in a rolling deploy does not bring it back (a job moved to a local timer would otherwise run twice per tick); the next BullMQ registration of that job deletes the key, and a real data loss takes it along. Only the schedule comes back (no second `runOnInit`, no second registry entry); a tick that fell due while it was missing is not run. **Changing a schedule at runtime (12.11.0): `rescheduleCronJob(name, schedule)`**, public — a cron expression or date (time zone / UTC offset kept) or `{ cronTime, timeZone }` / `{ cronTime, utcOffset }`; validated first (an invalid expression, an unknown zone or a past date rejects, the job stays as it was); calls run one after the other; rejects for a job that is not registered (unknown, disabled, before bootstrap, after shutdown). Only the schedule changes: `distributed`, `runParallel`, `throwException`, the leases and `bullJobOptions` stay. Local timer: the timer is replaced, a distributed tick leases on the NEW schedule's instant, a recurring job the Hub stopped stays stopped, `runOnInit` is not repeated. BullMQ: the scheduler is upserted with the new pattern and `bullJobOptions` — skipped when Redis already holds exactly that pattern and time zone, so N replicas calling it plan no tick twice —, the Hub's registry entry is replaced, and `restoreBullSchedulers()` restores the NEW schedule; Redis refusing the upsert rejects and keeps the old schedule. A schedule BullMQ cannot express (a date, a UTC offset) moves the job to a local timer with lease and removes its scheduler WITH the `cron-scheduler-removed:<job>` marker (marker first), so replicas still scheduling it through BullMQ do not restore it; a cron expression moves it back and deletes the marker. A BullMQ schedule changes fleet-wide, a local timer per process — call it on every replica; it is not stored, the next bootstrap schedules from the configuration (re-apply after `super.onApplicationBootstrap()`). Pinned by `tests/unit/core-cron-jobs-reschedule.spec.ts`. **Since 12.1.1 (DEV-3896)**: (1) a timer job's tick lease is keyed on the tick's SCHEDULED instant, captured from `nextDate()` when the job is armed and after each scheduled fire, and moved forward through the schedule to the last instant at or before the fire when the job did not fire for a while (stopped and started in the Hub; not for a `utcOffset` job) — cron 4 sets `lastDate()` to the moment its timer fired, so two replicas firing on either side of a second boundary computed different keys and both ran the tick. A fire that does not advance `lastDate()` is a manual run (the Hub's "Run now") with a key of its own, also on a job stopped in the Hub. (2) `runParallel: false` (or `1`) holds across replicas for a distributed job, in timer and BullMQ mode: the run holds a `<job>:running` lease (60 s, renewed every 20 s, released in `finally`; Redis — owner-checked renew and release —, else the SQL lease table, else `cron-locks`), and a replica that finds it held skips its tick; fail-open like the tick lease. A run that never ends therefore holds the job on EVERY replica while its process lives, not only on its own. A larger `runParallel` stays per process. (3) A failed TTL index on `cron-locks` is tried again on the next tick instead of being cached as done. (4) Without `redis`, startup logs ONE info line naming the jobs that run on every replica because they did not set `distributed` (silent with `log: false`, and for jobs that set `distributed: false`). (5) BullMQ scheduler jobs carry `bullJobOptions` (protected): `attempts: 1` — a failed tick is not repeated, as with the local timer —, `removeOnComplete: { count: 100 }`, `removeOnFail: { count: 500 }`; before, every completed and failed tick stayed in Redis for good. Existing schedulers get them at the next bootstrap, which upserts every scheduler — after `trimBullJobBacklog()` has removed the backlog an earlier version kept, oldest first, 1000 jobs per `clean()` call: BullMQ trims by `count` in one Lua call without a limit, and the first tick under the new options would otherwise delete the whole backlog at once (measured 2 s for 300k jobs, 4.4 s for 700k, with Redis answering nobody) |
|
|
353
|
+
| Shutdown Delay | `shutdownDelayMs` | Numeric Sentinel — Family B (`0` = off) | `0` (default, no delay, no log). Waits N ms **in the SIGTERM/SIGINT handler, before `close()` is entered**, so a load balancer can finish deregistering while the instance still serves; from the signal on `GET /health-check/ready` answers 503 `shutting_down` (12.11.0, `markShutdownDraining()`), so a load balancer polling readiness starts deregistering at once. NOT a lifecycle hook: `close()` runs `onModuleDestroy` → `beforeApplicationShutdown` → dispose → `onApplicationShutdown`, so a delay in `beforeApplicationShutdown` would wait with every module already torn down while the socket still accepts — worse than no delay. **Requires `installGracefulShutdown(app)` in main.ts, which REPLACES `server.enableShutdownHooks()`** — keeping both makes Nest close the app in parallel with the wait, so the delay silently never happens. At delay `0` the helper IS `enableShutdownHooks()`. **Keep the value well below the orchestrator grace period AND leave room for the drain that follows**: Compose `stop_grace_period` 10s, Kubernetes `terminationGracePeriodSeconds` 30s, and `installProcessDiagnostics()` force-exits after 30s — exceed any and the process is SIGKILLed mid-wait with no hook running. Warns above `10000`, capped at `60000`. Non-numeric / negative values behave like `0` |
|
|
353
354
|
| Body Parser Limits | `bodyParser.json.limit`, `bodyParser.urlencoded.limit` | Explicit Value (Express/body-parser default) — invalid → default, never unbounded | **Unset = 100 kB each, exactly as NestJS registers the parsers** (body-parser's own default — a limit nobody chose, and before 11.42.4 the only one in force: over it a request got a bare `request entity too large`, before auth and routing, GraphQL included). A number is bytes, a string a 1024-based size (`'500kb'`, `'2mb'`, units `b`/`kb`/`mb`/`gb`). The two limits are separate on purpose — raising JSON must not raise form posts. **Not raised by default because the parser runs before authentication** and `JSON.parse` blocks the event loop for the whole body: ~0.5 ms for 100 kB, ~16 ms for 1 MB, ~55 ms for 2 MB per request on a realistic document shape. Applied by `CoreBodyParserInitializer` (CoreModule provider) in `onModuleInit` by **swapping the handle of the global `jsonParser`/`urlencodedParser` layers NestJS registered, in place** — NestJS registers them inside `app.init()` before any init hook, and a parser appended later would sit behind the routes. Same position, `extended: true` for URL-encoded, `req.rawBody` kept when the app came from `NestFactory.create(…, { rawBody: true })` (read from the container's context options; under `Test.createTestingModule()` those options never reach the container, so a test app with `rawBody: true` gets no `req.rawBody` from a CONFIGURED parser). Because it runs during module init it **holds under `Test.createTestingModule()`**, which never runs `main.ts` — the reason a `useBodyParser()` in `main.ts` was not enough. A configured value also replaces a global parser registered in `main.ts`; a **path-scoped** one (`server.use('/upload', json({ limit }))`) is left alone and stays the way to give one path its own limit (the parser runs before routing; GraphQL shares one path). **Keep `server.useBodyParser('json')` in `main.ts` next to a path-scoped parser**: NestJS registers its global parser only when no layer with the same FUNCTION NAME exists (`isMiddlewareApplied()`), so a path-scoped `json()` registered before `app.init()` suppresses it and every other path gets an empty body (a sign-in fails with a validation error). Since 11.42.6 the initializer warns at boot about exactly that (`warnMissingGlobalParser()`). It deliberately does not re-insert the parser: NestJS would have placed it after everything `main.ts` registered, a position no longer knowable during module init, and a raw-body webhook or proxy registered after the path-scoped parser must keep seeing the unread stream. An invalid value (`0`, negative, `NaN`, a word) is refused with an error log and the parser keeps its limit. **Independent of configuration**, every 413 from a global parser is answered as `PayloadTooLargeException` with `#LTNS_0304: Request body too large [<n> bytes, limit <m> bytes]` (size only when a `Content-Length` was sent) and logged as a WARN naming method, path without query string, and the config key — no boot warning, because the framework cannot know which routes expect large bodies; the first oversized request is the earliest point anything can be said. Other parser errors pass through unchanged. Pinned by `tests/unit/body-parser.spec.ts` and `tests/body-parser.e2e-spec.ts` (mutations `body-parser-*`). Implementation: `common/services/core-body-parser.initializer.ts` |
|
|
354
355
|
| Trust Proxy | `trustProxy` | Explicit Value (pass-through, Express default) | `false` (Express's own default — the forwarded chain is not trusted). Passed verbatim to `app.set('trust proxy', …)` by `CoreTrustProxyInitializer`, a `CoreModule` provider, so a consumer inherits it by upgrading and needs no `main.ts` edit. Accepts `false` / a hop count (`1`, `2`) / `'loopback'` / a subnet list — **not** Express's predicate function: the value must survive `NEST_SERVER_CONFIG` / `NSC__*` (JSON) and the ConfigService deep clone. **This is what makes `request.ip` correct, and every IP-keyed rate limit depends on it**: unset behind Caddy/nginx/an ingress, `req.ip` is the PROXY address for every request, so all clients share ONE bucket and `auth.rateLimit.max` throttles everybody at once — exactly fleet-wide once `redis` is configured. Trusting MORE hops than exist is the opposite failure: a client prepends its own header entry and picks a fresh bucket per request. Applied at module init (inside `app.init()`/`listen()`, i.e. AFTER `main.ts`), so a configured value wins over a hand-written `app.set()`; an UNSET value is never applied, which keeps `app.set('trust proxy', fn)` in `main.ts` available as the escape hatch for the predicate form. **Unset + an IP-keyed limiter enabled (`auth.rateLimit` / `betterAuth.rateLimit`) logs a boot warning naming the shared-bucket consequence**; `trustProxy: false` is the explicit "nothing proxies me" answer that silences it. The AI limiter keys on the user id and is unaffected |
|
|
355
356
|
| Outbound URL Guard (SSRF) | `security.allowPrivateOutboundTargets` | Explicit Boolean with DERIVED default | **Opt-in helper for URLs a USER entered** (webhooks, export targets, ERP addresses) — `outboundFetch()`, `assertOutboundUrlAllowed()`, `createOutboundDispatcher()` in `common/helpers/outbound-url.helper.ts` (11.42.0). Nothing is applied globally: configured targets (AI providers, SMTP, S3, Redis, Brevo) never go through it. Refuses loopback, RFC 1918, link-local incl. `169.254.169.254`, CGNAT, `0/8`, benchmarking, multicast/reserved, IPv6 unspecified/loopback/IPv4-compatible (`::/96`), NAT64, ULA, link-local and multicast, and IPv4-mapped IPv6 in every notation (canonicalised through the URL parser). Checked TWICE: on the URL before sending (readable `OutboundUrlBlockedError`) and on every connection through an undici `Agent` with a guarded connector — the only place that sees a redirect's next hop and a DNS answer at connect time (rebinding). **Unset → derived from the environment**: allowed in `local`, `e2e`, `ci`, refused everywhere else — deliberately including `test`, a DEPLOYED stage in starter-based projects; `true`/`false` (also the strings, from `NSC__SECURITY__ALLOW_PRIVATE_OUTBOUND_TARGETS`) decide explicitly. Per call, `allowedHosts` frees single internal hosts (`'erp.local:8443'` = that port, `'erp.local'` = any port) without opening the rest — re-checked per connection, so a redirect does not inherit it. `outboundFetch()` uses undici's OWN `fetch` (runtime dependency `undici` since 11.42.0), because Node 22's built-in fetch bundles a different undici major than the agent |
|
|
@@ -394,6 +395,7 @@ CoreModule.forRoot(CoreAuthService, AuthModule.forRoot(envConfig.jwt), envConfig
|
|
|
394
395
|
|--------|--------|-------------|
|
|
395
396
|
| `ai` | `budgetService`, `connectionResolver`, `connectionService`, `controller`, `conversationService`, `interactionService`, `mcpClientService`, `mcpOAuthService`, `modeService`, `placeholderRegistry`, `preferenceService`, `promptBuilder`, `promptHintService`, `promptService`, `resolver`, `service`, `slotService`, `toolGrantService`, `toolPolicyService`, `userSettingService` | Custom AI orchestrator, connection-resolution chain, connection/preference/budget/conversation/interaction/MCP-client services, MCP OAuth service (the consent step), slot + user-prompt + learning-hint stores, mode service, placeholder registry, tool-grant + tool-policy services, personal-settings store, endpoints |
|
|
396
397
|
| `errorCode` | `controller`, `service` | Custom error code endpoint and/or service |
|
|
398
|
+
| `healthCheck` | `readinessController`, `service` | Custom health check service (project checks via `additionalHealthIndicators(kind)`) and/or readiness controller (12.11.0) |
|
|
397
399
|
| `betterAuth` | `controller`, `resolver` | Custom IAM REST controller and/or GraphQL resolver |
|
|
398
400
|
| `hub` | `controller`, `actionsController`, `service`, `htmlService`, `actionsService` | Custom Hub page/actions controllers and aggregator/HTML/actions services (each must extend its `Core*` base) |
|
|
399
401
|
|
|
@@ -179,7 +179,7 @@ entry, `ws`: GHSA-37g9-w4hg-h9qr (high, pre-auth memory-exhaustion DoS, patched
|
|
|
179
179
|
`@nestjs/graphql` 14.2.1 exact-pins, and the GraphQL WebSocket server runs on that copy. The advisory was published
|
|
180
180
|
by the ws maintainers on 2026-11-12 and was not yet in GitHub's global database when the entry was added, so
|
|
181
181
|
`pnpm audit` did not report it — read the advisories of a package's own repository when a release announces a
|
|
182
|
-
security fix. Its target moves in lockstep with the declared `ws` dependency (`docs/security-overrides.md`).
|
|
182
|
+
security fix. Its target moves in lockstep with the declared `ws` dependency (`docs/security-overrides.md`). From 12.10.0 to 12.10.1 a second entry, `minimatch` 11 -> 11.0.9: `@nestjs/cli` 12.0.13 exact-pins 11.0.5, covered by three moderate advisories (dev tooling only; the target is the newest 11.x, because an older one held every other `^11` consumer back). It left in 12.11.0, once `@nestjs/cli` 12.0.15 pinned 11.0.9 itself. Since 12.10.0 a second entry, `i18next` 26 -> 26.4.4: `@compodoc/compodoc` 2.0.0 exact-pins 26.3.3, covered by two repository advisories that were not yet in GitHub's global database (dev tooling only). An override is only necessary if removing it lets the package resolve
|
|
183
183
|
back INTO its vulnerable range (verify with a with/without lockfile diff; `pnpm audit` is the arbiter).
|
|
184
184
|
"Cheap insurance against a parent re-pinning downwards" is not a reason to keep one: `pnpm audit` and
|
|
185
185
|
`check:overrides` run on every `check` and report such a regression the day it happens. Each surviving entry carries its CVE rationale as a comment. Remove an entry once its parent dependency ships a fixed version.
|
|
@@ -484,13 +484,15 @@ which is how the hole this feature closes came about in the first place.
|
|
|
484
484
|
|
|
485
485
|
**Current entry (since 2026-10-31, owner decision, DEV-3899).** `GHSA-g3hv-75wg-m249` (minimatch
|
|
486
486
|
`< 11.0.1`, moderate), fixed only in a new major released 2026-10-27 that its remaining consumers cannot
|
|
487
|
-
take yet — `@swc/cli` 0.8.2
|
|
488
|
-
(re-verified 2026-11-
|
|
489
|
-
the comment above `ignoreGhsas`, the declaration in
|
|
490
|
-
`tests/unit/audit-suppression-scope.spec.ts`
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
487
|
+
take yet — `@swc/cli` 0.8.2 and nodemon 3.1.14, both dev tooling, each on its newest release
|
|
488
|
+
(re-verified 2026-11-19; `@nestjs/cli` 12.0.12 and glob 14 moved to minimatch 11, and `@ts-morph/common`
|
|
489
|
+
0.29.1 on 2026-11-16). The justification is in the comment above `ignoreGhsas`, the declaration in
|
|
490
|
+
`unusableFixConsumers`. `tests/unit/audit-suppression-scope.spec.ts` keeps every vulnerable minimatch (< 11)
|
|
491
|
+
out of the production tree. Until nest-server 12.10.1 it allowed one production path, `@ts-morph/common`
|
|
492
|
+
0.29.0 (the Permissions module's scanner), in its `prodVia` form; a fresh resolve then picked 0.29.1 and
|
|
493
|
+
`check:overrides` reported the stale declaration as RE-TEST. `GHSA-3g3m-2fjr-6pw4` (glob `<= 14.0.1`) was a
|
|
494
|
+
second entry until 2026-11-09 (nest-server 12.8.4), when rimraf 6.1.4 moved to glob 14.0.4 and no affected
|
|
495
|
+
glob remained.
|
|
494
496
|
|
|
495
497
|
**Before that, no entry from 2026-10-24.** `GHSA-vfj7-8cjw-p6xm` (braces, via nodemon / npm-watch) was
|
|
496
498
|
listed from 2026-10-11 to 2026-10-24: a dev-tooling-only path of an advisory with no patched release
|
|
@@ -491,7 +491,10 @@ re-signed legacy token opened sockets that HTTP refused (mutation `legacy-ws-jwt
|
|
|
491
491
|
socket therefore ends with its token: at expiry or at the next token refresh.
|
|
492
492
|
|
|
493
493
|
**A guard that asks "is this request allowed?" once is not enough for a connection that outlives the
|
|
494
|
-
answer.** When you add a long-lived channel (SSE, a WebSocket of your own), register it the same way.
|
|
494
|
+
answer.** When you add a long-lived channel (SSE, a WebSocket of your own), register it the same way. An HTTP
|
|
495
|
+
stream (SSE) is registered with `registerHttpStream()` (12.11.0, `common/helpers/http-stream-auth.helper.ts`): it is
|
|
496
|
+
re-checked in place like a WebSocket when its Better-Auth credential can be run again, and otherwise ends on every
|
|
497
|
+
re-check so the reconnect passes the guards — never trust the request's guards for the stream's whole life.
|
|
495
498
|
|
|
496
499
|
**Refusing the handshake itself (12.0.0).** `onConnect` refuses a missing or non-authenticating credential with
|
|
497
500
|
`return refuseWsHandshake(extra.socket, reason)` — close code **4401**, which the graphql-ws client does not retry.
|
package/.claude/rules/testing.md
CHANGED
|
@@ -412,7 +412,7 @@ pnpm run check:mutations -- --id=<id> # one mutation
|
|
|
412
412
|
pnpm run check:mutations -- --list # the registry, without running anything
|
|
413
413
|
pnpm run check:mutations -- --allow-dirty # when the fix and its evidence share a working tree
|
|
414
414
|
pnpm run check:mutations -- --jobs=4 # N mutations at a time (default: 2, or 4 on >=12 cores)
|
|
415
|
-
pnpm run check:mutations -- --no-infra # only the
|
|
415
|
+
pnpm run check:mutations -- --no-infra # only the 514 that need no MongoDB
|
|
416
416
|
pnpm run check:mutations -- --since=<ref> # only mutations touching files changed since <ref>
|
|
417
417
|
pnpm run check:mutations -- --shard=2/4 # this job's quarter of the selection (CI splits the full run)
|
|
418
418
|
```
|
|
@@ -432,7 +432,7 @@ when the registry, a vitest config or a setup file changed, since those can move
|
|
|
432
432
|
commit, and in CI alongside the publish without blocking it. The price of caching is a cache that
|
|
433
433
|
has to model each spec's full dependency closure correctly, and getting that wrong produces a stale
|
|
434
434
|
PASS for a test that has since gone vacuous — exactly what the gate is there to prevent. Bad trade
|
|
435
|
-
at
|
|
435
|
+
at 761 mutations.
|
|
436
436
|
|
|
437
437
|
**Decided 2026-10-03 (repo owner): keep the full run.** Measured at 128 mutations, the CI job for
|
|
438
438
|
11.41.6 took **14 minutes**. The trigger to revisit is that wall time, not the mutation count —
|
|
@@ -503,9 +503,9 @@ exactly the environment where the answer matters.
|
|
|
503
503
|
|
|
504
504
|
### The cost is vitest's cold start, not the tests
|
|
505
505
|
|
|
506
|
-
Worth knowing before optimising the wrong thing: the specs behind all
|
|
506
|
+
Worth knowing before optimising the wrong thing: the specs behind all 247 e2e mutations add up to
|
|
507
507
|
**~40 seconds**. The step takes ~740s. The remaining ~700s is paying vitest's startup — process
|
|
508
|
-
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation,
|
|
508
|
+
spawn, transform, module graph, mongod connect, DB create and drop — once per mutation, 761 times.
|
|
509
509
|
That work is largely single-threaded I/O and barely scales with cores: the full registry measures
|
|
510
510
|
**744s on a 12-core laptop and 777s on a 4-vCPU CI runner**.
|
|
511
511
|
|
package/CLAUDE.md
CHANGED
|
@@ -341,6 +341,11 @@ migration history — see `src/core/modules/migrate/README.md`.
|
|
|
341
341
|
|
|
342
342
|
**Key areas:** JWT, MongoDB, GraphQL, email, security, betterAuth
|
|
343
343
|
|
|
344
|
+
**`NSC__` values (12.11.0):** an empty value counts as not set (no entry and no objects along its path — `redis: {}`
|
|
345
|
+
would switch Redis on), `true` / `false` are read in any case and with spaces, and a key named `enabled` takes only
|
|
346
|
+
`true`, `false`, `1` or `0`; anything else stops the start. Before, `ENABLED=` became `0` and `ENABLED=FALSE` text,
|
|
347
|
+
and both left a feature on. Implementation: `getEnvironmentObject()` in `config.helper.ts`.
|
|
348
|
+
|
|
344
349
|
**`NODE_ENV` must name a block (12.7.0):** `getEnvironmentConfig()` throws on an empty `NODE_ENV` and on one without a
|
|
345
350
|
block in `config.env.ts` — before, both silently got the `local` block, which opens every local-only switch on a
|
|
346
351
|
deployed stage. Unset still means `local`; `NODE_ENV=test` under a test runner keeps the `local` block with a warning.
|
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-20 (v12.11.0)
|
|
4
4
|
> File: `FRAMEWORK-API.md` — compact, machine-readable API surface for Claude Code
|
|
5
5
|
|
|
6
6
|
## CoreModule.forRoot()
|
|
@@ -230,6 +230,7 @@ When `passkey` is enabled, `trustedOrigins` is required (compile-time enforcemen
|
|
|
230
230
|
- `ai?`: `{ budgetService?: Type<any>; connectionResolver?: Type<any>; connectionServic...` — Override AI module collaborators with project-specific subclasses.
|
|
231
231
|
- `betterAuth?`: `{ controller?: Type<any>; resolver?: Type<any>; }` — Override BetterAuth controller and/or resolver.
|
|
232
232
|
- `errorCode?`: `{ controller?: Type<any>; service?: Type<any>; }` — Override ErrorCode controller and/or service.
|
|
233
|
+
- `healthCheck?`: `{ readinessController?: Type<any>; service?: Type<any>; }` — Override the health check service and/or the readiness controller (12.11.0).
|
|
233
234
|
- `hub?`: `{ actionsController?: Type<any>; actionsService?: Type<any>; controller?: Typ...` — Override Hub controllers and/or services with project-specific subclasses.
|
|
234
235
|
|
|
235
236
|
### IBetterAuthPasskeyConfig
|
|
@@ -337,16 +337,19 @@ function getEnumName(enumObj) {
|
|
|
337
337
|
if (enumObj && typeof enumObj === 'object' && 'name' in enumObj && typeof enumObj.name === 'string') {
|
|
338
338
|
return enumObj.name;
|
|
339
339
|
}
|
|
340
|
-
if (typeof enumObj === 'function' && enumObj.name && enumObj
|
|
340
|
+
if (typeof enumObj === 'function' && enumObj.name && !isBuiltInConstructor(enumObj)) {
|
|
341
341
|
return enumObj.name;
|
|
342
342
|
}
|
|
343
343
|
if (enumObj && typeof enumObj === 'object') {
|
|
344
|
-
if (enumObj.constructor && enumObj.constructor.name && enumObj.constructor
|
|
344
|
+
if (enumObj.constructor && enumObj.constructor.name && !isBuiltInConstructor(enumObj.constructor)) {
|
|
345
345
|
return enumObj.constructor.name;
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
return undefined;
|
|
349
349
|
}
|
|
350
|
+
function isBuiltInConstructor(fn) {
|
|
351
|
+
return typeof fn === 'function' && !!fn.name && globalThis[fn.name] === fn;
|
|
352
|
+
}
|
|
350
353
|
function isGraphQLScalar(type) {
|
|
351
354
|
return ((type &&
|
|
352
355
|
typeof type === 'function' &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-field.decorator.js","sourceRoot":"","sources":["../../../../src/core/common/decorators/unified-field.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,SAAS,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,IAAI,EAAE,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AAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,eAAe,CAAC,IAAS;IAEhC,OAAO,CACL,CAAC,IAAI;QACH,OAAO,IAAI,KAAK,UAAU;QAC1B,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,KAAK,UAAU;QAC/C,OAAO,IAAI,CAAC,SAAS,EAAE,UAAU,KAAK,UAAU;QAChD,OAAO,IAAI,CAAC,SAAS,EAAE,YAAY,KAAK,UAAU,CAAC;QACrD,IAAI,YAAY,iBAAiB,CAClC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAO;IAC1B,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACtD,CAAC"}
|
|
1
|
+
{"version":3,"file":"unified-field.decorator.js","sourceRoot":"","sources":["../../../../src/core/common/decorators/unified-field.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,SAAS,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,cAAc,GAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAkB,MAAM,2BAA2B,CAAC;AASvE,OAAO,EAAE,kBAAkB,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/C,OAAO,IAAI,CAAC,SAAS,EAAE,UAAU,KAAK,UAAU;QAChD,OAAO,IAAI,CAAC,SAAS,EAAE,YAAY,KAAK,UAAU,CAAC;QACrD,IAAI,YAAY,iBAAiB,CAClC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAO;IAC1B,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -97,6 +97,33 @@ export function getEnvironmentConfig(options) {
|
|
|
97
97
|
console.info(`Configured for: ${envConfig.env}${env !== envConfig.env ? ` (requested: ${env})` : ''}`);
|
|
98
98
|
return envConfig;
|
|
99
99
|
}
|
|
100
|
+
function prepareEnvironmentValue(key, segment, value) {
|
|
101
|
+
if (typeof value !== 'string') {
|
|
102
|
+
return value;
|
|
103
|
+
}
|
|
104
|
+
const trimmed = value.trim();
|
|
105
|
+
const lower = trimmed.toLowerCase();
|
|
106
|
+
if (lower === 'true') {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
if (lower === 'false') {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (segment === 'enabled') {
|
|
113
|
+
if (trimmed === '1') {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
if (trimmed === '0') {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
throw new Error(`${key}="${value}" is not a switch value: write true or false (1 or 0 work too). ` +
|
|
120
|
+
'Before 12.11.0 any other text counted as switched on.');
|
|
121
|
+
}
|
|
122
|
+
if (!isNaN(Number(value))) {
|
|
123
|
+
return Number(value);
|
|
124
|
+
}
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
100
127
|
export function getEnvironmentObject(options) {
|
|
101
128
|
const config = {
|
|
102
129
|
prefix: 'NSC__',
|
|
@@ -107,6 +134,9 @@ export function getEnvironmentObject(options) {
|
|
|
107
134
|
Object.entries(config.processEnv)
|
|
108
135
|
.filter(([key]) => key.startsWith(config.prefix))
|
|
109
136
|
.forEach(([key, value]) => {
|
|
137
|
+
if (typeof value === 'string' && value.trim() === '') {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
110
140
|
const adjustedKey = key.slice(config.prefix?.length || 0);
|
|
111
141
|
const path = adjustedKey.split('__').map((part) => part
|
|
112
142
|
.split('_')
|
|
@@ -116,15 +146,7 @@ export function getEnvironmentObject(options) {
|
|
|
116
146
|
for (let i = 0; i < path.length; i++) {
|
|
117
147
|
const segment = path[i];
|
|
118
148
|
if (i === path.length - 1) {
|
|
119
|
-
|
|
120
|
-
value = true;
|
|
121
|
-
}
|
|
122
|
-
else if (value === 'false') {
|
|
123
|
-
value = false;
|
|
124
|
-
}
|
|
125
|
-
else if (!isNaN(Number(value))) {
|
|
126
|
-
value = Number(value);
|
|
127
|
-
}
|
|
149
|
+
value = prepareEnvironmentValue(key, segment, value);
|
|
128
150
|
current[segment] = value;
|
|
129
151
|
}
|
|
130
152
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/config.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAMrC,MAAM,CAAC,OAAO,OAAO,MAAM;IAelB,MAAM,CAAC,KAAK,CAAC,GAAwB,EAAE,GAAG,OAAc;QAC7D,OAAO,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAgBD,MAAM,UAAU,mBAAmB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