Implement Phase 1 audit logging

Add centralized admin action logger and integrate logging for:
- Alert resolutions (system, rate limit, grouped)
- Role grants/revokes in UserRoleManager
- Incident creation/acknowledgement/resolution
- Moderation lock overrides

Includes file updates and usage across relevant components to ensure consistent audit trails.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-11 14:22:30 +00:00
parent 53b576ecc1
commit 8581950a6e
7 changed files with 167 additions and 0 deletions

View File

@@ -44,6 +44,14 @@ export function useResolveAlertGroup() {
}
}
// Log to audit trail
const { logAdminAction } = await import('@/lib/adminActionAuditHelpers');
await logAdminAction('alert_group_resolved', {
alert_source: source,
alert_count: alertIds.length,
alert_ids: alertIds,
});
return { count: alertIds.length, updatedAlerts: data };
},
onMutate: async ({ alertIds }) => {