summaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src/config.rs
Commit message (Collapse)AuthorAgeFilesLines
* Turn FallbackList into a real type, and store one in GuardMgr.Nick Mathewson2022-03-301-9/+17
| | | | | | | | | | | | | | The guard manager is responsible for handing out the first hops of tor circuits, keeping track of their successes and failures, and remembering their states. Given that, it makes sense to store this information here. It is not yet used; I'll be fixing that in upcoming commits. Arguably, this information no longer belongs in the directory manager: I've added a todo about moving it. This commit will break compilation on its own in a couple of places; subsequent commits will fix it up.
* Move fallback.rs into guardmgr.Nick Mathewson2022-03-301-2/+2
| | | | | | | This is the logical place for it, I think: the GuardMgr's job is to pick the first hop for a circuit depending on remembered status for possible first hops. Making this change will let us streamline the code that interacts with these objects.
* Abolish filter::DynFilter in favour of transparent DirFilterIan Jackson2022-03-251-1/+1
| | | | | | | | | | | | There are two reasons why the DynFilter newtype might be needed: 1. To impl Default. But we don't need it to impl Default since we can have an accessor which does the defaulting. 2. To hide the API. But this is usrely an unstable API. Just writing Arc<dyn> gets rid of a lot of unnecessary boilerplate and conversion code.
* dirmgr: Initial DirFilter code.Nick Mathewson2022-03-241-0/+16
| | | | | | This code sits behind a feature flag, and can be used to modify directories before storing them. This is part of the implementation for #397.
* dirmgr: NetworkConfig: Abolish accessorsIan Jackson2022-03-181-16/+8
| | | | Using accessors for crate-only fields is otiose.
* dirmgr: NetworkConfig: Rename fallbacks struct fieldIan Jackson2022-03-181-6/+9
| | | | | | Rename this to be named the same as its accessor, and use the rename feature of builder and serde. (The shorter name is nicer in the code IMO.)
* DirMgrConfig: abolish builder; make it transparent and exhaustiveIan Jackson2022-03-161-56/+32
| | | | See rationale in the comment.
* Follow-up from arti!318Nick Mathewson2022-03-111-1/+10
| | | | Make update_config only conditionally exported; add semver-status update.
* Merge branch 'add-flatfile-dirmgr' into 'main'Nick Mathewson2022-03-111-6/+6
|\ | | | | | | | | Add flatfile DirMgr See merge request tpo/core/arti!318
| * Expose APIs for external DirProviderChristian Grigis2022-03-111-6/+6
| |
* | Drop remaining conversion from FooConfig to FooConfigBuilderIan Jackson2022-03-071-22/+0
| |
* | Derive Deserialize for derive-builder-generated config buildersIan Jackson2022-03-071-0/+3
|/ | | | | | | | | | | | | I used git-grep -P '\#\[serde\((?!default|deny_unknown)' to find places where I needed to add additional attributes on the builder method fields. This is currently a bit duplicative, but when #371 is completely done, the validated (non-builder) configs won't need to be Deserialize any more. This is part of #371 and #372.
* Use RsaIdentity::from_hex() and hex::decode_to_slice in more placesNick Mathewson2022-03-041-3/+1
| | | | These aren't critical-path, but they do make the code a little nicer.
* dirmgr: add Store traittharvik2022-02-231-8/+8
|
* Make much of DirMgrConfig reconfigurable.Nick Mathewson2021-12-071-12/+54
| | | | | | | | | | We can't change the authorities while in-flight: that would be pretty miserable to implement. Similarly we can't change the cache while in-flight. Everything else should be fair game, though there are a couple of tricky bits. I've tried to document those.
* Sketch API for reconfiguration.Nick Mathewson2021-12-071-0/+5
| | | | | | | This patch doesn't actually make anything reconfigurable, but it does create an API that will tell you "you can't change the value of that!" If the API looks reasonable, I can start making it possible to change the values of individual items.
* More typo fixes that I forgot to save :(Nick Mathewson2021-11-241-1/+1
|
* Make every Config type implement Eq.Nick Mathewson2021-11-211-3/+3
| | | | | Doing this is necessary for reconfiguration support, and will help a lot with testing, too.
* Give every ConfigBuilder a From<Config> implementation.Nick Mathewson2021-11-211-6/+25
| | | | This will make it more convenient to reconfigure things.
* Use named fields for the elements of ConfigBuildErrorNick Mathewson2021-11-181-4/+4
|
* Rename RetryConfig to DownloadSchedule, fold in parallelism.Nick Mathewson2021-11-181-34/+23
|
* Move top-level configuration downwards from `arti` to `arti-config`.Nick Mathewson2021-11-181-5/+9
| | | | | | | | To do this at all neatly, I had to split out `tor-config` from `arti-config` again, and putting the lower level stuff (paths, builder errors) into tor-config. I also changed our use of derive_builder to always use a common error type, to avoid error type proliferation.
* Try writing a bit more documentation for configuration types.Nick Mathewson2021-10-281-2/+13
|
* Replace references to arti-client in the documentation.Nick Mathewson2021-10-211-2/+2
|
* Use unwrap in tests.Jani Monoses2021-10-181-9/+15
| | | | | | | | | For now, this avoids having to separately handle AuthorityBuilderError, DirMgrConfigBuilderError, DownloadScheduleConfigBuilderError, NetworkConfigBuilderError and FallbackDirBuilderError when anyhow is not used. Turn off a clippy warning.
* Lock down some dirmgr config functions.Nick Mathewson2021-10-091-11/+11
|
* Re-export configuration types from tor-client.Nick Mathewson2021-10-091-0/+5
|
* Do not use set_ prefix on derive_builder settersJani Monoses2021-09-161-3/+3
|
* Use derive_builder for Authority and FallbackDir.Nick Mathewson2021-09-101-34/+0
|
* Use derive_builder for the rest of tor_dirmgr::configNick Mathewson2021-09-091-80/+21
|
* Use derive_builder for DownloadScheduleConfigNick Mathewson2021-09-081-66/+7
|
* Use derive_builder for NetworkConfig.Nick Mathewson2021-09-081-97/+37
|
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-0/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+594
This will cause some pain for now, but now is really the best time to do this kind of thing.