feat: user tombstone and retired usernames

This commit is contained in:
2026-10-26 02:03:36 +01:00
parent bde8040cc3
commit 31f5d5f337
15 changed files with 550 additions and 56 deletions

View File

@@ -59,6 +59,10 @@ pub struct InMemoryStore {
pub(super) movie_profiles: RwLock<HashMap<Uuid, MovieProfile>>,
pub(super) reviews: RwLock<HashMap<Uuid, Review>>,
pub(super) users: RwLock<HashMap<Uuid, User>>,
/// Ids of `users` rows carrying a `deleted_at` tombstone.
pub(super) tombstoned: RwLock<std::collections::HashSet<Uuid>>,
/// Lower-cased `retired_usernames` (the column is NOCASE).
pub(super) retired_usernames: RwLock<std::collections::HashSet<String>>,
pub(super) profile_fields: RwLock<HashMap<Uuid, Vec<ProfileField>>>,
pub(super) user_settings: RwLock<HashMap<Uuid, UserSettings>>,
pub(super) refresh_sessions: RwLock<Vec<RefreshSession>>,
@@ -82,6 +86,8 @@ impl InMemoryStore {
movie_profiles: RwLock::default(),
reviews: RwLock::default(),
users: RwLock::default(),
tombstoned: RwLock::default(),
retired_usernames: RwLock::default(),
profile_fields: RwLock::default(),
user_settings: RwLock::default(),
refresh_sessions: RwLock::default(),