summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Remove TODO to rename for_circuit_usage in favor of #623Nick Mathewson2022-11-101-1/+0
| | |
| * | GuardMgr: Remove TODO to move `mod bridge` to another crateNick Mathewson2022-11-101-3/+0
| | | | | | | | | | | | The code seems happy enough here for now.
| * | Resolve todo!()s and TODOs around BridgeRelay::HasAddrs.Nick Mathewson2022-11-101-15/+35
| | | | | | | | | | | | | | | | | | | | | Also, add a bunch of reminders around these implementations that `HasAddrs` returns all the address associated with you for GeoIp or family purposes, even if they are _not_ ones that we should actually contact you at.
| * | GuardMgr: Docs for BridgeDescProviderNick Mathewson2022-11-081-2/+12
| | |
| * | GuardMgr: Remove a TODO pt-client comment.Nick Mathewson2022-11-081-2/+0
| |/ | | | | | | | | The BridgeSet type does not necessarily need further changes... and if it gets them, it won't be because of this comment.
* / bump rust-version to 1.60 in every crate.Nick Mathewson2022-11-101-1/+1
|/
* Merge branch 'store' into 'main'Nick Mathewson2022-11-081-2/+2
|\ | | | | | | | | | | | | Persistently cache bridge descriptors Closes #619 See merge request tpo/core/arti!831
| * bridge descs: Rename BridgeDescMgr from BridgeDescManagerIan Jackson2022-11-081-2/+2
| | | | | | | | | | | | This is more consistent with our naming elsewhere. Suggested-by: Nick Mathewson <[email protected]>
* | Try to explain exactly what lookup_bridge_circ_target doesNick Mathewson2022-11-081-0/+11
| |
* | GuardMgr: Try to explain what is going on with update()Nick Mathewson2022-11-081-10/+45
| | | | | | | | | | | | | | | | | | | | This explanation is slightly complicated by the fact that I think that one of the calls to update_guardset_internal() is possibly unnecessary, and that one of the calls that it makes is potentially ill-advised. I'm not going to make those changes right now, however, because they are potentially a little destabilizing.
* | Refactor configured_bridgesNick Mathewson2022-11-081-30/+42
| | | | | | | | | | | | | | Now it is an Option, and is set to None if bridges aren't enabled. This simplifies `replace_bridge_config` a bit, and forces us to check for `None` in a few more places.
* | GuardMgr: Document that providers should only be installed once.Nick Mathewson2022-11-081-0/+14
| | | | | | | | Enforce this with assert!() and a documented panics section.
* | GuardMgr: Fix build with bridge-client disabled.Nick Mathewson2022-11-082-1/+4
| |
* | GuardMgr: Remove no-longer-relevant `TODO pt-client` commentsNick Mathewson2022-11-084-21/+0
| | | | | | | | | | Also remove a bunch of now-unnecessary `allow(dead_code)` annotations.
* | GuardMgr: Rename an error variantNick Mathewson2022-11-082-3/+3
| |
* | GuardMgr: Spelling fixes and normalizations.Nick Mathewson2022-11-084-7/+8
| |
* | GuardMgr: do not use fallbacks when in bridge mode.Nick Mathewson2022-11-081-5/+5
| |
* | GuardMgr: When possible, return a FirstHop that can be a CircTargetNick Mathewson2022-11-083-5/+29
| | | | | | | | | | | | We do this by checking the FirstHops we're about to return, and when they correspond to bridges, looking up an appropriate BridgeRelay in the current BridgeSet (if we can).
* | GuardMgr: Refactor UniverseRef to contains Arcs.Nick Mathewson2022-11-083-27/+31
| | | | | | | | | | | | We already _have_ these Arc<>s whenever we construct a UniverseRef, so there's no real point in using &refs and making these so hard to construct.
* | GuardMgr: Remove an outdated "Limitations" comment.Nick Mathewson2022-11-081-10/+0
| | | | | | | | Found while grepping for NetDir.
* | GuardMgr: do not block netdir if we are using bridgesNick Mathewson2022-11-081-0/+4
| | | | | | | | | | | | | | The `GuardMgr` code has functionality to tell the DirMgr "Hey, don't switch to the new NetDir yet: we still need more guard information!" But we never want to do that if we're selecting bridges, since they don't come from the NetDir.
* | GuardMgr: Add UniverseType to make code more explicit.Nick Mathewson2022-11-081-7/+28
| | | | | | | | | | | | Instead of duplicating the logic about which guard sample uses which universe, we explicitly ask it, and then use that universe. This will avoid trouble if/when we introduce more samples.
* | GuardMgr: Launch a background task to keep the list of bridgeNick Mathewson2022-11-082-1/+38
| | | | | | | | descriptors updated as appropriate.
* | GuardMgr: Exit keep-netdir-updated task early if GuardMgr disappears.Nick Mathewson2022-11-081-0/+2
| |
* | GuardMgr: Pass correct universe to "Bridges" `GuardSet`.Nick Mathewson2022-11-084-15/+115
| | | | | | | | | | | | This can probably be done in a simpler way, but for the moment I would prefer to try to minimize the amount of code I'm changing here.
* | GuardMgr: Change BridgeSet, BridgeRelay to use more referencesNick Mathewson2022-11-082-29/+27
| | | | | | | | | | | | | | This will match our needs better and help avoid some `Arc<>`s. It will be especially helpful for avoiding `Arc`s we don't actually have.
* | GuardMgr: Store bridge configuration.Nick Mathewson2022-11-081-15/+56
| | | | | | | | | | | | | | | | | | | | I'm using an Arc<[]> here though I think that there's a chance that a simple Vec<> would suffice. Since it's an internal type, nothing will break if we change it later. Also, we now switch into and out of the Bridges guard sample as needed. However, that selection is not (yet) built from the list of bridges. That will come soon.
* | GuardMgr: Remove duplicate code in set_filterNick Mathewson2022-11-081-13/+2
| |
* | GuardMgr: Clarify intent with update_active_set.Nick Mathewson2022-11-081-4/+5
| | | | | | | | Also fix its behavior when using bridges.
* | GuardMgr: Split `update_internal` into two functions.Nick Mathewson2022-11-081-27/+50
| | | | | | | | | | | | The first part changes which guard set is active based on based on the parameters, which always come from a NetDir; the second changes the contents of the active guard set, based on a Universe.
* | Refactor external guardmgr APIs: Stop taking NetDir arguments.Nick Mathewson2022-11-083-59/+46
| | | | | | | | | | | | | | | | | | These arguments were used only for legacy (testing) purposes; the tests now use `TestNetDirProvider`. This lets us simplify our internal logic for passing a `NetDir` to our samples, and prepare for having a `BridgeSet` to pass there instead. This is a breaking change to `guardmgr` and `circmgr`.
* | Add an accessor for the latest BridgeDescList.Nick Mathewson2022-11-081-0/+12
| |
* | Implement GuardMgr::install_bridge_desc_providerNick Mathewson2022-11-081-6/+25
| |
* | Require Send+Sync for BridgeDescProviderNick Mathewson2022-11-081-1/+1
| | | | | | | | We require these for NetDirProvider, so this shouldn't be a big reach.
* | bridge desc: Make BridgeDescProvider DynCloneIan Jackson2022-11-071-1/+3
| | | | | | | | | | This allows the use of Box<dyn BridgeDescProvider> in callers, since Box<dyn BridgeDescProvider> is now Clone.
* | Fix typosDimitris Apostolou2022-11-061-2/+2
|/
* Merge branch 'warning' into 'main'Nick Mathewson2022-11-031-1/+1
|\ | | | | | | | | tor-guardmgr: use imported WeightThreshold in one place See merge request tpo/core/arti!825
| * tor-guardmgr: use imported WeightThreshold in one placeIan Jackson2022-11-031-1/+1
| | | | | | | | | | Without this, an unused import warning is generated when building without features.
* | guardmgr config: Provide bridge information to new and reconfigureIan Jackson2022-11-032-1/+25
| |
* | bridges config: Provide uninhabited placeholderIan Jackson2022-11-031-0/+14
| | | | | | | | | | This will avoid having to make bridge-related trait features in GuardMgr conditional, which would be non-additive.
* | guardmgr config: Introduce and require new GuardMgrConfig traitIan Jackson2022-11-033-11/+66
| | | | | | | | | | It doesn't seem to me like it makes sense to provide the backward compatibility here.
* | guardmgr config: Pass fallback list from config by referenceIan Jackson2022-11-032-11/+11
|/ | | | | This does involve additional cloning. However, soon it will mean that we can pass the whole `TorClientConfig` by reference.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* Require derive_more 0.99.3Ian Jackson2022-11-031-1/+1
| | | | | | | | 0.99.[012] have a bug https://github.com/JelteF/derive_more/issues/114 which makes the Deref derive for bridgedesc::StateGuard not work and therefore breaks minimal-versions CI. It seems simpler to require the newer version everywhere.
* Merge branch 'guards_as_bridges_part3' into 'main'Nick Mathewson2022-11-026-156/+559
|\ | | | | | | | | GuardMgr: decouple NetDir from guards and sample code. See merge request tpo/core/arti!815
| * Refactor CandidateStatus API to simplify code in descs.Nick Mathewson2022-11-022-30/+35
| | | | | | | | This removes some duplication.
| * GuardMgr: Fix and improve comments based on review.Nick Mathewson2022-11-023-6/+13
| |
| * guardmgr: fix rustdoc references.Nick Mathewson2022-11-022-3/+3
| |
| * guardmgr: Refactor candidate info; add `full_dir_info`Nick Mathewson2022-11-024-30/+72
| | | | | | | | | | | | | | Previously we always set `dir_info_missing` to `false` for new guards, since new guards could only be taken from ones that were present in the NetDir. But for bridges, we don't download their info until _after_ we have chosen them as guards.
| * guardmgr: Implement Universe for bridges.Nick Mathewson2022-11-023-2/+161
| | | | | | | | | | Now we can use a group of bridges as the basis for a sample of guards.