feat: ConfigSource enum, RwLock provider_registry, is_admin in UserResponse, available_provider_types

This commit is contained in:
2026-03-16 03:30:44 +01:00
parent 0e51b7c0f1
commit 46333853d2
8 changed files with 131 additions and 78 deletions

View File

@@ -15,14 +15,15 @@ use tokio::sync::broadcast;
use crate::config::Config;
use crate::events::EventBus;
use crate::log_layer::LogLine;
use domain::{ActivityLogRepository, ChannelService, ScheduleEngineService, UserService};
use domain::{ActivityLogRepository, ChannelService, ProviderConfigRepository, ScheduleEngineService, UserService};
#[derive(Clone)]
pub struct AppState {
pub user_service: Arc<UserService>,
pub channel_service: Arc<ChannelService>,
pub schedule_engine: Arc<ScheduleEngineService>,
pub provider_registry: Arc<infra::ProviderRegistry>,
pub provider_registry: Arc<tokio::sync::RwLock<Arc<infra::ProviderRegistry>>>,
pub provider_config_repo: Arc<dyn ProviderConfigRepository>,
pub cookie_key: Key,
#[cfg(feature = "auth-oidc")]
pub oidc_service: Option<Arc<OidcService>>,
@@ -52,7 +53,8 @@ impl AppState {
user_service: UserService,
channel_service: ChannelService,
schedule_engine: ScheduleEngineService,
provider_registry: Arc<infra::ProviderRegistry>,
provider_registry: Arc<tokio::sync::RwLock<Arc<infra::ProviderRegistry>>>,
provider_config_repo: Arc<dyn ProviderConfigRepository>,
config: Config,
event_tx: EventBus,
log_tx: broadcast::Sender<LogLine>,
@@ -123,6 +125,7 @@ impl AppState {
channel_service: Arc::new(channel_service),
schedule_engine: Arc::new(schedule_engine),
provider_registry,
provider_config_repo,
cookie_key,
#[cfg(feature = "auth-oidc")]
oidc_service,