summaryrefslogtreecommitdiff
path: root/crates/arti-client/src/client.rs
Commit message (Collapse)AuthorAgeFilesLines
* Tweak documentation for wait_for_stop slightly.Nick Mathewson2024-07-231-1/+7
|
* tor-hsservice: Add OnionServiceBuilder, deprecate OnionService::new (fmt).Gabriela Moldovan2024-07-151-10/+8
|
* tor-hsservice: Add OnionServiceBuilder, deprecate OnionService::new.Gabriela Moldovan2024-07-151-6/+11
| | | | Closes #1490
* implement TorClient::wait_for_stoptrinity-1686a2024-07-111-0/+6
|
* arti-client: Gate generate_service_discovery_key() behind keymgr feature.Gabriela Moldovan2024-07-101-2/+10
| | | | | Otherwise arti-client fails to build with `-no-default-features --features onion-service-client,experimental-api`.
* arti-client: Add a function for generating client authorization keys.Gabriela Moldovan2024-06-271-1/+79
| | | | Part of #1281
* RPC: Use RPC methods instead of the "ClientConnectionTarget" trait.Nick Mathewson2024-06-111-4/+1
| | | | | | | | | | | | On its own, this might not seem like a huge improvement, but it will later let us implement these RPC methods for types that can't reasonably implement ClientConnectionTarget. It also serves as a proof of concept that special-method invocation can actually work, so that we can build things like this in cases where introducing a trait isn't practical. Closes #1427
* arti-client: Unconditionally retire all HS circuits if circmgr says so.Gabi Moldovan2024-06-031-12/+1
| | | | | | | If the circmgr retires all of its circuits, so should the HS circ pool. The circuits can be retired for various reasons (for example, if the configured vanguard mode changes).
* arti-client: Add TODO about always clearing the HS circ pool.Gabriela Moldovan2024-06-031-0/+8
|
* tor-circmgr: Remove VanguardMode from Pool (fmt).Gabriela Moldovan2024-06-031-4/+3
|
* tor-circmgr: Remove VanguardMode from Pool.Gabriela Moldovan2024-06-031-5/+7
| | | | | | | | | Storing the VanguardMode in multiple places (in the VanguardMgr *and* the HS circ Pool) is dangerous and can lead to split brain situations where different parts of the code think they are running in different VanguardModes. See #1424
* RPC: RpcDataStream type to act as a "stream-shaped hole"Nick Mathewson2024-05-141-0/+7
| | | | | | | | | The application creates these, using a new-stream-handle RPC command, on an object that can actually create streams. Then later, the application provides the (global) identity of one of these objects when it's making a SOCKS connection. This causes the object to take hold of a `DataStreamCtrl`.
* RPC: Add a trait that can be the target of SOCKS requestsNick Mathewson2024-05-121-1/+4
| | | | | | | | | | | | (These will later become objects that can receive any application request, once we have HTTP connect.) For now, Session and TorClient implement this trait; but soon there will be a new type to hold on to the created DataStreamCtrl. There are some XXXXs here, marking code that is too ugly to live. I should fix it before I merge this branch.
* rpc: Mark TorClient as exposed outside of sessionNick Mathewson2024-05-091-1/+6
|
* arti-client: add hs_circ_pool() method on TorClientRichard Pospesel2024-04-151-0/+14
|
* Port many of the macros in tor-rpcbase to use derive-deftly.Nick Mathewson2024-04-041-1/+2
| | | | | | This simplifies our implementation logic in a few places, and simplifies our invocation syntax greatly. There are a few infelicities, noted in `TODO RPC` comments.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-circmgr: Add HsCircPoolConfig, make HsCircPool::reconfigure general-purpose.Gabriela Moldovan2024-03-111-7/+1
|
* tor-circmgr: Create the VanguardMgr in CircMgr::new.Gabriela Moldovan2024-03-111-19/+0
|
* arti-client: Reconfigure the HS circuit pool if needed.Gabriela Moldovan2024-03-111-0/+14
|
* arti-client: Keep a handle to the HsCircPool if onion-service-client is enabled.Gabriela Moldovan2024-03-111-2/+2
| | | | | | | | | | | | | | | If vanguards are enabled, we will need to be able to reconfigure the HS circ pool in `TorClient::reconfigure_inner` (to handle the switch from vanguards-full to vanguards-lite etc.). The reconfiguration needs to happen even if only one of `onion-service-client` and `onion-service-service` is enabled. Without this change, in the `onion-service-client`-enabled / `onion-service-service`-disabled case, we'd need to reach into `HsClientConnector::hs_circ_pool` to reconfigure the client `HsCircPool`. By making `hs_circ_pool` part of `TorClient` in both cases, we only need to call `HsCircPool::reconfigure` from one place (in `TorClient::reconfigure_inner`).
* arti-client: Add VanguardsConfig to TorClientConfig.Gabriela Moldovan2024-03-111-3/+2
|
* tor-circmgr: Give CircMgr a VanguardMgr.Gabriela Moldovan2024-03-111-0/+20
| | | | Closes #1277
* tor-hsclient: Remove client nickname from the client key specifiers (fmt).Gabriela Moldovan2024-02-221-6/+2
|
* tor-hsclient: Remove client nickname from the client key specifiers.Gabriela Moldovan2024-02-221-5/+2
| | | | Closes #1283
* arti, arti-client, tor-keymgr: Remove keystore dir configuration.Gabriela Moldovan2024-02-211-2/+3
| | | | Closes #1202
* educe: Use std's default for two structsIan Jackson2024-02-121-2/+1
| | | | | | Reviewing uses of `#[educe(default)]`, I came across these two places where it was applied to a non-generic struct without any special attributes on fields. std's derive will do just as well here.
* educe: Use std's default for enums where default variant is unitIan Jackson2024-02-121-10/+6
| | | | | | | | | | | | | Since Rust 1.66, std's default works properly for enums, provided that the default variant is a unit. Review all uses of `#[educe(default)]` on enums and replace them with std where possible, which is most of them. In 1.66 and later, std's `#[derive(Default)]` doesn't infer any generic bounds on the derived impl, where it's an enum - since the unit variant can always be constructed. So this change doesn't add any generic bounds and is not API-visible.
* tor-hsservice: Use tor_persist::state_dirIan Jackson2024-02-011-1/+3
|
* tor-hsservice: Use tor_persist::state_dir, etc. (fmt)Ian Jackson2024-02-011-4/+3
|
* tor-hsservice: Use tor_persist::state_dirIan Jackson2024-02-011-8/+8
| | | | | | | | | | | | | | | | | | | | | | | We no longer do replay log locking in IptManager::new. Instead, we rely on the acquire_instance call in OnionService::launch, which ends up with ipt_mgr getting an InstanceHandle (which contains a lock guard). OnionServiceStateMgr is abolished; it existed to deal with the generics in the tor_persist::StateMgr API. state_dir has no generics (other than the T being loaded/stored). Many places (structs and argument lists) now have state_dir types which embody a path (or a CheckeDir) along with a lock, rather than separate path+lock+mistrust. The creation/startup code uses the new calls from state_dir. Other more minor changes: - StartupError::StateDirectoryInaccessible contains tor_persist::Error - test::create_storage_handles_from_state_dir changed and renamed, from _from_state_mgr. - replay::PersistFile's (separate) file lock is now fslock_guard's
* tor-hsclient: Rename HsClientSpecifier to HsClientNickname (fmt).Gabriela Moldovan2024-01-311-2/+2
|
* tor-hsclient: Rename HsClientSpecifier to HsClientNickname.Gabriela Moldovan2024-01-311-2/+2
| | | | | Service nicknames are represented by `HsNickname`, so let's rename `HsClientSpecifier` to `HsClientNickname`.
* tor-hsservice: Store the StateMgr inside OnionServiceState.Gabriela Moldovan2024-01-181-3/+5
| | | | | | This introduces an internal `OnionServiceStateMgr` trait, which enables us to store the `StateMgr` inside the `OnionServiceState` (without having to parameterize `OnionServiceState` on `S: StateMgr`).
* arti-client: Move state_dir and mistrust handling to separate function.Gabriela Moldovan2024-01-181-11/+19
| | | | This reduces code duplication.
* arti-client: Move keymgr creation to TorClient::create_keymgr.Gabriela Moldovan2024-01-181-49/+34
| | | | | This code was duplicated by `create_inner()` and `create_onion_service()`.
* tor-hsservice: Do not store the StateMgr in OnionService.Gabriela Moldovan2024-01-181-13/+7
| | | | | | | The `StateMgr` is currently only needed in `launch()`, so we don't really need to store it. This allows us to unparameterize OnionService.
* arti-client: Add a function for creating OnionServices.Gabriela Moldovan2024-01-181-0/+58
| | | | | This will be used from `arti` to create an `OnionService`, to implement the `arti hss` command.
* tor-hsservice: Create a separate RunningOnionService type.Gabriela Moldovan2024-01-181-5/+8
| | | | | | | | This will enable us to construct non-launched (but configured) `OnionService`s. We need this, for example, for implementing the `arti hss` CLI command. Part of #1227
* arti-client Remove a TODO hs that is no longer relevant.Gabriela Moldovan2024-01-111-1/+0
|
* arti-client: Add ErrorDetail::KeystoreRequired.Gabriela Moldovan2024-01-111-4/+3
| | | | | This addresses a `TODO HSS` about not using `internal!` for an error caused by misconfiguration.
* arti-client: Turn a TODO hs into #858.Gabriela Moldovan2024-01-111-1/+1
|
* arti-client: Turn a TODO HSS into #1106.Gabriela Moldovan2024-01-111-1/+1
|
* Merge branch 'expand-keystore-dir' into 'main'gabi-2502024-01-111-4/+2
|\ | | | | | | | | tor-keymgr: Abolish ArtiNativeKeystoreConfig::expand_keystore_dir. See merge request tpo/core/arti!1867
| * tor-keymgr: Abolish ArtiNativeKeystoreConfig::expand_keystore_dir.Gabriela Moldovan2024-01-101-4/+2
| | | | | | | | | | | | This resolves a `TODO HSS` in arti-client. Part of #1187
* | tor-hsclient: Derive the KeySpecifier implementation (fmt).Gabriela Moldovan2024-01-101-4/+2
| |
* | tor-hsclient: Derive the KeySpecifier implementation.Gabriela Moldovan2024-01-101-3/+2
|/ | | | | | | | This addresses a `TODO HSS` about deriving the `KeySpecifier` implementation for client key specifiers. Note that we no longer have a key specifier type for intro auth keys (which are not supported anyway, see #1037).
* arti_client: Change ephemeral-service TODO HSS comments to #1186.Nick Mathewson2024-01-091-3/+3
|
* arti-client::client: remove TODO HSS that is no longer true.Nick Mathewson2024-01-091-2/+0
|
* arti-client: TorClient.storage_mistrust: Correct doc commentIan Jackson2023-12-131-1/+6
|