feat(auth): GET /auth/module-identity — identity + module gate

Adds the route (cookie auth via verifyAccessToken, module gate seqid 31,
X-Auth-* headers, admin via seqid set). Adds a jest setupFiles hook giving a
dummy DUC_URL for module-load-time env reads, which also unblocks the
pre-existing authentication.guard.spec.

Co-Authored-By: WOZCODE <contact@withwoz.com>
This commit is contained in:
Rafael
2026-08-20 10:09:31 -03:00
co-authored by WOZCODE
parent 15b5c49fb2
commit a795f543f6
4 changed files with 189 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
/**
* Jest setupFiles hook: provide dummy values for env vars that modules read
* at *import time* (module-load side effects), so unit specs that transitively
* import those modules don't crash before a single test runs.
*
* These are never exercised by unit tests — the services that use them are
* stubbed via DI — but the values must exist because the reads happen at
* module evaluation, before any mock is installed.
*
* DUC_URL: read at load time in src/modules/duc/client.config.ts, reached via
* the AuthClientService import chain.
*/
process.env.DUC_URL = process.env.DUC_URL || 'duc:localhost:0';