summaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-chanmgr: remove comment for something that's not implementedSteven Engler2026-06-171-2/+1
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* tor-chanmgr: Add doccomments and fix typo.Wesley Aptekar-Cassels2026-06-021-1/+1
|
* tor-chanmgr: Refactor metrics code slightly.Wesley Aptekar-Cassels2026-06-021-73/+1
|
* tor-chanmgr: Split out channels built error metrics.Wesley Aptekar-Cassels2026-06-021-4/+72
|
* tor-chanmgr: Separate inbound/outbound channel metrics.Wesley Aptekar-Cassels2026-06-021-2/+2
|
* tor-chanmgr: Add metrics.Wesley Aptekar-Cassels2026-06-021-1/+10
| | | | | | This adds a structure to initialize metrics when the `ChanMgr` is created, and adds a counter for the total number of channels built, broken down by success and failure.
* Merge branch '3777_rebased' into 'main'Nick Mathewson2026-05-261-1/+1
|\ | | | | | | | | ptmgr: pass outbound_proxy to managed PT processes See merge request tpo/core/arti!4017
| * ptmgr: Defer proxy protocol string conversionNihal2026-05-261-1/+1
| |
* | tor-chanmgr: Notify waiters when a launch is cancelledBoris Nagaev2026-05-041-1/+0
|/ | | | | | | | | | | | | | | | | | If a future that owns a pending channel launch is dropped after publishing the pending entry, other waiters can see the oneshot sender disappear and report "channel build task disappeared" as an internal bug. Fix this by tying pending-entry cleanup and waiter notification together. Once we take responsibility for a pending launch, every exit path now removes or upgrades the pending entry and notifies waiters with the observed result. Cancellation reports RequestCancelled, while post-build failures keep their original error instead of turning into the internal bug or retrying the launch owner. Add regression tests that cover both successive dropped launch-owner futures and a failure while installing a newly built channel, so waiters see the expected error in each case.
* tor-chanmgr: add support for a `CreateRequestHandler`Steven Engler2026-04-081-2/+31
|
* proto: Rename RelayIdentities to RelayChannelAuthMaterialDavid Goulet2026-03-301-7/+13
| | | | | | | | | | | | This object contains a melting pot of public keys, private keys and certificates. Rename it to reflect that it is channel authentication material and not "identities. https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3791#note_3374454 Signed-off-by: David Goulet <[email protected]>
* tor-chanmgr: add loopback validation, startup warning and httparseNihal2026-03-181-0/+13
|
* chanmgr: Responder relay channel now use the builder my_addrsDavid Goulet2026-02-241-3/+2
| | | | | | No need to pass from the arti relay binary our addresses when handling an incoming channel, use the one in the channel builder that an initiator channel uses.
* chanmgr: Store our relay addresses in the builderDavid Goulet2026-02-241-1/+1
| | | | | | | | | | We need those addresses when we build a relay channel in order to send them into our NETINFO cell. This adds the `with_my_addrs()` on the `ChanMgrConfig` object. Next commit will make arti-relay use it. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add a set_relay_identities() to update the RelayIdentitiesDavid Goulet2026-02-241-0/+17
| | | | | | | | | | The arti-relay crate rotates the keys at regular interval which we need to give to the ChanMgr to update its builder. This function boldly replace the default factory with the new identities including the TLS acceptor can pick up the new key. Signed-off-by: David Goulet <[email protected]>
* proto: Remove unused ChannelBuilderDavid Goulet2026-02-191-2/+1
| | | | Signed-off-by: David Goulet <[email protected]>
* Merge branch 'mr_3616_rebased' into 'main'Nick Mathewson2026-02-161-1/+2
|\ | | | | | | | | | | | | Mr 3616 rebased Closes #1800 See merge request tpo/core/arti!3681
| * deps: add percent_encoding and remove serdeNihal2026-02-161-1/+1
| |
| * tor-chanmgr: add URI-style parsing for ProxyProtocol outbound_proxy configNihal2026-02-161-1/+2
| |
| * tor-chanmgr: integrate outbound proxy into DefaultTransportNihal2026-02-161-1/+1
| |
* | Merge branch 'msrv-1.89' into 'main'Nick Mathewson2026-02-161-0/+1
|\ \ | | | | | | | | | | | | Bump MSRV to 1.89 See merge request tpo/core/arti!3684
| * | Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| |/ | | | | | | | | | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* / tor-chanmgr: add doc comment to `ChanMgr::get_or_launch()`Steven Engler2026-02-121-0/+6
|/
* chanmgr: Gate relay only functionDavid Goulet2026-02-091-0/+1
| | | | | | | | | Also, allow the `ChanMgr::runtime` to be unused as client don't use it yet but might one day. Simpler this way than feature gating it for relay only. Signed-off-by: David Goulet <[email protected]>
* relay: Add a TLS acceptor in the ChanBuilderDavid Goulet2026-02-091-12/+14
| | | | | | | | | | | | | | | This requires the `TlsKeyAndCert` so be passed on the TLS acceptor settings. We assume that `RelayIdentities` has this information. The ChanBuilder::new() was getting a bit too convoluted and feature gated to instead we introduce new_client() and new_relay() and remove the need for `with_identities()`. Because of this, the ChanMgr::new() now returns a `Result<>`. Related to #1597 Signed-off-by: David Goulet <[email protected]>
* proto: Make ChannelProvider::get_or_launch() synchronousGabriela Moldovan2026-02-041-1/+1
| | | | This just removes an unnecessary `async`.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* proto: Improve comment for handle_incoming()David Goulet2026-01-221-5/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* relay: Pass advertised addresses to the channel handlerDavid Goulet2026-01-221-2/+3
| | | | | | | | | | | We need the advertised addresses for the NETINFO cell when opening a relay channel. Keep them in the TorRelay object so we can pass them to the ChanMgr channel handler. This will also help with config reload where only the local values in TorRelay will need to be updated. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Spawn task for ChannelProvider impl of get_or_launch()David Goulet2026-01-131-17/+23
| | | | | | | | | | | | | To pull this off, ChannelProvider::get_or_launch() needed to change from "&self" to "self: Arc<Self>" so we could pass self to the spawned task. This is fine as the caller of ChannelProvider (circuit reactor) has a Arc<ChanMgr>. This also removes the PhantomData for the runtime as we now actually use it. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Get rid of the builder outbound_chan_typeDavid Goulet2026-01-131-12/+10
| | | | | | | | | | | | | | | | | | | Instead, we'll simply use `RelayInitiator` if the identity keys (identities) struct is set. This avoids the problem where someone could call outbound_chan_type() of the ChanMgrConfig and get the wrong channel type if with_identities() is set after. This way, a single call, `with_identities()` is what will define the outbound channel type so no chance of errors. This also removes the cfg_if {} around the builder creation in a much more simplified version. Related to #1599 Signed-off-by: David Goulet <[email protected]>
* build: Fixes for non relay featureDavid Goulet2026-01-131-2/+6
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Implement tor_proto::ChannelProvider for ChanMgrDavid Goulet2026-01-131-0/+25
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add RelayIdentities to ChanBuilderDavid Goulet2026-01-131-1/+13
| | | | Signed-off-by: David Goulet <[email protected]>
* chanmgr: Add ChannelType to channel manager configDavid Goulet2026-01-131-1/+1
| | | | | | | | | | This allows us to pass it to the ChanBuilder which will be able to use this type for the outbound channels. For now, we do this trick where if we have relay identities, we always consider that all outbound channels will be RelayInitiator. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Introduce a ChanMgrConfig structDavid Goulet2026-01-131-2/+3
| | | | | | | | | | | | This struct is used to pass configuration parameters to the ChanMgr when building it. At the moment, it holds the ChannelConfig and RelayIdentities (feature gated) which will be used in subsequent commits. Note that relays do require RelayIdentities to build channels. Signed-off-by: David Goulet <[email protected]>
* chanmgr: Remove KeyMgr from constructorDavid Goulet2026-01-131-3/+1
| | | | | | | We'll rely on a RelayIdentities to pass in the right keys to the ChanMgr instead of the entire KeyMgr. Signed-off-by: David Goulet <[email protected]>
* opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-0/+6
| | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* Merge branch 'relay-bin-4' into 'main'opara2025-11-111-1/+3
|\ | | | | | | | | arti-relay: Add OR port listener task See merge request tpo/core/arti!3396
| * tor-chanmgr: wrap the peer address in `Sensitive`Steven Engler2025-11-051-1/+3
| | | | | | | | | | For incoming connections, wrap the peer address in `Sensitive` as it could be a client.
* | Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
|/ | | | Run maint/add_warning
* all: run cargo fmtSteven Engler2025-11-041-1/+1
|
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-1/+1
|
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* chanmgr: Add KeyMgr to channel builderDavid Goulet2025-08-201-2/+7
| | | | | | | This is so a relay can build authenticated channels. Several keys/cert are required for this that are within the key manager. Signed-off-by: David Goulet <[email protected]>
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | 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.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.