summaryrefslogtreecommitdiff
path: root/crates/arti-client/src/client.rs
Commit message (Collapse)AuthorAgeFilesLines
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-161-1/+1
| | | | | | | | | | | | Now ClientCirc is no longer `Clone`, and the things that need it to be `Clone` instead return and use an Arc<ClientCirc> We're doing this so that ClientCirc can participate in the RPC system, and so that its semantics are more obvious. Closes #846. Thanks to the type system, this was a much simpler refactoring than I had feared it would be.
* RPC: Start on plumbing TorClient into our RPC codeNick Mathewson2023-05-041-0/+4
| | | | | Because of #837, we won't be able to work with _every_ TorClient<R>, so I'm only going to be using TorClient<PreferredRuntime> for now.
* Merge branch 'plumb' into 'main'Alexander Færøy2023-03-301-5/+15
|\ | | | | | | | | More plumbing for hs connections See merge request tpo/core/arti!1098
| * Run rustfmtIan Jackson2023-03-301-8/+4
| | | | | | | | Apply this churn, which I deferred for ease of review.
| * arti-client: Call HsCircPool::launch_background_tasksIan Jackson2023-03-301-4/+13
| | | | | | | | | | | | | | | | I found that I had the bug where I forgot to call this function, and reached bad_api_usage!("The circuit launcher wasn't initialized") The possibility of such a bug is a hazard of this API pattern.
| * arti-client: When making hs conn, wait for bootstrapIan Jackson2023-03-301-0/+3
| | | | | | | | | | Not doing this was a bug. The bug was possible because of some code duplication between the exit and hs paths. Add a comment about that.
| * tor-client: Pass a netdir for each requestIan Jackson2023-03-301-1/+3
| | | | | | | | | | This will be more convenient inside tor-hsclient. In arti-client, this mirrors the way TorClient::get_or_launch_exit_circ works.
* | Move functionality from tor_basic_utils to tor_async_utilsNick Mathewson2023-03-291-1/+1
|/ | | | | This commit is mostly code movement; I'd recommend reviewing it with git's `--color-moved` option.
* Pass HsCircPool to hsclient connect function, not CircMgr (fmt)Ian Jackson2023-03-281-5/+5
|
* Pass HsCircPool to hsclient connect function, not CircMgrIan Jackson2023-03-281-2/+5
| | | | | We separated this out in the circmgr API. This is what the HS client needs. It doesn't want to participate in the general circuit pool.
* Apply deferred rustfmt churnIan Jackson2023-03-231-1/+4
|
* arti-client: Include redacted HsId in ObtainHsCircuit errorIan Jackson2023-03-231-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/1071/diffs?commit_id=580fe1118dbbbfa086d11b28e3e26d7c91afe21c#fbd7ab2d6d0a5b515697d4f9f99a42ebd508aa4b_153_165
* arti-client: Fix wording of docs for TorClient::isolationIan Jackson2023-03-231-1/+1
|
* arti-client: Strengthen an HS todoNick Mathewson2023-03-231-1/+1
|
* arti-client: Call tor-hsclient to create HS connectionsIan Jackson2023-03-231-4/+11
| | | | | Obviously this still doesn't work because the actual impl in hsclient is just a todo!().
* arti-client: Create an HsClientConnectorIan Jackson2023-03-231-0/+15
|
* arti-client: Move client stream creation out of match, in connectIan Jackson2023-03-231-16/+17
| | | | We want this part for HS too.
* arti-client: Break out TorClient::isolation(prefs)Ian Jackson2023-03-231-17/+32
| | | | | | | | We're going to want to reuse this. Also: rename StreamPrefs::isolation and update the docs, to better reflect its rather limited functionality. The new TorClient::isolation is the only call site.
* arti-client: Parse .onion addresses and dispatch to client.rsIan Jackson2023-03-091-0/+21
| | | | | | | 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-1/+1
| | | | This is more comprehensible, and will be more convenient.
* RustfmtIan Jackson2023-03-081-1/+4
|
* arti-client: Do not send resolve requests for IP addrs to exitsIan Jackson2023-03-081-13/+21
| | | | | | | | 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-22/+25
|
* Rename onion-* cargo features to hs-* in tor-* cratesIan Jackson2023-02-281-1/+1
| | | | Fixes #756
* Use ErrorReport for errors in error! in arti-clientIan Jackson2023-01-301-2/+2
|
* 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.
* made TorClient::set_stream_prefs publicMichael van Straten2023-01-181-4/+1
|
* Make a top-level API for connecting to onion services.Nick Mathewson2023-01-121-0/+6
| | | | 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.
* arti: pt mgr spawns the task itself in newIan Jackson2022-11-301-3/+0
|
* arti-client: Try to take ownership of state earlier.Nick Mathewson2022-11-291-0/+4
| | | | | | | | There's no harm in doing this, since we'll try to take ownership of the state soon as soon as we use it: We just want to try early, so that we'll get it before we decide that we're using bridges. Fixes bug #669; bug introduced by !889.
* PtMgr: Use a persistent state directory for PT state.Nick Mathewson2022-11-281-0/+5
| | | | | | | | | | This makes a `pt_state` directory inside .local/share/arti (or the local equivalent), right next to our existing `state` dir. Ideally we would use a separate directory for each PT, but we have a very fuzzy "what is a specific PT" notion. Closes #667
* Integrate PtMgr into arti-client.Nick Mathewson2022-11-281-0/+25
| | | | | | | | If support is available at compile-time, then we construct a PtMgr and register it with the ChanMgr. We keep a handle to it ourself so that we can reconfigure it as needed. Closes #659.
* arti-client: Add comment about Option DormantModeIan Jackson2022-11-231-0/+3
| | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/852#note_2854090 (ftaod, that is a different MR to this one)
* arti-client: Retain a strong reference to the inner Arc<BridgeDescMgr>Ian Jackson2022-11-151-5/+7
| | | | Fixes #636.
* bridges: Create and install a BridgeDescMgr when we bootstrapIan Jackson2022-11-151-0/+65
|
* arti-client: Store a handle to the DirMgrStore in TorClient (fmt)Ian Jackson2022-11-151-1/+6
| | | | rustfmt only.
* arti-client: Store a handle to the DirMgrStore in TorClientIan Jackson2022-11-151-1/+4
| | | | We'll need this shortly.
* arti-client: Store a handle to the guardmgr in TorClientIan Jackson2022-11-151-1/+5
| | | | We'll need this shortly.
* Merge branch 'guardmgr' into 'main'Ian Jackson2022-11-141-3/+11
|\ | | | | | | | | Move guardmgr creation to arti-client, rather than within circmgr See merge request tpo/core/arti!850
| * Move GuardMgr::new call to arti_client::TorClient (fmt)Ian Jackson2022-11-141-4/+8
| | | | | | | | rustfmt only, broken out to ease review.
| * Move GuardMgr::new call to arti_client::TorClientIan Jackson2022-11-141-1/+5
| | | | | | | | | | | | | | Having this done within circmgr was irregular - most of our other key buildup functions are done in TorClient::create_inner. It is also inconvenient, as it buries the guardmgr within the circmgr.
* | dirmgr Store: Have constructors take DirMgrStoreIan Jackson2022-11-141-2/+5
|/ | | | | | | Now the Store is constructed by arti_client, solving the problem described here https://gitlab.torproject.org/tpo/core/arti/-/issues/631#note_2853665 but in a different way.
* Spelling fixes and normalizations on some high-level cratesNick Mathewson2022-11-071-1/+1
|
* feature-gate some functions requiring PreferredRuntimetrinity-1686a2022-10-051-1/+10
|
* arti-client: Treat list of exit ports as sensitive.Nick Mathewson2022-08-251-2/+2
|
* arti-client: Downgrade "got a circuit for" message.Nick Mathewson2022-08-251-1/+1
| | | | | | This is not interesting to the user, and violates some of our safe-logging rules (like "Don't log at info for each user request" and "don't log ports").
* arti_client: Refuse to build a client if we are setuid.Nick Mathewson2022-08-241-0/+7
| | | | | | Arti is not designed to be a setuid-safe program. Part of #523.
* arti: Fix a minimal-versions failureIan Jackson2022-08-171-1/+1
|
* chanmgr: Use NetDirProvider::params and Arc<dyn..Netparameters>Ian Jackson2022-08-171-5/+6
| | | | | | | | | This gets rid of many Result(). Many parameters are renamed. Test cases of the now-impossible branch are removed. Deleting the match from padding_parameters will come in a moment. I've split off that commit since it has much whitespace noise. for now, change the error type to Void.