namespace AIStudio.Tools.PluginSystem; /// /// Static container for pending API keys during plugin loading. /// public static class PendingEnterpriseApiKeys { private static readonly List PENDING_KEYS = []; private static readonly Lock LOCK = new(); /// /// Adds a pending API key to the list. /// /// The pending API key to add. public static void Add(PendingEnterpriseApiKey key) { lock (LOCK) PENDING_KEYS.Add(key); } /// /// Gets and clears all pending API keys. /// /// A list of all pending API keys. public static IReadOnlyList GetAndClear() { lock (LOCK) { var keys = PENDING_KEYS.ToList(); PENDING_KEYS.Clear(); return keys; } } }