aboutsummaryrefslogtreecommitdiff
path: root/crates/arti/src/rpc.rs
Commit message (Collapse)AuthorAgeFilesLines
* arti: Give an Arc<CfgMgr> to RPC superuser sessions.Nick Mathewson7 days1-2/+13
|
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-1/+0
|
* 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.
* arti: rpc functionality to bootstrap a defer_bootstrapped client.Nick Mathewson2026-06-081-2/+14
|
* Make all TorClient constructors wrap the TorClient in an Arc.Nick Mathewson2026-05-131-2/+2
| | | | | | This is part of rationalizing the structure of TorClient so we can refactor startup logic, and so that RPC code can reason about object identity. See #2469.
* rpc: Add support for set_dormant.Nick Mathewson2026-03-161-0/+3
| | | | | This is not exactly the most _urgent_ superuser functionality, but it is probably the easiest to implement.
* rpc: Implement superuser mode.Nick Mathewson2026-03-161-2/+2
| | | | | When connection point provides superuser support, provide a (currently inert) RpcSuperuser object to the RPC session.
* rpc: Move responsibility for Session creation to ConnectionNick Mathewson2026-03-161-3/+10
| | | | | The Connection will know the options that the listener was created with, as opposed to RpcMgr, which is the same for every listener.
* arti: Fix some visibility-based compilation errors.Nick Mathewson2026-02-241-5/+4
|
* arti: Port rpc configuration to dd(TorConfig).Nick Mathewson2026-02-241-29/+14
|
* arti: Extract responsibility for port listing.Nick Mathewson2026-02-191-1/+0
| | | | | Instead of doing this when we construct the listeners, we can do it in a separate method, to simplify the return type.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-2/+2
|
* arti: Revise strings that implied that we were a SOCKS-only proxy.Nick Mathewson2025-10-281-1/+1
| | | | Closes #2225
* Fix warnings and errors from edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | The two main causes of errors were: - Since some of the lifetime rules have changed, we no longer need to do as many "bind a variable and immediately return it" patterns, and so clippy now warns about them. - We needed to adjust the explicit captures (`use<...>`) in a couple of our RPIT instances.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-3/+3
| | | | | | | | | | | | | | 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.
* *: 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.
* arti: Make Rpc argument unconditional when constructing socks proxyNick Mathewson2025-01-231-2/+14
| | | | | | Formerly this was a conditional method argument, which is a huge antipattern. Now it is unconditionally present, as `Option<T>` for a type that is uninhabited when RPC isn't supported.
* arti: remove an obsolete rpc todo.Nick Mathewson2025-01-231-1/+0
| | | | Information _is_ passed to the RpcMgr, via the argument to new_connection.
* arti: remove an obsolete rpc todo.Nick Mathewson2025-01-231-1/+0
| | | | | The RpcMgr does indirectly hold a reference to the client, via its make_session argument.
* arti: remove an obsolete rpc todo.Nick Mathewson2025-01-231-1/+0
| | | | We _do_ have error detection from this function, and have for ages.
* arti-rpcserver: Tell connections what kind of auth to expect.Nick Mathewson2025-01-151-13/+1
|
* rpc: Add a test for config parsing and defaults.Nick Mathewson2024-12-191-0/+89
|
* rpc: Clarify listen_defaults behavior.Nick Mathewson2024-12-191-1/+2
|
* rpc: Test that we can parse our defaults.Nick Mathewson2024-12-191-0/+11
|
* rpc: comments to explain where connect points are disabled.Nick Mathewson2024-12-191-0/+1
|
* rpc: Document that default-index is 1-basedNick Mathewson2024-12-191-1/+2
|
* Rename Guard=>ListenerGuard.Nick Mathewson2024-12-191-1/+1
|
* rpc: More logging when binding addressesNick Mathewson2024-12-191-1/+18
|
* arti: Use connect points to listen for RPC connections.Nick Mathewson2024-12-191-52/+97
|
* rpc: Configuration options for artiNick Mathewson2024-12-191-1/+31
| | | | | | This adds the options currently specified in rpc-connect-point.rs, though they don't do anything yet. We still have to implement the correct defaulting behavior.
* arti: Move RpcConfig to rpc.rsNick Mathewson2024-12-191-0/+29
|
* rpc: Try using postage::watch to initialize ProxyInfo.Nick Mathewson2024-08-281-1/+1
| | | | | (This is a bit trickier than I would like, but it ensures that we never return a "not initialized yet" code.)
* RPC: Add experimental method to list SOCKS proxies.Nick Mathewson2024-08-281-0/+1
| | | | | | | We'll need this for our rpc-library code to meaningfully open SOCKS connections. Closes #1523.
* arti: Define a new ArtiRpcSession type.Nick Mathewson2024-08-281-3/+7
| | | | | | | This type exists in the `arti` crate. It wraps and delegates to `arti_rpcserver::RpcSession`. Subsequent commits will use it to expose information from the `arti` crate to the RPC system; right now it does nothing.
* RPC: Use RPC methods instead of the "ClientConnectionTarget" trait.Nick Mathewson2024-06-111-0/+2
| | | | | | | | | | | | On its own, this might not seem like a huge improvement, but it will later let us implement these RPC methods for types that can't reasonably implement ClientConnectionTarget. It also serves as a proof of concept that special-method invocation can actually work, so that we can build things like this in cases where introducing a trait isn't practical. Closes #1427
* RPC: Give error from RpcMgr::new if method name is sufficiently bad.Nick Mathewson2024-05-141-1/+1
| | | | | (We don't give an error about unrecognized namespaces (for now), since we have no way to opt in to them.)
* RPC: Enforce method name format.Nick Mathewson2024-05-141-0/+29
| | | | | | | | | | | | We need to do this carefully, since we want our system to be extensible with new namespaces. First, when we are constructing an RpcMgr, we _warn_ about any method names that are misformed. Second, we add a test in the `arti` crate to fail if any method names are invalid. This will only catch method names in crates that `arti` depends on.
* RPC: RpcDataStream type to act as a "stream-shaped hole"Nick Mathewson2024-05-141-0/+1
| | | | | | | | | The application creates these, using a new-stream-handle RPC command, on an object that can actually create streams. Then later, the application provides the (global) identity of one of these objects when it's making a SOCKS connection. This causes the object to take hold of a `DataStreamCtrl`.
* TorClient: Slightly cleaner (?) interface for registering RPC methods.Nick Mathewson2024-05-061-1/+1
|
* RPC: Implement methods to get and watch client bootstrap status.Nick Mathewson2024-05-061-0/+5
|
* rpc: Give the session-creation function an argument.Nick Mathewson2023-06-151-1/+1
| | | | | | This will later let us tell the session-creation function how the authentication occurred, which will let it decide what privileges to provide.
* rpc: revise session initialization a lot.Nick Mathewson2023-06-151-7/+8
| | | | | | | | | | | | | | Formerly, every time we wanted to launch a new connection, we had to give the RpcMgr a TorClient. The connection would hold that TorClient until a session was authenticated, and then would wrap it in a Session and put it in the object map. Now, the RpcMgr holds a Box<dyn Fn()...> that knows how to create Sessions. When a connection is authenticated, it asks the Mgr to make it a new session. This lets us make it clearer that the TorClient simply can't be given out until the connection is authenticated. Later, it will let us create more types of Session objects under more complicated rules.
* RPC: rename new_session to new_connectionNick Mathewson2023-06-151-1/+1
|
* rpc: revise the relationship between Mgr and ConnectionNick Mathewson2023-06-141-1/+1
| | | | | | | | This adds a Weak reference from Connection to Mgr, makes DispatchTable mutable, and makes a few other changes as discussed between me and Diziet the other week. I bet we are not done tweaking this, but I hope it's a setp forwards.
* RPC: tell the `arti` SOCKS code about an RpcMgr object.Nick Mathewson2023-06-051-7/+29
| | | | | It will use this to find which TorClient to use when opening a stream.
* rpc: Move Arc::new() to RpcMgr code.Nick Mathewson2023-06-051-2/+2
|
* RPC: Start on plumbing TorClient into our RPC codeNick Mathewson2023-05-041-2/+2
| | | | | Because of #837, we won't be able to work with _every_ TorClient<R>, so I'm only going to be using TorClient<PreferredRuntime> for now.
* RPC: Move the "listen" part of the RPC listener code to `arti`.Nick Mathewson2023-05-041-0/+55
Now there's a module in `arti` that runs the loop for an RPC listener. The part of the old `listener` module that made the framed connections is now part of the `Session` object. There is now yet another a temporary location for the pipe; we should pick something better. At least now it's configurable.