use std::sync::OnceLock; use uuid::Uuid; static SYSTEM_UID: OnceLock = OnceLock::new(); /// Register the platform system actor (AI bot) that MCP internal keys act as. /// Once set, every authorization check treats this uid as the owner of every /// space and repository. The account is a bot with login prohibited, so it can /// only ever be reached through the internal MCP key path. pub fn set_system_uid(uid: Uuid) { let _ = SYSTEM_UID.set(uid); } pub fn system_uid() -> Option { SYSTEM_UID.get().copied() } pub fn is_system_uid(uid: Uuid) -> bool { SYSTEM_UID.get().is_some_and(|value| *value == uid) }