aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr
Commit message (Collapse)AuthorAgeFilesLines
...
* | | BridgeConfigBuilder: Allow (de)ser to/from bridge linesIan Jackson2022-11-211-2/+39
| | | | | | | | | | | | | | | | | | That the *de*serialisation works as expected will be tested properly in just a moment, because when we plumb this all the way through, it will be what parses the bridge lines in the example config file.
* | | BridgeConfigBuilder: Implement FromStrIan Jackson2022-11-211-1/+46
| | |
* | | BridgeConfigBuilder: Introduce build() functionIan Jackson2022-11-212-8/+256
| | | | | | | | | | | | And test cases for it, and its errors.
* | | BridgeConfigBuilder: Introduce the struct with the dictionary reprIan Jackson2022-11-214-6/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This struct is going to be the principal "dictionary-style" serde representation for a bridge, and the builder, making this all in keeping with our usual approach. In this commit: * Introduce the struct (defining the serialisation) * Provide the setters (defining the Rust API) * Add success test cases (not all of the data in which is used yet)
* | | BridgeAddr rename: update tor_guardmgr::bridge::configIan Jackson2022-11-211-5/+5
| |/ |/| | | | | | | Here is where my motivation is and I'm working on this code now, so do this renaming cleanup now.
* | Merge branch 'mark-bridges-not-experimental' into 'main'Nick Mathewson2022-11-182-2/+14
|\ \ | | | | | | | | | | | | | | | | | | Mark bridge and PT-related APIs as non-experimental. Closes #643 See merge request tpo/core/arti!865
| * | guardmgr: Make bridge-client and pt-client non-experimentalNick Mathewson2022-11-182-2/+14
| |/
* | Merge branch 'log_guard_status' into 'main'Nick Mathewson2022-11-183-21/+39
|\ \ | | | | | | | | | | | | | | | | | | GuardMgr: Log significant guard/bridge status changes at info/warn Closes #627 See merge request tpo/core/arti!869
| * | GuardMgr: Log when a guard status changes (significantly).Nick Mathewson2022-11-172-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously had a trace message on _every_ change. That's fine, but we also want to log more important changes where the user can see them. Namely: * If we go from any other status to Reachable, we want to tell the user. (We don't want to spam them if it was already reachable.) * If we go from Untried or Reachable to Unreachable, we want to tell the user. (We don't tell them about changes from Retriable to Unreachable, since that just means that a retry attempt was not successful.) Closes #627.
| * | GuardMgr: split Reachable::Unknown into Untried and RetriableNick Mathewson2022-11-172-20/+21
| |/ | | | | | | | | | | | | | | There are two cases here, and we will want to log them differently. (By removing the "Unknown" variant entirely, we ensure that we didn't miss any code that formerly checked for Unknown.)
* | GuardMgr: Add Instant to update().Nick Mathewson2022-11-162-20/+38
| | | | | | | | | | | | | | | | | | | | | | This lets us avoid calling `Instant::now()`, when `Runtime::now()` is what we want. Unfortunately, there are a bunch of functions that called `update()` that needed to change. Fortunately, none of the changes were very complicated. Fixes a `TODO pt-client` comment.
* | GuardMgr: Rename "now" arg in update() to "wallclock"Nick Mathewson2022-11-161-10/+10
|/ | | | | | | I'm about to add an `Instant` argument. By convention, when we have both, we call the Instant "now". This commit is a pure renaming.
* Allow a subset-only ChanMethod match when looking up a BridgeConfigNick Mathewson2022-11-151-1/+5
| | | | | | | | | If we have a bridge guard that is using Direct connection and it knows multiple addresses, our code to match it with a BridgeConfig is wrong, because the BridgeConfig has only one address, and our code looks for an exact match. Fixes #642.
* guardmgr: Document that guardmgr only holds a WeakIan Jackson2022-11-151-0/+5
|
* Merge branch 'make_bridges_work' into 'main'Nick Mathewson2022-11-141-0/+1
|\ | | | | | | | | Bugfix: preserve active_set when loading guards See merge request tpo/core/arti!848
| * Preserve active_set when loading guards.Nick Mathewson2022-11-141-0/+1
| |
* | Merge branch 'report_missing_descs' into 'main'Nick Mathewson2022-11-143-1/+66
|\| | | | | | | | | | | | | GuardMgr: Update desired bridge descs from 'update' function. Closes #622 See merge request tpo/core/arti!847
| * GuardMgr: Update desired bridge descs from 'update' function.Nick Mathewson2022-11-142-1/+29
| | | | | | | | | | There are some new TODOs here for us to think about, but I think this will give us something to test.
| * GuardSet: Add a method to report which bridge descs we want.Nick Mathewson2022-11-141-0/+37
| |
* | Merge branch 'guardmgr' into 'main'Ian Jackson2022-11-141-0/+2
|\ \ | |/ |/| | | | | Move guardmgr creation to arti-client, rather than within circmgr See merge request tpo/core/arti!850
| * Document Clone semantics of GuardMgr and DirMgrIan Jackson2022-11-111-0/+1
| |
| * cfg-ify an importIan Jackson2022-11-111-0/+1
| |
* | Merge branch 'guardmgr-todo-misc' into 'main'Nick Mathewson2022-11-106-75/+131
|\ \ | | | | | | | | | | | | Resolve most "TODO pt-client" comments in GuardMgr See merge request tpo/core/arti!840
| * | GuardMgr: Explain why we timestamp BridgeSets as we do.Nick Mathewson2022-11-102-10/+12
| | |
| * | GuardMgr: Downgrade a pt-client TODO about an internal APINick Mathewson2022-11-101-2/+4
| | |
| * | GuardMgr Document why a BridgeSet has trivial weight thresholds.Nick Mathewson2022-11-102-3/+4
| | | | | | | | | | | | | | | | | | This is the only way I could find in which parameter interpretation differs between bridge guards and relay guards; with it documented, I can remove a TODO about identifying such ways.
| * | GuardMgr: once more, fix our n_primary_dir_info check.Nick Mathewson2022-11-101-3/+25
| | | | | | | | | | | | | | | Have the check only apply to non-bridge universes, and explain why in a bunch more comments.
| * | GuardMgr: remove redundant call to extend_sample_as_neededNick Mathewson2022-11-102-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we would call extend_sample_as_needed in only two places, one of which called the other unconditionally. That's obviously not necessary. I've selected just one of them (`update_guardset_internal`) since it fits better with the theme if that function. I've added comments explaining what is going on. This commit also introduces a yes/no enum for "were any guards added while extending this set". Formerly we had a boolean, but it got passed around so many times that I think its intent became obscure.
| * | GuardMgr: rename n_primary_without_dir_infoNick Mathewson2022-11-102-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What this function actually does is return the number of primary guards whose presence (by identity) is ambiguous in a current universe. The new name and documentation should help avoid confusion. The method's old name had led me astray when identifying whether it should apply to bridges in one case. This commit also removes the corresponding `TODO pt-client`.
| * | 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.