Downgrade every "TODO HS" in tor-hsservice

These are all service-specific, and not client-specific.
This commit is contained in:
Nick Mathewson 2023-06-20 13:30:56 -04:00
parent 2fa8a4e56c
commit a812a486c3
5 changed files with 26 additions and 26 deletions

View File

@ -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).

View File

@ -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<T> = std::result::Result<T, Error>;
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<dyn Any>, 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?
}

View File

@ -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.
}

View File

@ -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

View File

@ -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<Mutex<>>, and have an inner
// TODO hss: We might want to wrap this in an Arc<Mutex<>>, and have an inner
// structure that contains these elements. Or we might want to refactor this in
// some other way.
pub struct OnionService<R: Runtime> {
@ -24,15 +24,15 @@ pub struct OnionService<R: Runtime> {
netdir_provider: Arc<dyn NetDirProvider>,
/// 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<CircMgr<R>>,
/// 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<R: Runtime> {
impl<R: Runtime> OnionService<R> {
/// 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<R: Runtime> OnionService<R> {
/// 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<R: Runtime> OnionService<R> {
/// 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
}
}