- Implemented Audit Logs page with a detailed view for each log entry. - Added API functions for fetching and exporting audit logs in CSV format. - Created hooks for managing audit log data fetching and state. - Integrated filtering options for audit logs based on various criteria. - Added unit tests for the Audit Logs page to ensure functionality and correctness. - Updated Security page to include a link to the Audit Logs page.
21 lines
770 B
Go
21 lines
770 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// SecurityAudit records admin actions or important changes related to security.
|
|
type SecurityAudit struct {
|
|
ID uint `json:"id" gorm:"primaryKey"`
|
|
UUID string `json:"uuid" gorm:"uniqueIndex"`
|
|
Actor string `json:"actor" gorm:"index"`
|
|
Action string `json:"action"`
|
|
EventCategory string `json:"event_category" gorm:"index"`
|
|
ResourceID *uint `json:"resource_id,omitempty"`
|
|
ResourceUUID string `json:"resource_uuid,omitempty" gorm:"index"`
|
|
Details string `json:"details" gorm:"type:text"`
|
|
IPAddress string `json:"ip_address,omitempty"`
|
|
UserAgent string `json:"user_agent,omitempty"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"index"`
|
|
}
|