No description
Find a file
rene 9394bab1fb Big Sweep: Security + Race-Conditions + Tests + DSGVO + A11y, SW by-v1095
SECURITY (auth.py, routes/auth.py, database.py, main.py)
- JWT bekommt jti; Logout trägt in neue jwt_blacklist-Tabelle ein,
  decode_token() prüft → server-side Invalidierung
- JWT-Expiry default 30 → 7 Tage (ENV JWT_EXPIRY_DAYS überschreibt)
- Sliding-Refresh-Middleware: erneuert Cookie wenn >50% verbraucht
  (Schwelle via JWT_REFRESH_FRACTION, Default 2)
- Login-Lockout in DB-Tabelle login_attempts (5 Versuche / 15 Min,
  überlebt Container-Restart) — alte In-Memory-Lockouts ersetzt
- SMTP-Versand: alle 'except: pass' durch logger.exception ersetzt;
  Fehlversuche landen in failed_emails-Tabelle für späteres Retry
- Referral-Counter Race gefixt: UPDATE partner_codes SET uses=uses+1
  ... WHERE uses<max_uses RETURNING — atomar statt SELECT+UPDATE

RACE CONDITIONS (routes/invoices.py, database.py)
- Neue invoice_counters-Tabelle für atomare Nummernvergabe
- _next_invoice_number nutzt BEGIN IMMEDIATE + atomares UPDATE
- Funktioniert für RG- und ST-Prefixe (Stornorechnungen)
- Race-Test verifiziert (5 Threads × 20 Calls = 100 eindeutige Nummern)

VERSION + TESTS + ERROR-DIGEST (VERSION, Makefile, tests/, scheduler.py)
- Neue VERSION-Datei (Single Source of Truth) — main.py liest beim
  Startup
- Makefile-Target 'make bump' propagiert in sw.js, app.js, index.html
- Makefile-Target 'make test' setzt venv auf, läuft pytest
- 19 Smoke-Tests in tests/ (health, auth, diary, invoice) — alle grün
- Scheduler: täglicher _job_error_digest um 06:30 → schickt Error-
  Zusammenfassung an ADMIN_EMAIL (still wenn keine Errors)

DSGVO + A11Y + ERSTE-HILFE
- landing.html: 'HTML und ODS' → 'JSON' (tatsächlich implementiert)
- datenschutz.js: Sektion Account-Löschung erweitert (sofort gelöscht /
  anonymisiert / 10 Jahre für Rechnungen)
- erste-hilfe.js: prominentes Warning-Banner oben (ersetzt keine
  Tierarzt-Beratung); Notfallnummern gruppiert nach Land, TODO-Platz-
  halter für AT-Uni-Klinik, CH Tox Info Suisse, CH Tierspital Zürich
- ui.js Modal: ESC schließt, Focus-Trap, Auto-Focus erstes Element,
  Restore Focus auf vorigen Caller
- impressum.js Kontaktformular: Labels mit for=cf-name etc.

NEUE DB-TABELLEN (idempotent via CREATE TABLE IF NOT EXISTS)
- jwt_blacklist, login_attempts, failed_emails, invoice_counters

NEUE ENV-VARS
- JWT_REFRESH_FRACTION (Default 2)
- JWT_EXPIRY_DAYS Default geändert (30 → 7)
2026-05-26 20:12:01 +02:00
backend Big Sweep: Security + Race-Conditions + Tests + DSGVO + A11y, SW by-v1095 2026-05-26 20:12:01 +02:00
diary Sprint 15: Suche, Ausweis, Teilen, Widget 2026-04-17 15:51:09 +02:00
promotion Dateien nach „promotion“ hochladen 2026-04-28 08:32:31 +02:00
reports Reports 2026-05-01 — Quartalsbericht 2026-05-01 08:07:41 +02:00
scripts Feature: Generische Seiten-Hilfe (UI.pageInfo), POI Multi-Select, Tagessprüche-DB (SW by-v654) 2026-05-03 20:10:01 +02:00
tests Big Sweep: Security + Race-Conditions + Tests + DSGVO + A11y, SW by-v1095 2026-05-26 20:12:01 +02:00
.env.example ki: Port 11435, Modell gemma-4-31b-it (LM Studio 0.4.x) 2026-04-24 18:15:32 +02:00
.gitignore Security: Play Store Paket aus Git entfernen (signing.keystore nicht eincheckbar) 2026-05-09 18:10:13 +02:00
docker-compose.staging.yml Fix: Storno sendet PDF+Mail+Scaninput; /scaninput Volume in staging ergänzt 2026-05-15 11:18:48 +02:00
docker-compose.yml Feature: Rechnungs-System (invoices) — Backend komplett 2026-05-15 10:04:23 +02:00
Dockerfile Fix: uvicorn --forwarded-allow-ips=* — echte Client-IP hinter NPM-Proxy sichtbar 2026-04-29 21:40:49 +02:00
Makefile Big Sweep: Security + Race-Conditions + Tests + DSGVO + A11y, SW by-v1095 2026-05-26 20:12:01 +02:00
PROJEKT.md Doku: Sprint 16 komplett — Phone-Frame, Screenshots, UX-Fixes 2026-04-27 19:44:26 +02:00
pytest.ini Big Sweep: Security + Race-Conditions + Tests + DSGVO + A11y, SW by-v1095 2026-05-26 20:12:01 +02:00
VERSION Big Sweep: Security + Race-Conditions + Tests + DSGVO + A11y, SW by-v1095 2026-05-26 20:12:01 +02:00