forked from datawhale/whale-town-end
- 新增auth模块处理认证逻辑 - 新增security模块处理安全相关功能 - 新增user-mgmt模块管理用户相关操作 - 新增shared模块存放共享组件 - 重构admin模块,添加DTO和Guards - 为admin模块添加测试文件结构
37 lines
857 B
TypeScript
37 lines
857 B
TypeScript
/**
|
|
* 安全功能模块
|
|
*
|
|
* 功能描述:
|
|
* - 整合所有安全相关功能
|
|
* - 频率限制和请求超时控制
|
|
* - 维护模式和内容类型验证
|
|
* - 系统安全防护机制
|
|
*
|
|
* @author kiro-ai
|
|
* @version 1.0.0
|
|
* @since 2025-12-24
|
|
*/
|
|
|
|
import { Module } from '@nestjs/common';
|
|
import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core';
|
|
import { ThrottleGuard } from './guards/throttle.guard';
|
|
import { TimeoutInterceptor } from './interceptors/timeout.interceptor';
|
|
|
|
@Module({
|
|
providers: [
|
|
ThrottleGuard,
|
|
TimeoutInterceptor,
|
|
// 全局频率限制守卫
|
|
{
|
|
provide: APP_GUARD,
|
|
useClass: ThrottleGuard,
|
|
},
|
|
// 全局超时拦截器
|
|
{
|
|
provide: APP_INTERCEPTOR,
|
|
useClass: TimeoutInterceptor,
|
|
},
|
|
],
|
|
exports: [ThrottleGuard, TimeoutInterceptor],
|
|
})
|
|
export class SecurityModule {} |