SMTP-Credentials und E_Mail-Adressen verschlüsselt abgelegt

This commit is contained in:
concierge committed 2026-11-16 15:43:51 +01:00
1 parent 781aa20253
commit 66659d9a23
32 files changed
+3276 -132

No files matched your search

+12
View File
@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"strings"
"time"
"lektorenplan/domain"
@@ -92,6 +93,12 @@ func (s *Store) ExportResources(ctx context.Context, tenantID string) (PlanExcha
if err != nil {
return PlanExchange{}, err
}
// Contact details are only stored encrypted and tied to accounts. They are
// deliberately left out of exchange files.
for index := range people {
people[index].Email = ""
people[index].EmailLocked = false
}
absences, err := s.Absences(ctx, tenantID)
if err != nil {
return PlanExchange{}, err
@@ -198,6 +205,11 @@ func (s *Store) ApplyExchange(ctx context.Context, tenantID string, exchange Pla
}
}
for _, person := range exchange.Resources.People {
// Exchange files never carry contact details. Keep any encrypted
// values that already exist instead of deleting them on import.
if strings.TrimSpace(person.Email) == "" {
person.EmailLocked = true
}
if err := s.UpsertPerson(ctx, tenantID, person); err != nil {
return ExchangeSummary{}, err
}