summaryrefslogtreecommitdiff
path: root/crates/tor-guardmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'remove-lint' into 'main'Jim Newsome2026-07-153-4/+1
|\ | | | | | | | | | | | | Removed unnecessary lint Closes #2556 See merge request tpo/core/arti!4210
| * Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-153-3/+0
| |
| * add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
| |
| * Removed unnecessary lintpryty262026-07-151-1/+1
| | | | | | | | Removed unnecessary lint
* | multiple crates: Fix clippy warningshjrgrn2026-07-101-5/+5
|/
* tor-guardmgr: Replace an Itertools::intersperse with joinIan Jackson2026-06-111-2/+2
| | | | We're collecting a String here. Do that the easy way.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-0911-0/+12
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* config: Add a method to fill in a builder with unset defaultsNick Mathewson2026-05-271-0/+1
| | | | | | | | | | | | | | | This new method modifies a builder by replacing any unset values that have a default with that default. We're using this method so that we can re-serialize a builder into a `ConfigurationTree` with all of its default values included. In all cases, `b.apply_defaults()?; b.build()` should produce the same output as `b.build()`. The interesting parts of this commit are in tor_config::load and tor_config::derive. The rest of this commit just adds `apply_defaults` to other builders that _aren't_ made with `derive_deftly(TorConfig)`.
* Merge branch 'rd-fingerprint' into 'main'Clara Engler2026-05-131-2/+18
|\ | | | | | | | | Store fingerprint in Option<SpFingerprint> See merge request tpo/core/arti!3978
| * tor-netdoc: Return copy in RouterDesc::rsa_identity()Clara Engler2026-05-121-2/+18
| | | | | | | | | | | | | | | | | | | | | | This change might seem pointless for now but it will be required and unavoidable later on, because we will have to change RouterDesc::fingerprint from RsaIdentity to Option<SpFingerprint> which will make it impossible to be used inside the getter anymore. With this change, our only resort is to obtain the RSA identity from the signing key but we can only return a copy then because that RSA identity is created ad-hoc then.
* | Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-124-9/+8
|/ | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* tor-guardmgr: Port to web_time_compat.Nick Mathewson2026-03-2610-62/+68
|
* tor-guardmgr: fix some duration string formattingSteven Engler2026-03-242-2/+2
| | | | | | Old text would say something like: > Retrying in FormattedDuration(29.999861026s).
* Fix word duplicate typosTobias Stoeckmann2026-03-152-3/+3
|
* guardmgr: Migrate config to derive_deftly.Nick Mathewson2026-02-171-7/+5
|
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-041-1/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-243-1/+12
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* RelayFlags: Use RelayFlag enum variant names everywhereIan Jackson2025-11-181-1/+1
| | | | | | | Abolish the constants with the transitional names. This also abolishes the controversial name `H_S_DIR`, which Rust case transformation rules generated from `HSDir`.
* RelayFlags: Use the singular RelayFlag for naming individual flagsIan Jackson2025-11-181-2/+2
| | | | | | | | | | | | | | We're going to separate RelayFlag from RelayFlags. We could continue to provide a bunch of constant values for RelayFlags, for each individual type, but that would involve an ad-hoc derive, and would still be a bit of an unusual API. Instead, we're going to make ``RelayFlag` a normal enum. In this commit, we change everyone to refer to it by its singular name. Hopefully separating out this bulk change makes both this, and the core commit, easier to review.
* tor-netdoc: Remove the RelayFlags type alias in netstatusIan Jackson2025-11-181-1/+2
| | | | I would do `#[deprecated]` but empirically that has no effect...
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0611-12/+12
| | | | Run maint/add_warning
* Conditionalise a test-only `use`Ian Jackson2025-11-061-1/+4
|
* all: run cargo fmtSteven Engler2025-11-042-2/+2
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-042-2/+2
|
* tor-guardmgr: Add more tracing to update_guardset_internal.Wesley Aptekar-Cassels2025-10-221-3/+7
| | | | This would have been useful in looking into #2224.
* tor-guardmgr: Ignore cognitive_complexity lint.Wesley Aptekar-Cassels2025-10-161-0/+1
| | | | | While this is fairly nested, it's short, and most of the complexity is just in the logging code.
* tor-guardmgr: Use humantime for some logging.Wesley Aptekar-Cassels2025-10-162-2/+2
|
* tor-guardmgr: Add retry time to guard failure warning.Wesley Aptekar-Cassels2025-10-161-7/+14
| | | | | The "Next retry time unknown" message can't be hit right now, but could be if the code changes in the future.
* tor-guardmgr: Include retry time in AllGuardsDown error message.Wesley Aptekar-Cassels2025-10-161-1/+6
| | | | | I don't love shoving such a complicated expression in thiserror, but it seems nicer than writing the implementation by hand...
* tor-linkspec: Change HasAddrs::addrs to return an Iterator (fmt)Ian Jackson2025-10-061-1/+4
|
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-064-17/+17
| | | | | | | | This will let us model the actual structure of routerstatus entries in netdocs more closely. They don't have the addresses in a single list. When this code was written this would have been much more awkward, but now we have RPITIT.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* opentelemetry: Add some instrument macros.Wesley Aptekar-Cassels2025-09-242-1/+7
| | | | | I've added these in places that are useful for the debugging that I've been doing.
* Move `FallbackDir` into `tor-dircommon`Clara Engler2025-09-115-577/+402
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0711-98/+126
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-092-2/+2
| | | | Made with https://crates.io/crates/typos-cli
* tor-dirmgr, tor-guardmgr: Use std::slice::from_ref as suggested by clippy.Gabriela Moldovan2025-07-071-2/+2
|
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* guardmgr, circmgr: Make vanguard selection take a RelaySelector.Nick Mathewson2025-05-202-20/+26
| | | | | | This is the preferred type for choosing a relay, since unlike a RelayExclusion, it lets us add multiple restrictions, and a relay usage.
* guardmgr: Fix clippy warning about needlessly owned cow.Nick Mathewson2025-05-151-1/+1
|
* Resolve clippy warnings from 1.83Nick Mathewson2025-05-131-1/+1
| | | | | Now that our MSRV is 1.83, clippy is happy to make more recommendations for us.
* Run cargo fmtNick Mathewson2025-03-181-11/+3
|
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-3/+3
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-182-2/+2
| | | | - Several methods have been moved out of SliceRandom.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-187-9/+9
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* guardmgr: flag to indicate whether a FirstHop is a BridgeNick Mathewson2025-02-251-0/+9
| | | | | This will affect some details of path selection as we provide more info about families.
* 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.