summaryrefslogtreecommitdiff
path: root/crates/tor-dirclient/src/request.rs
Commit message (Collapse)AuthorAgeFilesLines
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* Fix typosDimitris Apostolou2024-01-081-1/+1
|
* Only send Content-Length when needed.Nick Mathewson2023-11-271-7/+7
| | | | | | | | | | | | | | | According to RFC 9110: A user agent SHOULD send Content-Length in a request when the method defines a meaning for enclosed content and it is not sending Transfer-Encoding. For example, a user agent normally sends Content-Length in a POST request even when the value is 0 (indicating empty content). A user agent SHOULD NOT send a Content-Length header field when the request message does not contain content and the method semantics do not anticipate such data. Part of #1024
* tor-dirclient: Always set the Content-Length header.Gabriela Moldovan2023-10-241-7/+7
|
* dirclient: Seal the Requestable trait and hide most of its members.Nick Mathewson2023-10-171-39/+67
| | | | | | | | Since none of these methods were invoked from outside `tor-dirclient` (except for debugging), and since we have had a fair amount of churn on what we actually want them to be, it seems like a good idea to use this trick to hide them. This will let us make other changes to the actual behavior of Requestable in the future.
* dirclient: Rename partial_docs_ok to partial_response_body_okNick Mathewson2023-10-171-23/+22
|
* dirclient: Make Requestable::anonymized mandatory.Nick Mathewson2023-10-171-3/+21
|
* dirclient: Explain why 1024 is a sufficient maximum response length.Nick Mathewson2023-10-161-0/+4
|
* dirclient: Wrap a somewhat wide comment.Nick Mathewson2023-10-161-5/+3
|
* Downgrade another TODO HSS and move it to TODO BREAKINGNick Mathewson2023-10-161-2/+3
|
* Privacy: Do not list supported encodings in hsdesc reqs.Nick Mathewson2023-10-161-19/+46
| | | | | | | | | | | | | 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
* dirclient: Change a todo to an API todo and make it less blocking.Nick Mathewson2023-10-161-1/+9
|
* tor-dirclient: Set a non-zero expected response len for uploads.Gabriela Moldovan2023-10-031-5/+5
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* tor-dirclient: Remove unused `StringBody` trait.Gabriela Moldovan2023-08-161-26/+0
|
* tor-dirclient: Make Requestable return requests with String bodies.Gabriela Moldovan2023-08-161-31/+14
| | | | | It's simpler to always use a `String` to represent directory request bodies. We no longer need the `StringBody` trait.
* tor-dirclient: Rename StringBody::str() to StringBody::as_str().Gabriela Moldovan2023-08-161-4/+4
|
* tor-dirclient: Add `HsDescUploadRequest`.Gabriela Moldovan2023-08-161-0/+46
| | | | | The hsdir publisher will send the `HsDescUploadRequest`s to the appropriate directory using `send_request()`.
* tor-dirclient: Make the body type of a `Requestable` type configurable.Gabriela Moldovan2023-08-161-1/+42
| | | | | | | | | Previously, the `Requestable` trait assumed the body of the request would always be empty (`http::Request<()>`). This change replaces the hardcoded `()` body type with the `Requestable::Body` associated type (which will allow implementors to create requests with non-empty bodies). This will enable us to reuse the `Requestable` trait for building `POST` requests for uploading descriptors.
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* dirclient: use correct default max_lenNick Mathewson2023-06-271-2/+2
| | | | | | Yes, it's 50 kilobytes, not 50 kibibytes. I double-checked this with the C implementation and with param-spec.txt's documentation for `HSV3MaxDescriptorSize`.
* dirclient: Correct an erroneous comment.Nick Mathewson2023-06-271-1/+2
|
* dirclient: Make maximum hsdesc length adjustable.Nick Mathewson2023-06-271-8/+12
|
* dirclient: Explain why hardcoding "3" is ok.Nick Mathewson2023-06-271-1/+7
|
* Use an Enum for the description requesttranna2023-04-101-37/+54
|
* dirclient: fix an "unused import" warning.Nick Mathewson2023-04-061-1/+1
|
* tor-dirclient: Add a comment about 50 x 1024gabi-2502023-04-031-0/+1
|
* tor-dirclient: Add test case for HsDescDownloadRequestIan Jackson2023-04-031-1/+21
| | | | | | | | I couldn't find a test vector in C Tor. This test case was generated from the code here. I'm fairly sure it's right since I managed to get my descriptor downloader to work. (That's not an MR yet, but uses this code.)
* tor-dirclient: Provide HsDescDownloadRequestIan Jackson2023-04-031-0/+43
| | | | | In my tests this seems to do the right thing, but I'm getting 404s. I'm not sure if actually this URL is wrong.
* 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.
* Complete our migration to base64ct.Nick Mathewson2023-01-201-1/+2
| | | | | | | | | This is in lieu of upgrading to the latest base64 crate, which has a different API from the old one. Since we have to migrate either way, we might as well use base64ct everywhere. I don't think that most of these cases _require_ constant-time base64, but it won't hurt.
* 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.
* cfg compilation: Add two allowsIan Jackson2022-11-181-0/+1
|
* tor-dirclient: Provide RoutersOwnDescRequestIan Jackson2022-10-251-0/+29
| | | | This will be used for bridges' descriptors.
* dirclient: Generalize MdSha256Empty to EmptyRequest.Nick Mathewson2022-07-071-2/+5
| | | | | (It makes sense to use this for things that are not in fact lists of SHA256 digests of Microdescriptors.)
* dirclient: Fix comments re conssensus request without authoritiesIan Jackson2022-06-101-5/+3
|
* dirclient: Replace four very similar "ids in request"Ian Jackson2022-06-091-28/+44
| | | | | | | | | | In reviewing !553 I noticed that the empty digest list error had to be handled in two places. I filed #492 about the duplication. In fact it turns out to have been quadruplication. The new code also avoids cloning the underlying objects, instead sorting a Vec of references.
* dirclient: Test consensus request based on empty ConsensusRequestIan Jackson2022-06-091-0/+8
| | | | | | I'm not sure this is right. But providing a test case for it before my next change ensures that my refactoring doesn't change the behaviour.
* tor-dirclient: Require that self.digests is nonemptyNeel Chauhan2022-05-301-2/+6
|
* dirclient: add the ability to reject circuits that are too skewed.Nick Mathewson2022-05-111-1/+65
| | | | This will help implement #466.
* Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-301-1/+0
|
* Merge branch 'no-system-time' into 'main'eta2022-03-301-0/+1
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * use wallclock where possible in teststrinity-1686a2022-02-261-0/+1
| |
* | dirclient: Collect and expose peer information from errors.Nick Mathewson2022-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | This commit refactors the dirclient error type into two cases: errors when constructing a circuit, and errors that occur once we already have a one-hop circuit. The latter can usually be attributed to the specific cache we're talking to. This commit also adds a function to expose the information about which directory gave us the info.
* | Replace manual Default and new with std derive in tor-dirclientIan Jackson2022-03-021-30/+6
|/
* add semicolons if nothing returnedDaniel Eades2021-11-251-2/+2
|
* tor-dirclient: Put routerdesc download behind a feature.Nick Mathewson2021-11-121-0/+8
| | | | Part of #125
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-1/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+555
This will cause some pain for now, but now is really the best time to do this kind of thing.