feat: Analyse-Module auf 100% — Backend-Wiring, Proxy-Route, DELETE-Endpoints
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 35s
CI / test-python-backend-compliance (push) Successful in 29s
CI / test-python-document-crawler (push) Successful in 24s
CI / test-python-dsms-gateway (push) Successful in 17s
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 35s
CI / test-python-backend-compliance (push) Successful in 29s
CI / test-python-document-crawler (push) Successful in 24s
CI / test-python-dsms-gateway (push) Successful in 17s
7 Analyse-Module (Requirements, Controls, Evidence, Risk Matrix, AI Act, Audit Checklist, Audit Report) von ~35% auf 100% gebracht: - Catch-all Proxy-Route /api/sdk/v1/compliance/[[...path]] erstellt - DELETE-Endpoints fuer Risks und Evidence im Backend hinzugefuegt - Alle 7 Frontend-Seiten ans Backend gewired (Fetch, PUT, POST, DELETE) - Mock-Daten durch Backend-Daten ersetzt, Templates als Fallback - Loading-Skeletons und Error-Banner hinzugefuegt - AI Act: Add-System-Form + assess-risk API-Integration - Audit Report: API-Pfade von /api/admin/ auf /api/sdk/v1/compliance/ korrigiert Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -147,6 +147,30 @@ async def create_evidence(
|
||||
)
|
||||
|
||||
|
||||
@router.delete("/evidence/{evidence_id}")
|
||||
async def delete_evidence(
|
||||
evidence_id: str,
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""Delete an evidence record."""
|
||||
evidence = db.query(EvidenceDB).filter(EvidenceDB.id == evidence_id).first()
|
||||
if not evidence:
|
||||
raise HTTPException(status_code=404, detail=f"Evidence {evidence_id} not found")
|
||||
|
||||
# Remove artifact file if it exists
|
||||
if evidence.artifact_path and os.path.exists(evidence.artifact_path):
|
||||
try:
|
||||
os.remove(evidence.artifact_path)
|
||||
except OSError:
|
||||
logger.warning(f"Could not remove artifact file: {evidence.artifact_path}")
|
||||
|
||||
db.delete(evidence)
|
||||
db.commit()
|
||||
|
||||
logger.info(f"Evidence {evidence_id} deleted")
|
||||
return {"success": True, "message": f"Evidence {evidence_id} deleted"}
|
||||
|
||||
|
||||
@router.post("/evidence/upload")
|
||||
async def upload_evidence(
|
||||
control_id: str = Query(...),
|
||||
|
||||
@@ -164,6 +164,24 @@ async def update_risk(
|
||||
)
|
||||
|
||||
|
||||
@router.delete("/risks/{risk_id}")
|
||||
async def delete_risk(
|
||||
risk_id: str,
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""Delete a risk."""
|
||||
repo = RiskRepository(db)
|
||||
risk = repo.get_by_risk_id(risk_id)
|
||||
if not risk:
|
||||
raise HTTPException(status_code=404, detail=f"Risk {risk_id} not found")
|
||||
|
||||
db.delete(risk)
|
||||
db.commit()
|
||||
|
||||
logger.info(f"Risk {risk_id} deleted")
|
||||
return {"success": True, "message": f"Risk {risk_id} deleted"}
|
||||
|
||||
|
||||
@router.get("/risks/matrix", response_model=RiskMatrixResponse)
|
||||
async def get_risk_matrix(db: Session = Depends(get_db)):
|
||||
"""Get risk matrix data for visualization."""
|
||||
|
||||
Reference in New Issue
Block a user