feat(settings): Settings page with email, webhooks, notifications, profile [FASE-8]
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
- SystemConfig model + migration b033 for runtime key-value config - GET/PATCH /system/email-config + POST /system/email-test (admin only) - email_service reads SMTP config from DB (overrides .env) - Webhooks now accessible to red_lead/blue_lead + admin - GET /users/me already existed; /users/me/preferences already working - SettingsPage with 4 role-aware tabs: * Profile & Jira: jira_account_id, user info * Notifications: role-specific email/in-app toggles (12 prefs) * Webhooks: full CRUD + test ping (leads + admin) * Email/SMTP: enable toggle, server config, test email (admin only) - Added /settings route (all authenticated users) - Settings link added to Sidebar Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,8 @@ from app.models.worklog import Worklog
|
||||
from app.models.osint_item import OsintItem
|
||||
from app.models.scoring_config import ScoringConfig
|
||||
from app.models.enums import TechniqueStatus, TestState, TestResult, TeamSide
|
||||
from app.models.webhook_config import WebhookConfig
|
||||
from app.models.system_config import SystemConfig
|
||||
|
||||
__all__ = [
|
||||
"User", "Technique", "Test", "TestTemplate", "Evidence",
|
||||
@@ -34,4 +36,5 @@ __all__ = [
|
||||
"JiraLink", "JiraLinkEntityType", "JiraSyncDirection",
|
||||
"Worklog", "OsintItem", "ScoringConfig",
|
||||
"TechniqueStatus", "TestState", "TestResult", "TeamSide",
|
||||
"WebhookConfig", "SystemConfig",
|
||||
]
|
||||
|
||||
26
backend/app/models/system_config.py
Normal file
26
backend/app/models/system_config.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""SystemConfig model — runtime key-value configuration store."""
|
||||
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import Column, String, Text, DateTime, func
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class SystemConfig(Base):
|
||||
"""Generic key-value store for runtime system configuration.
|
||||
|
||||
Currently used for:
|
||||
- SMTP email settings (overrides .env values when present)
|
||||
|
||||
Keys are namespaced by convention: ``smtp.host``, ``smtp.port``, etc.
|
||||
"""
|
||||
|
||||
__tablename__ = "system_configs"
|
||||
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
key = Column(String(200), unique=True, nullable=False, index=True)
|
||||
value = Column(Text, nullable=True)
|
||||
description = Column(String(500), nullable=True)
|
||||
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
|
||||
Reference in New Issue
Block a user