d5279b124f
Storage Persistence Guard / storage-persistence-audit (push) Has been cancelled
Client Quality Gates / Shared client and Web (push) Has been cancelled
Client Quality Gates / macOS Desktop (push) Has been cancelled
Client Quality Gates / Shared client and Web (pull_request) Has been cancelled
Client Quality Gates / macOS Desktop (pull_request) Has been cancelled
Storage Persistence Guard / storage-persistence-audit (pull_request) Has been cancelled
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
import uuid
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class AuditLogRead(BaseModel):
|
|
id: uuid.UUID
|
|
study_id: Optional[uuid.UUID] = None
|
|
entity_type: str
|
|
entity_id: Optional[uuid.UUID] = None
|
|
action: str
|
|
detail: Optional[str]
|
|
operator_id: uuid.UUID
|
|
operator_name: Optional[str] = None
|
|
operator_email: Optional[str] = None
|
|
operator_role: str
|
|
client_ip: Optional[str] = None
|
|
ip_location: str = ""
|
|
ip_country: str = ""
|
|
ip_province: str = ""
|
|
ip_city: str = ""
|
|
ip_isp: str = ""
|
|
user_agent: Optional[str] = None
|
|
client_type: Optional[str] = None
|
|
client_version: Optional[str] = None
|
|
client_platform: Optional[str] = None
|
|
build_channel: Optional[str] = None
|
|
build_commit: Optional[str] = None
|
|
created_at: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
|
class AuditEventCreate(BaseModel):
|
|
action: str
|
|
detail: Optional[str] = None
|
|
entity_type: Optional[str] = None
|
|
entity_id: Optional[uuid.UUID] = None
|