From a812a486c366326908f063d8ced2380afb0a2ccf Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 20 Jun 2023 13:30:56 -0400 Subject: [PATCH] Downgrade every "TODO HS" in tor-hsservice These are all service-specific, and not client-specific. --- crates/tor-hsservice/src/keys.rs | 12 ++++++------ crates/tor-hsservice/src/lib.rs | 12 ++++++------ crates/tor-hsservice/src/status.rs | 2 +- crates/tor-hsservice/src/streamproxy.rs | 4 ++-- crates/tor-hsservice/src/svc.rs | 22 +++++++++++----------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/crates/tor-hsservice/src/keys.rs b/crates/tor-hsservice/src/keys.rs index 4436ff429..1a1e0b9af 100644 --- a/crates/tor-hsservice/src/keys.rs +++ b/crates/tor-hsservice/src/keys.rs @@ -1,9 +1,9 @@ //! HS service key specifiers. /// KP_hs_id, KS_hs_id. -#[allow(unused)] // TODO hs: remove +#[allow(unused)] // TODO hss: remove struct HsServiceIdentityKeySpecifier { - // TODO hs: fill out the implementation. + // TODO hss: fill out the implementation. // // NOTE: this is just a sketch and might not be the right way of representing HS service // specifiers (i.e. maybe we shouldn't have a separate *Specifier struct for each type of key). @@ -12,9 +12,9 @@ struct HsServiceIdentityKeySpecifier { } /// KP_hs_blind_id, KS_hs_blind_id. -#[allow(unused)] // TODO hs: remove +#[allow(unused)] // TODO hss: remove struct HsServiceBlindedKeySpecifier { - // TODO hs: fill out the implementation. + // TODO hss: fill out the implementation. // // NOTE: this is just a sketch and might not be the right way of representing HS service // specifiers (i.e. maybe we shouldn't have a separate *Specifier struct for each type of key). @@ -23,9 +23,9 @@ struct HsServiceBlindedKeySpecifier { } /// KP_hs_desc_sign, KS_hs_desc_sign. -#[allow(unused)] // TODO hs: remove +#[allow(unused)] // TODO hss: remove struct HsServiceDescriptorSigningKeySpecifier { - // TODO hs: fill out the implementation. + // TODO hss: fill out the implementation. // // NOTE: this is just a sketch and might not be the right way of representing HS service // specifiers (i.e. maybe we shouldn't have a separate *Specifier struct for each type of key). diff --git a/crates/tor-hsservice/src/lib.rs b/crates/tor-hsservice/src/lib.rs index 9b2c69a97..5e39b8635 100644 --- a/crates/tor-hsservice/src/lib.rs +++ b/crates/tor-hsservice/src/lib.rs @@ -1,7 +1,7 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg))] #![doc = include_str!("../README.md")] -// TODO hs: Add complete suite of warnings here. -#![allow(dead_code, unused_variables)] // TODO hs remove. +// TODO hss: Add complete suite of warnings here. +#![allow(dead_code, unused_variables)] // TODO hss remove. mod err; mod keys; @@ -23,24 +23,24 @@ pub type Result = std::result::Result; pub trait StreamHandler { /// Handle an incoming stream request on a given onion service. // - // TODO hs: the `circ_info` argument should have data about the circuit on + // TODO hss: the `circ_info` argument should have data about the circuit on // which the request arrived. If the client authenticated, it might tell us // who they are. Or it might have information about how many requests // (and/or failed requests) we've gotten on the circuit. // - // TODO hs: The `circ_info` argument should at a minimum include the + // TODO hss: The `circ_info` argument should at a minimum include the // circuit; ideally in a form that we can get a weak reference to it, and // use it in the key of a `PtrWeakKeyHashMap`. (Or we could stick the info // in the circuit itself somehow, and access it as a Box, but // that's a bit sketchy type-wise.) // - // TODO hs: the `stream` argument should be an IncomingStream from + // TODO hss: the `stream` argument should be an IncomingStream from // tor-proto, but that branch is not yet merged as of this writing. async fn handle_request(&self, circ_info: &(), stream: ()); } mod mgr { - // TODO hs: Do we want to have the notion of a collection of onion services, + // TODO hss: Do we want to have the notion of a collection of onion services, // running in tandem? Or is that a higher-level crate, possibly a part of // TorClient? } diff --git a/crates/tor-hsservice/src/status.rs b/crates/tor-hsservice/src/status.rs index ed7abf2bd..2324e0102 100644 --- a/crates/tor-hsservice/src/status.rs +++ b/crates/tor-hsservice/src/status.rs @@ -1,4 +1,4 @@ pub struct OnionServiceStatus { - // TODO hs Should say how many intro points are active, how many descriptors + // TODO hss Should say how many intro points are active, how many descriptors // are updated, whether we're "healthy", etc. } diff --git a/crates/tor-hsservice/src/streamproxy.rs b/crates/tor-hsservice/src/streamproxy.rs index 83e0aac57..4f5bd9b68 100644 --- a/crates/tor-hsservice/src/streamproxy.rs +++ b/crates/tor-hsservice/src/streamproxy.rs @@ -14,7 +14,7 @@ pub(crate) struct StreamProxy { } impl StreamProxy { - // TODO hs need a new() function. It should reject non-localhost addresses + // TODO hss need a new() function. It should reject non-localhost addresses // by default, and have a way to override. (Alternatively, that should be // done in the configuration code?) } @@ -22,7 +22,7 @@ impl StreamProxy { #[async_trait] impl StreamHandler for StreamProxy { async fn handle_request(&self, circinfo: &(), stream: ()) { - todo!() // TODO hs: implement + todo!() // TODO hss: implement // - Look up the port for the incoming stream request. // - If no port is found, reject the request, and possibly increment a diff --git a/crates/tor-hsservice/src/svc.rs b/crates/tor-hsservice/src/svc.rs index ea4349e27..c942ab55f 100644 --- a/crates/tor-hsservice/src/svc.rs +++ b/crates/tor-hsservice/src/svc.rs @@ -8,7 +8,7 @@ use crate::{OnionServiceStatus, Result}; /// A handle to an instance of an onion service. // -// TODO hs: We might want to wrap this in an Arc>, and have an inner +// TODO hss: We might want to wrap this in an Arc>, and have an inner // structure that contains these elements. Or we might want to refactor this in // some other way. pub struct OnionService { @@ -24,15 +24,15 @@ pub struct OnionService { netdir_provider: Arc, /// A circuit manager to use in making circuits to our introduction points, /// HsDirs, and rendezvous points. - // TODO hs: Maybe we can make a trait that only gives a minimal "build a + // TODO hss: Maybe we can make a trait that only gives a minimal "build a // circuit" API from CircMgr, so that we can have this be a dyn reference // too? circmgr: Arc>, /// Private keys in actual use for this onion service. /// - /// TODO hs: This will need heavy refactoring. + /// TODO hss: This will need heavy refactoring. /// - /// TODO hs: There's a separate blinded ID, certificate, and signing key + /// TODO hss: There's a separate blinded ID, certificate, and signing key /// for each active time period. keys: (), /// Status for each active introduction point for this onion service. @@ -47,7 +47,7 @@ pub struct OnionService { impl OnionService { /// Create (but do not launch) a new onion service. pub fn new(config: (), netdir_provider: (), circmgr: ()) -> Self { - todo!(); // TODO hs + todo!(); // TODO hss } /// Change the configuration of this onion service. @@ -56,24 +56,24 @@ impl OnionService { /// that the identity of a service is fixed. We might want to make the /// storage backing this, and the anonymity status, unchangeable.) pub fn reconfigure(&self, new_config: ()) -> Result<()> { - todo!() // TODO hs + todo!() // TODO hss } /// Tell this onion service about some new short-term keys it can use. pub fn add_keys(&self, keys: ()) -> Result<()> { - todo!() // TODO hs + todo!() // TODO hss } /// Return the current status of this onion service. pub fn status(&self) -> OnionServiceStatus { - todo!() // TODO hs + todo!() // TODO hss } - // TODO hs let's also have a function that gives you a stream of Status + // TODO hss let's also have a function that gives you a stream of Status // changes? Or use a publish-based watcher? /// Tell this onion service to begin running. pub fn launch(&self) -> Result<()> { - todo!() // TODO hs + todo!() // TODO hss // This needs to launch at least the following tasks: // @@ -105,6 +105,6 @@ impl OnionService { /// You can also shut down an onion service completely by dropping the last /// Clone of it. pub fn stop(&self) -> Result<()> { - todo!() // TODO hs + todo!() // TODO hss } }