mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 08:27:04 +00:00
Desktop persistence for the AuthApprovalPolicy in commons. Backs the `auth_approvals` use case from the plan using java.util.prefs.Preferences instead of the originally proposed sibling outbox.db SQLite table. Trade-off rationale: the AUTH approval set per account is small (typically < 50 relays for any user) and the read pattern is bounded (one lookup per relay per session, easily cached in memory by the policy layer). java.util.prefs is already in use elsewhere on desktop (SearchHistoryStore, DesktopPreferences) and adds zero new dependencies or schema migrations. The retry_queue table from the same outbox.db proposal needs the higher-throughput characteristics SQLite gives us; it remains scoped to P3 (send visibility), which can introduce a proper sibling DB at that point. Per-account scoping by Preferences node — logout/account-delete calls clear() which removeNode()s the subtree. ONCE scope is never written to disk, enforced explicitly here in addition to the interface contract. Not yet wired into a DesktopAuthCoordinator (today desktop has NO AUTH wiring at all). That wiring lands in P2.5 alongside the banner UI.