mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 21:08:12 +00:00
feat(passenger-api): integrate @tria-plc IAM package (dual-ORM iam schema + package auth guard)
This commit is contained in:
18
apps/edr-passenger-api/src/config/iam-database.config.ts
Normal file
18
apps/edr-passenger-api/src/config/iam-database.config.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { registerAs } from '@nestjs/config';
|
||||
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
|
||||
import { buildIamTypeOrmOptions } from '../common/iam-typeorm.config';
|
||||
|
||||
/**
|
||||
* Dedicated config namespace for the IAM **TypeORM** connection — the shared `iam` schema ONLY.
|
||||
*
|
||||
* This is intentionally separate from Prisma: Prisma remains the app's primary ORM and owns the
|
||||
* `passenger` schema via `DATABASE_URL` (see prisma.service.ts). This second connection exists
|
||||
* solely because `@tria-plc/api-common` / `@tria-plc/iamapi-common` are TypeORM-based and the
|
||||
* `JwtGuard` reads `iam.sessions` through a TypeORM `DataSource`.
|
||||
*
|
||||
* Consumed by `TypeOrmModule.forRootAsync` in app.module.ts.
|
||||
*/
|
||||
export default registerAs(
|
||||
'iamDatabase',
|
||||
(): TypeOrmModuleOptions => buildIamTypeOrmOptions(),
|
||||
);
|
||||
Reference in New Issue
Block a user