@lenne.tech/nest-server 12.4.0 → 12.5.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.
Files changed (35) hide show
  1. package/.claude/rules/configurable-features.md +1 -0
  2. package/.claude/rules/testing.md +4 -4
  3. package/FRAMEWORK-API.md +2 -1
  4. package/dist/core/common/helpers/config-endpoint.helper.d.ts +3 -0
  5. package/dist/core/common/helpers/config-endpoint.helper.js +17 -0
  6. package/dist/core/common/helpers/config-endpoint.helper.js.map +1 -0
  7. package/dist/core/common/helpers/redact-secrets.helper.d.ts +3 -0
  8. package/dist/core/common/helpers/redact-secrets.helper.js +72 -0
  9. package/dist/core/common/helpers/redact-secrets.helper.js.map +1 -0
  10. package/dist/core/common/interfaces/server-options.interface.d.ts +1 -0
  11. package/dist/core/common/services/config.service.d.ts +3 -0
  12. package/dist/core/common/services/config.service.js +17 -3
  13. package/dist/core/common/services/config.service.js.map +1 -1
  14. package/dist/core/modules/hub/core-hub.service.js +1 -13
  15. package/dist/core/modules/hub/core-hub.service.js.map +1 -1
  16. package/dist/core/modules/hub/helpers/hub-mask.helper.d.ts +1 -1
  17. package/dist/core/modules/hub/helpers/hub-mask.helper.js +1 -42
  18. package/dist/core/modules/hub/helpers/hub-mask.helper.js.map +1 -1
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +2 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/server/server.controller.d.ts +1 -1
  23. package/dist/server/server.controller.js +2 -2
  24. package/dist/server/server.controller.js.map +1 -1
  25. package/migration-guides/12.4.x-to-12.5.x.md +136 -0
  26. package/package.json +1 -1
  27. package/src/core/common/helpers/config-endpoint.helper.ts +56 -0
  28. package/src/core/common/helpers/redact-secrets.helper.ts +175 -0
  29. package/src/core/common/interfaces/server-options.interface.ts +20 -0
  30. package/src/core/common/services/config.service.ts +41 -3
  31. package/src/core/modules/hub/README.md +3 -1
  32. package/src/core/modules/hub/core-hub.service.ts +4 -20
  33. package/src/core/modules/hub/helpers/hub-mask.helper.ts +4 -92
  34. package/src/index.ts +2 -0
  35. package/src/server/server.controller.ts +7 -2
@@ -322,6 +322,7 @@ This pattern is currently applied to:
322
322
  | Response Model Interceptor | `security.responseModelInterceptor` | Boolean Shorthand | `true` (enabled), `debug: false` |
323
323
  | Translate Response Interceptor | `security.translateResponseInterceptor` | Boolean Shorthand | `true` (enabled) |
324
324
  | 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` |
325
+ | 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` |
325
326
  | 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`) |
326
327
  | 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) |
327
328
  | 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 |
@@ -410,7 +410,7 @@ pnpm run check:mutations -- --id=<id> # one mutation
410
410
  pnpm run check:mutations -- --list # the registry, without running anything
411
411
  pnpm run check:mutations -- --allow-dirty # when the fix and its evidence share a working tree
412
412
  pnpm run check:mutations -- --jobs=4 # N mutations at a time (default: 2, or 4 on >=12 cores)
413
- pnpm run check:mutations -- --no-infra # only the 321 that need no MongoDB
413
+ pnpm run check:mutations -- --no-infra # only the 331 that need no MongoDB
414
414
  pnpm run check:mutations -- --since=<ref> # only mutations touching files changed since <ref>
415
415
  pnpm run check:mutations -- --shard=2/4 # this job's quarter of the selection (CI splits the full run)
416
416
  ```
@@ -430,7 +430,7 @@ when the registry, a vitest config or a setup file changed, since those can move
430
430
  commit, and in CI alongside the publish without blocking it. The price of caching is a cache that
431
431
  has to model each spec's full dependency closure correctly, and getting that wrong produces a stale
432
432
  PASS for a test that has since gone vacuous — exactly what the gate is there to prevent. Bad trade
433
- at 543 mutations.
433
+ at 555 mutations.
434
434
 
435
435
  **Decided 2026-10-03 (repo owner): keep the full run.** Measured at 128 mutations, the CI job for
436
436
  11.41.6 took **14 minutes**. The trigger to revisit is that wall time, not the mutation count —
@@ -501,9 +501,9 @@ exactly the environment where the answer matters.
501
501
 
502
502
  ### The cost is vitest's cold start, not the tests
503
503
 
504
- Worth knowing before optimising the wrong thing: the specs behind all 222 e2e mutations add up to
504
+ Worth knowing before optimising the wrong thing: the specs behind all 224 e2e mutations add up to
505
505
  **~40 seconds**. The step takes ~740s. The remaining ~700s is paying vitest's startup — process
506
- spawn, transform, module graph, mongod connect, DB create and drop — once per mutation, 543 times.
506
+ spawn, transform, module graph, mongod connect, DB create and drop — once per mutation, 555 times.
507
507
  That work is largely single-threaded I/O and barely scales with cores: the full registry measures
508
508
  **744s on a 12-core laptop and 777s on a 4-vCPU CI runner**.
509
509
 
package/FRAMEWORK-API.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @lenne.tech/nest-server — Framework API Reference
2
2
 
3
- > Auto-generated from source code as of 2026-11-05 (v12.4.0)
3
+ > Auto-generated from source code as of 2026-11-05 (v12.5.0)
4
4
  > File: `FRAMEWORK-API.md` — compact, machine-readable API surface for Claude Code
5
5
 
6
6
  ## CoreModule.forRoot()
@@ -22,6 +22,7 @@
22
22
  - `bodyParser?`: `IBodyParserConfig` — Size limits for request bodies.
23
23
  - `brevo?`: `{ apiKey: string; exclude?: RegExp; maxRetries?: number; sender: { email: str...` — Configuration for Brevo
24
24
  - `compression?`: `boolean | compression.CompressionOptions` — Whether to use the compression middleware package to enable gzip compression.
25
+ - `configEndpoint?`: `boolean` (default: `undefined (answers only in `local`, `ci` and `e2e`)`) — Whether a project's `GET /config` may answer (12.5.0+). The route lives in project code (the starter's
25
26
  - `cookies?`: `boolean | ICookiesConfig` (default: `true`) — Cookie configuration for authentication handling.
26
27
  - `cors?`: `boolean | ICorsConfig` (default: `undefined (enabled with auto-derived origins)`) — CORS (Cross-Origin Resource Sharing) configuration.
27
28
  - `cronJobs?`: `Record<string, string | false | 0 | CronJobConfigWithTimeZone<null, null> | C...` — Cron jobs configuration object with the name of the cron job function as key
