feat: add initial setup wizard, workload insights, and policy audit mode
Add setup wizard with status tracking via SystemSetting model, implement /setup/status and /setup/complete endpoints to create initial admin user and optional cluster configuration, add workload insights endpoint with traffic analysis and policy matching including audit mode detection, implement enforcement_mode property on Policy model with audit/enforced states, add Modal component for dialogs, create SetupWizard page with multi
This commit is contained in:
@@ -49,6 +49,13 @@ class TimestampMixin:
|
||||
updated_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|
||||
|
||||
|
||||
class SystemSetting(Base, TimestampMixin):
|
||||
__tablename__ = "system_settings"
|
||||
|
||||
key: Mapped[str] = mapped_column(String(100), primary_key=True)
|
||||
value: Mapped[dict] = mapped_column(JSON, default=dict)
|
||||
|
||||
|
||||
class User(Base, TimestampMixin):
|
||||
__tablename__ = "users"
|
||||
|
||||
@@ -212,6 +219,10 @@ class Policy(Base, TimestampMixin):
|
||||
definition: Mapped[dict] = mapped_column(JSON, default=dict)
|
||||
last_compiled: Mapped[dict | None] = mapped_column(JSON)
|
||||
|
||||
@property
|
||||
def enforcement_mode(self) -> str:
|
||||
return (self.definition or {}).get("enforcement_mode", "enforced")
|
||||
|
||||
|
||||
class ServiceCatalogItem(Base, TimestampMixin):
|
||||
__tablename__ = "service_catalog"
|
||||
@@ -251,4 +262,3 @@ class AuditLog(Base):
|
||||
user_agent: Mapped[str | None] = mapped_column(String(512))
|
||||
result: Mapped[str] = mapped_column(String(100), default="success")
|
||||
error_text: Mapped[str | None] = mapped_column(Text)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user