mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
perf(core): Lazyload security audit reporters (#7696)
Also converting to service. Followup to https://github.com/n8n-io/n8n/pull/7663
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { authorize } from '@/PublicApi/v1/shared/middlewares/global.middleware';
|
||||
import { audit } from '@/audit';
|
||||
import type { Response } from 'express';
|
||||
import type { AuditRequest } from '@/PublicApi/types';
|
||||
import Container from 'typedi';
|
||||
|
||||
export = {
|
||||
generateAudit: [
|
||||
authorize(['owner']),
|
||||
async (req: AuditRequest.Generate, res: Response): Promise<Response> => {
|
||||
try {
|
||||
const result = await audit(
|
||||
const { SecurityAuditService } = await import('@/security-audit/SecurityAudit.service');
|
||||
const result = await Container.get(SecurityAuditService).run(
|
||||
req.body?.additionalOptions?.categories,
|
||||
req.body?.additionalOptions?.daysAbandonedWorkflow,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user