diff options
author | Gabriela Moldovan <gabi@torproject.org> | 2023-09-18 17:20:36 +0100 |
---|---|---|
committer | Gabriela Moldovan <gabi@torproject.org> | 2023-09-18 17:36:59 +0100 |
commit | 2c4d9652663cee7d4e75c1103d60884a55ad7213 (patch) | |
tree | 9b181dc46ab2c3991f39b4c96beceded587eae50 | |
parent | 9f27d7cc1ca39377fdd6257427148856ec1aa43a (diff) | |
download | arti-2c4d9652663cee7d4e75c1103d60884a55ad7213.tar.gz arti-2c4d9652663cee7d4e75c1103d60884a55ad7213.zip |
tor-hsservice: Derive PartialEq for Anonimity and DescEncryptionConfig.
This will enable the descriptor publisher to tell whether it needs to
update the descriptor.
When the publisher is notified of an `OnionServiceConfig` change, it
checks whether the `anonimity` or `encrypt_descriptor` fields have
changed. If they have, it rebuilds and republishes the descriptor
using the new values (note: the publisher changes will be implemented in
a future commit).
-rw-r--r-- | crates/tor-hsservice/src/anon_level.rs | 2 | ||||
-rw-r--r-- | crates/tor-hsservice/src/config.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/tor-hsservice/src/anon_level.rs b/crates/tor-hsservice/src/anon_level.rs index 91deed7aa..b07bd7475 100644 --- a/crates/tor-hsservice/src/anon_level.rs +++ b/crates/tor-hsservice/src/anon_level.rs @@ -1,7 +1,7 @@ //! Define the `Anonymity` type to indicate a level of anonymity. /// The level of anonymity that an onion service should try to run with. -#[derive(Debug, Default, Copy, Clone)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] #[non_exhaustive] pub enum Anonymity { /// Try to keep the location of the onion service private. diff --git a/crates/tor-hsservice/src/config.rs b/crates/tor-hsservice/src/config.rs index bedfd4bb4..17570d1de 100644 --- a/crates/tor-hsservice/src/config.rs +++ b/crates/tor-hsservice/src/config.rs @@ -136,7 +136,7 @@ impl TokenBucketConfig { } /// Configuration for descriptor encryption. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct DescEncryptionConfig { /// A list of our authorized clients. /// @@ -150,7 +150,7 @@ pub struct DescEncryptionConfig { } /// A single client (or a collection of clients) authorized using the descriptor encryption mechanism. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] #[non_exhaustive] pub enum AuthorizedClientConfig { /// A directory full of authorized public keys. |