From 7999fab25c5172207ee41e38732f4923565ff6b6 Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Fri, 30 Oct 2026 04:43:59 +0400 Subject: Validate controller diagnostics, reboot protection, and terminal authentication --- src/runtime.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/runtime.rs') 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); +} + #[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 { + async fn probe(&mut self, _: &Trojan, _: u64) -> Result> { bail!("Protected diagnostic probes are unavailable in this runtime") } /// Called only after disabled intent has been durably recorded. -- cgit v1.2.3