forked from wangziqi/gongxue-base
由 OCR(open-codereview.ai,deepseek-v4-flash)审查驱动修复: - JWT 生产必填、密码 8-72 字节、防枚举;全局 ValidationPipe - classes/dashboard/schedules/students/attendance/archive/exams 越权与 IDOR 修复 - LIKE 通配符转义(14 处);上传 10MB 上限 + MIME 白名单 + 附件 XSS - 集成配置 appSecret AES 加密 + 回填脚本;审计 best-effort;IP 来源防伪造 Reviewed-by: OCR (open-codereview.ai)
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { Module, forwardRef } from '@nestjs/common';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { PassportModule } from '@nestjs/passport';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { User } from '../entities/user.entity';
|
|
import { AuthService } from './auth.service';
|
|
import { AuthController } from './auth.controller';
|
|
import { JwtStrategy } from './strategies/jwt.strategy';
|
|
import { getJwtSecret } from './jwt-secret';
|
|
import { RbacModule } from '../rbac/rbac.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
TypeOrmModule.forFeature([User]),
|
|
PassportModule,
|
|
JwtModule.registerAsync({
|
|
imports: [ConfigModule],
|
|
inject: [ConfigService],
|
|
useFactory: (config: ConfigService) => ({
|
|
secret: getJwtSecret(config),
|
|
signOptions: { expiresIn: config.get('JWT_EXPIRES_IN', '4h') },
|
|
}),
|
|
}),
|
|
forwardRef(() => RbacModule),
|
|
],
|
|
controllers: [AuthController],
|
|
providers: [AuthService, JwtStrategy],
|
|
exports: [AuthService],
|
|
})
|
|
export class AuthModule {}
|