DSGVO: Selbstauskunft auf Konto & Sicherheit
GET /omega/api/me/gdpr/report liefert die Auskunft immer nur über die angemeldete Person; vermerkt im Audit-Log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec1d884f4c
commit
842a4a60ea
5 files changed
+47
-4
No files matched your search
@@ -81,6 +81,16 @@ code, out, _ = cli("--as", "admin", "gdpr", "report", "anna")
|
||||
check(code == 0 and "annas-laptop" in out and not word(out, "bert"), "Auskunft auch über die Kommandozeile")
|
||||
check(sql("SELECT count(*) FROM audit_log WHERE action = 'gdpr.report'")[0][0] >= 2, "Auskunft im Audit-Log vermerkt")
|
||||
|
||||
print("2b) Selbstauskunft: jede Person über sich selbst, und nur über sich")
|
||||
st, body = http(f"{P}/omega/api/me/gdpr/report", headers=login("bert"))
|
||||
html = body.decode()
|
||||
check(st == 200 and "berts-rechner" in html and "bert@th-beispiel.de" in html, f"bert bekommt seine Auskunft ({st})")
|
||||
for other in ["anna", "lena", "annas-laptop", "anna@th-beispiel.de", "admin"]:
|
||||
check(not word(html, other), f"Selbstauskunft ohne {other!r}")
|
||||
st, _ = http(f"{P}/omega/api/me/gdpr/report")
|
||||
check(st == 401, f"ohne Anmeldung keine Auskunft ({st})")
|
||||
check(sql("SELECT count(*) FROM audit_log WHERE action = 'gdpr.report' AND actor = 'bert'")[0][0] == 1, "Selbstauskunft im Audit-Log")
|
||||
|
||||
print("3) Löschung nur mit Bestätigung und nie für Administratoren")
|
||||
st, body = http(f"{P}/omega/api/gdpr/anna/delete", {"confirm": "ja"}, admin)
|
||||
check(st == 400, f"falsches Bestätigungswort abgelehnt ({st})")
|
||||
|
||||
@@ -403,6 +403,15 @@ async function flows(fail) {
|
||||
await submit(w, '#prune-days');
|
||||
expect(text(w).includes('0 Einträge gelöscht'), 'keine Rückmeldung: ' + summary(w).errorsOnPage.join());
|
||||
});
|
||||
await step('student erstellt auf Konto & Sicherheit eine Auskunft über sich selbst', async () => {
|
||||
const { w } = browser(student, '#/account');
|
||||
await settle(w);
|
||||
const link = [...w.document.querySelectorAll('a.btn')].find((a) => a.textContent === 'Auskunft erstellen');
|
||||
expect(link && link.getAttribute('href') === '/omega/api/me/gdpr/report' && link.target === '_blank', 'Knopf fehlt');
|
||||
const res = await fetch(BASE + link.getAttribute('href'), { headers: { Cookie: student } });
|
||||
const html = await res.text();
|
||||
expect(res.status === 200 && html.includes('betrifft <b>student</b>') && !/\bdozent\b/.test(html), 'Bericht: ' + res.status);
|
||||
});
|
||||
await step('DSGVO: Auskunft öffnet den Bericht, Löschung mit zwei Rückfragen', async () => {
|
||||
const { w } = browser(admin, '#/users');
|
||||
await settle(w);
|
||||
|
||||
Reference in new issue
Block a user