@@ -0,0 +1,3 @@
1
+ import type { IServerOptions } from '../interfaces/server-options.interface.js';
2
+ export declare function isConfigEndpointEnabled(config?: Partial<IServerOptions> | undefined): boolean;
3
+ export declare function configEndpointResponse(): Record<string, unknown>;
@@ -0,0 +1,17 @@
1
+ import { NotFoundException } from '@nestjs/common';
2
+ import { ConfigService } from '../services/config.service.js';
3
+ import { isLocalEnv } from './cookies.helper.js';
4
+ export function isConfigEndpointEnabled(config = ConfigService.configFastButReadOnly) {
5
+ const setting = config?.configEndpoint;
6
+ if (setting === true || setting === false) {
7
+ return setting;
8
+ }
9
+ return isLocalEnv(config?.env ?? process.env.NODE_ENV);
10
+ }
11
+ export function configEndpointResponse() {
12
+ if (!isConfigEndpointEnabled(ConfigService.configFastButReadOnly)) {
13
+ throw new NotFoundException();
14
+ }
15
+ return ConfigService.getRedactedConfig();
16
+ }
17
+ //# sourceMappingURL=config-endpoint.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-endpoint.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/config-endpoint.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAkBjD,MAAM,UAAU,uBAAuB,CACrC,SAA8C,aAAa,CAAC,qBAAqB;IAEjF,MAAM,OAAO,GAAG,MAAM,EAAE,cAAc,CAAC;IACvC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QAC1C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,UAAU,CAAC,MAAM,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACzD,CAAC;AAoBD,MAAM,UAAU,sBAAsB;IACpC,IAAI,CAAC,uBAAuB,CAAC,aAAa,CAAC,qBAAqB,CAAC,EAAE,CAAC;QAClE,MAAM,IAAI,iBAAiB,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,aAAa,CAAC,iBAAiB,EAAE,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const REDACTED_VALUE = "***";
2
+ export declare const FRAMEWORK_SECRET_FIELDS: readonly string[];
3
+ export declare function redactSecrets<T>(value: T, extraSecretKeys?: readonly string[]): T;
@@ -0,0 +1,72 @@
1
+ const SECRET_KEY_PATTERN = /secret|passwd|password|passphrase|credential|api[-_]?key|access[-_]?key|private[-_]?key|encryption|token|\bpass\b|pass$|dsn|salt|key$|(^|[^a-z])key([^a-z]|$)/i;
2
+ const URL_KEY_PATTERN = /(url|uri|endpoint|webhook)$/i;
3
+ const URI_PARTS_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/[^/?#]*)(.*)$/is;
4
+ const URI_USERINFO_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/).*@/is;
5
+ const URI_CREDENTIAL_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/[^/?#:]*:)([^/?#]*)(@[^@/?#]*)(?=[/?#]|$)/i;
6
+ const URI_QUERY_PARAM_PATTERN = /([?&])([^=&#\s]+)=([^&#\s]*)/g;
7
+ export const REDACTED_VALUE = '***';
8
+ export const FRAMEWORK_SECRET_FIELDS = [
9
+ 'password',
10
+ 'verificationToken',
11
+ 'passwordResetToken',
12
+ 'passwordResetTokenExpiresAt',
13
+ 'refreshTokens',
14
+ 'tempTokens',
15
+ 'apiKeyEncrypted',
16
+ ];
17
+ export function redactSecrets(value, extraSecretKeys = []) {
18
+ const extra = new Set(extraSecretKeys.filter((key) => typeof key === 'string').map((key) => key.toLowerCase()));
19
+ return redactValue(value, false, extra, '');
20
+ }
21
+ function isSecretKey(key, extra) {
22
+ return extra.has(key.toLowerCase()) || SECRET_KEY_PATTERN.test(key);
23
+ }
24
+ function redactUrl(value) {
25
+ const parts = value.match(URI_PARTS_PATTERN);
26
+ if (!parts) {
27
+ return redactString(value);
28
+ }
29
+ const authority = parts[1].replace(URI_USERINFO_PATTERN, `$1${REDACTED_VALUE}@`);
30
+ return parts[2] && parts[2] !== '/' ? `${authority}/${REDACTED_VALUE}` : `${authority}${parts[2]}`;
31
+ }
32
+ function redactString(value) {
33
+ if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(value)) {
34
+ return value;
35
+ }
36
+ const withoutUserPassword = value.replace(URI_CREDENTIAL_PATTERN, `$1${REDACTED_VALUE}$3`);
37
+ return withoutUserPassword.replace(URI_QUERY_PARAM_PATTERN, (match, separator, name) => SECRET_KEY_PATTERN.test(safeDecode(name)) ? `${separator}${name}=${REDACTED_VALUE}` : match);
38
+ }
39
+ function safeDecode(value) {
40
+ try {
41
+ return decodeURIComponent(value);
42
+ }
43
+ catch {
44
+ return value;
45
+ }
46
+ }
47
+ function redactValue(value, underSecretKey, extra, key) {
48
+ if (value === null || value === undefined) {
49
+ return value;
50
+ }
51
+ if (typeof value !== 'object') {
52
+ if (underSecretKey) {
53
+ return typeof value === 'boolean' ? value : REDACTED_VALUE;
54
+ }
55
+ if (typeof value !== 'string') {
56
+ return value;
57
+ }
58
+ return URL_KEY_PATTERN.test(key) ? redactUrl(value) : redactString(value);
59
+ }
60
+ if (value instanceof Date || Buffer.isBuffer(value)) {
61
+ return underSecretKey ? REDACTED_VALUE : value;
62
+ }
63
+ if (Array.isArray(value)) {
64
+ return value.map((item) => redactValue(item, underSecretKey, extra, key));
65
+ }
66
+ const out = {};
67
+ for (const [childKey, item] of Object.entries(value)) {
68
+ out[childKey] = redactValue(item, underSecretKey || isSecretKey(childKey, extra), extra, childKey);
69
+ }
70
+ return out;
71
+ }
72
+ //# sourceMappingURL=redact-secrets.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact-secrets.helper.js","sourceRoot":"","sources":["../../../../src/core/common/helpers/redact-secrets.helper.ts"],"names":[],"mappings":"AA8BA,MAAM,kBAAkB,GACtB,gKAAgK,CAAC;AAOnK,MAAM,eAAe,GAAG,8BAA8B,CAAC;AAGvD,MAAM,iBAAiB,GAAG,yCAAyC,CAAC;AAMpE,MAAM,oBAAoB,GAAG,gCAAgC,CAAC;AAc9D,MAAM,sBAAsB,GAAG,oEAAoE,CAAC;AAOpG,MAAM,uBAAuB,GAAG,+BAA+B,CAAC;AAGhE,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AAQpC,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,UAAU;IACV,mBAAmB;IACnB,oBAAoB;IACpB,6BAA6B;IAC7B,eAAe;IACf,YAAY;IACZ,iBAAiB;CAClB,CAAC;AAgBF,MAAM,UAAU,aAAa,CAAI,KAAQ,EAAE,kBAAqC,EAAE;IAChF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAChH,OAAO,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAM,CAAC;AACnD,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAE,KAAkB;IAClD,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtE,CAAC;AAM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AAC;AACb,CAAC"}
@@ -309,6 +309,7 @@ export interface IServerOptions {
309
309
  timeoutInSeconds?: number;
310
310
  };
311
311
  compression?: boolean | compression.CompressionOptions;
312
+ configEndpoint?: boolean;
312
313
  cookies?: boolean | ICookiesConfig;
313
314
  cors?: boolean | ICorsConfig;
314
315
  cronJobs?: Record<string, CronExpression | CronJobConfigWithTimeZone | CronJobConfigWithUtcOffset | Date | Falsy | string>;
@@ -22,6 +22,9 @@ export declare class ConfigService {
22
22
  static get configFastButReadOnly(): Partial<IServerOptions> & {
23
23
  [key: string]: any;
24
24
  };
25
+ getRedactedConfig(): Record<string, unknown>;
26
+ static getRedactedConfig(): Record<string, unknown>;
27
+ protected static redact(config: Record<string, any>): Record<string, unknown>;
25
28
  get<T = any>(key: string, defaultValue?: any): T;
26
29
  static get<T = any>(key: string, defaultValue?: any): T;
27
30
  getFastButReadOnly<T = any>(key: string, defaultValue?: any): T;
@@ -3,6 +3,7 @@ import { BehaviorSubject, firstValueFrom } from 'rxjs';
3
3
  import { filter, map } from 'rxjs/operators';
4
4
  import { merge } from '../helpers/config.helper.js';
5
5
  import { clone, deepFreeze } from '../helpers/clone.helper.js';
6
+ import { FRAMEWORK_SECRET_FIELDS, redactSecrets } from '../helpers/redact-secrets.helper.js';
6
7
  export class ConfigService {
7
8
  static _configSubject$ = new BehaviorSubject(undefined);
8
9
  static _frozenConfigSubject$ = new BehaviorSubject(undefined);
@@ -47,6 +48,19 @@ export class ConfigService {
47
48
  static get configFastButReadOnly() {
48
49
  return ConfigService._frozenConfigSubject$.getValue();
49
50
  }
51
+ getRedactedConfig() {
52
+ return ConfigService.getRedactedConfig();
53
+ }
54
+ static getRedactedConfig() {
55
+ return ConfigService.redact(ConfigService.configFastButReadOnly ?? {});
56
+ }
57
+ static redact(config) {
58
+ const projectSecretFields = config?.security?.secretFields;
59
+ return redactSecrets(config, [
60
+ ...FRAMEWORK_SECRET_FIELDS,
61
+ ...(Array.isArray(projectSecretFields) ? projectSecretFields : []),
62
+ ]);
63
+ }
50
64
  get(key, defaultValue = undefined) {
51
65
  return ConfigService.get(key, defaultValue);
52
66
  }
@@ -106,12 +120,12 @@ export class ConfigService {
106
120
  const merged = merge(ConfigService._configSubject$.getValue() || {}, _.cloneDeep(configData));
107
121
  ConfigService._configSubject$.next(merged);
108
122
  if (config.warn) {
109
- console.warn(`ConfigService ${activity}`, JSON.stringify(merged, null, 2));
123
+ console.warn(`ConfigService ${activity}`, JSON.stringify(ConfigService.redact(merged), null, 2));
110
124
  }
111
125
  return ConfigService.config;
112
126
  }
113
127
  mergeProperty(key, value, options) {
114
- return ConfigService.mergeProperty(key, options);
128
+ return ConfigService.mergeProperty(key, value, options);
115
129
  }
116
130
  static mergeProperty(key, value, options) {
117
131
  const config = {
@@ -155,7 +169,7 @@ export class ConfigService {
155
169
  if (firstInitialization || config.reInit) {
156
170
  ConfigService._configSubject$.next(configObject || {});
157
171
  if (config.warn && !firstInitialization) {
158
- console.warn('ConfigService reinitialized', JSON.stringify(configObject, null, 2));
172
+ console.warn('ConfigService reinitialized', JSON.stringify(ConfigService.redact(configObject || {}), null, 2));
159
173
  }
160
174
  }
161
175
  return ConfigService.config;
@@ -1 +1 @@
1
- {"version":3,"file":"config.service.js","sourceRoot":"","sources":["../../../../src/core/common/services/config.service.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAIpD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AA0B/D,MAAM,OAAO,aAAa;IAQd,MAAM,CAAC,eAAe,GAC9B,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC;IAKvB,MAAM,CAAC,qBAAqB,GACpC,IAAI,eAAe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CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;YAGvD,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBAExC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACjH,CAAC;QACH,CAAC;QAGD,OAAO,aAAa,CAAC,MAAM,CAAC;IAC9B,CAAC;IAKD,WAAW,CAAC,GAAW,EAAE,KAAU,EAAE,OAA4B;QAC/D,OAAO,aAAa,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAKD,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,KAAU,EAAE,OAA4B;QACtE,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,KAAK;YACX,GAAG,OAAO;SACX,CAAC;QAGF,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;YACjC,IAAI,aAAa,EAAE,CAAC;QACtB,CAAC;QAGD,MAAM,OAAO,GAAG,aAAa,CAAC,eAAe,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CAAC,iBAAiB,GAAG,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACxE,CAAC;QAGD,OAAO,aAAa,CAAC,MAAM,CAAC;IAC9B,CAAC"}
@@ -16,17 +16,7 @@ import { getBuildInfo } from '../../common/helpers/meta.helper.js';
16
16
  import { ConfigService } from '../../common/services/config.service.js';
17
17
  import { HUB_CONFIG } from './hub.constants.js';
18
18
  import { HUB_PANEL_GROUPS, HUB_PANELS } from './hub-nav.js';
19
- import { maskConfigDeep } from './helpers/hub-mask.helper.js';
20
19
  import { CoreHubSourcesService } from './services/core-hub-sources.service.js';
21
- const FRAMEWORK_SECRET_FIELDS = [
22
- 'password',
23
- 'verificationToken',
24
- 'passwordResetToken',
25
- 'passwordResetTokenExpiresAt',
26
- 'refreshTokens',
27
- 'tempTokens',
28
- 'apiKeyEncrypted',
29
- ];
30
20
  const MONGO_STATES = {
31
21
  0: 'disconnected',
32
22
  1: 'connected',
@@ -82,9 +72,7 @@ let CoreHubService = class CoreHubService {
82
72
  };
83
73
  }
84
74
  getConfigMasked() {
85
- const raw = this.configService.configFastButReadOnly;
86
- const projectSecretFields = this.configService.get('security.secretFields', []) ?? [];
87
- return maskConfigDeep(raw, [...FRAMEWORK_SECRET_FIELDS, ...projectSecretFields]);
75
+ return this.configService.getRedactedConfig();
88
76
  }
89
77
  getResolvedConfig() {
90
78
  return this.config;
@@ -1 +1 @@
1
- {"version":3,"file":"core-hub.service.js","sourceRoot":"","sources":["../../../../src/core/modules/hub/core-hub.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAGrF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAQ/E,MAAM,uBAAuB,GAAG;IAC9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,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC1C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;gBAC7D,OAAO,KAAK,CAAC;YACf,CAAC;YACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,OAAQ,KAA+B,CAAC,OAAO,KAAK,KAAK,CAAC;YAC5D,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;QAEF,OAAO;YACL,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC;YAGb,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE;YAC7C,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,KAAK;YACpD,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,KAAK;YACpD,WAAW,EAAE,GAAG,CAAC,aAAa,CAAC;YAC/B,YAAY,EAAE,GAAG,CAAC,cAAc,CAAC;YACjC,WAAW,EAAE,GAAG,CAAC,aAAa,CAAC;YAC/B,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC;SAChB,CAAC;IACJ,CAAC;CACF,CAAA;AA7HY,cAAc;IAD1B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAGlB,WAAA,QAAQ,EAAE,CAAA;IAAE,WAAA,gBAAgB,EAAE,CAAA;6CAFG,aAAa;QACnB,qBAAqB;GAJxC,cAAc,CA6H1B"}
@@ -1 +1 @@
1
- export declare function maskConfigDeep<T>(value: T, extraSecretKeys?: string[]): T;
1
+ export { redactSecrets as maskConfigDeep } from '../../../common/helpers/redact-secrets.helper.js';
@@ -1,43 +1,2 @@
1
- const SECRET_KEY_PATTERN = /secret|passwd|password|passphrase|credential|api[-_]?key|access[-_]?key|access[-_]?token|refresh[-_]?token|private[-_]?key|encryption|\btoken\b|\bpass\b|(^|[^a-z])key([^a-z]|$)/i;
2
- const URI_CREDENTIAL_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/[^/@:\s]*:)([^@/\s]+)(@)/i;
3
- const MASK = '***';
4
- export function maskConfigDeep(value, extraSecretKeys = []) {
5
- const extra = new Set(extraSecretKeys.map((k) => k.toLowerCase()));
6
- return maskValue(value, false, extra);
7
- }
8
- function isSecretKey(key, extra) {
9
- return extra.has(key.toLowerCase()) || SECRET_KEY_PATTERN.test(key);
10
- }
11
- function maskString(value) {
12
- const uriMatch = value.match(URI_CREDENTIAL_PATTERN);
13
- if (uriMatch) {
14
- return value.replace(URI_CREDENTIAL_PATTERN, `$1${MASK}$3`);
15
- }
16
- return value;
17
- }
18
- function maskValue(value, keyIsSecret, extra) {
19
- if (value === null || value === undefined) {
20
- return value;
21
- }
22
- if (typeof value !== 'object') {
23
- if (keyIsSecret) {
24
- return MASK;
25
- }
26
- return typeof value === 'string' ? maskString(value) : value;
27
- }
28
- if (keyIsSecret) {
29
- return MASK;
30
- }
31
- if (value instanceof Date || Buffer.isBuffer(value)) {
32
- return value;
33
- }
34
- if (Array.isArray(value)) {
35
- return value.map((item) => maskValue(item, false, extra));
36
- }
37
- const out = {};
38
- for (const [key, val] of Object.entries(value)) {
39
- out[key] = maskValue(val, isSecretKey(key, extra), extra);
40
- }
41
- return out;
42
- }
1
+ export { redactSecrets as maskConfigDeep } from '../../../common/helpers/redact-secrets.helper.js';
43
2
  //# sourceMappingURL=hub-mask.helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hub-mask.helper.js","sourceRoot":"","sources":["../../../../../src/core/modules/hub/helpers/hub-mask.helper.ts"],"names":[],"mappings":"AAeA,MAAM,kBAAkB,GACtB,mLAAmL,CAAC;AActL,MAAM,sBAAsB,GAAG,mDAAmD,CAAC;AAEnF,MAAM,IAAI,GAAG,KAAK,CAAC;AAYnB,MAAM,UAAU,cAAc,CAAI,KAAQ,EAAE,kBAA4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;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;QAC1E,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"hub-mask.helper.js","sourceRoot":"","sources":["../../../../../src/core/modules/hub/helpers/hub-mask.helper.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,kDAAkD,CAAC"}
package/dist/index.d.ts CHANGED
@@ -25,6 +25,7 @@ export * from './core/common/filters/http-exception-log.filter.js';
25
25
  export * from './core/common/filters/mongoose-cast-error.filter.js';
26
26
  export * from './core/common/helpers/common.helper.js';
27
27
  export * from './core/common/helpers/config.helper.js';
28
+ export * from './core/common/helpers/config-endpoint.helper.js';
28
29
  export * from './core/common/helpers/content-disposition.helper.js';
29
30
  export * from './core/common/helpers/context.helper.js';
30
31
  export * from './core/common/helpers/cookies.helper.js';
@@ -45,6 +46,7 @@ export * from './core/common/helpers/meta.helper.js';
45
46
  export * from './core/common/helpers/model.helper.js';
46
47
  export * from './core/common/helpers/outbound-url.helper.js';
47
48
  export * from './core/common/helpers/process-diagnostics.helper.js';
49
+ export * from './core/common/helpers/redact-secrets.helper.js';
48
50
  export * from './core/common/helpers/register-enum.helper.js';
49
51
  export * from './core/common/helpers/scim.helper.js';
50
52
  export * from './core/common/helpers/service.helper.js';
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ export * from './core/common/filters/http-exception-log.filter.js';
24
24
  export * from './core/common/filters/mongoose-cast-error.filter.js';
25
25
  export * from './core/common/helpers/common.helper.js';
26
26
  export * from './core/common/helpers/config.helper.js';
27
+ export * from './core/common/helpers/config-endpoint.helper.js';
27
28
  export * from './core/common/helpers/content-disposition.helper.js';
28
29
  export * from './core/common/helpers/context.helper.js';
29
30
  export * from './core/common/helpers/cookies.helper.js';
@@ -44,6 +45,7 @@ export * from './core/common/helpers/meta.helper.js';
44
45
  export * from './core/common/helpers/model.helper.js';
45
46
  export * from './core/common/helpers/outbound-url.helper.js';
46
47
  export * from './core/common/helpers/process-diagnostics.helper.js';
48
+ export * from './core/common/helpers/redact-secrets.helper.js';
47
49
  export * from './core/common/helpers/register-enum.helper.js';
48
50
  export * from './core/common/helpers/scim.helper.js';
49
51
  export * from './core/common/helpers/service.helper.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AAKjC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wDAAwD,CAAC;AACvE,cAAc,+DAA+D,CAAC;AAC9E,cAAc,oDAAoD,CAAC;AACnE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,iDAAiD,CAAC;AAChE,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc,qDAAqD,CAAC;AACpE,cAAc,iDAAiD,CAAC;AAChE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,kCAAkC,CAAC;AACjD,cAAc,w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CAAyC,CAAC;AACxD,cAAc,iDAAiD,CAAC;AAChE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wDAAwD,CAAC;AACvE,cAAc,oDAAoD,CAAC;AAMnE,cAAc,6BAA6B,CAAC;AAM5C,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mDAAmD,CAAC;AAClE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAM7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sDAAsD,CAAC;AACrE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uEAAuE,CAAC;AAMtF,cAAc,uBAAuB,CAAC"}
@@ -5,5 +5,5 @@ export declare class ServerController {
5
5
  root(): {
6
6
  env: any;
7
7
  };
8
- config(): any;
8
+ config(): Record<string, unknown>;
9
9
  }
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { Controller, Get, Render } from '@nestjs/common';
11
- import { ConfigService, RoleEnum, Roles } from '../index.js';
11
+ import { ConfigService, configEndpointResponse, RoleEnum, Roles } from '../index.js';
12
12
  let ServerController = class ServerController {
13
13
  configService;
14
14
  constructor(configService) {
@@ -20,7 +20,7 @@ let ServerController = class ServerController {
20
20
  };
21
21
  }
22
22
  config() {
23
- return JSON.parse(JSON.stringify(this.configService.configFastButReadOnly));
23
+ return configEndpointResponse();
24
24
  }
25
25
  };
26
26
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"server.controller.js","sourceRoot":"","sources":["../../src/server/server.controller.ts"],"names":[],"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OAAO;YACL,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC;IASD,MAAM;QACJ,OAAO,sBAAsB,EAAE,CAAC;IAClC,CAAC;CACF,CAAA;AAhBC;IAHC,GAAG,EAAE;IACL,MAAM,CAAC,OAAO,CAAC;IACf,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;;;;4CAK1B;AASD;IAFC,GAAG,CAAC,QAAQ,CAAC;IACb,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;;;;8CAGrB;AArBU,gBAAgB;IAF5B,UAAU,EAAE;IACZ,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;qCAEiB,aAAa;GADvC,gBAAgB,CAsB5B"}
@@ -0,0 +1,136 @@
1
+ # Migration Guide: 12.4.x → 12.5.x
2
+
3
+ ## 12.5.0 contains breaking changes
4
+
5
+ The version number moves only the MINOR digit (the MAJOR follows NestJS). Read §1 before you update: a project's
6
+ `GET /config` answers 404 in deployed environments from now on — once the project's controller uses the core's
7
+ `configEndpointResponse()`, which this guide asks for.
8
+
9
+ ## Overview
10
+
11
+ | Category | Details |
12
+ |---|---|
13
+ | **Breaking Changes** | `GET /config` via `configEndpointResponse()` answers only in `local`, `ci` and `e2e` unless `configEndpoint` opens it, and always redacted (§1) |
14
+ | **New Features** | `redactSecrets()`, `ConfigService.getRedactedConfig()`, `configEndpointResponse()`, `isConfigEndpointEnabled()`, the `configEndpoint` setting (§1) |
15
+ | **Bugfixes** | `GET /config` of a project created before the starter redacted returned every secret of the deployment to administrators (§1). The `ConfigService` debug output (`warn: true`) printed the configuration unredacted (§2). `ConfigService#mergeProperty(key, value)` merged nothing (§3) |
16
+ | **Migration Effort** | One line in the project's `ServerController` (§1). Nothing else |
17
+
18
+ ## Quick Migration
19
+
20
+ ```bash
21
+ pnpm add @lenne.tech/nest-server@12.5.0
22
+ pnpm run update # nest-server-starter based projects: aligns the pins the framework raised
23
+ pnpm run build
24
+ pnpm test
25
+ ```
26
+
27
+ **Vendor mode**: run `/lt-dev:backend:update-nest-server-core` as usual, then apply §1 to `src/server/server.controller.ts`.
28
+
29
+ ## 1. `GET /config`: redacted by the core, closed in deployed environments
30
+
31
+ The route lives in project code — the starter's `ServerController`. Until the starter redacted it (October 2026) it
32
+ returned `configFastButReadOnly` as it is: the database URI with its password, the JWT and Better-Auth secrets, the
33
+ mail password, API keys. Every project created before that still does, and an administrator account — or a stolen
34
+ administrator session — was enough to read them.
35
+
36
+ **What the core now provides:**
37
+
38
+ - `redactSecrets(value, extraSecretKeys?)` — the framework's one masker (moved from the Hub, where it stays available
39
+ as `maskConfigDeep`). It masks by key name — `secret`, `password`, `token` and `credential` anywhere in the name,
40
+ names ending in `pass` or `key` (`smtpPass`, `signingKey`), `encryption`, `dsn`, `salt`, … — masks the password of a
41
+ connection URI and every secret-named query parameter of a URI, keeps only scheme, host and port of an address under
42
+ a key ending in `url`, `uri`, `endpoint` or `webhook` (a webhook carries its secret in the path), works through nested
43
+ values, and masks EVERYTHING below a secret-named key except booleans.
44
+ - `ConfigService.getRedactedConfig()` — the running configuration through `redactSecrets()`, with the framework's
45
+ secret fields and your `security.secretFields`. The Hub config panel shows the same view.
46
+ - `configEndpointResponse()` — the body of `GET /config`: the redacted configuration, or a 404 where the endpoint is
47
+ closed.
48
+ - `configEndpoint` — whether it answers:
49
+
50
+ | `configEndpoint` | `local` / `ci` / `e2e` | every other environment (`develop`, `test`, `production`, …) |
51
+ |---|---|---|
52
+ | not set | answers | **404** |
53
+ | `true` | answers | answers |
54
+ | `false` | 404 | 404 |
55
+
56
+ A value that is not a boolean counts as not set. Environment variable: `NSC__CONFIG_ENDPOINT=true`.
57
+
58
+ **What to do** — in `src/server/server.controller.ts`, replace the body of the `config()` handler:
59
+
60
+ ```typescript
61
+ // Before (verbatim configuration, or the starter's own redact-secrets.util.ts)
62
+ @Get('config')
63
+ @Roles(RoleEnum.ADMIN)
64
+ config() {
65
+ return JSON.parse(JSON.stringify(this.configService.configFastButReadOnly));
66
+ }
67
+
68
+ // After
69
+ import { configEndpointResponse } from '@lenne.tech/nest-server';
70
+
71
+ @Get('config')
72
+ @Roles(RoleEnum.ADMIN)
73
+ config() {
74
+ return configEndpointResponse();
75
+ }
76
+ ```
77
+
78
+ A starter-based project that already redacts with `src/server/common/utils/redact-secrets.util.ts` can delete that
79
+ file: the core's key pattern is a superset of that util's, and the core also masks what the util let through (values
80
+ nested below a secret-named key, a password passed as a URI query parameter). One difference you will see: the util
81
+ blanked a whole URL, the core keeps its scheme, host and port.
82
+
83
+ **Who calls `/config`?** No frontend or script of the lenne.Tech stack does; it is an administrator's debugging aid.
84
+ **If your project's own admin UI or tooling reads `/config` on a deployed stage, switch it back on there explicitly:**
85
+
86
+ ```bash
87
+ NSC__CONFIG_ENDPOINT=true # or configEndpoint: true in config.env.ts for that environment
88
+ ```
89
+
90
+ The endpoint then answers in that environment again, and the answer stays redacted: secret values read `***`, every
91
+ other setting is unchanged. An admin UI that displayed secrets from `/config` gets `***` for them from now on — that is
92
+ the point of this change.
93
+
94
+ **The status codes:** without a session the route's `@Roles(ADMIN)` still answers 401; an administrator gets 404
95
+ where the endpoint is closed, so it reads like a route that does not exist.
96
+
97
+ ## 2. The `ConfigService` debug output is redacted
98
+
99
+ `new ConfigService(config, { warn: true })`, `mergeConfig(…, { warn: true })` and `setConfig(…, { warn: true })` print
100
+ the merged configuration — an opt-in debugging aid since 12.0.0. That output now goes through the same redaction, so
101
+ a debug session no longer writes the deployment's secrets to a log.
102
+
103
+ ## 3. `ConfigService#mergeProperty(key, value)` merges the value
104
+
105
+ The instance method forwarded its `options` in place of `value` to the static one, so it merged `undefined`. It now
106
+ merges the value as its signature says. `ConfigService.mergeProperty()` (static) was not affected.
107
+
108
+ ## Compatibility Notes
109
+
110
+ | Pattern | Status |
111
+ |---|---|
112
+ | A `ServerController` returning `configFastButReadOnly` | Still unredacted until you apply §1 — the core cannot reach a route in project code |
113
+ | `configEndpointResponse()` in `local` / `ci` / `e2e` | Answers as before, redacted |
114
+ | E2E suites reading `/config` (`NODE_ENV=e2e`) | Unchanged, apart from masked secret values |
115
+ | `maskConfigDeep` (Hub) | Still exported, now the same function as `redactSecrets` — values below a secret-named key keep their structure (masked) and booleans stay visible |
116
+ | Health check, `/meta`, error responses | Unchanged — they carry no configuration |
117
+
118
+ ## Troubleshooting
119
+
120
+ | Symptom | Cause | Fix |
121
+ |---|---|---|
122
+ | `GET /config` answers 404 for an administrator | Deployed environment without `configEndpoint` | `NSC__CONFIG_ENDPOINT=true` on that stage, if you need it |
123
+ | A value you need reads `***` | Its key matches a secret pattern | Read it from the environment of the deployment; `/config` never shows secrets |
124
+ | A secret under an unusual key appears in plain text | No pattern matches it | Add the key to `security.secretFields` |
125
+
126
+ ## Module Documentation
127
+
128
+ - [Hub README](../src/core/modules/hub/README.md) — the config panel uses the same redaction
129
+ - `.claude/rules/configurable-features.md` — "Config Endpoint" row
130
+
131
+ ## References
132
+
133
+ - `src/core/common/helpers/redact-secrets.helper.ts` — `redactSecrets()`, `FRAMEWORK_SECRET_FIELDS`
134
+ - `src/core/common/helpers/config-endpoint.helper.ts` — `isConfigEndpointEnabled()`, `configEndpointResponse()`
135
+ - `src/core/common/services/config.service.ts` — `getRedactedConfig()`
136
+ - `src/server/server.controller.ts` — the reference controller
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/nest-server",
3
- "version": "12.4.0",
3
+ "version": "12.5.0",
4
4
  "type": "module",
5
5
  "description": "Server framework in TypeScript on top of NestJS: GraphQL and REST APIs on MongoDB, PostgreSQL, MySQL or MariaDB, with authentication, field-level permissions, multi-tenancy, offline sync and an AI assistant.",
6
6
  "keywords": [
@@ -0,0 +1,56 @@
1
+ import { NotFoundException } from '@nestjs/common';
2
+
3
+ import type { IServerOptions } from '../interfaces/server-options.interface.js';
4
+ import { ConfigService } from '../services/config.service.js';
5
+ import { isLocalEnv } from './cookies.helper.js';
6
+
7
+ /**
8
+ * Whether a project's `GET /config` may answer (`configEndpoint`, 12.5.0+).
9
+ *
10
+ * | `configEndpoint` | `local` / `ci` / `e2e` | every other environment (`develop`, `test`, `production`, …) |
11
+ * |------------------|------------------------|---------------------------------------------------------------|
12
+ * | not set | answers | **404** |
13
+ * | `true` | answers | answers |
14
+ * | `false` | 404 | 404 |
15
+ *
16
+ * Answering always means the REDACTED configuration ({@link configEndpointResponse}). A value that is not a boolean
17
+ * (the string `'true'` from `NEST_SERVER_CONFIG`) counts as not set, so a string cannot open the endpoint by
18
+ * truthiness. The environment is the configured `env`, else `NODE_ENV`, compared with {@link isLocalEnv}.
19
+ *
20
+ * @param config - defaults to the running configuration
21
+ * @since 12.5.0
22
+ */
23
+ export function isConfigEndpointEnabled(
24
+ config: Partial<IServerOptions> | undefined = ConfigService.configFastButReadOnly,
25
+ ): boolean {
26
+ const setting = config?.configEndpoint;
27
+ if (setting === true || setting === false) {
28
+ return setting;
29
+ }
30
+ return isLocalEnv(config?.env ?? process.env.NODE_ENV);
31
+ }
32
+
33
+ /**
34
+ * The body of a project's `GET /config`: the redacted configuration, or a 404 where `configEndpoint` keeps the
35
+ * endpoint closed ({@link isConfigEndpointEnabled}).
36
+ *
37
+ * 404 rather than 403, so a closed endpoint reads like one that does not exist. The route's own `@Roles(ADMIN)`
38
+ * still runs first, so an anonymous caller keeps getting 401.
39
+ *
40
+ * ```typescript
41
+ * @Get('config')
42
+ * @Roles(RoleEnum.ADMIN)
43
+ * config() {
44
+ * return configEndpointResponse();
45
+ * }
46
+ * ```
47
+ *
48
+ * @throws NotFoundException when the endpoint is closed in this environment
49
+ * @since 12.5.0
50
+ */
51
+ export function configEndpointResponse(): Record<string, unknown> {
52
+ if (!isConfigEndpointEnabled(ConfigService.configFastButReadOnly)) {
53
+ throw new NotFoundException();
54
+ }
55
+ return ConfigService.getRedactedConfig();
56
+ }
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Recursive, non-mutating secret redaction for configuration objects and anything shaped like them.
3
+ *
4
+ * The framework's ONE masker: `GET /config` (`configEndpointResponse()`), the Hub config panel and the
5
+ * `ConfigService` debug output all go through it, so they cannot drift apart. It moved here from the Hub
6
+ * (`hub-mask.helper.ts`, which re-exports it as `maskConfigDeep`) in 12.5.0.
7
+ *
8
+ * CRITICAL: this deep-clones before masking. A response must never be handed a live, service-owned object —
9
+ * `CheckSecurityInterceptor` deletes secret-named keys IN PLACE, which would corrupt the running server config.
10
+ * Cloning here is the guarantee.
11
+ *
12
+ * It errs towards masking: a value that only looks secret costs an operator a look into the environment, a
13
+ * missed secret costs the platform.
14
+ *
15
+ * @since 12.5.0 (as `maskConfigDeep` in the Hub since 11.x)
16
+ */
17
+
18
+ /**
19
+ * Key-name heuristics that mark a value as secret. Matched case-insensitively against each key.
20
+ *
21
+ * A SUPERSET of the pattern the nest-server-starter used before 12.5.0 (`token`, `pass$`, `key$`, `salt`, `dsn`, …), so
22
+ * a project that swaps its own masker for this one loses nothing. Compound names are what makes that matter:
23
+ * `\btoken\b` misses `botToken` and `GITHUB_TOKEN` (letters and `_` are both word characters, so there is no boundary
24
+ * inside them), `\bpass\b` misses `smtpPass`, and `(^|[^a-z])key…` misses `signingKey` (the `i` flag makes `[^a-z]`
25
+ * reject the uppercase `K`). Hence the unanchored `token`, `pass$` and `key$`.
26
+ *
27
+ * `access[-_]?key` covers `accessKeyId`, which neither `key$` nor the bounded `key` alternative reaches. The cost of
28
+ * the broad forms is a few masked non-secrets (`passkey`, `tokenExpiresInMinutes`): the module errs towards masking,
29
+ * and booleans below such a key stay visible.
30
+ */
31
+ const SECRET_KEY_PATTERN =
32
+ /secret|passwd|password|passphrase|credential|api[-_]?key|access[-_]?key|private[-_]?key|encryption|token|\bpass\b|pass$|dsn|salt|key$|(^|[^a-z])key([^a-z]|$)/i;
33
+
34
+ /**
35
+ * Keys whose value is an address that can carry a secret in its PATH (a Slack or Teams webhook,
36
+ * `https://hooks.slack.com/services/T…/B…/<secret>`) or anywhere in its query. Such a value keeps scheme, host and port —
37
+ * what an operator needs to tell where it points — and loses the rest.
38
+ */
39
+ const URL_KEY_PATTERN = /(url|uri|endpoint|webhook)$/i;
40
+
41
+ /** `scheme://authority` and whatever follows (path, query, fragment). The authority may hold spaces (a password can) */
42
+ const URI_PARTS_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/[^/?#]*)(.*)$/is;
43
+
44
+ /**
45
+ * The whole user info of an authority, up to its LAST `@`: under a URL-named key a token is often the user itself
46
+ * (`https://<pat>@github.com`, `https://<key>@o0.ingest.sentry.io`), so not only a password goes.
47
+ */
48
+ const URI_USERINFO_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/).*@/is;
49
+
50
+ /**
51
+ * Value-shape heuristic: a connection URI carrying `scheme://user:password@host`.
52
+ *
53
+ * The user part is `*`, not `+`, so the PASSWORD-ONLY form is matched too:
54
+ * `redis://:password@host` is the canonical Redis URL (Redis < 6 has no username, and
55
+ * `redis-cli -u`, Heroku Redis and ElastiCache AUTH all emit it).
56
+ *
57
+ * The user may contain `@` (a mail login is an e-mail address: `smtps://noreply@example.com:pw@smtp.example.com`) and
58
+ * the password `@` or spaces (`pg`, ioredis and the MongoDB driver accept them unencoded): the password runs to the LAST
59
+ * `@` before the path, query or end. Still safe against false positives: `http://host:8080/x@y`,
60
+ * `https://user@host:443/p` and `https://host/?a=b@c` do not match — the `@` must sit inside the authority.
61
+ */
62
+ const URI_CREDENTIAL_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/[^/?#:]*:)([^/?#]*)(@[^@/?#]*)(?=[/?#]|$)/i;
63
+
64
+ /**
65
+ * A query parameter of a URI-shaped value (`?password=…`, `&sslpassword=…`, `&token=…`). Its value is masked when
66
+ * the parameter name is secret by {@link SECRET_KEY_PATTERN}: a PostgreSQL or MongoDB URL can carry a password there
67
+ * instead of in the user info.
68
+ */
69
+ const URI_QUERY_PARAM_PATTERN = /([?&])([^=&#\s]+)=([^&#\s]*)/g;
70
+
71
+ /** What a masked value reads as */
72
+ export const REDACTED_VALUE = '***';
73
+
74
+ /**
75
+ * Field names the framework treats as secret wherever they appear, whatever the key pattern says (the defaults of
76
+ * `security.secretFields`, see `CheckSecurityInterceptor`).
77
+ *
78
+ * @since 12.5.0
79
+ */
80
+ export const FRAMEWORK_SECRET_FIELDS: readonly string[] = [
81
+ 'password',
82
+ 'verificationToken',
83
+ 'passwordResetToken',
84
+ 'passwordResetTokenExpiresAt',
85
+ 'refreshTokens',
86
+ 'tempTokens',
87
+ 'apiKeyEncrypted',
88
+ ];
89
+
90
+ /**
91
+ * Deep-clone `value` and mask every secret it contains.
92
+ *
93
+ * - A value whose key matches {@link SECRET_KEY_PATTERN} or appears in `extraSecretKeys` is masked. Below such a key
94
+ * EVERYTHING is masked — a nested object is never a way around it — except booleans, which carry no secret and
95
+ * keep flags such as `emailAndPassword.disableSignUp` readable.
96
+ * - A string shaped like a connection URI has the password of its user info masked, and every secret-named query
97
+ * parameter, whatever its key is called.
98
+ * - `null` and `undefined` pass through; a `Date` or `Buffer` is kept as it is (masked under a secret key).
99
+ *
100
+ * @param value - the object or value to mask (never mutated)
101
+ * @param extraSecretKeys - additional exact key names to always mask (e.g. `security.secretFields`)
102
+ * @since 12.5.0
103
+ */
104
+ export function redactSecrets<T>(value: T, extraSecretKeys: readonly string[] = []): T {
105
+ const extra = new Set(extraSecretKeys.filter((key) => typeof key === 'string').map((key) => key.toLowerCase()));
106
+ return redactValue(value, false, extra, '') as T;
107
+ }
108
+
109
+ function isSecretKey(key: string, extra: Set<string>): boolean {
110
+ return extra.has(key.toLowerCase()) || SECRET_KEY_PATTERN.test(key);
111
+ }
112
+
113
+ /**
114
+ * A URI-shaped value of a URL-named key: scheme, host and port stay; the whole user info and everything after the
115
+ * authority are replaced
116
+ */
117
+ function redactUrl(value: string): string {
118
+ const parts = value.match(URI_PARTS_PATTERN);
119
+ if (!parts) {
120
+ return redactString(value);
121
+ }
122
+ const authority = parts[1].replace(URI_USERINFO_PATTERN, `$1${REDACTED_VALUE}@`);
123
+ return parts[2] && parts[2] !== '/' ? `${authority}/${REDACTED_VALUE}` : `${authority}${parts[2]}`;
124
+ }
125
+
126
+ function redactString(value: string): string {
127
+ if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(value)) {
128
+ return value;
129
+ }
130
+ const withoutUserPassword = value.replace(URI_CREDENTIAL_PATTERN, `$1${REDACTED_VALUE}$3`);
131
+ return withoutUserPassword.replace(URI_QUERY_PARAM_PATTERN, (match, separator: string, name: string) =>
132
+ SECRET_KEY_PATTERN.test(safeDecode(name)) ? `${separator}${name}=${REDACTED_VALUE}` : match,
133
+ );
134
+ }
135
+
136
+ function safeDecode(value: string): string {
137
+ try {
138
+ return decodeURIComponent(value);
139
+ } catch {
140
+ return value;
141
+ }
142
+ }
143
+
144
+ function redactValue(value: unknown, underSecretKey: boolean, extra: Set<string>, key: string): unknown {
145
+ if (value === null || value === undefined) {
146
+ return value;
147
+ }
148
+
149
+ // Primitives
150
+ if (typeof value !== 'object') {
151
+ if (underSecretKey) {
152
+ return typeof value === 'boolean' ? value : REDACTED_VALUE;
153
+ }
154
+ if (typeof value !== 'string') {
155
+ return value;
156
+ }
157
+ return URL_KEY_PATTERN.test(key) ? redactUrl(value) : redactString(value);
158
+ }
159
+
160
+ // Non-plain objects (Date, Buffer) are kept as they are — cloning would lose their type, and they carry no framework
161
+ // secret — unless they sit below a secret key
162
+ if (value instanceof Date || Buffer.isBuffer(value)) {
163
+ return underSecretKey ? REDACTED_VALUE : value;
164
+ }
165
+
166
+ if (Array.isArray(value)) {
167
+ return value.map((item) => redactValue(item, underSecretKey, extra, key));
168
+ }
169
+
170
+ const out: Record<string, unknown> = {};
171
+ for (const [childKey, item] of Object.entries(value as Record<string, unknown>)) {
172
+ out[childKey] = redactValue(item, underSecretKey || isSecretKey(childKey, extra), extra, childKey);
173
+ }
174
+ return out;
175
+ }
@@ -2603,6 +2603,26 @@ export interface IServerOptions {
2603
2603
  */
2604
2604
  compression?: boolean | compression.CompressionOptions;
2605
2605
 
2606
+ /**
2607
+ * Whether a project's `GET /config` may answer (12.5.0+). The route lives in project code (the starter's
2608
+ * `ServerController`) and asks `configEndpointResponse()`, which decides with `isConfigEndpointEnabled()`.
2609
+ *
2610
+ * | Value | `local` / `ci` / `e2e` | every other environment (`develop`, `test`, `production`, …) |
2611
+ * |-------|------------------------|---------------------------------------------------------------|
2612
+ * | not set | answers | **404** |
2613
+ * | `true` | answers | answers |
2614
+ * | `false` | 404 | 404 |
2615
+ *
2616
+ * The answer is ALWAYS the redacted configuration (`ConfigService.getRedactedConfig()`): before 12.5.0 the
2617
+ * starter's endpoint returned the database URI, the auth secrets and the mail password to every administrator,
2618
+ * and a project created before the starter redacted kept doing so. A value that is not a boolean counts as not
2619
+ * set. Environment variable: `NSC__CONFIG_ENDPOINT=true`.
2620
+ *
2621
+ * @default undefined (answers only in `local`, `ci` and `e2e`)
2622
+ * @since 12.5.0
2623
+ */
2624
+ configEndpoint?: boolean;
2625
+
2606
2626
  /**
2607
2627
  * Cookie configuration for authentication handling.
2608
2628
  *
@@ -7,6 +7,7 @@ import { merge } from '../helpers/config.helper.js';
7
7
  // restricted.decorator, which reaches back here via core-tenant.helpers — that cycle is what the
8
8
  // extraction removed. See clone.helper's docblock.
9
9
  import { clone, deepFreeze } from '../helpers/clone.helper.js';
10
+ import { FRAMEWORK_SECRET_FIELDS, redactSecrets } from '../helpers/redact-secrets.helper.js';
10
11
  import { IServerOptions } from '../interfaces/server-options.interface.js';
11
12
 
12
13
  /**
@@ -65,6 +66,7 @@ export class ConfigService {
65
66
  * aid, and an opt-in since 12.0.0 like it always was for `setConfig()` / `mergeConfig()`. As the default it
66
67
  * wrote every secret in the config (JWT and Better-Auth secrets, database and Redis URIs, API keys) to
67
68
  * stdout whenever `CoreModule.forRoot()` ran a second time in one process: tests, scripts, a second app.
69
+ * Since 12.5.0 the printed configuration is redacted (`redactSecrets()`).
68
70
  */
69
71
  constructor(
70
72
  configObject?: Partial<IServerOptions> & { [key: string]: any },
@@ -140,6 +142,40 @@ export class ConfigService {
140
142
  return ConfigService._frozenConfigSubject$.getValue();
141
143
  }
142
144
 
145
+ /**
146
+ * The configuration with every secret masked — the view to show anybody, an administrator included
147
+ * (`GET /config` via `configEndpointResponse()`, the Hub config panel).
148
+ *
149
+ * A deep copy, masked by {@link redactSecrets}: key patterns, credentials in connection URIs, nested values,
150
+ * plus the framework's secret fields and the project's `security.secretFields`. The live configuration is never
151
+ * touched.
152
+ *
153
+ * @since 12.5.0
154
+ */
155
+ getRedactedConfig(): Record<string, unknown> {
156
+ return ConfigService.getRedactedConfig();
157
+ }
158
+
159
+ /**
160
+ * The configuration with every secret masked (see the instance method)
161
+ *
162
+ * @since 12.5.0
163
+ */
164
+ static getRedactedConfig(): Record<string, unknown> {
165
+ return ConfigService.redact(ConfigService.configFastButReadOnly ?? {});
166
+ }
167
+
168
+ /**
169
+ * Mask a configuration object with the framework's rules and the project's `security.secretFields`
170
+ */
171
+ protected static redact(config: Record<string, any>): Record<string, unknown> {
172
+ const projectSecretFields = config?.security?.secretFields;
173
+ return redactSecrets(config, [
174
+ ...FRAMEWORK_SECRET_FIELDS,
175
+ ...(Array.isArray(projectSecretFields) ? projectSecretFields : []),
176
+ ]) as Record<string, unknown>;
177
+ }
178
+
143
179
  /**
144
180
  * Get readable and writable deep-cloned property from configuration
145
181
  */
@@ -280,7 +316,8 @@ export class ConfigService {
280
316
 
281
317
  // Warn if requested
282
318
  if (config.warn) {
283
- console.warn(`ConfigService ${activity}`, JSON.stringify(merged, null, 2));
319
+ // Redacted: this goes to stdout, and the merged configuration holds every secret of the deployment
320
+ console.warn(`ConfigService ${activity}`, JSON.stringify(ConfigService.redact(merged), null, 2));
284
321
  }
285
322
 
286
323
  // Return configuration
@@ -291,7 +328,7 @@ export class ConfigService {
291
328
  * Merge config property and set in ConfigService
292
329
  */
293
330
  mergeProperty(key: string, value: any, options?: { warn?: boolean }) {
294
- return ConfigService.mergeProperty(key, options);
331
+ return ConfigService.mergeProperty(key, value, options);
295
332
  }
296
333
 
297
334
  /**
@@ -372,7 +409,8 @@ export class ConfigService {
372
409
 
373
410
  // Warn if requested
374
411
  if (config.warn && !firstInitialization) {
375
- console.warn('ConfigService reinitialized', JSON.stringify(configObject, null, 2));
412
+ // Redacted: this goes to stdout, and the configuration holds every secret of the deployment
413
+ console.warn('ConfigService reinitialized', JSON.stringify(ConfigService.redact(configObject || {}), null, 2));
376
414
  }
377
415
  }
378
416
 
@@ -123,7 +123,9 @@ Every action writes an audit line: `[HUB-ACTION] <action> by user <id>`.
123
123
  The messages are centralized in `hub-action-messages.ts` (`HubActionMessage`) so the wording stays
124
124
  consistent and reviewable in one place.
125
125
  - **CSP**: strict per-request nonce; no `unsafe-inline`; `X-Frame-Options: DENY`; `no-store`.
126
- - **Secrets**: the config viewer deep-clones and masks by key pattern + `security.secretFields`.
126
+ - **Secrets**: the config viewer deep-clones and masks by key pattern + `security.secretFields` — since 12.5.0
127
+ through the framework-wide `redactSecrets()` / `ConfigService.getRedactedConfig()`, the same view `GET /config`
128
+ serves (`configEndpointResponse()`).
127
129
  - **Interceptor safety**: sidecars return pre-serialized JSON strings, so the global response
128
130
  interceptors never walk/mutate live config.
129
131
  - **Mailbox guard**: `mode: 'capture'` throws at startup in any **reachable** environment (anything
@@ -7,25 +7,10 @@ import { ConfigService } from '../../common/services/config.service.js';
7
7
 
8
8
  import { HUB_CONFIG } from './hub.constants.js';
9
9
  import { HUB_PANEL_GROUPS, HUB_PANELS } from './hub-nav.js';
10
- import { maskConfigDeep } from './helpers/hub-mask.helper.js';
11
10
  import { CoreHubSourcesService } from './services/core-hub-sources.service.js';
12
11
  import { HubDashboardData, HubDiagnosticsData, HubSessionData } from './interfaces/hub-panels.interface.js';
13
12
  import type { ResolvedHubConfig } from './interfaces/hub-config.interface.js';
14
13
 
15
- /**
16
- * Framework-default secret field names (see CheckSecurityInterceptor). Union with the pattern-based
17
- * masking in {@link maskConfigDeep} and the project's `security.secretFields`.
18
- */
19
- const FRAMEWORK_SECRET_FIELDS = [
20
- 'password',
21
- 'verificationToken',
22
- 'passwordResetToken',
23
- 'passwordResetTokenExpiresAt',
24
- 'refreshTokens',
25
- 'tempTokens',
26
- 'apiKeyEncrypted',
27
- ];
28
-
29
14
  const MONGO_STATES: Record<number, string> = {
30
15
  0: 'disconnected',
31
16
  1: 'connected',
@@ -92,13 +77,12 @@ export class CoreHubService {
92
77
  }
93
78
 
94
79
  /**
95
- * The full server config with all secrets masked. Deep-cloned first (never mutate the live config),
96
- * then masked by key heuristics + the framework/project secret-field lists.
80
+ * The full server config with all secrets masked — the same view `GET /config` serves
81
+ * (`ConfigService.getRedactedConfig()`): deep-cloned first, then masked by key heuristics + the framework/project
82
+ * secret-field lists.
97
83
  */
98
84
  getConfigMasked(): Record<string, unknown> {
99
- const raw = this.configService.configFastButReadOnly as Record<string, unknown>;
100
- const projectSecretFields = this.configService.get<string[]>('security.secretFields', []) ?? [];
101
- return maskConfigDeep(raw, [...FRAMEWORK_SECRET_FIELDS, ...projectSecretFields]);
85
+ return this.configService.getRedactedConfig();
102
86
  }
103
87
 
104
88
  /** The resolved Hub config (for controller/actions/gating decisions). */
@@ -1,95 +1,7 @@
1
1
  /**
2
- * Recursive, non-mutating config masker for the Hub config viewer.
2
+ * The Hub config viewer's masker — since 12.5.0 the framework-wide `redactSecrets()`
3
+ * (`common/helpers/redact-secrets.helper.ts`), which `GET /config` and the `ConfigService` debug output use too.
3
4
  *
4
- * CRITICAL: this deep-clones before masking. Hub JSON sidecars must never hand a live,
5
- * service-owned object to the response pipeline — `CheckSecurityInterceptor` deletes secret-named
6
- * keys IN PLACE, which would corrupt the running server config. Cloning here is the guarantee.
5
+ * Kept under its old name so no import path broke.
7
6
  */
8
-
9
- /**
10
- * Key-name heuristics that mark a value as secret. Matched case-insensitively against each key.
11
- *
12
- * `access[-_]?key` also covers `accessKeyId`: the trailing `(^|[^a-z])key([^a-z]|$)` alternative
13
- * does NOT, because the `i` flag makes `[^a-z]` reject an uppercase letter, so `…sKeyI…` fails it.
14
- * `s3.secretAccessKey` was already caught by `secret`; the ID was not.
15
- */
16
- const SECRET_KEY_PATTERN =
17
- /secret|passwd|password|passphrase|credential|api[-_]?key|access[-_]?key|access[-_]?token|refresh[-_]?token|private[-_]?key|encryption|\btoken\b|\bpass\b|(^|[^a-z])key([^a-z]|$)/i;
18
-
19
- /**
20
- * Value-shape heuristic: a connection URI carrying `scheme://user:password@host`.
21
- *
22
- * The user part is `*`, not `+`, so the PASSWORD-ONLY form is matched too:
23
- * `redis://:password@host` is the canonical Redis URL (Redis < 6 has no username, and
24
- * `redis-cli -u`, Heroku Redis and ElastiCache AUTH all emit it). Requiring a non-empty
25
- * user printed that shape verbatim in the Hub config panel. `redis.url` became a
26
- * first-class option in 11.33.0, so the shape is newly reachable here.
27
- *
28
- * Still safe against false positives: the password group cannot contain `/`, and the `@`
29
- * must follow it immediately — so `http://host:8080/x@y` does not match.
30
- */
31
- const URI_CREDENTIAL_PATTERN = /^([a-z][a-z0-9+.-]*:\/\/[^/@:\s]*:)([^@/\s]+)(@)/i;
32
-
33
- const MASK = '***';
34
-
35
- /**
36
- * Deep-clone `value` and mask every secret it contains.
37
- *
38
- * A value is masked when its key matches {@link SECRET_KEY_PATTERN} or appears in `extraSecretKeys`.
39
- * Additionally, any string that looks like a credentialed connection URI has its password segment
40
- * masked regardless of key name.
41
- *
42
- * @param value - the object/value to mask (not mutated)
43
- * @param extraSecretKeys - additional exact key names to always mask (e.g. `security.secretFields`)
44
- */
45
- export function maskConfigDeep<T>(value: T, extraSecretKeys: string[] = []): T {
46
- const extra = new Set(extraSecretKeys.map((k) => k.toLowerCase()));
47
- return maskValue(value, false, extra) as T;
48
- }
49
-
50
- function isSecretKey(key: string, extra: Set<string>): boolean {
51
- return extra.has(key.toLowerCase()) || SECRET_KEY_PATTERN.test(key);
52
- }
53
-
54
- function maskString(value: string): string {
55
- const uriMatch = value.match(URI_CREDENTIAL_PATTERN);
56
- if (uriMatch) {
57
- return value.replace(URI_CREDENTIAL_PATTERN, `$1${MASK}$3`);
58
- }
59
- return value;
60
- }
61
-
62
- function maskValue(value: unknown, keyIsSecret: boolean, extra: Set<string>): unknown {
63
- if (value === null || value === undefined) {
64
- return value;
65
- }
66
-
67
- // Primitives.
68
- if (typeof value !== 'object') {
69
- if (keyIsSecret) {
70
- return MASK;
71
- }
72
- return typeof value === 'string' ? maskString(value) : value;
73
- }
74
-
75
- // A whole secret-keyed object/array is collapsed to the mask (never leak its interior).
76
- if (keyIsSecret) {
77
- return MASK;
78
- }
79
-
80
- // Preserve non-plain objects verbatim (Date, Buffer, etc.) — cloning would lose their type and
81
- // they never carry framework secrets.
82
- if (value instanceof Date || Buffer.isBuffer(value)) {
83
- return value;
84
- }
85
-
86
- if (Array.isArray(value)) {
87
- return value.map((item) => maskValue(item, false, extra));
88
- }
89
-
90
- const out: Record<string, unknown> = {};
91
- for (const [key, val] of Object.entries(value as Record<string, unknown>)) {
92
- out[key] = maskValue(val, isSecretKey(key, extra), extra);
93
- }
94
- return out;
95
- }
7
+ export { redactSecrets as maskConfigDeep } from '../../../common/helpers/redact-secrets.helper.js';
package/src/index.ts CHANGED
@@ -32,6 +32,7 @@ export * from './core/common/filters/http-exception-log.filter.js';
32
32
  export * from './core/common/filters/mongoose-cast-error.filter.js';
33
33
  export * from './core/common/helpers/common.helper.js';
34
34
  export * from './core/common/helpers/config.helper.js';
35
+ export * from './core/common/helpers/config-endpoint.helper.js';
35
36
  export * from './core/common/helpers/content-disposition.helper.js';
36
37
  export * from './core/common/helpers/context.helper.js';
37
38
  export * from './core/common/helpers/cookies.helper.js';
@@ -52,6 +53,7 @@ export * from './core/common/helpers/meta.helper.js';
52
53
  export * from './core/common/helpers/model.helper.js';
53
54
  export * from './core/common/helpers/outbound-url.helper.js';
54
55
  export * from './core/common/helpers/process-diagnostics.helper.js';
56
+ export * from './core/common/helpers/redact-secrets.helper.js';
55
57
  export * from './core/common/helpers/register-enum.helper.js';
56
58
  export * from './core/common/helpers/scim.helper.js';
57
59
  export * from './core/common/helpers/service.helper.js';
@@ -1,6 +1,6 @@
1
1
  import { Controller, Get, Render } from '@nestjs/common';
2
2
 
3
- import { ConfigService, RoleEnum, Roles } from '../index.js';
3
+ import { ConfigService, configEndpointResponse, RoleEnum, Roles } from '../index.js';
4
4
 
5
5
  @Controller()
6
6
  @Roles(RoleEnum.ADMIN)
@@ -16,9 +16,14 @@ export class ServerController {
16
16
  };
17
17
  }
18
18
 
19
+ /**
20
+ * The configuration with every secret masked, and only where `configEndpoint` opens the route (by default in
21
+ * `local`, `ci` and `e2e`; 404 elsewhere). It used to return the configuration verbatim — database URI, auth
22
+ * secrets, mail password — to every administrator.
23
+ */
19
24
  @Get('config')
20
25
  @Roles(RoleEnum.ADMIN)
21
26
  config() {
22
- return JSON.parse(JSON.stringify(this.configService.configFastButReadOnly));
27
+ return configEndpointResponse();
23
28
  }
24
29
  }