-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
20 lines (16 loc) · 708 Bytes
/
settings.py
File metadata and controls
20 lines (16 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from fastapi import APIRouter, Depends
from pydantic import BaseModel
from .auth import get_current_user, User
router = APIRouter()
class PlatformSettings(BaseModel):
enable_ai_remediation: bool = True
realtime_osint: bool = True
rbac_role_default: str = "Analyst"
audit_retention_days: int = 90
@router.get("/", response_model=PlatformSettings)
def get_settings(current_user: User = Depends(get_current_user)):
return PlatformSettings()
@router.post("/")
def update_settings(settings: PlatformSettings, current_user: User = Depends(get_current_user)):
# In a real scenario, this would persist to the DB/Redis
return {"status": "SUCCESS", "updated_by": current_user.username}