summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-circmgr: Expose CircParameters from NetParameters constructionIan Jackson2023-06-291-15/+5
| | | | | | | | As per #935. I called this "circparameters_from_netparameters" not "circparameters_from_netparams" because the type is "NetParameters" not "NetParams".
* Merge branch 'circmgr-timeout-est' into 'main'Nick Mathewson2023-06-221-1/+31
|\ | | | | | | | | circmgr: New API to expose estimate-based timeouts. See merge request tpo/core/arti!1281
| * circmgr: New API to expose estimate-based timeouts.Nick Mathewson2023-06-221-1/+31
| | | | | | | | | | This will help create good timeout values for various onion-service operations.
* | lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|/
* cirmgr: remove a dead-code exception.Nick Mathewson2023-06-161-1/+0
|
* Refactor ClientCirc APIs to use Arc<ClientCirc>.Nick Mathewson2023-05-161-4/+4
| | | | | | | | | | | | 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.
* Add some missing importsIan Jackson2023-03-281-1/+1
| | | | | | | | Now nailing-cargo +stable clippy -p tor-hsclient --all-features --all-targets actually works. squash! Add some missing imports
* circmgr: Declare builder() unconditionally.Nick Mathewson2023-03-221-2/+3
| | | | (Still, only expose it when experimental-api is enabled.)
* circmgr: Begin an HS circuit pool structureNick Mathewson2023-03-221-0/+2
| | | | | This is now enough to launch circuits on demand. It still needs to pre-build the first three hops, and to retry on failure.
* circmgr: Add a usage for building the beginning of an hs circNick Mathewson2023-03-221-15/+17
| | | | | This only builds the first 3 hops. It can be extended to a fourth hop later -- or not, depending on the circuit kind.
* circmgr: Functions to launch an unmanaged circuit.Nick Mathewson2023-03-221-3/+8
| | | | We'll use this to implement the circuits used by onion circuits.
* hsclient: Abolish knowledge of HS circuits in circmgrIan Jackson2023-03-011-48/+0
| | | | | | | | | | | Abolish CircMgr::get_or_launch_onion_client and everything to support it. We have decided that `.onion` diversion ccan't/shouldn't occur in tor-circmgr. Probably, it should occur much higher up - arti-client maybe - since it will sometimes need ambient authority (KS_hsc_*). Now all knowledge of HS connections is in tor-hsclient. This gets rid of a layering inversion and the trait needed for tor-circmgr to do the upcall to tor-hsclient.
* tor-circmgr: Provide testing feature and TestConfigIan Jackson2023-03-011-0/+3
| | | | Like the similar thing in tor-guardmgr.
* HS API: Remove HS client keys from circmgr APIIan Jackson2023-03-011-1/+0
| | | | | | | | *If* we're going to retain any HS knowledge in circmgr, it definitely doesn't need to know about per-operation client secrets. (Maybe there might be ambient secrets, used for .onion diversion, but they don't need to be in this API.)
* HS planning: Discuss whether to remove all HS code from circmgrIan Jackson2023-03-011-4/+10
|
* HS planning: Intend for HS connector to do all lifecycle mgmtIan Jackson2023-03-011-6/+3
| | | | | | | | Otherwise there has to be a state entry in the circmgr *and* a state entry in the hs connector, for every HS. This division of responsibilit will be confusing. The HS code will then be more completely just a layer on top of circmgr.
* Rename onion-* cargo features to hs-* in tor-* cratesIan Jackson2023-02-281-6/+6
| | | | Fixes #756
* tor-hscrypto: Rename key types to correspond to new spec names.Nick Mathewson2023-02-081-1/+1
|
* Use ErrorReport - run rustfmtIan Jackson2023-01-301-2/+8
| | | | Split off for ease of review and possible rebase.
* Use ErrorReport for remaining errors in error! in tor-circmgrIan Jackson2023-01-301-4/+4
|
* Use ErrorReport for errors in warn! in tor-circmgrIan Jackson2023-01-301-3/+3
|
* circmgr: drop a receiver more explicitly.Nick Mathewson2023-01-271-1/+4
| | | | | | | | | Clippy now complains about `let _ = (expr_producing_a_future);`, which is probably smart, since maybe you wanted to await that future and ignore the result. So it seems that the right way to get rid of an unwanted Receiver is now to drop it explicitly. Closes #749
* 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.
* Disable clippy::unlinlined-format-argsNick Mathewson2023-01-271-0/+1
| | | | | | | | This warning kind of snuck up on us! (See #748) For now, let's disable it. (I've cleaned it up in a couple of examples, since those are meant to be more idiomatic and user-facing.) Closes #748.
* CircMgr: Draft API to construct targeted multihop circuits.Nick Mathewson2023-01-241-1/+24
| | | | | Onion services and onion clients need these to make connections to HsDirs, Introduction points, and Rendezvous points.
* CircMgr: Draft APIs used to implement onion service clients.Nick Mathewson2023-01-241-0/+46
|
* Merge branch 'test-lints' into 'main'eta2023-01-061-0/+8
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * 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.
* | tor-circmgr: Use ErrorReport on a logged errorIan Jackson2022-12-121-1/+2
|/ | | | To demonstrate what the use looks like.
* Improve notes surrounding circuit cancellation.Nick Mathewson2022-11-221-1/+0
| | | | | | | It turns out that bug #656 is not a real bug, but it was easy to overlook the code that prevented it. Closes #656.
* CircMgr: retire all circuits if bridge configuration changes.Nick Mathewson2022-11-221-5/+9
| | | | Closes #650.
* CircMgr: Refactor DirSpecificTarget constructorNick Mathewson2022-11-181-3/+3
| | | | | | | | | | | | This commit replaces the `impl From<&T> for OwnedChanTarget where T:ChanTarget` with a new `IntoOwnedChanTarget` trait. This lets us be explicit that we're constructing an owned object, and not just converting something. No semver change needed, since these APIs haven't been released. ----------- (new description)
* Move GuardMgr::new call to arti_client::TorClientIan Jackson2022-11-141-1/+1
| | | | | | | 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.
* Document Clone semantics of GuardMgr and DirMgrIan Jackson2022-11-111-0/+2
|
* Refactor external guardmgr APIs: Stop taking NetDir arguments.Nick Mathewson2022-11-081-12/+2
| | | | | | | | | These arguments were used only for legacy (testing) purposes; the tests now use `TestNetDirProvider`. This lets us simplify our internal logic for passing a `NetDir` to our samples, and prepare for having a `BridgeSet` to pass there instead. This is a breaking change to `guardmgr` and `circmgr`.
* guardmgr config: Introduce and require new GuardMgrConfig traitIan Jackson2022-11-031-10/+3
| | | | | It doesn't seem to me like it makes sense to provide the backward compatibility here.
* guardmgr config: Pass fallback list from config by referenceIan Jackson2022-11-031-1/+1
| | | | | This does involve additional cloning. However, soon it will mean that we can pass the whole `TorClientConfig` by reference.
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* tor-circmgr: Make get_or_launch_dir_specific feature-specificIan Jackson2022-10-211-1/+6
|
* tor-circmgr: Rename get_or_launch_dir_specific from _bridgeIan Jackson2022-10-211-1/+1
| | | | | DirSpecificTarget in the usage was renamed apropos an MR comment but this function name was overlooked.
* circmgr: Plumbing for direct to target directory circuitsIan Jackson2022-10-201-1/+16
| | | | | The target is identified by Into<OwnedChanTarget>. We introduce corresponding TargetCircUsage and SupportedCircUsage.
* cargo fmt to remove blank linesIan Jackson2022-10-121-1/+0
| | | | | | | Apparently cargo fmt doesn't like these, which my perl rune didn't delete. This commit is precisely the result of `cargo fmt`.
* Replace all README copies in src/lib.rs with includesIan Jackson2022-10-121-21/+1
| | | | | | | | The feature we want is `#[doc = include_str!("README.md")]`, which is stable since 1.54 and our MSRV is now 1.56. This commit is precisely the result of the following Perl rune: perl -i~ -0777 -pe 's{(^//!(?!.*\@\@).*\n)+}{#![doc = include_str!("../README.md")]\n}m' crates/*/src/lib.rs
* CircMgr: Add an accessor for the CircuitBuilder.Nick Mathewson2022-09-221-0/+8
| | | | | | | Without this, actually building circuits manually is a pain. This API is behind the `experimental-api` feature, and so it does not require a semver.md entry.
* circmgr: treat usage as sensitive.Nick Mathewson2022-08-251-1/+6
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-241-0/+1
|
* guardmgr: Change APIs that used to take IDs.Nick Mathewson2022-08-021-10/+8
| | | | These are the other inspiration for #428.
* CircMgr: Update to new NetDirProvider APINick Mathewson2022-07-261-8/+7
| | | | | Everything here wants a timely directory, except that it is okay to build timeout-testing circuits with a stale one.
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* CircMgr: Enable reachable_addrs filter.Nick Mathewson2022-06-171-0/+7
|