summaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+2
|
* Throughout: Use *_report!() macros for reporting Errors.Nick Mathewson2023-07-071-10/+7
| | | | | | | | | | | | | | | I identified the cases to replace by searching for the string `.report()`. There are a few that I didn't change: * A couple of cases that used anyhow::Error, * One case that reported two Errors. * Two cases in `tor_hsclient::err` that just did `error!("Bug: {}")`. I have also not audited the cases in `tor-hsclient` where we're using `tor_error::Report` manually. Nonetheless, closes #949.
* 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
|
* DirMgr: More logs in top-level bootstrapping code.Nick Mathewson2023-05-031-5/+12
| | | | Closes #803, I hope.
* DirMgr: Log at trace! when starting a new "AttemptId".Nick Mathewson2023-05-031-1/+7
|
* tor-dirmgr: Don't try to mark consensus usable in a read-only store.Nick Mathewson2023-03-081-4/+6
| | | | | | | | | | | Doing this means that any attempt to use a read-only store would crash as soon as it found that the consensus was usable. It seems that this bug was introduced at some point doing all the dirmgr refactors we did over the past year. Perhaps there should be a test for running with a read-only store. Fixes #779
* Use ErrorReport - run rustfmtIan Jackson2023-01-301-2/+6
| | | | Split off for ease of review and possible rebase.
* Use ErrorReport for errors in warn! in tor-dirmgrIan Jackson2023-01-301-3/+3
|
* Use ErrorReport for errors in info! in tor-dirmgrIan Jackson2023-01-301-2/+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.
* 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.
* dirmgr: Spelling fixes and normali[sz]ationsNick Mathewson2022-12-061-1/+1
|
* Fix a couple of rustdoc issues.Nick Mathewson2022-11-181-1/+2
| | | | These slipped in while nightly was broken.
* dirmgr Store: Have constructors take DirMgrStoreIan Jackson2022-11-141-6/+13
| | | | | | | Now the Store is constructed by arti_client, solving the problem described here https://gitlab.torproject.org/tpo/core/arti/-/issues/631#note_2853665 but in a different way.
* dirmgr Store: Introduce DirMgrStore and use for BridgeDescMgrIan Jackson2022-11-141-0/+25
| | | | We are going to change DirMgr's constructors to also take a DirMgrStore.
* dirmgr Store: Use `**` syntax and deref to trait objectsIan Jackson2022-11-141-23/+14
| | | | This will allow us to get rid of a needless trait impl.
* bridge desc: Drop a done TODOIan Jackson2022-11-081-1/+0
| | | | | We have a separate BridgeDescMgr, rather than reusing DirMgr, so we will not be implementing BridgeDescProvider for DirMgr.
* dirmgr: Make store be in an ArcIan Jackson2022-11-041-2/+2
| | | | | This will let us share it with the bridge descriptor manager. (As discussed with Nick.)
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* bridge descriptors: Provide an implementation of BridgeDescProviderIan Jackson2022-11-031-0/+2
| | | | Tests will come in a moment.
* Fix clippy false positiveIan Jackson2022-10-251-0/+5
|
* FlagEvent trait: Implement using macrosIan Jackson2022-10-251-0/+3
| | | | | | | | | | | The explicit list of variant names, that needs to be kept in sync, and is a test failure semver break hazard, is now gone. All the necessary code is now generated automatically, and cannot be wrong. I want this because I find myself wanting to add a second implementation of FlagEvent, for another type.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-51/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* Mark all bridge and pt features as experimental for now.Nick Mathewson2022-09-291-0/+26
| | | | | | Also, document the features. Closes #588.