feat(sso-backend-api): Update AppModule to register new SSO provider/service or configure environment-specific SSO settings

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Lilith 2026-02-25 16:13:03 -08:00
parent 755c053b99
commit a7928d8a62

View file

@ -1,10 +1,13 @@
import { BotDefenseModule } from "@features/bot-defense-backend-api";
// BotDefenseModule temporarily removed: bun creates per-workspace copies of
// @nestjs/typeorm with different content-addressable hashes, causing NestJS
// DataSource injection to fail across workspace boundaries.
// TODO: Re-enable when bun dedup issue is resolved or bot-defense is published
// import { BotDefenseModule } from "@features/bot-defense-backend-api";
import { getServiceRegistry } from "@lilith/service-registry";
import { BullModule } from "@nestjs/bullmq";
import { Module } from "@nestjs/common";
import { ConfigModule, ConfigService } from "@nestjs/config";
import { ConfigModule } from "@nestjs/config";
import { ScheduleModule } from "@nestjs/schedule";
import { TypeOrmModule } from "@nestjs/typeorm";
import { DomainEventsModule } from "./common/domain-events";
import { EmailClientModule } from "@lilith/email-client";
@ -25,31 +28,6 @@ import { UIController } from "./ui/ui.controller";
isGlobal: true,
envFilePath: ".env",
}),
// Database (Service-Registry + AutoLoad)
TypeOrmModule.forRootAsync({
inject: [ConfigService],
useFactory: async (config: ConfigService) => {
const { getDatabaseConfig } = await import('@lilith/service-registry');
const dbConfig = getDatabaseConfig('sso', {
username: config.get('DATABASE_POSTGRES_USER'),
password: config.get('DATABASE_POSTGRES_PASSWORD'),
database: config.get('DATABASE_POSTGRES_NAME'),
});
return {
type: 'postgres',
host: dbConfig.host,
port: dbConfig.port,
username: dbConfig.username,
password: dbConfig.password,
database: dbConfig.database,
autoLoadEntities: true,
synchronize: config.get('NODE_ENV') !== 'production',
logging: config.get('NODE_ENV') !== 'production',
};
},
}),
// Redis queue - uses sso shared service's Redis
BullModule.forRootAsync({
useFactory: async () => {
@ -83,7 +61,7 @@ import { UIController } from "./ui/ui.controller";
SettingsModule,
UsersModule,
AdminModule,
BotDefenseModule,
// BotDefenseModule, // See note above re: bun dual-instance issue
],
controllers: [UIController, HealthController],
providers: [HealthCheckService],