aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* dirmgr: use FixedB64 to parse MD digests in as_plugin.Nick Mathewson2026-08-111-8/+10
|
* dirmgr: Provide a DirPlugin to temporarily pose as a directory cacheNick Mathewson2026-08-112-0/+293
| | | | Part of #2657
* Merge branch 'refactor-tor-dirmgr-0' into 'main'Jim Newsome2026-07-231-102/+180
|\ | | | | | | | | tor-dirmgr: Refactor function download See merge request tpo/core/arti!4204
| * tor-dirmgr: Refactor bootstrap::downloadhjrgrn2026-07-231-102/+180
| | | | | | | | | | | | | | - Add helper functions: perform_download, advance_state, apply_state, and update_state - Add enum used in said helper functions: DownloadOutcome and AdvanceStateError - Add minor improvements on the readability of the entire sub-module
* | tor-checkable: Rename `TimeBound::is_valid_at` to `check_valid_at`Ian Jackson2026-07-231-1/+1
| | | | | | | | | | I find this names confusing. To my mind "is" implies a function returning `bool`.
* | tor-checkable: Rename `TimeBound::check_valid_*` to `if_valid_*`Ian Jackson2026-07-231-2/+2
| | | | | | | | | | | | | | I find these names confusing. To my mind "check" implies a function returning `Result<(), _>`. Some other APIs use `unwrap` here but I think `if` is good.
* | tor-checkable: TimeBound: Make dangerously_into_parts return TimeRangeIan Jackson2026-07-232-3/+4
|/ | | | | It is better to return a more cooked type. `TimeRange` aka `TimeRangeBound<()>` is perfect for this.
* Use new TimeBound name throughout the treeIan Jackson2026-07-162-2/+2
|
* Merge branch 'remove-lint' into 'main'Jim Newsome2026-07-153-10/+1
|\ | | | | | | | | | | | | Removed unnecessary lint Closes #2556 See merge request tpo/core/arti!4210
| * Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-152-8/+0
| |
| * add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
| |
| * Removed unnecessary lintpryty262026-07-152-2/+1
| | | | | | | | Removed unnecessary lint
* | multiple crates: Fix clippy warningshjrgrn2026-07-102-4/+4
|/
* Fix deprecation-warning in tor-dirmgr.Nick Mathewson2026-06-301-2/+2
| | | | | time::format_description::parse is now deprecated; the replacement we want to use is first available in time 0.3.49.
* Apply deferred rustfmt churnIan Jackson2026-06-221-1/+3
|
* Remove renaming aliases for MicrodescAndHashIan Jackson2026-06-222-9/+9
|
* tor-netdoc: Break Microdesc up into Microdesc and MicrodescAndHashIan Jackson2026-06-222-2/+2
| | | | | | | | | | | | | The Microdesc type having a copy of the document hash was always weird, and it's weirder now that there's all these parse2 types that don't have it and parse2 derives on Microdesc that don't touch it. Make a new type for the descriptor and its hash. Use deref to arrange that the new type works almost like the old one. Adjust the use lines in the dependencies to temporarily import MicrodescAndHash as Microdesc.
* arti-client: remove string slicesNick Mathewson2026-06-101-2/+1
|
* everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-091-0/+1
| | | | | | | | This commit adds #[allow(clippy::string_slice)] to all functions in the code where string slices are used, alongside a TODO comment. We do this add the function header to have it consistent, as things like expression based allow's are still experimental.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-0910-0/+11
| | | | | | | | | | | | 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-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
|