aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-client/src/address.rs
Commit message (Collapse)AuthorAgeFilesLines
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Turn off HS client connections by defaultIan Jackson2023-06-291-2/+2
| | | | As per IRC discussion, re lack of Vanguards.
* arti-client tests: Explicitly enable .onion in most testsIan Jackson2023-06-291-2/+16
| | | | | These tests include tests of .onion, which we are disabling by default. So we must make some prefs that enable them.
* arti_client: Add a warning comment to TorAddrError.Nick Mathewson2023-06-291-0/+3
|
* arti_client: Move BadOnion from TorAddrError to ErrorDetail.Nick Mathewson2023-06-291-9/+0
| | | | | | | | | | This variant can never be constructed when parsing a TorAddr, so it doesn't make sense to have it in TorAddrError: the use can never see it unless they enable `error_detail`. Not a semver break because the client feature is not yet stable. Closes #932.
* HS configuration: Add and honour `allow_onion_addrs` in configurationIan Jackson2023-06-281-5/+8
| | | | | | | We put this in `[address_filter]`. The interaction with the corresponding stream preference is a bit complicated. We must turn the stream pref into a `BoolOrAuto`.
* arti-client: address: Prefer to throw OnionAddressResolveRequest (fmt)Ian Jackson2023-06-161-9/+7
|
* arti-client: address: Prefer to throw OnionAddressResolveRequestIan Jackson2023-06-161-7/+23
| | | | Reformatting deferred for clarity.
* arti-client: hs: Test cases for variously disabling .onionIan Jackson2023-06-161-1/+57
| | | | This test case shows that we return a suboptimal error in some cases.
* arti-client: StreamPrefs::connect_to_onion_services: honourIan Jackson2023-06-161-0/+12
|
* arti-client: address: Apply deferred rustfmt churnIan Jackson2023-06-161-2/+6
|
* arti-client: address: Plumb StreamPrefs into enforce_configIan Jackson2023-06-161-5/+10
| | | | No functional change yet. We'll use this shortly.
* arti-client: address: Move config enforcementIan Jackson2023-06-161-5/+9
| | | | Disposes of two TODOs.
* arti-client: address: Move config enforcement (pre-fmt)Ian Jackson2023-06-161-2/+6
| | | | This will make subsequent commits less noisy to read.
* arti-client: address: Disable some tests when HS disabledIan Jackson2023-06-161-9/+16
| | | | | These have already been partially/replaced supplemented. The other test referred to will appear shortly.
* arti-client: Rename hs feature to onion-service-client (cfg lines)Ian Jackson2023-06-161-6/+6
|
* Discuss in comment why we're not using a newtype for the Strings in HostIan Jackson2023-03-091-0/+8
|
* Reject invalid hostnamesIan Jackson2023-03-091-2/+5
| | | | | | Reject them both for .onion and for "exit" hostnames This prevents a `Host` from having an invalid hostname in it.
* Fix reference to no-longer-contemplated Host variantIan Jackson2023-03-091-1/+1
| | | | | Reported in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1060#note_2884755
* Dummy HsId::from_str on .onion: Return Bug, rather than panickingIan Jackson2023-03-091-5/+4
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1060#note_2884754
* Improve error from HsId parse of "www.B32.onion"Ian Jackson2023-03-091-0/+2
| | | | And add some clarity and todos about address errors.
* arti-client: Parse .onion addresses and dispatch to client.rsIan Jackson2023-03-091-24/+126
| | | | | | | Now, a Host has a separate variant for `.onion` which is always used, even when HS is disabled. Currently it ends in a todo!.
* arti-client: DoThingInstructions: Make error returns consistentIan Jackson2023-03-091-8/+9
| | | | This is more comprehensible, and will be more convenient.
* arti-client: Host: Use Display::fmt rather than write!Ian Jackson2023-03-091-2/+3
| | | | | write! is less good because the `{}` overwrites stuff like "did the caller ask for padding".
* Merge branch 'suffix' into 'main'Nick Mathewson2023-03-081-1/+1
|\ | | | | | | | | Introduce and use ends_with_ignore_ascii_case See merge request tpo/core/arti!1058
| * Introduce and use ends_with_ignore_ascii_caseIan Jackson2023-03-081-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1056#note_2884428
* | Merge branch 'host2' into 'main'Ian Jackson2023-03-081-11/+90
|\ \ | |/ |/| | | | | arti-client: Do not send resolve requests for IP addrs to exits See merge request tpo/core/arti!1057
| * arti-client: Host: Be more explicit about what is allowed in HostnameIan Jackson2023-03-081-1/+11
| |
| * RustfmtIan Jackson2023-03-081-3/+12
| |
| * Abolish Host::into_string_and_portIan Jackson2023-03-081-23/+0
| | | | | | | | | | | | | | | | | | When I was trying to add HS support to these layers, I found I could add a new variant to the `Host` enum but everything would still compile even though I hadn't written the necessary implementation! This method is a liability: when using it, one inevitably writes such latent bugs.
| * arti-client: Do not send resolve requests for IP addrs to exitsIan Jackson2023-03-081-0/+37
| | | | | | | | | | | | | | | | Doing so doesn't seem like a good idea. It might even be some kind of leak? Found because I added a variant to `address::Host` for hidden services, and noticed that the resolve code still compiled.
| * arti-client addr handling: Introduce StreamInstructionsIan Jackson2023-03-081-0/+46
| |
* | arti-client: Reject .onion, when we should, without allocatingIan Jackson2023-03-081-1/+2
|/ | | | Use new strip_suffix_ignore_ascii_case
* Rename onion-* cargo features to hs-* in tor-* cratesIan Jackson2023-02-281-1/+1
| | | | Fixes #756
* 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.
* Make a top-level API for connecting to onion services.Nick Mathewson2023-01-121-0/+10
| | | | Fortunately, it adds very little to the arti-client API surface.
* 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.
* Fix a bunch of "needless borrow" warnings on nightlyNick Mathewson2022-11-181-1/+1
| | | | | It looks like, despite a few false starts, they've got this warning right; there weren't any false positives.
* Merge branch 'hostname-validation' into 'main'Nick Mathewson2022-10-031-18/+1
|\ | | | | | | | | Use hostname-validator crate for hostname validation See merge request tpo/core/arti!739
| * Use hostname-validator crate for hostname validationReylaba2022-10-031-18/+1
| |
* | Apply 1 suggestion(s) to 1 file(s)Ian Jackson2022-09-221-1/+1
| |
* | fix clippy::needless_borrowtrinity-1686a2022-09-101-0/+2
|/
* More docs for IntoTorAddrNick Mathewson2022-02-141-4/+25
|
* arti_client: Rename Error to ErrorDetail.Nick Mathewson2022-02-081-10/+14
| | | | | | | This is closer to what we described in Errors.md. Also, remove the (sometimes private) Result alias: it was only used in one or two places, and never exposed in public.
* errors: Refer to err::Error in some bits of arti_clientIan Jackson2022-02-041-5/+5
| | | | We are going to make the top-level Error type conditionally hidden.
* Fix typosDimitris Apostolou2022-02-021-1/+1
|
* arti-client: Change an XXXX to a TODO.Nick Mathewson2021-12-201-1/+5
| | | | | | We _do_ reject bad hostnames: just not where I once thought we might. We need to decide if the current behavior is what we want (and I think it is, probably?).
* Add constructor for TorAddr, to enforce port != 0Nick Mathewson2021-11-301-24/+30
| | | | This makes sure that we're checking for a nonzero port in all cases.
* arti-client: Reject Port 0 when parsing address:port combosNeel Chauhan2021-11-291-2/+5
|