aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirclient/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* test: invalid utf-8 bytes in response bodyiqdecay2026-08-041-1/+18
|
* 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.
* dirclient: Split EncodedRequest and RequestBody.Nick Mathewson2026-05-121-2/+2
| | | | | RequestBody is now just an `Option<Arc<str>>` internally, and EncodedRequest is much simpler.
* tor-dirclient: Avoid copying bytes that we want to POST.Nick Mathewson2026-05-121-5/+7
| | | | | 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-121-0/+1
| | | | | I'm going to use this to avoid copying when uploading large documents.
* tor-dirclient: port to web-time-compat.Nick Mathewson2026-03-261-1/+2
|
* tor-dirclient: Use US spellingIan Jackson2026-03-111-6/+6
|
* tor-dirclient: Attempt to explain AnonymizedRequestIan Jackson2026-03-111-3/+44
|
* tor-dirclient: Only fail on empty GET responsesClara Engler2026-03-041-1/+10
| | | | | | | | | 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.
* 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.
* 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/+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-061-2/+2
| | | | 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.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | 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 interfaceDavid Goulet2025-08-051-5/+5
| | | | | | This entirely removes the requirement on ClientCirc. Signed-off-by: David Goulet <[email protected]>
* dirclient: New error type for too-long headers.Nick Mathewson2025-07-101-4/+8
| | | | (This was previously called a parse error, which isn't right.)
* dirclient: refactor logic for constructing a SourceInfo from a circuitNick Mathewson2025-07-101-6/+5
| | | | | | | 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.
* dirclient: Stop sending suffix .z in URLs.Nick Mathewson2025-05-271-1/+1
| | | | | | | | 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-151-1/+9
| | | | | | | | 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-101-1/+1
|
* 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.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Preserve HTTP status text in dirclient errors.Nick Mathewson2023-11-291-1/+6
| | | | | | | | The HTTP status text is often useful for diagnosing errors. Tor directory and hsdir caches frequently put useful messages there, especially when rejecting an uploaded document. Inspired by #1142.
* Add cfg_attr allow(unused_imports) to two cratesIan Jackson2023-10-311-0/+6
| | | | | As per this comment, and preceding discussion https://gitlab.torproject.org/tpo/core/arti/-/issues/1060#note_2959187
* dirclient: Rename partial_docs_ok to partial_response_body_okNick Mathewson2023-10-171-1/+1
|
* Privacy: Do not list supported encodings in hsdesc reqs.Nick Mathewson2023-10-161-8/+34
| | | | | | | | | | | | | Since not everybody has xz and/or zstd, we don't want to admit whether we support them when we are uploading or downloading an onion service descriptor. Similarly, if we aren't advertising support for an encoding, we shouldn't accept it. Finally, while we're doing this, it made sense to have the ability to mark requests based on how anonymized they are, and reject (some) attempts to send those requests over a one-hop circuit. Closes #1062
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* tor-dirclient: Deprecate download() instead of removing it.Gabriela Moldovan2023-08-161-0/+16
|
* tor-dirclient: Rename download() to send_request().Gabriela Moldovan2023-08-161-6/+6
| | | | | | `download()` is actually a general-purpose function for sending HTTP requests on a stream. We will soon repurpose it for `POST`-ing descriptors, so let's rename it to `send_request`.
* 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
|
* 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
|
* tor-dirclient: De-genericise internal fn retire_circIan Jackson2023-01-301-2/+1
| | | | | | | Requring `Display` is wrong here, because if this is actually an Error, Display would be wrong because it doesn't display causes. As it happens, the `error` parameter is only ever `&str`.
* 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.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* tor-dirclient: Promise that download only gives RequestFailedIan Jackson2022-10-251-0/+4
|
* tor-dirclient: Make RequestFailed its own error type (rustfmt)Ian Jackson2022-10-201-12/+18
| | | | Split off to assist review.
* tor-dirclient: Make RequestFailed its own error typeIan Jackson2022-10-201-13/+13
| | | | | | | We're going to have functions on Response that fail by returning only one of these. Sadly this diff is quite noisy.