aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-client/src/builder.rs
Commit message (Collapse)AuthorAgeFilesLines
* client: Defer creation of most structures until bootstrap.Nick Mathewson2026-05-261-1/+1
| | | | | | This will let us be more confident in the inertness of a not-bootstrapping TorClient, _and_ make it easier to reconfigure things before the client is started.
* client: Rename create_inner to create_implNick Mathewson2026-05-261-1/+1
| | | | | Now that we have a type called "inner", and will soon have a function to create it, we really don't want to retain this name.
* Make all TorClient constructors wrap the TorClient in an Arc.Nick Mathewson2026-05-131-5/+5
| | | | | | This is part of rationalizing the structure of TorClient so we can refactor startup logic, and so that RPC code can reason about object identity. See #2469.
* arti-client: Port to web-time-compat.Nick Mathewson2026-03-261-7/+4
|
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-0/+4
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Fix `crate_bootstrapped` typokpcyrd2025-02-161-1/+1
|
* arti-client: Document the unspecified behavior of create_inert().Gabriela Moldovan2024-08-281-0/+6
| | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2370#note_3066621
* arti-client: Add an InertTorClient for accessing client state (fmt).Gabriela Moldovan2024-08-281-1/+3
|
* arti-client: Add an InertTorClient for accessing client state.Gabriela Moldovan2024-08-281-1/+8
| | | | | | | | | | | | | | | | 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.
* Resolve a rustdoc warning.Nick Mathewson2024-06-241-2/+2
|
* Add a maximum to local_resource_timeout.Nick Mathewson2024-06-241-7/+32
|
* local_resource_timeout: Change wait interval to 50 ms.Nick Mathewson2024-06-241-1/+1
|
* Rename fslock_timeout to local_resource_timeoutNick Mathewson2024-06-241-11/+16
| | | | Name chosen to match the error kind that we're detecting.
* Clarify documentation about blocking.Nick Mathewson2024-06-241-2/+4
|
* TorClientBuilder: Wait for a little while if the lockfiles are held.Nick Mathewson2024-06-241-4/+109
| | | | | | | | | | | | | | | | | | | | | This commit adds a parameter to TorClientBuilder that control how long we should retry constructing a TorClient if we get a LocalResourceInUse error. When this parameter is not set, we default to 500 milliseconds for async entry points and 0 milliseconds for sync entry points. (`LocalResourceInUse` usually means that a lockfile is held by somebody else; but when the resource is some other type, we typically want the same behavior anyway.) (I really don't want to introduce delays by default for the create_unbootstrapped case, since it previously had no delay at all.) There is now also an async entry point to create an unbootstrapped TorClient. Closes #1464.
* TorClientBuilder: take self by reference when buildingNick Mathewson2024-06-241-4/+4
| | | | | There is no actual reason to consume this type, and taking it by reference allows us to retry.
* HS configuration: Plumb configuration through (clippy)Ian Jackson2023-06-281-1/+1
| | | | Apply deferred clippy churn.
* Also require that TorClientBuilder be Sync.Nick Mathewson2023-06-261-2/+2
|
* arti-client: Mark DirProviderBuilder Send+Sync;Nick Mathewson2023-06-261-1/+15
| | | | | | | | | | Doing this causes TorClientBuilder to become Send. I also add a test to ensure that TorClientBuilder remains Send in the future. This isn't a semver break, but only because DirProviderBuilder is marked with `experimental-api`. Closes #924
* dirmgr Store: Have constructors take DirMgrStoreIan Jackson2022-11-141-2/+4
| | | | | | | 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.
* add feature annotation not added by doc_auto_cfgtrinity-1686a2022-08-241-0/+1
|
* arti_client: Split DirMgr error into useful types.Nick Mathewson2022-07-211-1/+1
|
* arti-client: Remove code related to overriding fs-mistrust.Nick Mathewson2022-07-191-31/+0
| | | | | | | | This logic can now be adjusted via the config object so that it does its own overriding by looking at the environment as appropriate. Removing these methods helps simplify the code a bit. Enabled by #483.
* Move responsibility for disable-fs-mistrust envvar.Nick Mathewson2022-07-191-28/+3
| | | | | | | The variable is now handled when building the configuration, and no longer needs to be special-cased. Closes #483.
* Remove now-redundant Send+Sync constraints alongside NetDirProviderNick Mathewson2022-06-071-2/+2
|
* Make fs-mistrust configurable from the top level.Nick Mathewson2022-05-241-19/+46
| | | | | | This change requires a little refactoring of TorClientBuilder: now, instead of enabling or disabling mistrust, it enables or disables the decision to _override_ the mistrust in the config.
* fs-mistrust: make Mistrust have a corresponding Builder type.Nick Mathewson2022-05-241-2/+1
| | | | | This is an approximately minimal revision to get Builder in place; subsequent commits will clean up the API.
* Remove "Mistrust" from the public API of arti-client.Nick Mathewson2022-05-091-7/+0
| | | | | | | | | | I'm doing this per discussion, so that we can have it be part of the TorConfig later on, and not break stuff as we change the Mistrust API to have a builder. This change, unfortunately, results in a little more internal complexity and duplicated code in arti and arti-client. I've marked those points with TODOs.
* arti: use fs-mistrust to validate configuration file locations.Nick Mathewson2022-05-091-12/+2
|
* arti-client: Configure and use fs-mistrust.Nick Mathewson2022-05-091-0/+47
| | | | | | This is derived from the environment, not the configuration file: We might not want to trust the configuration file until we've decided whether we like its permissions.
* Fix grammar and typosSamanta Navarro2022-04-271-1/+1
|
* Abolish filter::DynFilter in favour of transparent DirFilterIan Jackson2022-03-251-3/+3
| | | | | | | | | | | | There are two reasons why the DynFilter newtype might be needed: 1. To impl Default. But we don't need it to impl Default since we can have an accessor which does the defaulting. 2. To hide the API. But this is usrely an unstable API. Just writing Arc<dyn> gets rid of a lot of unnecessary boilerplate and conversion code.
* Make DirFilter be Debug + Send + SyncIan Jackson2022-03-251-1/+1
| | | | | Abolish the handwritten Debug impl for DynFilter, which is no longer needed.
* Expose DirFilter from arti-client.Nick Mathewson2022-03-241-0/+28
| | | | | This will make it possible to implement a directory-munging mechanism in arti-testing for #397.
* Have caller of dirmgr_builder() provide Arc.Nick Mathewson2022-03-021-2/+2
|
* DirProvider: Fix infinite recursion bugNick Mathewson2022-02-251-1/+1
|
* Add a builder function for replacing a DirProvider.Nick Mathewson2022-02-231-7/+62
| | | | Put it behind experimental_api.
* Documentation suggestion from review.Ian Jackson2022-02-231-1/+1
|
* Make a TorClientBuilder API.Nick Mathewson2022-02-181-0/+78
This is a defensive API choice to protect against the possibility that we'll want to add a bunch of other non-config options in the future. Closes #350