summaryrefslogtreecommitdiff
path: root/crates/tor-ptmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* removed unnecessary PinBox wrapperpryty262026-06-241-5/+1
|
* ptmgr: Remove string slicing.Nick Mathewson2026-06-101-11/+11
|
* everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-091-0/+2
| | | | | | | | This commit adds #[allow(clippy::string_slice)] to all functions in the code where string slices are used, alongside a TODO comment. We do this add the function header to have it consistent, as things like expression based allow's are still experimental.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-092-0/+2
| | | | | | | | | | | | 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.
* ptmgr: Defer proxy protocol string conversionNihal2026-05-262-5/+9
|
* ptmgr: pass outbound_proxy to managed PT processesNihal2026-05-262-3/+12
| | | | | | | Previously the [channel] outbound_proxy setting was applied to Arti's own direct connections but was not forwarded to managed PT processes. https://spec.torproject.org/pt-spec/configuration-environment.html
* tor-ptmgr: port to web-time-compat.Nick Mathewson2026-03-261-4/+4
|
* ptmgr: Migrate to derive_deftly(TorConfig)Nick Mathewson2026-02-171-12/+11
|
* 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.
* relay: Add a TLS acceptor in the ChanBuilderDavid Goulet2026-02-091-1/+1
| | | | | | | | | | | | | | | 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]>
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* chanmgr: Get rid of the builder outbound_chan_typeDavid Goulet2026-01-131-3/+1
| | | | | | | | | | | | | | | | | | | 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]>
* chanmgr: Add ChannelType to channel manager configDavid Goulet2026-01-131-1/+3
| | | | | | | | | | 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: Remove KeyMgr from constructorDavid Goulet2026-01-131-1/+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]>
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-062-2/+2
| | | | 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-1/+1
| | | | | | | 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-074-12/+22
| | | | | | | | | | | | | | 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.
* ptmgr: Use simpler expression to extract a HashMap's keys.Nick Mathewson2025-05-291-1/+1
|
* *: suppress cognitive_complexity warnings from nightlyNick Mathewson2025-05-291-0/+1
| | | | | | | | | | | | | Apparently clippy nightly is better (or worse?) about detecting complex functions than before, so I'm suppressing these warnings where they occur. I have mixed feelings about these warnings: On the plus side, they really do help to detect functions that are twistier than they need to be. On the minus side, they get confused by tracing macros, and the "allows" do pile up. But on the plus side, those "allows" do provide a way to find functions that need to be refactored, and they are never uglier than the functions they decorate.
* 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.
* update `CfgPath::path` to use a `CfgPathResolver`Steven Engler2024-11-181-5/+7
| | | | | | | | | | | | | | | | This is a big change across multiple crates since there isn't a good way to break it up. This changes the signature of `CfgPath::path` to: ``` pub fn path(&self, path_resolver: &CfgPathResolver) -> Result<PathBuf, CfgPathError> { ``` Making this change means that our global `CfgPathResolver` needs to be stored in the 'arti-client' library instead of `tor-config-path`, and must be passed through to anything that calls `path` to expand the variables.
* tor-ptmgr: pass through the `CfgPathResolver`Steven Engler2024-11-182-3/+17
|
* tor-config: removed re-export of `CfgPath`Steven Engler2024-11-042-2/+3
| | | | | Also updated other packages to get `CfgPath` directly from `tor-config-path' instead of 'tor-config'.
* Use mpsc_channel_no_memquota next to a TODOIan Jackson2024-10-151-3/+2
| | | | We have a ticket for this. But the ticket number was wrong, so fix that.
* memquota: Note a TODO about PT channelsIan Jackson2024-10-021-0/+1
|
* ptmgr: Forbid managed pts on non-localhostNick Mathewson2024-09-251-0/+7
|
* ptmgr: Warn on non-local unmanaged PTsNick Mathewson2024-09-252-0/+12
|
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-282-3/+4
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* tor-ptmgr: added a 'managed-pts' default featureSteven Engler2024-08-213-81/+120
| | | | | This conditionally compiles most of the code related to managed transports.
* tor-ptmgr: break out `spawn_transport` into separate functionSteven Engler2024-08-201-33/+38
|
* tor-ptmgr: moved `PtClientMethod` from ipc to crate moduleSteven Engler2024-08-202-22/+24
|
* tor-ptmgr: move some code to a new 'managed' moduleSteven Engler2024-08-203-312/+331
| | | | | | Code that's related to managed transports has been moved to a new 'managed' module. This includes the PT reactor since it's not needed for unmanaged transports.
* tor-ptmgr: fix warnings when 'tor-channel-factory' isn't enabledSteven Engler2024-08-202-3/+7
|
* tor-ptmgr: added the `TransportOptions` enumSteven Engler2024-08-202-43/+99
| | | | | | | | This is a little nicer and more type-safe to work with than `TransportConfig`. It would have been nice to change `TransportConfig` directly instead, but it would slightly change arti_client's public API, and would require an extra field in the `[[bridges.transports]]` toml table.
* Add test for PtStatus containing TRANSPORT field.Alexander Færøy2024-08-011-0/+10
| | | | See: tpo/core/arti#1488.
* Don't require TRANSPORT for PT STATUS messages.Alexander Færøy2024-08-011-18/+4
| | | | | | | | | | | | | | | This patch changes the PT STATUS handler to not require the presence of the `TRANSPORT` field in the K/V line. This matches current behaviour of C Tor and was requested by the Anti-censorship Team at an earlier point to enable STATUS messages to work for situation where it's not transport specific messages. To avoid future issues, we simply ignore any required keys right now even though TYPE is to be expected. See: tpo/core/torspec#267 See: tpo/core/torspec!63 See: tpo/core/arti#1488
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* ptmgr: Use impl_standard_builder for TransportConfigNick Mathewson2024-04-021-1/+3
| | | | (This is !Default, since there is no default TransportConfig.)
* tor-ptmgr: Comment fixesgabi-2502024-03-142-2/+2
|
* Move comment from factory_for_transport.Nick Mathewson2024-03-141-21/+21
|
* Clean up parts of the ptmgr docs that assume managed ptsNick Mathewson2024-03-142-4/+8
|
* Teach get_cmethod_for_transport to handle unmanaged transports.Nick Mathewson2024-03-142-3/+23
| | | | | | | This will suffice to bypass the reactor when we're dealing with an unmanaged pluggable transport. Closes #755.
* Lightly refactor get_cmethod_for_transportNick Mathewson2024-03-141-40/+41
| | | | Now that it's extracted, we can remove a mut and some nesting.
* Rename cmethods => managed_cmethodsNick Mathewson2024-03-141-7/+11
|
* Extract cmethod lookup from factory_for_transport.Nick Mathewson2024-03-141-59/+77
|