summaryrefslogtreecommitdiff
path: root/crates/arti-client/src/client.rs
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Introduce ChannelConfigIan Jackson2022-08-161-1/+16
| | | | | This commit is just the necessary plumbing. The config is currently empty. We'll add something to it, for padding control, later.
* dormancy: Plumb through to chanmgr reconfigure_generalIan Jackson2022-08-161-4/+27
| | | | | | | | | | | | | | | The chanmgr remembers the last dormancy state it was told. We invent a chanmgr-specific Dormancy which the arti-client code knows how to convert from the richer top-level dormant status. This avoids having to have everyone know all the variants of the top-level state. To call reconfigure_general, we must also obtain and plumb through a netdir. Right now we must return an internal error if there is in fact no netdir, because reconfigure_general does not yet cope with a missing netdir. Nothing actually *uses* the dormancy yet.
* dormancy: tor-client: Break initial dormancy out into a variableIan Jackson2022-08-161-1/+2
| | | | | | We're going to need to reuse this, so we can plumb the dormancy to more places. Breaking it out avoids having repeat the initial dormancy value in two places.
* arti-client: TorClient constructor: add a blank lineIan Jackson2022-08-161-0/+1
| | | | | The rustfmt-mandated different formatting of these two very similar blocks is bad enough, without them being smooshed together.
* Update arti-client to new NetDirProvider API.Nick Mathewson2022-07-261-6/+20
| | | | | | This allows us to give better errors in the case where bootstrapping succeeds at first, but fails thereafter for long enough to make our directory expire.
* arti-client: Split "Persist" into setup and access variants.Nick Mathewson2022-07-211-2/+8
|
* arti_client: turn "Proto" error into StreamFailed.Nick Mathewson2022-07-211-3/+12
|
* arti_client: Split DirMgr error into useful types.Nick Mathewson2022-07-211-1/+4
|
* arti-client: Remove code related to overriding fs-mistrust.Nick Mathewson2022-07-191-12/+6
| | | | | | | | 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.
* arti-client: Do periodic task dormancy in a management taskIan Jackson2022-07-181-37/+28
| | | | | This means that it is no longer possible to write code which updates the dormant mode but forgets to notify the periodic tasks.
* arti-client: Make dormant_mode be an Option, None on dropIan Jackson2022-07-181-13/+27
| | | | | This will allow receivers (which we are about to introduce) to terminate when the last client is dropped.
* arti-client: Convert dormant_mode into a postage::watchIan Jackson2022-07-181-17/+34
| | | | | | | | We are going to want to be able to wake up other tasks elsewhere in Arti, that need to know about dormancy. We will give them a postage watch Receiver. Right now there are no such things yet.
* arti-client: Make DormantMode have a DefaultIan Jackson2022-07-181-1/+3
|
* channel padding: Plumb settings from chanmgrIan Jackson2022-06-211-1/+1
|
* Merge branch 'dormant_directory' into 'main'Nick Mathewson2022-06-131-0/+1
|\ | | | | | | | | | | | | Use TaskSchedule to sleep in directory bootstrapping Closes #497 See merge request tpo/core/arti!571
| * New API to expose and use TaskHandle from DirMgr.Nick Mathewson2022-06-131-0/+1
| | | | | | | | | | | | This change also means that we need to create the handle and scheduler earlier in the process of creating the DirMgr. If we don't, we won't have a way to manage the task before bootstrap() returns.
* | Move responsibility for GuardMgr NetDir updates to GuardMgr.Nick Mathewson2022-06-071-7/+0
| | | | | | | | | | | | | | | | | | | | | | Previously it was the job of a task in CircMgr to do this; but we're going to want to give GuardMgr full access to the latest NetDir for this, and for other code-simplification reasons. With this change I'm deprecating a couple of functions in tor-circmgr. It's no longer necessary for us to have an artificial external way for you to feed new NetDirs to a circmgr. (I could just remove them, but I want practice deprecating.)
* | 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-1/+2
| | | | | | 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.
* add unit tests for arti_client::StreamPrefsmichael mccune2022-05-231-0/+77
| | | | | | this change adds unit tests for the public methods of StreamPrefs. although these are mostly "setter" style functions, the tests confirm the basic expectations and operation.
* Merge branch 'use-fs-mistrust'Nick Mathewson2022-05-091-3/+11
|\
| * arti-client: Configure and use fs-mistrust.Nick Mathewson2022-05-091-3/+11
| | | | | | | | | | | | 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.
* | Apply `sensitive` in some info-level log messages.Nick Mathewson2022-05-061-1/+2
|/ | | | | This specifically applies the `sensitive` wrapper in the places where we're logging target addresses at level "info" or higher.