Refactor proxy routing and installer flows

This commit is contained in:
2026-07-08 11:05:52 +03:00
parent e745633d91
commit 88d5b94133
14 changed files with 1899 additions and 487 deletions
+3 -24
View File
@@ -437,39 +437,18 @@ impl Clock for SystemClock {
}
}
pub struct StagedApplyHelper;
impl ProxyApplyHelper for StagedApplyHelper {
fn apply_proxy_config(
&self,
request: HelperApplyRequest<'_>,
) -> Result<HelperApplyResult, CommandError> {
Ok(HelperApplyResult {
success: true,
changed: true,
action: format!("{}.stage-generated-config", request.adapter_id),
message: format!(
"Сгенерированный конфиг подготовлен в {}; интеграция привилегированного помощника еще не подключена",
request.config_path.display()
),
})
}
}
pub struct DetectedProxyApplyHelper<H = SystemProxyfierDetectionHost> {
host: H,
}
impl DetectedProxyApplyHelper<SystemProxyfierDetectionHost> {
pub fn system() -> Self {
Self {
host: SystemProxyfierDetectionHost,
}
SystemProxyfierDetectionHost.into()
}
}
impl<H> DetectedProxyApplyHelper<H> {
pub fn new(host: H) -> Self {
impl<H> From<H> for DetectedProxyApplyHelper<H> {
fn from(host: H) -> Self {
Self { host }
}
}