fix(gateway): gate FederationModule on tier === 'federated' (#1138) #1140

Merged
shaggy merged 7 commits from fix/1138-conditional-federation into next 2026-08-10 07:09:52 +00:00
Showing only changes of commit b4753a75cd - Show all commits
+8 -1
View File
@@ -26,6 +26,13 @@ import { WorkspaceModule } from './workspace/workspace.module.js';
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';
// Federation (step-ca client, enrollment, federation verbs) is only wired for
// tier 'federated' — CaService hard-requires STEP_CA_* at construction, which
// must not gate standalone/local boots (docker-compose.federated.yml: the
// federation profile "must not start in non-federated dev").
const federationEnabled = loadConfig().tier === 'federated';
@Module({
imports: [
@@ -53,7 +60,7 @@ import { ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler';
QueueModule,
ReloadModule,
WorkspaceModule,
FederationModule,
...(federationEnabled ? [FederationModule] : []),
],
controllers: [HealthController],
providers: [