feat: integrate rate limiting and enhance security features
- Added @convex-dev/rate-limiter dependency to manage request limits effectively. - Implemented rate limiting configurations for IPs, users, and endpoints to prevent abuse and enhance security. - Introduced new security analysis endpoint to detect potential attacks based on incoming requests. - Updated backend schema to include rate limit configurations and various cyber attack types for improved incident tracking. - Enhanced existing security functions to incorporate rate limiting checks, ensuring robust protection against brute force and other attacks.
This commit is contained in:
@@ -305,16 +305,19 @@
|
||||
(() => {
|
||||
const agregados = new SvelteMap<number, SolicitacoesPorAnoResumo>();
|
||||
|
||||
for (const periodo of solicitacoesAprovadas) {
|
||||
const totalDias = periodo.diasFerias;
|
||||
const existente = agregados.get(periodo.anoReferencia) ?? {
|
||||
ano: periodo.anoReferencia,
|
||||
for (const solicitacao of solicitacoesAprovadas) {
|
||||
const totalDias = solicitacao.periodos.reduce(
|
||||
(acc, periodo) => acc + periodo.diasFerias,
|
||||
0
|
||||
);
|
||||
const existente = agregados.get(solicitacao.anoReferencia) ?? {
|
||||
ano: solicitacao.anoReferencia,
|
||||
solicitacoes: 0,
|
||||
diasTotais: 0
|
||||
};
|
||||
existente.solicitacoes += 1;
|
||||
existente.diasTotais += totalDias;
|
||||
agregados.set(periodo.anoReferencia, existente);
|
||||
agregados.set(solicitacao.anoReferencia, existente);
|
||||
}
|
||||
|
||||
return Array.from(agregados.values()).sort((a, b) => a.ano - b.ano);
|
||||
@@ -458,18 +461,9 @@
|
||||
console.log('📅 [Eventos] Total de eventos:', eventosFerias.length);
|
||||
console.log('📋 [Periodos] Total de períodos:', periodosDetalhados.length);
|
||||
console.log('✅ [Aprovadas] Total de solicitações aprovadas:', solicitacoesAprovadas.length);
|
||||
console.log('📊 [PeriodosPorMes] Total:', periodosPorMes.length);
|
||||
console.log('📊 [PeriodosPorMesAtivos] Total:', periodosPorMesAtivos.length);
|
||||
console.log('📊 [SolicitacoesPorAno] Total:', solicitacoesPorAno.length);
|
||||
if (eventosFerias.length > 0) {
|
||||
console.log('📅 [Eventos] Primeiro evento:', eventosFerias[0]);
|
||||
}
|
||||
if (periodosPorMes.length > 0) {
|
||||
console.log('📊 [PeriodosPorMes] Primeiro:', periodosPorMes[0]);
|
||||
}
|
||||
if (solicitacoesPorAno.length > 0) {
|
||||
console.log('📊 [SolicitacoesPorAno] Primeiro:', solicitacoesPorAno[0]);
|
||||
}
|
||||
});
|
||||
|
||||
let calendarioContainer: HTMLDivElement | null = null;
|
||||
|
||||
Reference in New Issue
Block a user