summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
| | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-4/+4
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-281-1/+1
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* tor-config: Apply deferred cargo fmt.Gabriela Moldovan2024-06-031-1/+1
|
* tor-config: Add macro for implementing NotAutoValue.Gabriela Moldovan2024-06-031-2/+2
|
* tor-config: Add NotAutoValue trait bound to ExplicitOrAuto inner type.Gabriela Moldovan2024-06-031-1/+3
| | | | | | | This is a safeguard to prevent users from using ExplicitOrAuto with types that serialize to the same value as ExplicitOrAuto::Auto. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2146#note_3030692
* tor-guardmgr: Replace From impl with VanguardConfig::mode accessor.Gabriela Moldovan2024-06-031-7/+9
|
* tor-guardmgr: Use ExplicitOrAuto in the VanguardConfigGabriela Moldovan2024-06-031-2/+11
|
* tor-guardmgr: Unconditionally define VanguardConfig.Gabriela Moldovan2024-06-031-0/+15
| | | | | | | | | We want to export the `VanguardConfig` even if the `vanguards` feature is disabled (we will need to unconditionally include it in the arti config). Note that if `vanguards` are disabled, the `VanguardMode` from the `VanguardConfig` can only be `Dsiabled`.
* tor-guardmgr: Remove dead_code allow.Gabriela Moldovan2024-05-091-1/+0
|
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* tor-guardmgr: Split derive list over multiple lines.Gabriela Moldovan2024-04-111-2/+4
|
* tor-guardmgr: Derive Ord for VanguardMode.Gabriela Moldovan2024-04-111-6/+14
|
* tor-guardmgr: Replace From impl with from_net_parameter constructor.Gabriela Moldovan2024-03-261-2/+8
|
* tor-guardmgr: Implement From<BoundedInt32> for VanguardMode.Gabriela Moldovan2024-03-261-0/+13
| | | | | We'll need this to convert the `vanguard_enabled` and `vanguard_hs_service` net params to a `VanguardMode.
* tor-circmgr: Unconditionally define VanguardMode.Gabriela Moldovan2024-03-201-0/+32
|
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-circmgr: Give CircMgr a VanguardMgr.Gabriela Moldovan2024-03-111-0/+4
| | | | Closes #1277
* tor-guardmgr: Add vanguards API skeleton.Gabriela Moldovan2024-03-111-0/+2
| | | | Part of #1275
* Fix typos in doc commentsTobias Stoeckmann2024-03-061-1/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* educe: Use std's default for enums where default variant is unitIan Jackson2024-02-121-7/+4
| | | | | | | | | | | | | Since Rust 1.66, std's default works properly for enums, provided that the default variant is a unit. Review all uses of `#[educe(default)]` on enums and replace them with std where possible, which is most of them. In 1.66 and later, std's `#[derive(Default)]` doesn't infer any generic bounds on the derived impl, where it's an enum - since the unit variant can always be constructed. So this change doesn't add any generic bounds and is not API-visible.
* guardmgr: Stop using now-needless retain_mut crate.Nick Mathewson2023-11-301-6/+1
|
* oneshot: Use veneer in tor-ptmgrIan Jackson2023-10-111-1/+4
|
* 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