diff --git a/frontends/nextjs/src/lib/security/secure-db/log-operation.ts b/frontends/nextjs/src/lib/security/secure-db/log-operation.ts index 4189f1535..f7ec08679 100644 --- a/frontends/nextjs/src/lib/security/secure-db/log-operation.ts +++ b/frontends/nextjs/src/lib/security/secure-db/log-operation.ts @@ -1,4 +1,5 @@ import type { SecurityContext, OperationType, ResourceType, AuditLog } from './types' +import { addAuditLog } from './audit-log-store' /** * Log an operation for audit trail @@ -25,13 +26,10 @@ export async function logOperation( } try { - // TODO: Replace with proper audit log storage - // For now, just log to console in development + addAuditLog(log) if (process.env.NODE_ENV === 'development') { console.log('[AUDIT]', log) } - // In production, this would write to a persistent audit log table - // await Database.addAuditLog(log) } catch (error) { console.error('Failed to log operation:', error) } diff --git a/frontends/nextjs/src/lib/security/secure-db/operations/get-audit-logs.ts b/frontends/nextjs/src/lib/security/secure-db/operations/get-audit-logs.ts index 65bb28b76..a96b52d18 100644 --- a/frontends/nextjs/src/lib/security/secure-db/operations/get-audit-logs.ts +++ b/frontends/nextjs/src/lib/security/secure-db/operations/get-audit-logs.ts @@ -1,4 +1,5 @@ import type { AuditLog, SecurityContext } from '../types' +import { listAuditLogs } from '../audit-log-store' /** * Fetch audit logs with role checks @@ -11,7 +12,5 @@ export async function getAuditLogs( throw new Error('Access denied. Only god-tier users can view audit logs.') } - // TODO: Replace with proper audit log storage query using the requested limit. - void limit - return [] + return listAuditLogs(limit) }