mirror of
https://github.com/mblanke/ThreatHunt.git
synced 2026-03-01 14:00:20 -05:00
Implement Phase 2: Refresh tokens, 2FA, password reset, and audit logging
Co-authored-by: mblanke <9078342+mblanke@users.noreply.github.com>
This commit is contained in:
29
backend/app/schemas/audit.py
Normal file
29
backend/app/schemas/audit.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional, Dict, Any
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class AuditLogBase(BaseModel):
|
||||
"""Base audit log schema"""
|
||||
action: str
|
||||
resource_type: str
|
||||
resource_id: Optional[int] = None
|
||||
details: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
class AuditLogCreate(AuditLogBase):
|
||||
"""Schema for creating an audit log entry"""
|
||||
pass
|
||||
|
||||
|
||||
class AuditLogRead(AuditLogBase):
|
||||
"""Schema for reading audit log data"""
|
||||
id: int
|
||||
user_id: Optional[int]
|
||||
tenant_id: int
|
||||
ip_address: Optional[str]
|
||||
user_agent: Optional[str]
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user