summaryrefslogtreecommitdiff
path: root/crates/arti-client/src
Commit message (Collapse)AuthorAgeFilesLines
...
* HS configuration: Plumb configuration through (clippy)Ian Jackson2023-06-282-5/+5
| | | | Apply deferred clippy churn.
* HS configuration: Plumb configuration throughIan Jackson2023-06-282-2/+4
| | | | | 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-283-10/+25
| | | | | | | 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`.
* 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
* 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-225-133/+4
|
* arti-client: Make all dummy APIs pub.Gabriela Moldovan2023-06-221-10/+12
| | | | | `dummy.rs` will be moved to `tor-keymgr`, which will export everything from the module.
* arti-client: Add a dummy KeyType.Gabriela Moldovan2023-06-221-0/+3
|
* Merge branch 'stderr' into 'main'Alexander Færøy2023-06-211-0/+2
|\ | | | | | | | | lints: Promote clippy::print_stderr and clippy::print_stdout See merge request tpo/core/arti!1271
| * lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
| |
* | Merge branch 'keymgr-api-consistency' into 'main'Ian Jackson2023-06-211-1/+1
|\ \ | | | | | | | | | | | | keymgr: Remove Error::NotFound, update KeyMgr, KeyStore APIs. See merge request tpo/core/arti!1280
| * | keymgr: Remove Error::NotFound, update KeyMgr, KeyStore APIs.Gabriela Moldovan2023-06-211-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the `NotFound` `tor_keymgr::Error` variant. Since `KeyMgr` and `KeyStore` users will need to be able to distinguish between "not found" errors and other I/O errors, this also changes the return types of the `get()` and `remove()` functions of `KeyStore` and `KeyMgr`, which now return `Ok(None)` instead of `Error::NotFound`. This makes the `KeyStore` API consistent with `KeyMgr::get`, which already has a return type of `Result<Option<K>>` (rather than `Result<K>`). This also prepares us for #901, which will make key store errors opaque. Without this change: * we'd have to create a `struct NotFoundError;` error type. Its `HasKind` impl would need to return a new `ErrorKind::KeyStoreErrorNotFound` `ErrorKind` variant * callers would have to match the `error_kind()` of the error to figure out whether the key simply can't be found (`ErrorKind::KeyStoreErrorNotFound`), or if something went wrong (any other `ErrorKind`). Given the above, I think `Result<Option<()>>` makes for a more ergonomic API. Part of #901
* | 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-204-105/+118
| | | | | | | | 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: Make some of the dummy KeyMgr impls return an error.Gabriela Moldovan2023-06-201-8/+9
| | | | | | `insert` and `remove` should return an error rather than `Ok(())`, as `Ok(())` implies the key was stored/removed, which is impossible in the no-op implementation.
* arti-client: Add more dummy keymgr APIs.Gabriela Moldovan2023-06-201-0/+30
| | | | | | This will help us reduce the number of `#[cfgs(...)]` from `client.rs` Part of #897
* arti-client: Add a result type for the dummy keymgr impl.Gabriela Moldovan2023-06-201-3/+6
| | | | Part of #897
* arti-client: Add an Error type for the dummy key manager.Gabriela Moldovan2023-06-202-7/+15
| | | | 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: address: Prefer to throw OnionAddressResolveRequest (fmt)Ian Jackson2023-06-161-9/+7
|
* arti-client: address: Prefer to throw OnionAddressResolveRequestIan Jackson2023-06-161-7/+23
| | | | Reformatting deferred for clarity.
* arti-client: hs: Test cases for variously disabling .onionIan Jackson2023-06-161-1/+57
| | | | This test case shows that we return a suboptimal error in some cases.
* arti-client: Provide ErrorDetailDiscriminants for convenient testingIan Jackson2023-06-162-2/+3
| | | | | 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-163-2/+20
|
* 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: OnionAddressNotSupported: Change description and kindIan Jackson2023-06-161-3/+3
| | | | | Previously this error meant "we haven't written this code yet". Now, we change it to "you haven't built Arti with this feature".
* arti-client: address: Apply deferred rustfmt churnIan Jackson2023-06-161-2/+6
|
* arti-client: address: Plumb StreamPrefs into enforce_configIan Jackson2023-06-162-7/+12
| | | | No functional change yet. We'll use this shortly.
* arti-client: address: Move config enforcementIan Jackson2023-06-162-9/+11
| | | | Disposes of two TODOs.
* arti-client: address: Move config enforcement (pre-fmt)Ian Jackson2023-06-161-2/+6
| | | | This will make subsequent commits less noisy to read.
* arti-client: address: Disable some tests when HS disabledIan Jackson2023-06-161-9/+16
| | | | | These have already been partially/replaced supplemented. The other test referred to will appear shortly.
* arti-client: Rename hs feature to onion-service-client (cfg lines)Ian Jackson2023-06-163-21/+21
|
* arti-client: rustfmtGabriela Moldovan2023-06-151-3/+8
|
* arti-client: Fix clippy lints.Gabriela Moldovan2023-06-151-0/+7
| | | | | | We need to allow some lints in the dummy key manager because its implementation needs to mirror that of `tor_keymgr::KeyMgr` (so we can't apply the API changes suggested by clippy).
* arti-client: Use a dummy key manager if the keymgr feature is disabled.Gabriela Moldovan2023-06-154-7/+70
| | | | | | | | | 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-152-4/+9
|
* 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`.