summaryrefslogtreecommitdiff
path: root/crates/arti-client/src/client.rs
Commit message (Collapse)AuthorAgeFilesLines
* keystore: Change the dummy HsClientSpecifier to "default".Gabriela Moldovan2023-06-301-1/+1
|
* keymgr: Rename KeyStore to Keystore globally.Gabriela Moldovan2023-06-291-5/+5
| | | | | We've been capitalizing the "s" in "KeyStore" inconsistently. This `s/KeyStore/Keystore/g` across the codebase.
* Merge branch 'validate-client-spec' into 'main'Ian Jackson2023-06-291-1/+2
|\ | | | | | | | | keymgr: Validate ArtiPaths, replace HsClientSpecifier with generic ArtiPathComponent See merge request tpo/core/arti!1262
| * Run rustfmtIan Jackson2023-06-291-3/+2
| |
| * keymgr: Define an error type for bad `ArtiPathComponents`.Gabriela Moldovan2023-06-291-12/+3
| |
| * arti-client, hsclient: Typealias HsClientSpecifier to ArtiPathComponent.Gabriela Moldovan2023-06-291-1/+12
| | | | | | | | `ArtiPathComponent` is a more generic version of `HsClientSpecifier`.
* | Merge branch 'keymgr-config' into 'main'gabi-2502023-06-291-9/+5
|\ \ | | | | | | | | | | | | arti-client: Add keystore_dir to StorageConfig. See merge request tpo/core/arti!1312
| * | arti-client: Fix clippy lints.Gabriela Moldovan2023-06-291-1/+1
| | | | | | | | | | | | Part of #891
| * | arti-client: Load keystore dir and permissions from config.Gabriela Moldovan2023-06-291-6/+2
| | | | | | | | | | | | Part of #891
| * | arti-client: Add keystore_dir to StorageConfig.Gabriela Moldovan2023-06-291-4/+4
| |/
* | arti-client: StreamPrefs: Add security noteIan Jackson2023-06-291-0/+7
| |
* | Turn off HS client connections by defaultIan Jackson2023-06-291-1/+1
|/ | | | As per IRC discussion, re lack of Vanguards.
* HS configuration: Plumb configuration through (fmt)Ian Jackson2023-06-281-1/+4
| | | | Apply deferred rustfmt churn.
* HS configuration: Plumb configuration through (clippy)Ian Jackson2023-06-281-4/+4
| | | | Apply deferred clippy churn.
* HS configuration: Plumb configuration throughIan Jackson2023-06-281-2/+2
| | | | | Invent a trait a la circmgr config for the hs client connector config. Plumb a suitable value all the way through to the code that will use it.
* HS configuration: Add and honour `allow_onion_addrs` in configurationIan Jackson2023-06-281-5/+10
| | | | | | | We put this in `[address_filter]`. The interaction with the corresponding stream preference is a bit complicated. We must turn the stream pref into a `BoolOrAuto`.
* tor-hsclient: Expire old data eventuallyIan Jackson2023-06-231-1/+12
| | | | Otherwise we'll fill up our RAM with junk.
* keymgr: Move dummy implementation to tor-keymgr.Gabriela Moldovan2023-06-221-1/+1
|
* Merge branch 'doc_link_fix' into 'main'Alexander Færøy2023-06-211-1/+1
|\ | | | | | | | | Fix a rustdoc link. See merge request tpo/core/arti!1274
| * Fix a rustdoc link.Nick Mathewson2023-06-211-1/+1
| |
* | Remove extra 'this' in some methodsSaksham Mittal2023-06-211-3/+3
| |
* | Create chanmgr() method in TorClientSaksham Mittal2023-06-211-0/+9
|/
* arti-client: Remove unnecessary #[cfgs(...)].Gabriela Moldovan2023-06-201-5/+0
| | | | | | | | The `keymgr` module selects one of the key manager implementations (dummy or "real") and exposes all the APIs we need, so we can remove all of the cfgs related to the `keymgr` feature from `client.rs`. Part of #897
* arti-client: Create module exposing one of the key manager APIs.Gabriela Moldovan2023-06-201-5/+1
| | | | | | | | This moves the key manager API selection (dummy vs "real" impl) into the `keymgr` module. The module exports the dummy API if the `keymgr` feature is disabled, and the impl from `tor-keymgr` otherwise. Part of #897
* arti-client, keymgr: Introduce Mistrust settings and enforce FS permissions.Gabriela Moldovan2023-06-201-3/+9
|
* arti-client: Temporarily ignore key store errors.Gabriela Moldovan2023-06-201-3/+10
| | | | | | | | | We currently initialize the `ArtiNativeKeyStore` with a dummy root dir, so when `ArtiNativeKeyStore` starts validating directories, this code will start to fail. Let's preemptively ignore any errors coming from `ArtiNativeKeyStore::new`. This is temporary and will be removed when we introduce the key store config (and a real default value for the keystore root dir).
* arti-client: hs: remove some now-obsolete allowsIan Jackson2023-06-161-3/+0
|
* arti-client: Provide ErrorDetailDiscriminants for convenient testingIan Jackson2023-06-161-2/+1
| | | | | ErrorDetail isn't PartialEq so we can't assert_eq! it. But the discriminants will be.
* arti-client: StreamPrefs::connect_to_onion_services: honourIan Jackson2023-06-161-2/+1
|
* arti-client: StreamPrefs::connect_to_onion_services: docsIan Jackson2023-06-161-1/+6
| | | | This disposes of the TODO as well.
* arti-client: StreamPrefs::connect_to_onion_services: fix cfgIan Jackson2023-06-161-1/+1
|
* arti-client: StreamPrefs::connect_to_onion_services: fix nameIan Jackson2023-06-161-1/+1
|
* Added setter method in impl for StreamPrefsnate_d1azzz2023-06-161-1/+5
| | | | | | | | (Taken from tpo/core/arti!1113 and squashed by Ian Jackson, with conflicting hunk in StreamPrefs struct skipped. The setter name is wrong, the cfg feature is wrong, there are no docs, and the TODO is still there. These will be fixed in a moment.)
* arti-client hs: connect_to_onion_services: default to trueIan Jackson2023-06-161-2/+5
| | | | | This should be enabled by default. There's still no setter for not, nor is it honoured - those are separate TODOs.
* arti-client: address: Plumb StreamPrefs into enforce_configIan Jackson2023-06-161-2/+2
| | | | No functional change yet. We'll use this shortly.
* arti-client: address: Move config enforcementIan Jackson2023-06-161-4/+2
| | | | Disposes of two TODOs.
* arti-client: Rename hs feature to onion-service-client (cfg lines)Ian Jackson2023-06-161-7/+7
|
* arti-client: Use a dummy key manager if the keymgr feature is disabled.Gabriela Moldovan2023-06-151-4/+17
| | | | | | | | | TorClient now only uses the tor_keymgr::KeyMgr implementation if the keymgr experimental feature is enabled. If the feature is disabled, a dummy key manager implementation is used. The new `keymgr` feature depends on `onion-client`, because the key manager is only used for HS client auth.
* arti-client: Implement From<tor_keymgr::Error> for Error.Gabriela Moldovan2023-06-151-4/+2
|
* keymgr, arti-client: KeyMgr should return Ok(None) if the key is not found.Gabriela Moldovan2023-06-151-24/+2
| | | | | | | This simplifies usage quite a bit and will enable us to implement a dummy `KeyMgr` that doesn't depend on the error types from tor-keymgr (which will replace the "real" `KeyMgr` if the keymgr feature is disabled).
* arti_client: Add TODO about refactoring code around HsClientSecretKeysBuilder.Gabriela Moldovan2023-06-151-0/+4
|
* keymgr: Move the HS client and service key specifiers out of tor-keymgr.Gabriela Moldovan2023-06-151-6/+5
| | | | | | The HS `HsClientSpecifier` and `HsClientSecretKeySpecifier` are moved to `tor-hsclient`. The HS service secret key specifier stubs are moved to `tor-hsservice`.
* arti-client, keymgr: Initialize KeyMgr with an ArtiNativeKeyStore.Gabriela Moldovan2023-06-151-2/+16
| | | | | | | The `KeyMgr` is now initialized with an `ArtiNativeKeyStore` built from an invalid key store root dir (this is alright for the purposes of this proof-of-concept, since `ArtiNativeKeyStore::new` won't fail as it doesn't currently validate the keystore root dir).
* keymgr: Introduce ToEncodableKey to simplify lookups.Gabriela Moldovan2023-06-151-7/+6
| | | | | | | This means `KeyMgr` users don't need to specify the underlying key type (e.g. `ed25519::Keypair`) when retrieving keys. Instead, they can just specify the type required (as long as it implements `ToEncodableKey`), e.g. `HsClientIntroAuthKeypair`.
* arti-client: Make the client use the KeyMgr.Gabriela Moldovan2023-06-151-3/+75
| | | | | `TorClient` now uses a `KeyMgr` to retrieve the `HsClientSecretKeys` client auth keys passed to `get_or_launch_connection`.
* hs: Fix a feature name in arti-clientNick Mathewson2023-06-071-1/+1
| | | | In arti-client it's called "onion-client", not "hs-client".
* 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.