summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Add cognitive-complexity exceptions for clippy.Nick Mathewson2023-09-051-0/+1
| | | | I have no idea why these became necessary.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* guardmgr: Fix a dead-code warning when built without bridge support.Nick Mathewson2023-08-161-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Better report for any recurrence of bug #638.Nick Mathewson2023-07-131-0/+14
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+2
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* Merge branch 'test-lints' into 'main'eta2023-01-061-0/+8
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | Remove allow(unreachable_pub) from tor-guardmgr/src/lib.rsNeel Chauhan2022-12-161-5/+0
|/ | | | Closes #589
* Rename for_circuit_usage => as_relay_with_descNick Mathewson2022-11-301-1/+1
|
* guardmgr: Remove now-unneeded #[allow(unnecessary_wraps)]Nick Mathewson2022-11-291-1/+0
|
* Merge branch 'reconfig-bridges-bad' into 'main'Nick Mathewson2022-11-271-7/+14
|\ | | | | | | | | | | | | Require state ownership when using bridges Closes #612 See merge request tpo/core/arti!889
| * tor-guardmgr: rustfmt for recent changesIan Jackson2022-11-241-1/+1
| | | | | | | | Left unsquashed for ease of review
| * tor-guardmgr: NoLock error: add TODO for trying to get lockIan Jackson2022-11-241-0/+2
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/889#note_2856874
| * tor-guardmgr: Refuse to configure bridges if we don't have the lockIan Jackson2022-11-231-0/+3
| | | | | | | | Fixes #612
| * tor-guardmgr: make replace_bridge_config fallibleIan Jackson2022-11-231-7/+8
| | | | | | | | | | | | The error type needs to be convertible to GuardMgrError and also to ReconfigureError. Neither of those is right, so we need a new error type.
| * tor-guardmgr: Replace a let _ignore with a typed versionIan Jackson2022-11-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | `let _ignore =` isn't great because if the function called is currently infallible, but becomes fallible, it suppresses the detection of the error check. A better pattern is to specify the type of the ignored value. I'm about to do precisely this, here. I did a git-grep and `let _ignore =` seems very common. Let's not deal with all those now.
* | Merge branch 'bridge-config-arc' into 'main'Nick Mathewson2022-11-231-2/+1
|\ \ | | | | | | | | | | | | | | | | | | Make BridgeConfig be Arc, so no Arc<BridgeConfig> Closes #635 See merge request tpo/core/arti!885
| * | BridgeConfig: Replace all Arc<BridgeConfig> with BridgeConfigIan Jackson2022-11-221-2/+1
| | | | | | | | | | | | BridgeConfig is itself an Arc now, so these are redundant.
* | | Merge branch 'test-config' into 'main'Ian Jackson2022-11-231-1/+1
|\ \ \ | |_|/ |/| | | | | | | | tor-guardmgr: Fix visibility of TestConfig with no features enabled See merge request tpo/core/arti!875
| * | tor-guardmgr: Fix visibility of TestConfig with no features enabledIan Jackson2022-11-181-1/+1
| | | | | | | | | | | | | | | Without this, tor-guardmgr tests don't build when run without the crate's own testing feature enabled.
* | | CircMgr: retire all circuits if bridge configuration changes.Nick Mathewson2022-11-221-7/+40
| |/ |/| | | | | Closes #650.
* | bridge non-support: Move dummy bridge module into own fileIan Jackson2022-11-211-22/+2
| | | | | | | | | | A bit more stuff is going to appear here, so it's getting to be rather much for an inline module.
* | BridgeConfigBuilder: Introduce the struct with the dictionary reprIan Jackson2022-11-211-0/+10
|/ | | | | | | | | | | 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)
* GuardMgr: Add Instant to update().Nick Mathewson2022-11-161-18/+36
| | | | | | | | | | | 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.
* 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-141-0/+28
|\| | | | | | | | | | | | | 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-141-0/+28
| | | | | | | | | | There are some new TODOs here for us to think about, but I think this will give us something to test.
* | 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
| |
* | 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-101-3/+0
| | | | | | | | | | | | 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-101-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-101-4/+4
|/ | | | | | | | | | | 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`.
* 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-081-1/+3
|
* GuardMgr: Remove no-longer-relevant `TODO pt-client` commentsNick Mathewson2022-11-081-5/+0
| | | | | Also remove a bunch of now-unnecessary `allow(dead_code)` annotations.
* GuardMgr: Spelling fixes and normalizations.Nick Mathewson2022-11-081-1/+1
|