From 417394ddbef57ae0a28a4ce08d65c3bb9d016bce Mon Sep 17 00:00:00 2001 From: killer-cf Date: Mon, 12 Jan 2026 13:31:22 -0300 Subject: [PATCH] refactor: improve code readability by formatting multiline function calls and ensuring consistent indentation in security.ts --- packages/backend/convex/security.ts | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/backend/convex/security.ts b/packages/backend/convex/security.ts index 792227f..dbb316f 100644 --- a/packages/backend/convex/security.ts +++ b/packages/backend/convex/security.ts @@ -479,7 +479,12 @@ export const enforceRequest = mutation({ // 2) Rate limit enforcement (endpoint + IP) // - endpoint rules usam o "pathKey" (ex.: api/auth/sign-in/email) // - ip rules usam o IP e namespace por endpoint - const endpointCheck = await aplicarRateLimit(ctx, 'endpoint', pathKey || 'root', pathKey || 'root'); + const endpointCheck = await aplicarRateLimit( + ctx, + 'endpoint', + pathKey || 'root', + pathKey || 'root' + ); if (!endpointCheck.permitido) { return { allowed: false, @@ -1688,9 +1693,9 @@ export const dispararAlertasInternos = internalMutation({ command_injection: 'Command Injection', nosql_injection: 'NoSQL Injection', xxe: 'XXE', - man_in_the_middle: 'MITM', - ddos: 'DDoS', - cve_exploit: 'Exploração de CVE', + man_in_the_middle: 'MITM', + ddos: 'DDoS', + cve_exploit: 'Exploração de CVE', apt: 'APT', zero_day: 'Zero-Day', supply_chain: 'Supply Chain', @@ -3174,12 +3179,13 @@ export const listarAutoBlockConfigs = query({ await assertAdmin(ctx); const queryInitializer = ctx.db.query('autoBlockConfig'); - const query = args.ativo !== undefined - ? queryInitializer.withIndex('by_ativo', (q) => { - const ativoValue: boolean = args.ativo!; - return q.eq('ativo', ativoValue); - }) - : queryInitializer; + const query = + args.ativo !== undefined + ? queryInitializer.withIndex('by_ativo', (q) => { + const ativoValue: boolean = args.ativo!; + return q.eq('ativo', ativoValue); + }) + : queryInitializer; const configs = await query.order('desc').take(args.limit ?? 100);