IMP-07: mehrfach-postfach-verwaltung-pro-tenant
Verwaltung mehrerer Postfächer je Mandant: Anlage, getrennte Abrufkonfiguration pro Postfach. - store.go: Postgres-Store, beliebig viele unabhängige Postfächer je Mandant, eigene Abrufparameter (Intervall, Host/Port/Benutzername, Ordnerauswahl) je Postfach. Passwort nie im Klartext gespeichert — Wiederverwendung von mail/internal/crypto (ARC-02, unverändert) für Envelope-Encryption. List filtert strikt nach tenant_slug, Update/Delete streng auf tenant_slug+id beschränkt. Prüfungen (alle real durchgeführt, siehe mail/docs/IMP-07-PRUEFPROTOKOLL.md): 1. TestList_TwoTenantsWithMultipleMailboxesSeeOnlyOwn: zwei Mandanten sehen real ausschließlich eigene Postfächer. 2. TestDelete_DoesNotAffectSiblingMailboxes: Löschen real ohne Auswirkung auf Geschwister-Postfächer. 3. TestUpdate_ConfigChangeDoesNotAffectOtherMailboxes: Änderung real isoliert auf ein Postfach beschränkt. Kein Umbau: mail/internal/crypto unverändert wiederverwendet. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HhgFcLS8tYMhDJpP74C6AQ
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
145a161f8a
commit
5dcfa36f99
@@ -0,0 +1,15 @@
|
||||
CREATE TABLE IF NOT EXISTS mail_mailboxes (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
tenant_slug TEXT NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
imap_host TEXT NOT NULL,
|
||||
imap_port INT NOT NULL DEFAULT 993,
|
||||
imap_username TEXT NOT NULL,
|
||||
wrapped_password_dek BYTEA NOT NULL,
|
||||
encrypted_password BYTEA NOT NULL,
|
||||
folder_selection TEXT NOT NULL DEFAULT 'INBOX',
|
||||
interval_seconds INT NOT NULL DEFAULT 300,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
UNIQUE (tenant_slug, name)
|
||||
)
|
||||
Reference in New Issue
Block a user