[split-required] [guardrail-change] Enforce 500 LOC budget across all services
Install LOC guardrails (check-loc.sh, architecture.md, pre-commit hook) and split all 44 files exceeding 500 LOC into domain-focused modules: - consent-service (Go): models, handlers, services, database splits - backend-core (Python): security_api, rbac_api, pdf_service, auth splits - admin-core (TypeScript): 5 page.tsx + sidebar extractions - pitch-deck (TypeScript): 6 slides, 3 UI components, engine.ts splits - voice-service (Python): enhanced_task_orchestrator split Result: 0 violations, 36 exempted (pipeline, tests, pure-data files). Go build verified clean. No behavior changes — pure structural splits. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
52
backend-core/security_models.py
Normal file
52
backend-core/security_models.py
Normal file
@@ -0,0 +1,52 @@
|
||||
"""
|
||||
Security API - Shared Pydantic Models
|
||||
|
||||
Data models used across security_api, security_mock_data, and security_monitoring.
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ToolStatus(BaseModel):
|
||||
name: str
|
||||
installed: bool
|
||||
version: Optional[str] = None
|
||||
last_run: Optional[str] = None
|
||||
last_findings: int = 0
|
||||
|
||||
|
||||
class Finding(BaseModel):
|
||||
id: str
|
||||
tool: str
|
||||
severity: str
|
||||
title: str
|
||||
message: Optional[str] = None
|
||||
file: Optional[str] = None
|
||||
line: Optional[int] = None
|
||||
found_at: str
|
||||
|
||||
|
||||
class SeveritySummary(BaseModel):
|
||||
critical: int = 0
|
||||
high: int = 0
|
||||
medium: int = 0
|
||||
low: int = 0
|
||||
info: int = 0
|
||||
total: int = 0
|
||||
|
||||
|
||||
class ScanResult(BaseModel):
|
||||
tool: str
|
||||
status: str
|
||||
started_at: str
|
||||
completed_at: Optional[str] = None
|
||||
findings_count: int = 0
|
||||
report_path: Optional[str] = None
|
||||
|
||||
|
||||
class HistoryItem(BaseModel):
|
||||
timestamp: str
|
||||
title: str
|
||||
description: str
|
||||
status: str # success, warning, error
|
||||
Reference in New Issue
Block a user