feat: implementar melhorias na autenticação
- Adicionar refresh tokens para renovação automática de tokens - Implementar controle de sessões simultâneas - Adicionar blacklist de tokens para logout seguro - Implementar rate limiting para proteção contra ataques - Melhorar detecção de IP e identificação de sessão atual - Adicionar endpoints para gerenciamento de sessões - Corrigir inconsistências na validação de usuário - Atualizar configuração Redis com nova conexão
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import {
|
||||
HealthCheck,
|
||||
HealthCheckService,
|
||||
@@ -9,7 +9,8 @@ import {
|
||||
import { TypeOrmHealthIndicator } from './indicators/typeorm.health';
|
||||
import { DbPoolStatsIndicator } from './indicators/db-pool-stats.health';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from 'src/auth/guards/jwt-auth.guard';
|
||||
import * as os from 'os';
|
||||
|
||||
@ApiTags('Health Check')
|
||||
@@ -26,10 +27,11 @@ export class HealthController {
|
||||
private dbPoolStats: DbPoolStatsIndicator,
|
||||
private configService: ConfigService,
|
||||
) {
|
||||
// Define o caminho correto para o disco, baseado no sistema operacional
|
||||
this.diskPath = os.platform() === 'win32' ? 'C:\\' : '/';
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Get()
|
||||
@HealthCheck()
|
||||
@ApiOperation({ summary: 'Verificar saúde geral da aplicação' })
|
||||
@@ -59,6 +61,8 @@ export class HealthController {
|
||||
]);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Get('db')
|
||||
@HealthCheck()
|
||||
@ApiOperation({ summary: 'Verificar saúde das conexões de banco de dados' })
|
||||
@@ -69,6 +73,8 @@ export class HealthController {
|
||||
]);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Get('memory')
|
||||
@HealthCheck()
|
||||
@ApiOperation({ summary: 'Verificar uso de memória' })
|
||||
@@ -79,6 +85,8 @@ export class HealthController {
|
||||
]);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Get('disk')
|
||||
@HealthCheck()
|
||||
@ApiOperation({ summary: 'Verificar espaço em disco' })
|
||||
@@ -97,6 +105,8 @@ export class HealthController {
|
||||
]);
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@Get('pool')
|
||||
@HealthCheck()
|
||||
@ApiOperation({ summary: 'Verificar estatísticas do pool de conexões' })
|
||||
|
||||
Reference in New Issue
Block a user