summaryrefslogtreecommitdiff
path: root/crates/tor-dirclient/src
Commit message (Collapse)AuthorAgeFilesLines
* dirclient: improve macro documentationNick Mathewson2026-05-121-6/+16
|
* dirclient: Split EncodedRequest and RequestBody.Nick Mathewson2026-05-124-101/+81
| | | | | RequestBody is now just an `Option<Arc<str>>` internally, and EncodedRequest is much simpler.
* dirclient: Add a request to upload routerdescsNick Mathewson2026-05-121-34/+67
| | | | | (Also refactor the code for POST requests into a new macro, since it would otherwise get quite duplicated.)
* dirclient: Add accessor for status message.Nick Mathewson2026-05-121-0/+5
|
* dirclient: Implement Requestable for Arc<dyn Requestable>.Nick Mathewson2026-05-121-1/+17
|
* dirclient, hsservice: Use Arc<str> for hsdesc publishing.Nick Mathewson2026-05-121-2/+4
| | | | | This saves a little memory, but the technique will help save more memory for other uploads.
* tor-dirclient: Avoid copying bytes that we want to POST.Nick Mathewson2026-05-124-28/+49
| | | | | This required a change to the hsservice tests, which previously assumed that we'd perform one write per request.
* tor-dirclient: Introduce a new RequestBody type.Nick Mathewson2026-05-124-28/+138
| | | | | I'm going to use this to avoid copying when uploading large documents.
* tor-dirclient: port to web-time-compat.Nick Mathewson2026-03-262-2/+4
|
* Merge branch 'extra-info' into 'main'Clara Engler2026-03-181-1/+131
|\ | | | | | | | | tor-dirclient: Support for extra-info requests See merge request tpo/core/arti!3764
| * tor-dirclient: Add TODO wrt Default for requestsClara Engler2026-03-181-0/+2
| |
| * tor-dirclient: Add TODO for renamingClara Engler2026-03-121-0/+1
| |
| * tor-dirclient: No ref semantic in ExtraInfoClara Engler2026-03-121-6/+6
| |
| * tor-dirclient: Small semantic fixupsClara Engler2026-03-121-5/+15
| |
| * tor-dirclient: Support for extra-info requestsClara Engler2026-03-111-1/+118
| | | | | | | | | | | | | | | | | | | | | | This commit implements support for extra-info requests in tor-dirclient. It is gated behind the already existing `routerdesc` feature flag, because entities building upon router descriptors most likely also need extra-info, namely directory mirrors and directory authorities. The implementation is largely based upon the existing one for router descriptors, as they are of a very similar request format, most likely due to simply being closely related anyways.
* | tor-dirclient: Use US spellingIan Jackson2026-03-111-6/+6
| |
* | tor-dirclient: Attempt to explain AnonymizedRequestIan Jackson2026-03-111-3/+44
|/
* 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.
* tor-dirclient: Only fail on empty GET responsesClara Engler2026-03-043-12/+26
| | | | | | | | | This commit fixes the previous check to only fail on empty GET responses. For this, it introduces a `method` field into `DirResponse`, which is required to determine the method there. Doing this is reasonable for an HTTP client, as responses have different meanings depending on the request method used.
* tor-dirclient: Disallow empty successful responsesClara Engler2026-03-042-0/+18
| | | | | | | | | | | | | | | This commit disallows empty responses with a status code 200. From a pure HTTP level, this is totally valid, but it does not make any sense in the context of the Tor directory protocol, where an empty response only makes sense with a 404. The motivation for this is that a work-in-progress tor_dirclient::send_request wrapper for tor-dirserver passes the response into the parse2 multiple function which returns a Vec<T>. Interfacing code would then always have to check for an empty length and do respective error handling, which should already fail at an earlier level (tor-dirclient) instead.
* 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.
* tor-dirclient: Document retriability of failuresClara Engler2026-02-051-0/+6
| | | | | This commit documents the retriability of `RequestFailedError`, following an IRC conversation with nickm.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* tor-dirclient: Remove Downloadable for goodClara Engler2025-12-101-24/+0
|
* tor-dirclient: Fix Requestable rustdocClara Engler2025-12-101-2/+2
|
* tor-dirclient: Improve upon Requestable subtraitsClara Engler2025-12-101-11/+7
| | | | | | | This commit removes the unused `Votable` and `Uploadable` traits and changes the `Downloadable` trait to depend on `Requestable` rather the sealed type, as it achieves the same level of sealedness while clearly communicating the hierarchy.
* tor-dirclient: Semantic traits for RequestableClara Engler2025-12-101-0/+28
| | | | | | | | | | | | | | This commit introduces three new traits to `tor-dirclient`: * `Downloadable` * `Uploadable` * `Votable` All of these traits have no associated methods or constants and all require an existing implementation of `Requestable`. The idea behind this is for applications to accept generic arguments based upon the semantic meaning, allowing for a better integration with proposal330.
* tor-dirclient: Improve upon error loggingClara Engler2025-12-101-3/+3
| | | | | | This commit improves upon the error logging of the `tor-dirclient` crate in order to not just log the location/source of an error but also the actual reason of an error.
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-1/+2
| | | | | 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-064-5/+5
| | | | Run maint/add_warning
* Stop using MockSleepProvider in a few cratesNeel Chauhan2025-11-021-3/+2
| | | | Part of #1885.
* 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-netdoc: Rename ConsensusFlavor::Ns to ConsensusFlavor::PlainIan Jackson2025-08-181-1/+1
| | | | This is part of abolishing the use of "ns" to mean "plain".
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-072-13/+42
| | | | | | | | | | | | | | 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.
* dirclient: Use the new Tunnel interface (fmt).Gabriela Moldovan2025-08-051-1/+3
|
* dirclient: Use the new Tunnel interfaceDavid Goulet2025-08-054-20/+29
| | | | | | This entirely removes the requirement on ClientCirc. Signed-off-by: David Goulet <[email protected]>
* Rename last_hop to last_hop_info to fix name conflictNick Mathewson2025-07-101-3/+3
|
* dirclient: treat excessive incoming cells as suspicious.Nick Mathewson2025-07-101-2/+3
|
* hs*: Define some HsDesc errors as _suspicious_.Nick Mathewson2025-07-101-0/+39
| | | | | These errors are suspicious as hsdir inflation attacks, in the context of prop360.
* dirclient: New error type for too-long headers.Nick Mathewson2025-07-102-4/+13
| | | | (This was previously called a parse error, which isn't right.)
* dirclient: Make SourceInfo::from_circuit public.Nick Mathewson2025-07-101-8/+8
|
* dirclient: refactor logic for constructing a SourceInfo from a circuitNick Mathewson2025-07-102-11/+16
| | | | | | | 1) It's the last hop that matters, not the first. 2) The last hop could conceivably be virtual, making the source anonymous. (Though this never happens in Arti today.)
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* Remove comment saying we do not implement consensus diffsNick Mathewson2025-06-101-2/+0
|
* Merge branch 'nightly-warnings' into 'main'Nick Mathewson2025-05-291-1/+1
|\ | | | | | | | | | | | | Fix clippy warnings from nightly rust Closes #2009 See merge request tpo/core/arti!3008
| * arti, cell, dirclient: Use expect instead of unwrap.Nick Mathewson2025-05-291-1/+1
| | | | | | | | | | | | Clippy nightly detects this problem, though earlier clippy verisons haven't. The common element here is applying unwrap() to the result from a write!().
* | dirclient: Stop sending suffix .z in URLs.Nick Mathewson2025-05-272-15/+12
|/ | | | | | | | This suffix is redundant with "Accept-Encoding", which all Tor directory caches have supported since 0.3.1.1-alpha. See torspec#342.
* tor-proto: Update the TunnelMutableState when a circuit is removed.Gabriela Moldovan2025-05-152-5/+13
| | | | | | | | This is messy, because `ClientCirc::{path_ref, n_hops, ..}` become fallible (we can't unwrap the result, because when a circuit is closed, its state gets removed from the `TunnelSharedState`, but its `ClientCirc` handle continues to exist, so any attempt to retrieve the state will result in an `Err`).
* tor-rtmock: allow-Decorate every use of MockSleepProviderIan Jackson2025-03-061-1/+5
| | | | | | | MockSleepProvider and MockSleepRuntime have been declared deprecated by the docs for some time. We're about to mark them `#[deprecated]`. This commit has been split out for clarity of review.
* tor-dirclient: modify `check_circuit` to use `first_hop_clock_skew`Steven Engler2025-02-102-15/+30
|