feat(cookie): A — Findings auditfest an Controls verdrahten

Jeder Cookie-Befund traegt jetzt ein strukturiertes control-Feld
(control_id aus doc_check_controls + regulation + article) statt nur
hardcodeter Strings: vague_duration->AUTH-2051-A03 (Art.5(1)e+13),
tracker_as_necessary->DATA-2851-A05 (§25 TDDDG), third_country->
DATA-1624-A04 (Art.44). Kette Regulation->Article->Control->Finding.
Frontend zeigt die Rechtsgrundlage je Befund. (Controls tragen
regulation/article noch NULL -> hier mitgeliefert bis gepflegt.)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-06-11 08:44:19 +02:00
parent 4c45f11e43
commit 901de1ca97
3 changed files with 38 additions and 0 deletions
@@ -79,6 +79,21 @@ def test_excessive_lifetime():
assert el and "Art. 5" in el[0]["remediation"]
def test_findings_carry_control_and_legal_basis():
# A: jeder Befund traegt control_id + Rechtsgrundlage (auditfest).
out = analyze_cookies([{
"name": "Google", "category": "necessary",
"cookies": [{"name": "_ga", "purpose": "x",
"expiry": "Wird solange gespeichert, bis es deaktiviert wird."}],
}])
assert out["findings"], "es sollte Befunde geben"
for f in out["findings"]:
assert "control" in f
vd = next(f for f in out["findings"] if f["type"] == "vague_duration")
assert vd["control"]["control_id"] == "AUTH-2051-A03"
assert "Art. 5" in vd["control"]["article"]
def test_vague_duration_flagged_concrete_ok():
# User-Beispiel Salesforce: "bis der Nutzer es deaktiviert" = vage.
out = analyze_cookies([{