aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr
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-113-1/+296
| | | | Part of #2657
* Bump versions for tor-* and arti-* cratesSteven Engler2026-08-031-22/+22
| | | | | | | ```bash readarray -t bump < <(maint/list-crates | grep -P '^tor-|^arti-') for crate in "${bump[@]}"; do cargo set-version --bump minor -p "${crate}"; done ```
* 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
|/
* Upgrade to itertools 0.15.0Nick Mathewson2026-07-011-1/+1
| | | | | | Additionally, fix itertools usage in maybenot_padding.rs The definition of `Position` changed in 0.15.0.
* Require a more recent "time" to fix parsing issues.Nick Mathewson2026-06-301-1/+1
|
* Fix deprecation-warning in tor-dirmgr.Nick Mathewson2026-06-302-3/+3
| | | | | time::format_description::parse is now deprecated; the replacement we want to use is first available in time 0.3.49.
* Version bumps for 2.5.0Nick Mathewson2026-06-301-27/+27
| | | | | | | | | | | | | Closes #2617. We've lucked out this time, and it turns out that every one of our published crates gets a minor bump. So this was generated with: ``` for cr in $(./maint/list-crates); do cargo set-version -p $cr --bump minor done ```
* 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.
* Merge branch 'msrv-1.91' into 'main'gabi-2502026-06-181-1/+1
|\ | | | | | | | | Bump MSRV to 1.91 See merge request tpo/core/arti!4105
| * Bump MSRV to 1.91Clara Engler2026-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit bumps the MSRV to 1.91 which was released on 2025-10-30. The Cargo.toml files were updated as follows: ```sh git ls-files | \ grep ".*Cargo\.toml$" | \ xargs sed -i '' 's/^rust-version = "1\.89"$/rust-version = "1\.91"/g' ``` The following files were updated manually: ``` modified: .gitlab-ci.yml modified: README.md modified: flake.nix modified: maint/docker-android/Dockerfile ```
* | 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.
* Bump all the unstable tor- and arti- crates to 0.43.0Gabriela Moldovan2026-06-011-22/+22
| | | | | | | | | | Done using: ``` for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.43.0 done ```
* Bump the versions of the non-{arti-,tor-} cratesGabriela Moldovan2026-06-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The non-{arti-,tor-} crates are: ``` ./maint/list-crates | rg -v '^(tor|arti)' oneshot-fused-workaround web-time-compat slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error futures-copy ``` We split them in the following categories: * crates with no changes (no version bumps): ``` oneshot-fused-workaround: No change. web-time-compat: No change. slotmap-careful: No change. test-temp-dir: No change. caret: No change. safelog: No change. retry-error: No change. futures-copy: No change. ``` Obtained with: ``` maint/changed-crates -v "arti-v$LAST_VERSION" 2>&1 >/dev/null | grep -i "no change" | grep -v '\(tor\|arti\)-' ``` * crates that only have non-functional changes (bump the patch version, but not the dependend-on version): - equix * crates where functional changes were made, but no APIs were broken (bump patch): - fs-mistrust * crates where APIs were broken (bump minor): - hashx - fslock-guard The bumps from this commit were created using this script: ``` PATCH_NF=( equix ) PATCH=" fs-mistrust " MINOR=" hashx fslock-guard " ./maint/bump-nodep "${PATCH_NF[@]}" for crate in $PATCH; do cargo set-version --bump patch -p $crate; done for crate in $MINOR; do cargo set-version --bump minor -p $crate; done ```
* dirmgr: Run maint/fixup-featuresGabriela Moldovan2026-06-011-0/+1
|
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-123-3/+3
| | | | | | | | | | | 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-062-65/+71
| | | | | | 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.
* release: Bump tor- and arti- crate versions.Wesley Aptekar-Cassels2026-05-061-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cargo set-version -p arti-client 0.42.0 cargo set-version -p arti-config 0.42.0 cargo set-version -p arti-relay 0.42.0 cargo set-version -p arti-rpc-client-core 0.42.0 cargo set-version -p arti-rpcserver 0.42.0 cargo set-version -p arti-testing 0.42.0 cargo set-version -p arti-ureq 0.42.0 cargo set-version -p tor-async-utils 0.42.0 cargo set-version -p tor-basic-utils 0.42.0 cargo set-version -p tor-bytes 0.42.0 cargo set-version -p tor-cell 0.42.0 cargo set-version -p tor-cert 0.42.0 cargo set-version -p tor-cert-x509 0.42.0 cargo set-version -p tor-chanmgr 0.42.0 cargo set-version -p tor-checkable 0.42.0 cargo set-version -p tor-circmgr 0.42.0 cargo set-version -p tor-config 0.42.0 cargo set-version -p tor-config-path 0.42.0 cargo set-version -p tor-consdiff 0.42.0 cargo set-version -p tor-dirclient 0.42.0 cargo set-version -p tor-dircommon 0.42.0 cargo set-version -p tor-dirmgr 0.42.0 cargo set-version -p tor-dirserver 0.42.0 cargo set-version -p tor-error 0.42.0 cargo set-version -p tor-events 0.42.0 cargo set-version -p tor-general-addr 0.42.0 cargo set-version -p tor-geoip 0.42.0 cargo set-version -p tor-guardmgr 0.42.0 cargo set-version -p tor-hsclient 0.42.0 cargo set-version -p tor-hscrypto 0.42.0 cargo set-version -p tor-hsrproxy 0.42.0 cargo set-version -p tor-hsservice 0.42.0 cargo set-version -p tor-key-forge 0.42.0 cargo set-version -p tor-keymgr 0.42.0 cargo set-version -p tor-linkspec 0.42.0 cargo set-version -p tor-llcrypto 0.42.0 cargo set-version -p tor-log-ratelim 0.42.0 cargo set-version -p tor-memquota 0.42.0 cargo set-version -p tor-memquota-cost 0.42.0 cargo set-version -p tor-netdir 0.42.0 cargo set-version -p tor-netdoc 0.42.0 cargo set-version -p tor-persist 0.42.0 cargo set-version -p tor-proto 0.42.0 cargo set-version -p tor-protover 0.42.0 cargo set-version -p tor-ptmgr 0.42.0 cargo set-version -p tor-relay-crypto 0.42.0 cargo set-version -p tor-relay-selection 0.42.0 cargo set-version -p tor-rpcbase 0.42.0 cargo set-version -p tor-rpc-connect 0.42.0 cargo set-version -p tor-rtcompat 0.42.0 cargo set-version -p tor-rtmock 0.42.0 cargo set-version -p tor-socksproto 0.42.0 cargo set-version -p tor-units 0.42.0
* release: Bump safelog version to 0.8.2.Wesley Aptekar-Cassels2026-05-061-1/+1
|
* dirmgr: Use HashMap::into_values.Nick Mathewson2026-04-211-2/+2
|
* Update to rusqlite 0.39.xIan Jackson2026-03-311-1/+1
| | | | | Relax the r2d2 and rusqlite deps, and manually pick the relevant hunks from `cargo update` in Cargo.lock.
* Bump versions: tor-* and arti-* unstable cratesIan Jackson2026-03-301-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/issues/2436#note_3384773 Made with nailing-cargo -Eu set-version -p arti-client 0.41.0 nailing-cargo -Eu set-version -p arti-relay 0.41.0 nailing-cargo -Eu set-version -p arti-rpcserver 0.41.0 nailing-cargo -Eu set-version -p arti-ureq 0.41.0 nailing-cargo -Eu set-version -p arti-rpc-client-core 0.41.0 nailing-cargo -Eu set-version -p tor-basic-utils 0.41.0 nailing-cargo -Eu set-version -p tor-error 0.41.0 nailing-cargo -Eu set-version -p tor-general-addr 0.41.0 nailing-cargo -Eu set-version -p tor-geoip 0.41.0 nailing-cargo -Eu set-version -p tor-memquota-cost 0.41.0 nailing-cargo -Eu set-version -p tor-llcrypto 0.41.0 nailing-cargo -Eu set-version -p tor-cert-x509 0.41.0 nailing-cargo -Eu set-version -p tor-rtcompat 0.41.0 nailing-cargo -Eu set-version -p tor-rtmock 0.41.0 nailing-cargo -Eu set-version -p tor-async-utils 0.41.0 nailing-cargo -Eu set-version -p tor-config 0.41.0 nailing-cargo -Eu set-version -p tor-config-path 0.41.0 nailing-cargo -Eu set-version -p tor-rpc-connect 0.41.0 nailing-cargo -Eu set-version -p tor-log-ratelim 0.41.0 nailing-cargo -Eu set-version -p tor-rpcbase 0.41.0 nailing-cargo -Eu set-version -p tor-memquota 0.41.0 nailing-cargo -Eu set-version -p tor-units 0.41.0 nailing-cargo -Eu set-version -p tor-bytes 0.41.0 nailing-cargo -Eu set-version -p tor-protover 0.41.0 nailing-cargo -Eu set-version -p tor-checkable 0.41.0 nailing-cargo -Eu set-version -p tor-cert 0.41.0 nailing-cargo -Eu set-version -p tor-key-forge 0.41.0 nailing-cargo -Eu set-version -p tor-hscrypto 0.41.0 nailing-cargo -Eu set-version -p tor-socksproto 0.41.0 nailing-cargo -Eu set-version -p tor-linkspec 0.41.0 nailing-cargo -Eu set-version -p tor-cell 0.41.0 nailing-cargo -Eu set-version -p tor-persist 0.41.0 nailing-cargo -Eu set-version -p tor-keymgr 0.41.0 nailing-cargo -Eu set-version -p tor-relay-crypto 0.41.0 nailing-cargo -Eu set-version -p tor-proto 0.41.0 nailing-cargo -Eu set-version -p tor-netdoc 0.41.0 nailing-cargo -Eu set-version -p tor-consdiff 0.41.0 nailing-cargo -Eu set-version -p tor-netdir 0.41.0 nailing-cargo -Eu set-version -p tor-relay-selection 0.41.0 nailing-cargo -Eu set-version -p tor-chanmgr 0.41.0 nailing-cargo -Eu set-version -p tor-ptmgr 0.41.0 nailing-cargo -Eu set-version -p tor-dircommon 0.41.0 nailing-cargo -Eu set-version -p tor-guardmgr 0.41.0 nailing-cargo -Eu set-version -p tor-circmgr 0.41.0 nailing-cargo -Eu set-version -p tor-dirclient 0.41.0 nailing-cargo -Eu set-version -p tor-dirmgr 0.41.0 nailing-cargo -Eu set-version -p tor-dirserver 0.41.0 nailing-cargo -Eu set-version -p tor-hsclient 0.41.0 nailing-cargo -Eu set-version -p tor-hsservice 0.41.0 nailing-cargo -Eu set-version -p tor-hsrproxy 0.41.0
* Bump versions: patchlevel, with dependenciesIan Jackson2026-03-301-1/+1
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/issues/2436#note_3384773 Made with cargo set-version --offline --bump patch -p safelog
* Plumb web-time-compat/full dependency through everywhere.Ian Jackson2026-03-301-0/+1
| | | | As generated by maint/fixup-features.
* dirmgr: port to web-time-compat.Nick Mathewson2026-03-266-14/+25
|
* dirmgr: Stub out usage of Lockfile on wasm32-unknown.Nick Mathewson2026-03-252-5/+38
| | | | | | | 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
|
* Merge branch 'dirclient-empty-successful' into 'main'Clara Engler2026-03-041-1/+1
|\ | | | | | | | | tor-dirclient: Disallow empty successful responses See merge request tpo/core/arti!3650
| * 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.
* | deps: use the same `rusqlite` version range for all cratesHydroxideUnlaced2026-03-041-1/+1
| | | | | | | | Co-authored-by: Ian Jackson <[email protected]>
* | Apply 1 suggestion(s) to 1 file(s)HydroxideUnlaced2026-03-041-0/+1
| | | | | | Co-authored-by: Ian Jackson <[email protected]>
* | deps: relax `libsqlite3-sys` version requirementHydroxideUnlaced2026-03-041-1/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue concerns `libsqlite3-sys` linking to a native library. Cargo cannot handle multiple versions/crates linking to the same native library. This affects both the `tor-dirmgr` and `tor-dirserver` crates, which depend on `rusqlite`. Relaxing the version requirement gives downstream projects flexibility so cargo can select an appropriate `libsqlite3-sys` version without a high chance of conflicts caused by pinning a specific version. The proposed supported version range was determined by testing until encountering a version lacking a feature currently in use (breaking unchange?). Regarding testing, the current CI with minimum-version test only validates the maximum and minimum versions, so breaking changes introduced between them can pass unnoticed. Tools like [Cargo-Bounds](https://github.com/vivax3794/cargo_bounds) can help, but this is out of scope for this MR. Also, supported versions of `rusqlite` for `tor-dirmgr` and `tor-dirserver` differ, so running tests for the whole project (same workspace) causes cargo to pick only overlapping versions, which hides parts of each crate’s supported range. Referencing #754, after this MR, increasing the maximum version or decreasing the minimum version of `rusqlite` shouldn't be a breaking change, but increasing the minimum version could be. Resolves: #1740
* Bump strum to 0.28Gabriela Moldovan2026-03-041-1/+1
|
* Bump all the unstable tor- and arti- crates to 0.40.0.Gabriela Moldovan2026-03-021-22/+22
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.40.0 done
* Bump the versions of the non-{arti-,tor-} cratesGabriela Moldovan2026-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The non-{arti-,tor-} crates are: ``` ./maint/list-crates | rg -v '^(tor|arti)' oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error futures-copy ``` Because this release bumps the MSRV, I am bumping the minor version of all of them. MINOR=" oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error futures-copy " for crate in $MINOR; do cargo set-version --bump minor -p $crate; done ```