diff options
| author | Andrew Guschin <guschin@altlinux.org> | 2026-10-30 04:43:59 +0400 |
|---|---|---|
| committer | Andrew Guschin <guschin@altlinux.org> | 2026-10-30 04:43:59 +0400 |
| commit | 7999fab25c5172207ee41e38732f4923565ff6b6 (patch) | |
| tree | 0e239d6ba65d4babfc0f1007ac350f6f4f9e73d1 /src/runtime.rs | |
| parent | fc3c1d51b1be9db6ba6ad286584fbc34bb305f38 (diff) | |
Validate controller diagnostics, reboot protection, and terminal authentication
Diffstat (limited to 'src/runtime.rs')
| -rw-r--r-- | src/runtime.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/runtime.rs b/src/runtime.rs index 2d5552d..d1b5798 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -2,6 +2,18 @@ use crate::model::Trojan; use anyhow::{Result, bail}; use async_trait::async_trait; +/// A verified local proxy connection owned by a runtime probe session. +pub struct ProbeConnection<'a> { + pub proxy_url: &'a str, + pub certificate: &'a str, +} + +#[async_trait] +pub trait ProbeSession: Send { + fn connection(&self) -> ProbeConnection<'_>; + async fn stop(self: Box<Self>); +} + #[async_trait] pub trait Runtime: Send { /// Protection must be installed before durable enabled intent changes. @@ -14,7 +26,7 @@ pub trait Runtime: Send { async fn maintain(&mut self, connection: Option<&Trojan>, generation: u64) -> Result<()> { self.apply(connection, generation).await } - async fn probe(&mut self, _: &Trojan, _: u64) -> Result<crate::xray::Probe> { + async fn probe(&mut self, _: &Trojan, _: u64) -> Result<Box<dyn ProbeSession>> { bail!("Protected diagnostic probes are unavailable in this runtime") } /// Called only after disabled intent has been durably recorded. |