summaryrefslogtreecommitdiff
path: root/crates/arti-client/src/client.rs
Commit message (Collapse)AuthorAgeFilesLines
* arti-client: add path resolver to `TorClient` and `TorClientConfig`Steven Engler2024-11-181-3/+18
| | | | | | Rather than using `arti_client::config::path_resolver()`, third-party code can get the path resolver using `TorClientConfig`s `AsRef<CfgPathResolver>` impl instead.
* update `CfgPath::path` to use a `CfgPathResolver`Steven Engler2024-11-181-5/+6
| | | | | | | | | | | | | | | | This is a big change across multiple crates since there isn't a good way to break it up. This changes the signature of `CfgPath::path` to: ``` pub fn path(&self, path_resolver: &CfgPathResolver) -> Result<PathBuf, CfgPathError> { ``` Making this change means that our global `CfgPathResolver` needs to be stored in the 'arti-client' library instead of `tor-config-path`, and must be passed through to anything that calls `path` to expand the variables.
* tor-ptmgr: pass through the `CfgPathResolver`Steven Engler2024-11-181-0/+2
|
* tor-hsservice: pass through the `CfgPathResolver`Steven Engler2024-11-181-0/+2
|
* arti-client: add doc comment to `TorClient::reconfigure`Steven Engler2024-11-051-0/+4
|
* memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-151-2/+1
| | | | Fixes a TODO.
* arti-client: Fix a broken doc comment.Gabriela Moldovan2024-10-081-1/+1
| | | | | This broke because `tor_keymgr::config::arti` was moved to `tor_keymgr::config`.
* arti-client, tor-keymgr: Remove a couple of now-addressed TODOs.Gabriela Moldovan2024-10-081-1/+0
|
* arti-client: Use the configured C Tor client keystores.Gabriela Moldovan2024-10-081-1/+12
|
* arti-client: Use the configured C Tor keystores, if any.Gabriela Moldovan2024-10-081-4/+21
|
* arti-client: Refactor KeyMgr building logic.Gabriela Moldovan2024-10-081-15/+14
| | | | | | | | This deduplicates the keymgr building logic in preparation for supporting C Tor keystores (building the keymgr in a central place makes things a bit easier, because regardless of the `kind` of the primary keystore, we will need to extend the `KeyMgrBuilder` with the configured secondary `ctor` keystores, if any).
* tor-keymgr: Move config/arti.rs to config.rsGabriela Moldovan2024-10-081-1/+1
| | | | | | | | The config will soon contain secondary C Tor keystore configuration too, so the `arti` namespacing is about to stop making sense. I recommend reviewing this commit using `git diff --color-moved=zebra --ignore-space-change`
* arti-client: Fix incorrect feature gate for onion-service-client.Wesley Aptekar-Cassels2024-10-071-4/+3
| | | | | | | | | | Currently, arti-client doesn't compile with just the features experimental-api and onion-service-client enabled, because it incorrectly depends on tor-hsservice. This fixes that by gating the use statement behind the correct feature. Fixes: #1638
* Merge branch 'mq' into 'main'Ian Jackson2024-10-071-0/+2
|\ | | | | | | | | Implement memory quota tracking See merge request tpo/core/arti!2493
| * memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-031-0/+2
| | | | | | | | | | | | | | | | | | Plumb through a top-level account. This doesn't have any channel-specific, circuit-specific or stream-specific accounts yet. tor-circmgr's and tor-hsclient's *tests* need fake account. In arti-relay, use a dummy account for now.
* | Merge branch 'launch-with-hsid-docs' into 'main'gabi-2502024-10-031-0/+8
|\ \ | | | | | | | | | | | | | | | | | | arti-client: Clarify the launch_onion_service_with_hsid() docs. Closes #1626 See merge request tpo/core/arti!2494
| * | arti-client: Clarify the launch_onion_service_with_hsid() docs.Gabriela Moldovan2024-10-031-0/+8
| | | | | | | | | | | | | | | | | | | | | This updates the docs to mention that the specified key may get actually persisted to disk. Closes #1626
* | | Merge branch 'rename-client-auth' into 'main'Ian Jackson2024-10-031-2/+2
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Use the new "restricted discovery" terminology throughout Closes #1476 See merge request tpo/core/arti!2495
| * | arti-client: Use the new "restricted discovery" terminology.Gabriela Moldovan2024-10-031-2/+2
| |/ | | | | | | Part of #1476
* | CircMgr: Start writing tests.Wesley Aptekar-Cassels2024-10-031-1/+1
| |
* | Revise RPC documentation to be more informative.Nick Mathewson2024-10-021-0/+12
|/ | | | | | Previous documentation was more-or-less meant for the Arti developer only. This new documentation is intended for actual users of RPC functionality. It's meant to be extracted with `maint/rpc-doc-tool`.
* CircMgr: Make CircMgr and HsCircPool generic over builder type.Wesley Aptekar-Cassels2024-09-241-9/+11
| | | | | | | | | | This will allow for testing, as the CircuitBuilder can be replaced with a mocked version. This did require moving some of what was in the CircuitBuilder impl into the AbstractCircuitBuilder type, since Drop implementations can't be specialized, but that's fine, as we'll probably be doing more of that in the future anyways.
* tor-keymgr: Move keystore config under keystore.primary.Gabriela Moldovan2024-09-231-1/+1
| | | | | The keystore settings only configure the *primary* keystore, so they should be under `keystore.primary`.
* arti: Reinstate the keystore.enabled option.Gabriela Moldovan2024-09-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up from !2394 I want to keep the `keystore.enabled` option, because I'm planning on extending `ArtiKeystoreConfig` to support configuring secondary keystores too (currently, the only supported setting is `keystore.kind`, which configures the primary keystore). `keystore.enabled` will disable keystore use altogether (i.e. both primary and secondary). Currently, we only support configuring the "primary" (previously known as "default") keystore, which can be either "native" (the on-disk Arti keystore), or "ephemeral" (an in-memory keystore). To implement #858, we will need to support configuring additional keystores too, so we will need to move to a config of the form ```toml [storage.keystore] # Whether the keystore is enabled. #enabled = "auto" # Configure the primary keystore. [storage.keystore.primary] # The type of primary keystore to use kind = "auto" | "native" | "ephemeral" # Optionally configure C Tor keystores for arti to use. # # Note: The keystores listed here are read-only (keys are only # ever written to the primary keystore, configured in # `storage.keystore.primary`). [[storage.keystore.ctor]] # If the `kind` is `service`, this should be set to the `HiddenServiceDirectory` # of your hidden service. Arti will read `HiddenServiceDirectory/hostname` # and `HiddenServiceDirectory/private_key`. (Note: if your service is running # in restricted discovery mode, you must set the # `[[onion_services."<the nickname of your svc>".restricted_discovery.key_dirs]]` # to `HiddenServiceDirectory/client_keys` # # If the `kind` is `client`, this should be set to `ClientOnionAuthDir` of # your client. If Arti is configured to run as a client (i.e. if it runs in SOCKS # proxy mode), it will read the client restricted discovery keys from this path. path = "/foo/bar" # The type of keystore `path` should be interpreted as kind = "client" | "service" ``` This moves the current keystore settings to `storage.keystore.primary` in preparation for that change.
* arti-client: Update docs to reflect KeystoreSelector renaming.Gabriela Moldovan2024-09-231-3/+3
|
* tor-keymgr: Rename the primary keystore for clarity.Gabriela Moldovan2024-09-231-6/+6
| | | | | | | | | | Previously, arti's primary keystore was referred to as its "default" keystore. However, "default" is inaccurate here: there is no way to meaningfully override this "default" (the "default" store acts as the main keystore). Throughout the codebase, we query all keystores for keys (including the secondary ones), but only ever write to the default/primary keystore. This is OK for now, because it enables us to have one mutable keystore, and multiple secondary, read-only stores.
* arti-client: added support for constructing ArtiEphemeralKeystore to ↵Morgan2024-09-201-22/+37
| | | | InertTorClient::create_keymgr()
* arti-client: Add APIs for rotating service discovery keys.Gabriela Moldovan2024-09-191-0/+80
|
* arti-client: add experimental launch_onion_service_with_hsid() method which ↵Morgan2024-09-151-1/+45
| | | | HsIdKeypair
* arti-client: Convert a note to a comment.Gabriela Moldovan2024-09-121-1/+1
| | | | This was supposed to be a comment, not part of the docs.
* arti-client: Remove duplicated documentation.Gabriela Moldovan2024-09-121-42/+4
| | | | | | `TorClient` and `InertTorClient` have a number of identical state-management functions. This makes the `InertTorClient` link to the `TorClient` docs instead of duplicating them.
* arti-client: implemented insert_service_discovery_key and ↵Morgan2024-09-101-1/+168
| | | | remove_service_discovery_key methods
* Provide a MemoryQuotaTracker in TorClientIan Jackson2024-09-041-0/+10
| | | | Nothing uses this yet.
* arti-client: Add an InertTorClient for accessing client state.Gabriela Moldovan2024-08-281-72/+157
| | | | | | | | | | | | | | | | Implements the `TorClientThatIsntRunning` mentioned in !2314 (see also `doc/dev/notes/keymgr-porcelain.md`), except `TorClientThatIsntRunning` is called `InertTorClient`. This commit is mostly code motion: I've moved the `create_keymgr` function and the impls of `generate_service_discovery_key` and `get_service_discovery_key` from `TorClient` to `InertTorClient`. The `InertTorClient` advertises itself as a handle for accessing the keystores and other persistent state, but it currently only has 2 functions (`generate_service_discovery_key` and `get_service_discovery_key`). I expect it will grow additional functionality in the future.
* arti-client: Move state_dir() to TorClientConfig.Gabriela Moldovan2024-08-281-17/+3
| | | | | I am about to use `state_dir()` outside of `TorClient`, so I am preemptively moving it to `TorClientConfig`.
* 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
|