fix(gateway): anchor config discovery and isolate env tests (#1138)

This commit is contained in:
shaggy (mosaic-dev box)
2026-08-09 23:11:09 -05:00
parent 884d527cc8
commit 2d5a8c81ec
3 changed files with 404 additions and 258 deletions
+2 -1
View File
@@ -27,6 +27,7 @@ import { QueueModule } from './queue/queue.module.js';
import { FederationModule } from './federation/federation.module.js';
import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler';
import { loadConfig } from '@mosaicstack/config';
import { resolveGatewayConfigPath } from './env.js';
// Federation (step-ca client, enrollment, federation verbs) is only wired for
// tier 'federated' — CaService hard-requires STEP_CA_* at construction, which
@@ -34,7 +35,7 @@ import { loadConfig } from '@mosaicstack/config';
// federation profile "must not start in non-federated dev"). The gateway
// entrypoint loads env.ts before evaluating this module so dotenv-backed tier
// configuration is visible here.
const federationEnabled = loadConfig().tier === 'federated';
const federationEnabled = loadConfig(resolveGatewayConfigPath()).tier === 'federated';
@Module({
imports: [