Vollständiges Zugangs-/Rollen-/Rechtesystem gebaut (Anforderungsdokument): D1-Datenbank, AES-verschlüsselte Codes nur für Owner einsehbar, granulare Permissions, Session-Auth mit Lockout, Zugänge-&-Teammitglieder-Verwaltungsseite, Bewerbungen mit Status/Notizen/Entwürfen

This commit is contained in:
2026-07-31 00:37:04 +02:00
parent 96087f460e
commit 6a1c0e355c
18 changed files with 2283 additions and 539 deletions
+15
View File
@@ -0,0 +1,15 @@
/* =====================================================================
audit.js — Aktivitätsprotokoll
WICHTIG: Codes dürfen hier NIEMALS im Klartext (oder auch nur
teilweise) auftauchen. `detail` ist für zusätzlichen, unkritischen
Kontext gedacht (z.B. "role: rechte-hand"), niemals für Geheimnisse.
===================================================================== */
import { nowIso } from "./crypto.js";
export async function logAction(env, actor, action, target, detail) {
await env.DB.prepare(
`INSERT INTO audit_log (actor, action, target, detail, created_at) VALUES (?, ?, ?, ?, ?)`
)
.bind(actor, action, target || null, detail ? JSON.stringify(detail) : null, nowIso())
.run();
}