code: nextjs,frontends,operation (2 files)

This commit is contained in:
2025-12-25 22:41:00 +00:00
parent f87fd9f48d
commit 13eeaeae48
2 changed files with 4 additions and 7 deletions

View File

@@ -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)
}

View File

@@ -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)
}