summaryrefslogtreecommitdiff
path: root/crates/tor-ptmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Adapt TransportConfig to support unmanaged transports.Nick Mathewson2024-03-142-8/+75
| | | | | | | | | | | This is based on an original branch by Trinity. Instead of its original approach, which used an enum in the configuration to distinguish managed from unmanaged transports, this branch uses builder validation function to ensure that incompatible options aren't used together. Doing the lets us generate better error messages. Thanks: trinity-1686a <[email protected]>
* Rename ManagedTransportConfig to TransportConfig.Nick Mathewson2024-03-142-10/+10
| | | | We're going to start using this type for _every_ kind of transport.
* Merge branch 'encapsulate_config_rs' into 'main'Nick Mathewson2024-03-131-1/+1
|\ | | | | | | | | Encapsulate usage of config-rs inside tor-config. See merge request tpo/core/arti!2040
| * ptmgr: Use Itertools directly.Nick Mathewson2024-03-131-1/+1
| | | | | | | | Previously it used tor_config::Itertools, which is silly.
* | Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|/
* Use tor_basic_utils::PathExt::display_lossyIan Jackson2024-03-051-1/+2
| | | | | Change Path::display to this new function, in call sites where it's being used for a diagnostic.
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Merge branch 'todo-not-hss' into 'main'Alexander Færøy2023-10-221-1/+1
|\ | | | | | | | | Remove an "HSS" from a "TODO HSS" comment in ptmgr See merge request tpo/core/arti!1676
| * Remove an "HSS" from a "TODO HSS" comment in ptmgrNick Mathewson2023-10-161-1/+1
| | | | | | | | This isn't actually onion service related, AFAICT.
* | tor-ptmgr: Handle unsupported escapesEmil Engler2023-10-171-1/+8
|/
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-111-1/+1
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-ptmgrIan Jackson2023-10-111-1/+1
|
* Resolve ClientTransportLaunched and ServerTransportLaunched in different armsSaksham Mittal2023-09-131-24/+26
|
* Rename ClientTransportGaveError to TransportGaveErrorSaksham Mittal2023-09-132-4/+4
|
* Deduplicate ClientTransportLaunched and ServerTransportLaunchedSaksham Mittal2023-09-111-106/+135
| | | | | | | Note: this isn't perfect, though it moves both match arms to try_match_common_messages, it does end up resolving them separately using a helper function, and also necessitated creating another function in the PluggableTransportPrivate trait
* Deduplicate ClientTransportFailed and ServerTransportFailedSaksham Mittal2023-09-111-22/+11
|
* Import sealed module to avoid syntactic vinegarSaksham Mittal2023-09-111-14/+15
|
* tor-ptmgr: Test for empty valuesEmil Engler2023-09-071-0/+7
| | | | | | | This commit adds a unit test that checks if an empty value is parsed properly. It fixes the coverage in `crates/tor-ptmgr/src/ipc.rs:120`.
* tor-ptmgr: Test for missing valuesEmil Engler2023-09-071-0/+6
| | | | | This commit adds a test which checks for a missing value in an SMETHOD argument.
* tor-ptmgr: Test for forbidden `=`Emil Engler2023-09-071-0/+6
| | | | | This commit adds a unit test to the `tor-ptmgr` crate, which checks for forbidden `=` signs while reading a value.
* tor-ptmgr: Test argument ending with backslashEmil Engler2023-09-071-0/+6
| | | | | This commit adds a unit test to the `tor-ptmgr` crate, which checks if arguments are terminated with a backslash, which is forbidden.
* tor-ptmgr: Test unsupported octal sequencesEmil Engler2023-09-071-0/+9
| | | | | This commit adds a unit test that checks if all octal escape sequences are treated as an unsupported error.
* tor-ptmgr: Test escape sequencesEmil Engler2023-09-071-0/+8
| | | | | This commit adds a test to the `tor-ptmgr` crate, which increases the test coverage by checking for escape sequences in values.