4dea19cae9
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Admins now create users with a name + email (no password) and role; a Send Email action (per-user, also reusable for resets) issues a one-time token and POSTs it to an admin-configurable webhook URL — intended for a Power Automate flow that delivers the actual email. The old admin-sets-the-password flow is kept server-side (LegacyUserCreateWithPassword) but no longer wired into the UI. Every user-facing surface (top bar, sidebar, user management, audit log, assignee pickers, dispute notifications) now shows full_name instead of username, falling back to username when unset. Also fixes long attack_procedure/expected_detection/suggested_text text overflowing its container in the template review panels and Red/Blue team fields (missing break-words on whitespace-pre-wrap blocks).
50 lines
1.3 KiB
Python
50 lines
1.3 KiB
Python
"""Pydantic schemas for Audit Log endpoints."""
|
|
|
|
# Import uuid
|
|
import uuid
|
|
|
|
# Import datetime from datetime
|
|
from datetime import datetime
|
|
from typing import Any, Optional
|
|
|
|
# Import BaseModel, ConfigDict from pydantic
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
# Define class AuditLogOut
|
|
class AuditLogOut(BaseModel):
|
|
"""Complete representation of an audit log entry."""
|
|
|
|
# id: uuid.UUID
|
|
id: uuid.UUID
|
|
# Assign user_id = None
|
|
user_id: uuid.UUID | None = None
|
|
# Assign username = None # Populated from user relationship
|
|
username: str | None = None # Populated from user relationship
|
|
full_name: str | None = None # Populated from user relationship
|
|
# action: str
|
|
action: str
|
|
# Assign entity_type = None
|
|
entity_type: str | None = None
|
|
# Assign entity_id = None
|
|
entity_id: str | None = None
|
|
timestamp: Optional[datetime] = None
|
|
details: dict[str, Any] | None = None
|
|
|
|
# Assign model_config = ConfigDict(from_attributes=True)
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
|
# Define class AuditLogPage
|
|
class AuditLogPage(BaseModel):
|
|
"""Paginated response for audit logs."""
|
|
|
|
# items: list[AuditLogOut]
|
|
items: list[AuditLogOut]
|
|
# total: int
|
|
total: int
|
|
# offset: int
|
|
offset: int
|
|
# limit: int
|
|
limit: int
|