diff options
Diffstat (limited to 'crates/arti/src/rpc')
| -rw-r--r-- | crates/arti/src/rpc/session.rs | 4 | ||||
| -rw-r--r-- | crates/arti/src/rpc/superuser.rs | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/crates/arti/src/rpc/session.rs b/crates/arti/src/rpc/session.rs index 853e6ae21..be1bca55b 100644 --- a/crates/arti/src/rpc/session.rs +++ b/crates/arti/src/rpc/session.rs @@ -12,7 +12,7 @@ use tor_rtcompat::Runtime; use crate::{ proxy::port_info, - reload_cfg::LaunchableTorClient, + reload_cfg::{CfgMgr, LaunchableTorClient}, rpc::{listener::RpcConnInfo, superuser::RpcSuperuser}, }; @@ -82,6 +82,7 @@ impl ArtiRpcSession { client_root: &Arc<TorClient<R>>, launchable_client: &Arc<LaunchableTorClient<R>>, arti_state: &Arc<RpcVisibleArtiState>, + cfg_mgr: &Arc<CfgMgr<R>>, listener_info: &RpcConnInfo, ) -> Arc<Self> { let _ = auth; // This is currently unused; any authentication gives the same result. @@ -91,6 +92,7 @@ impl ArtiRpcSession { session.provide_superuser_permission(Arc::new(RpcSuperuser::new( client_root.clone(), launchable_client.clone(), + cfg_mgr.clone(), )) as _); } Arc::new(ArtiRpcSession { diff --git a/crates/arti/src/rpc/superuser.rs b/crates/arti/src/rpc/superuser.rs index c8a3a5cb8..9e36e608f 100644 --- a/crates/arti/src/rpc/superuser.rs +++ b/crates/arti/src/rpc/superuser.rs @@ -13,7 +13,7 @@ use std::sync::Arc; use tor_rpcbase::{self as rpc}; use tor_rtcompat::Runtime; -use crate::reload_cfg::LaunchableTorClient; +use crate::reload_cfg::{CfgMgr, LaunchableTorClient}; /// An object representing superuser access to Arti over an RPC session. /// @@ -27,6 +27,10 @@ pub(super) struct RpcSuperuser<R: Runtime> { /// A wrapper around `tor_client` with the ability to launch a deferred-bootstrap client. launchable: Arc<LaunchableTorClient<R>>, + + /// A handle to the manager for configuration information. + #[allow(unused)] // TODO(rpc) remove + cfg_mgr: Arc<CfgMgr<R>>, } impl<R: Runtime> RpcSuperuser<R> { @@ -34,10 +38,12 @@ impl<R: Runtime> RpcSuperuser<R> { pub(super) fn new( tor_client: Arc<TorClient<R>>, launchable: Arc<LaunchableTorClient<R>>, + cfg_mgr: Arc<CfgMgr<R>>, ) -> Self { RpcSuperuser { tor_client, launchable, + cfg_mgr, } } |
