aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* dirmgr: Provide a DirPlugin to temporarily pose as a directory cacheNick Mathewson2026-08-111-0/+14
| | | | Part of #2657
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-4/+0
|
* add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
|
* Removed unnecessary lintpryty262026-07-151-1/+1
| | | | Removed unnecessary lint
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+2
| | | | | | | | | | | | 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.
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-1/+1
| | | | | | | | | | | 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.
* dirmgr: port to web-time-compat.Nick Mathewson2026-03-261-1/+3
|
* 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::cloneGabriela Moldovan2026-01-271-1/+1
| | | | | Now that `load` is no longer `async`, this triggers a lint about the unnecessary clone.
* dirmgr: Make various functions synchronousGabriela Moldovan2026-01-271-5/+5
| | | | 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.
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-1/+5
| | | | | 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-061-2/+2
| | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-041-1/+1
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-2/+2
|
* 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.
* Move `FallbackDir` into `tor-dircommon`Clara Engler2025-09-111-1/+1
|
* tor-dircommon: Use amplify and getters for configClara Engler2025-09-091-3/+3
|
* Move `DirTolerance` into `tor-dircommon`Clara Engler2025-09-091-1/+2
| | | | | This commit moves the `DirTolerance` structure from `tor-dirmgr` into `tor-dircommon`.
* Move `DownloadSchedule` into `tor-dircommon`Clara Engler2025-09-081-6/+1
| | | | | This commit moves the `DowenloadSchedule` related types from `tor-dirmgr` into `tor-dircommon`.
* Move `NetworkStatus` to `tor-dircommon`Clara Engler2025-09-081-1/+1
| | | | | | 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-021-2/+0
| | | | | | | | | | | | | | 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`.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-9/+12
| | | | | | | | | | | | | | 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-071-1/+1
| | | | | | | | | | | | | | | | | | 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.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* *: suppress cognitive_complexity warnings from nightlyNick Mathewson2025-05-291-0/+3
| | | | | | | | | | | | | 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-161-1/+1
| | | | | 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
|
* Add warnings about removing supported protocols.Nick Mathewson2025-04-161-0/+2
|
* netdir: Add a recommended_protocols() to NetDirProviderNick Mathewson2025-04-161-0/+4
|
* dirmgr, netdir: Store protocol requirments as soon as they are validated.Nick Mathewson2025-04-161-0/+23
|
* New functions to report supported subprotocolsNick Mathewson2025-04-161-0/+18
| | | | | | | | | | | | | | | Part of #1849. Note that these functions are distributed across crates, so that if (in the future) we stop doing API breaks with every release, we will get the right outputs. Note also that these functions build the list of protocols out of specific symbolic features, rather than numbers: this makes it easier to avoid errors about "which feature was Relay=4 again", and easier to avoid accidentally referring to a protocol that doesn't exist, like "Consensus" (should be "Cons") or "HsDir" (case is wrong).
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-2/+2
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* 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.
* tor-dirmgr: don't support changing `DirMgrConfig::cache_trust`Steven Engler2024-11-051-0/+4
| | | | | `DirMgrConfig::update_from_config` uses the old value and not the new value, so it should be reported using `Reconfigure::cannot_change`.
* 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.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* dirmgr: Use contains_key in check.Nick Mathewson2024-04-221-1/+1
|
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* tor-dirmgr: Simplify a clone call (fmt)Ian Jackson2024-01-311-3/+1
|
* tor-dirmgr: Simplify a clone callIan Jackson2024-01-311-2/+1
| | | | Prompted by clippy.
* tor-dirmgr: Rename DirMgrConfig.cache_path to cache_dirIan Jackson2023-12-041-3/+3
| | | | | | This variable contains precisely the value of cache_dir from arti_client::config::StorageConfig and it should therefore have the same name.
* oneshot: Use veneer in tor-dirmgrIan Jackson2023-10-111-1/+2
|
* 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
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|