refactor: improve code readability by formatting multiline function calls and ensuring consistent indentation in security.ts
This commit is contained in:
@@ -479,7 +479,12 @@ export const enforceRequest = mutation({
|
|||||||
// 2) Rate limit enforcement (endpoint + IP)
|
// 2) Rate limit enforcement (endpoint + IP)
|
||||||
// - endpoint rules usam o "pathKey" (ex.: api/auth/sign-in/email)
|
// - endpoint rules usam o "pathKey" (ex.: api/auth/sign-in/email)
|
||||||
// - ip rules usam o IP e namespace por endpoint
|
// - 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) {
|
if (!endpointCheck.permitido) {
|
||||||
return {
|
return {
|
||||||
allowed: false,
|
allowed: false,
|
||||||
@@ -1688,9 +1693,9 @@ export const dispararAlertasInternos = internalMutation({
|
|||||||
command_injection: 'Command Injection',
|
command_injection: 'Command Injection',
|
||||||
nosql_injection: 'NoSQL Injection',
|
nosql_injection: 'NoSQL Injection',
|
||||||
xxe: 'XXE',
|
xxe: 'XXE',
|
||||||
man_in_the_middle: 'MITM',
|
man_in_the_middle: 'MITM',
|
||||||
ddos: 'DDoS',
|
ddos: 'DDoS',
|
||||||
cve_exploit: 'Exploração de CVE',
|
cve_exploit: 'Exploração de CVE',
|
||||||
apt: 'APT',
|
apt: 'APT',
|
||||||
zero_day: 'Zero-Day',
|
zero_day: 'Zero-Day',
|
||||||
supply_chain: 'Supply Chain',
|
supply_chain: 'Supply Chain',
|
||||||
@@ -3174,12 +3179,13 @@ export const listarAutoBlockConfigs = query({
|
|||||||
await assertAdmin(ctx);
|
await assertAdmin(ctx);
|
||||||
|
|
||||||
const queryInitializer = ctx.db.query('autoBlockConfig');
|
const queryInitializer = ctx.db.query('autoBlockConfig');
|
||||||
const query = args.ativo !== undefined
|
const query =
|
||||||
? queryInitializer.withIndex('by_ativo', (q) => {
|
args.ativo !== undefined
|
||||||
const ativoValue: boolean = args.ativo!;
|
? queryInitializer.withIndex('by_ativo', (q) => {
|
||||||
return q.eq('ativo', ativoValue);
|
const ativoValue: boolean = args.ativo!;
|
||||||
})
|
return q.eq('ativo', ativoValue);
|
||||||
: queryInitializer;
|
})
|
||||||
|
: queryInitializer;
|
||||||
|
|
||||||
const configs = await query.order('desc').take(args.limit ?? 100);
|
const configs = await query.order('desc').take(args.limit ?? 100);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user