feat(api): GDPR data export as JSON and PDF and account and organization deletion
Users export everything stored about them, organization admins their organization's configuration, incidents, audit log and daily statistics; secrets are never included. Users delete their account after confirming with their password (or email for SSO-only accounts); organizations they alone belong to go with it, shared ones they own must be handed over first. Audit entries elsewhere stay as "deleted user". Owners delete their organization after typing its slug, including check results and aggregates. Exports and deletions are logged. Sessions pointing at a deleted organization no longer fail the console. Closes #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
f892f7c03a
commit
b58c6d5909
17 files changed
+1821
-47
No files matched your search
@@ -36,6 +36,8 @@ var auditActions = map[string]string{
|
||||
"POST /api/v1/me/totp/enable": "account.totp_enable",
|
||||
"POST /api/v1/me/totp/disable": "account.totp_disable",
|
||||
"POST /api/v1/me/totp/recovery-codes": "account.recovery_codes",
|
||||
"POST /api/v1/me/delete": "account.delete",
|
||||
"POST /api/v1/org/delete": "org.delete",
|
||||
"POST /api/v1/invitations/:token/accept": "member.join",
|
||||
"POST /api/v1/invitations/:token/signup": "member.join",
|
||||
|
||||
@@ -332,17 +334,18 @@ func auditEntries(c *gin.Context, rows []store.ListAuditEventsRow) []web.AuditEn
|
||||
if label := i18n.T(ctx, "audit.action."+r.Action); label != "audit.action."+r.Action {
|
||||
e.Action = label
|
||||
}
|
||||
var details map[string]any
|
||||
_ = json.Unmarshal(r.Details, &details)
|
||||
switch {
|
||||
case r.ActorEmail != "":
|
||||
e.Actor = r.ActorEmail
|
||||
case r.ActorUserID != nil:
|
||||
case r.ActorUserID != nil || details["actor_deleted"] == true:
|
||||
e.Actor = i18n.T(ctx, "audit.deleted_user")
|
||||
}
|
||||
if r.ActorTokenID != nil {
|
||||
e.Actor += " · " + i18n.T(ctx, "audit.via_token")
|
||||
}
|
||||
var details map[string]any
|
||||
if json.Unmarshal(r.Details, &details) == nil {
|
||||
if details != nil {
|
||||
for _, f := range auditFields {
|
||||
if v := asString(details[f]); v != "" {
|
||||
e.Target = v
|
||||
|
||||
Reference in new issue
Block a user