summaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-122-2/+2
| | | | | | | | | | | 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.
* Remove users of fslock other than fslock-guard.Nick Mathewson2026-05-061-62/+70
| | | | | | There were two that relied on the the ability to have a lock in an unlocked state. Instead, we replace those with Option<LockFileGuard> or its equivalent.
* dirmgr: Use HashMap::into_values.Nick Mathewson2026-04-211-2/+2
|
* dirmgr: port to web-time-compat.Nick Mathewson2026-03-265-14/+24
|
* dirmgr: Stub out usage of Lockfile on wasm32-unknown.Nick Mathewson2026-03-251-2/+31
| | | | | | | This is temporary while we wait on arti#2106. (This made cargo-sort have me move a section around. Not sure why it cares.)
* tor-basic-utils: Remove IoErrorExt and BinaryHeapExt.Nick Mathewson2026-03-251-2/+1
| | | | | | | | | | IoErrorExt existed to provide a workaround for Rust versions that didn't have io::ErrorKind::NotADirectory. But NotADirectory was stabilized in 1.83 and our MSRV is 1.89. BinaryHeapExt existed to provide an implementation for Rust versions that didn't have BinaryHeap::retain. But BinaryHeap::retain was stabilized in 1.70 and our MSRV is 1.70.
* Fix word duplicate typosTobias Stoeckmann2026-03-152-2/+2
|
* Rename DirResponse::from_body to from_get_bodyClara Engler2026-03-041-1/+1
| | | | | | This reflects that it is expected for an HTTP GET body. It is okay because it is only used in tor-dirmgr, which only performs GET request anyways.
* 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.
* dirmgr: Make `DirMgr::load_once()` synchronousGabriela Moldovan2026-01-271-1/+1
|
* dirmgr: Remove unnecessary Arc::clone (fmt)Gabriela Moldovan2026-01-271-2/+1
|
* dirmgr: Remove unnecessary Arc::cloneGabriela Moldovan2026-01-272-4/+4
| | | | | Now that `load` is no longer `async`, this triggers a lint about the unnecessary clone.
* dirmgr: Make various functions synchronousGabriela Moldovan2026-01-272-10/+9
| | | | To fix `clippy::unused_async`.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* tor-netdoc: authcert: Make key_ids return owned AuthCertKeyIdsIan Jackson2026-01-062-5/+5
| | | | | AuthCert is about to lose its copy of H(KP_auth_sign_rsa) so it needs to return an owned value.
* tor-netdoc: Store n_authorities in usizeClara Engler2025-12-021-2/+1
| | | | | | | Previously, this value was stored in a u16. However, because this number is usually always derived from some sort of list type, such as `Vec`, it makes more sense to use usize for this, as it avoid unnecessary casting and error checking.
* dirmgr: Rewrite .is_some()/.unwrap() using let matchGabriela Moldovan2025-12-011-4/+6
| | | | | | | On nightly, clippy now warns against this and recommends using a `match` instead. See https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-242-2/+10
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0610-11/+11
| | | | Run maint/add_warning
* Drop two use's that seem no longer to be necessaryIan Jackson2025-11-061-1/+1
|
* all: run cargo fmtSteven Engler2025-11-041-1/+1
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-042-4/+4
|
* Remove one stray allow(deprecated)Neel Chauhan2025-11-041-1/+0
|
* Stop using MockSleepProvider in a few cratesNeel Chauhan2025-11-021-3/+2
| | | | Part of #1885.
* Fix new clippy nightly warning about subtracting Durations.Nick Mathewson2025-10-161-1/+3
|
* tor-linkspec: Change HasAddrs::addrs to return an IteratorIan Jackson2025-10-061-1/+1
| | | | | | | | 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.
* tor-dircommon: Implement proposal 330Clara Engler2025-09-162-24/+20
| | | | | | | This commit implements proposal 330 in the context of `tor-dircommon`, by replacing the single `Authority` structure used in a list context by a single structure called `AuthorityContacts` which contains all v3idents, upload, download, and vote endpoints in one central place.
* Move `FallbackDir` into `tor-dircommon`Clara Engler2025-09-112-2/+2
|
* tor-dircommon: Use amplify and getters for configClara Engler2025-09-094-17/+18
|
* tor-dircommon: Make config non_exhaustiveClara Engler2025-09-091-4/+1
|
* Move `DirTolerance` into `tor-dircommon`Clara Engler2025-09-092-67/+4
| | | | | This commit moves the `DirTolerance` structure from `tor-dirmgr` into `tor-dircommon`.
* Move `DownloadSchedule` into `tor-dircommon`Clara Engler2025-09-085-281/+5
| | | | | This commit moves the `DowenloadSchedule` related types from `tor-dirmgr` into `tor-dircommon`.
* Move `NetworkStatus` to `tor-dircommon`Clara Engler2025-09-083-77/+9
| | | | | | This commit moves `NetworkStatus` from `tor-dirmgr::config` to `tor-dircommon::config` in order to start the work on a common place for configuration options shared by both directory implementations.
* tor-dircommon: Initial commitClara Engler2025-09-024-143/+4
| | | | | | | | | | | | | | This commit initializes the `tor-dircommon` crate: A crate serving the purpose to form an umbrella for the lowest common denominator primitives found across crates implementing (parts of) the directory specification. For now, the only such primitive is the found within the `authority` module, which has been refactored from `tor-dirmgr` into this crate, alongside additional getter functions due to the lack of `pub(crate)` in this context. In the future, we may move further primitives away from `tor-dirmgr` into `tor-dircommon`.
* misc: cleanup now that `_report!` macros support fieldsSteven Engler2025-08-181-2/+1
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-0713-76/+98
| | | | | | | | | | | | | | 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.
* Update code for Edition 2024Nick Mathewson2025-08-072-2/+2
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* dirmgr: Rename circuit to tunnelDavid Goulet2025-08-051-3/+3
| | | | Signed-off-by: David Goulet <[email protected]>
* config-path, dirmgr, general-addr: Remove unnecessary parentheses (fmt).Gabriela Moldovan2025-07-151-2/+1
|
* config-path, dirmgr, general-addr: Remove unnecessary parentheses.Gabriela Moldovan2025-07-151-1/+1
| | | | This resolves some nightly clippy warnings.
* tor-dirmgr, tor-guardmgr: Use std::slice::from_ref as suggested by clippy.Gabriela Moldovan2025-07-071-4/+4
|
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-dirmgr: Removed dependency on `once_cell`hashcatHitman2025-06-142-6/+9
| | | | | | - Replaced `once_cell::sync::Lazy` with `std::sync::LazyLock`. Signed-off-by: hashcatHitman <[email protected]>
* *: suppress cognitive_complexity warnings from nightlyNick Mathewson2025-05-292-0/+7
| | | | | | | | | | | | | Apparently clippy nightly is better (or worse?) about detecting complex functions than before, so I'm suppressing these warnings where they occur. I have mixed feelings about these warnings: On the plus side, they really do help to detect functions that are twistier than they need to be. On the minus side, they get confused by tracing macros, and the "allows" do pile up. But on the plus side, those "allows" do provide a way to find functions that need to be refactored, and they are never uglier than the functions they decorate.
* Rename recommended_protocols to protocol_statuses.Nick Mathewson2025-04-162-9/+9
| | | | | This name reflects its purpose better than the original one, since it includes required protocols as well as recommended ones.
* protover, *: Add documentation about what "supported" means.Nick Mathewson2025-04-161-1/+2
|
* dirmgr: Always apply changes before advancing consensus.Nick Mathewson2025-04-161-6/+6
| | | | | | | | | | | In the directory code, we have functionality to advance the consensus download state whenever possible, even if there is more we could download in the current state. That's fine, but when we're in this position, we need to be sure that we're taking any action based on the current state (such as installing notably parameters or, notably, protocol recommendations) before we move on.
* Add warnings about removing supported protocols.Nick Mathewson2025-04-161-0/+2
|
* netdir: Add a recommended_protocols() to NetDirProviderNick Mathewson2025-04-161-0/+4
|