feat: change email, export my data, delete account (with data anonymization)

This commit is contained in:
Florian Sylvain committed 2026-10-30 20:19:07 +01:00
1 parent bb191c389a
commit 10a66cd979
123 files changed
+10789 -76

No files matched your search

+7
View File
@@ -106,6 +106,12 @@ const (
ActionUserChangeRole = "user.change_role"
ActionUserTransferOwnership = "user.transfer_ownership"
ActionUserRemove = "user.remove"
ActionUserRequestEmail = "user.request_email_change"
ActionUserResendEmail = "user.resend_email_change"
ActionUserCancelEmail = "user.cancel_email_change"
ActionUserConfirmEmail = "user.confirm_email_change"
ActionUserExportData = "user.export_data"
ActionUserDeleteAccount = "user.delete_account"
ActionInviteCreate = "invite.create"
ActionInviteCancel = "invite.cancel"
ActionInviteRenew = "invite.renew"
@@ -132,6 +138,7 @@ const (
const (
SystemActorName = "System"
ReasonWrongLogin = "Wrong username or password."
ReasonWrongPassword = "Wrong password."
MaxUserAgentLength = 255
ParamRemoved = "removed"
ParamFrom = "from"
+19
View File
@@ -0,0 +1,19 @@
package audit
import "strconv"
func (e Event) ConcernsOtherPerson(userID uint32, ownAuthorID *uint32) bool {
switch e.Target.Type {
case TargetUser:
return e.Target.ID != formatID(userID)
case TargetInvite:
return true
case TargetAuthor:
return ownAuthorID == nil || e.Target.ID != formatID(*ownAuthorID)
}
return false
}
func formatID(id uint32) string {
return strconv.FormatUint(uint64(id), 10)
}
@@ -9,6 +9,7 @@ type Repository interface {
DeleteOlderThan(cutoff time.Time) (int, error)
DeleteOldest(limit int, before time.Time) (int, error)
SizeBytes() (int64, error)
AnonymiseUser(userID uint32, ownAuthorID *uint32, name string) error
}
type SettingsRepository interface {