File size: 1,407 Bytes
990c0e8
 
 
 
 
 
 
 
 
 
 
 
 
 
a8a7b69
990c0e8
 
 
 
 
 
 
 
 
 
a8a7b69
990c0e8
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { SecurityLog } from './entities/security-log.entity';
import { AuditLog } from './entities/audit-log.entity';
import { LoginAttempt } from './entities/login-attempt.entity';
import { BlockedIp } from './entities/blocked-ip.entity';
import { Session } from '../auth/entities/session.entity';
import { SecurityService } from './services/security.service';
import { AuditService } from './services/audit.service';
import { IpBlockerService } from './services/ip-blocker.service';
import { SecurityController } from './controllers/security.controller';
import { AuditController } from './controllers/audit.controller';
import { AuditLogInterceptor } from './interceptors/audit-log.interceptor';
import { NotificationsModule } from '../notifications/notifications.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      SecurityLog,
      AuditLog,
      LoginAttempt,
      BlockedIp,
      Session,
    ]),
    NotificationsModule,
  ],
  controllers: [SecurityController, AuditController],
  providers: [
    SecurityService,
    AuditService,
    IpBlockerService,
    {
      provide: APP_INTERCEPTOR,
      useClass: AuditLogInterceptor,
    },
  ],
  exports: [SecurityService, AuditService, IpBlockerService],
})
export class SecurityModule {}