summaryrefslogtreecommitdiff
path: root/crates/arti-rpcserver
Commit message (Collapse)AuthorAgeFilesLines
* Bump all the unstable tor- and arti- crates to 0.22.0.Gabriela Moldovan2024-09-031-10/+10
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.22.0 done ```
* oneshot-fused-workaround: Set the initial version to 0.1.0.Gabriela Moldovan2024-09-031-1/+1
| | | | This is the first time we're publishing this, so let's start at 0.1.0.
* arti-rpcserver: Use a non-wildcard version requirement for slotmap-careful.Gabriela Moldovan2024-09-031-1/+1
|
* Run fixup-features in preparation for release.Gabriela Moldovan2024-09-031-1/+1
|
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-282-1/+2
| | | | | | | | | | | | | | 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.
* rpcserver: Fix a trivial doc typo.Nick Mathewson2024-08-281-1/+1
|
* rpcserver: Use slotmap-careful instead of generational-arena.Nick Mathewson2024-08-143-35/+38
| | | | | | | | | Unlike generational-arena, slotmap is maintained. Unlike slotmap, slotmap-careful should never be able to reuse the same key for two different objects. Closes #1282.
* Merge branch 'rpc-connection-error' into 'main'Nick Mathewson2024-08-131-16/+66
|\ | | | | | | | | | | | | rpcserver: use more sophisticated handling for ConnectionError. Closes #1517 See merge request tpo/core/arti!2335
| * rpcserver: use more sophisticated handling for ConnectionError.Nick Mathewson2024-08-121-16/+66
| | | | | | | | | | | | | | | | | | | | | | | | In general, we don't want to return a ConnectionError for a simple EOF condition; we only want to report an error when there's an actual failure. Also, it's a good idea to capture the actual error return conditions that we get from aynchronous_codecs, rather than throwing them away as we did before. Closes #1517.
* | Unstable RPC method to dump method information.Nick Mathewson2024-08-122-1/+43
|/
* Bump versions for tor- and arti- crates to 0.21.0Nick Mathewson2024-08-011-10/+10
| | | | | | | | | | This is the result of: ``` for crate in $( ./maint/list_crates |grep '^\(tor\|arti-\)' ); do cargo set-version -p $crate 0.21.0 done ```
* Mark a struct as allowed-to-be-unused.Nick Mathewson2024-07-281-0/+1
| | | | | (This will either become used later, or we will remove it; the TODO RPC will remind us.)
* rpc: Rename the error codes for something like consistency.Nick Mathewson2024-07-253-4/+4
|
* rpc: Remove RpcError data field and use ReportNick Mathewson2024-07-251-1/+1
| | | | | | | | | | | | Per discussion, this field isn't really specified in a way that lets us fill it sensibly at the moment. So for now, we're going to just omit it. Additionally, we said that we'd Report on our errors; this branch changes the implementation of RpcError to do that. Question: Will the blanket implementation for Into<RpcError> make it harder to re-add a Data field later on if we want to do so?
* rpc: Refactor errors part 1: a new RpcMethod trait.Nick Mathewson2024-07-254-14/+7
| | | | | It is no longer necessary to say, for every RPC method, that its error type is RpcError.
* Update to derive-deftly 0.14Ian Jackson2024-07-081-1/+1
| | | | | This removes the deprecated syntaxes. Updating now will prevent us re-introducing the old syntaxes, which we updated in arti!2209.
* Update versions of 0.x tor-* and arti-* cratesIan Jackson2024-06-271-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nailing-cargo -uE set-version -p arti-client 0.20.0 nailing-cargo -uE set-version -p arti-relay 0.20.0 nailing-cargo -uE set-version -p arti-rpcserver 0.20.0 nailing-cargo -uE set-version -p tor-async-utils 0.20.0 nailing-cargo -uE set-version -p tor-basic-utils 0.20.0 nailing-cargo -uE set-version -p tor-bytes 0.20.0 nailing-cargo -uE set-version -p tor-cell 0.20.0 nailing-cargo -uE set-version -p tor-cert 0.20.0 nailing-cargo -uE set-version -p tor-chanmgr 0.20.0 nailing-cargo -uE set-version -p tor-checkable 0.20.0 nailing-cargo -uE set-version -p tor-circmgr 0.20.0 nailing-cargo -uE set-version -p tor-config 0.20.0 nailing-cargo -uE set-version -p tor-consdiff 0.20.0 nailing-cargo -uE set-version -p tor-dirclient 0.20.0 nailing-cargo -uE set-version -p tor-dirmgr 0.20.0 nailing-cargo -uE set-version -p tor-error 0.20.0 nailing-cargo -uE set-version -p tor-geoip 0.20.0 nailing-cargo -uE set-version -p tor-guardmgr 0.20.0 nailing-cargo -uE set-version -p tor-hsclient 0.20.0 nailing-cargo -uE set-version -p tor-hscrypto 0.20.0 nailing-cargo -uE set-version -p tor-hsrproxy 0.20.0 nailing-cargo -uE set-version -p tor-hsservice 0.20.0 nailing-cargo -uE set-version -p tor-keymgr 0.20.0 nailing-cargo -uE set-version -p tor-linkspec 0.20.0 nailing-cargo -uE set-version -p tor-llcrypto 0.20.0 nailing-cargo -uE set-version -p tor-log-ratelim 0.20.0 nailing-cargo -uE set-version -p tor-memquota 0.20.0 nailing-cargo -uE set-version -p tor-netdir 0.20.0 nailing-cargo -uE set-version -p tor-netdoc 0.20.0 nailing-cargo -uE set-version -p tor-persist 0.20.0 nailing-cargo -uE set-version -p tor-proto 0.20.0 nailing-cargo -uE set-version -p tor-protover 0.20.0 nailing-cargo -uE set-version -p tor-ptmgr 0.20.0 nailing-cargo -uE set-version -p tor-relay-selection 0.20.0 nailing-cargo -uE set-version -p tor-rpcbase 0.20.0 nailing-cargo -uE set-version -p tor-rtcompat 0.20.0 nailing-cargo -uE set-version -p tor-rtmock 0.20.0 nailing-cargo -uE set-version -p tor-socksproto 0.20.0 nailing-cargo -uE set-version -p tor-units 0.20.0 Each of which runs a rune like cargo set-version --offline -p tor-units 0.20.0
* Update to derive-deftly 0.13.0Ian Jackson2024-06-251-1/+1
| | | | | | | No code changes needed. Precisely nailing-cargo -Eu upgrade --incompatible -p derive-deftly
* Update to derive-deftly 0.12.1Ian Jackson2024-06-171-1/+1
| | | | | | * Bump in Cargo.toml * Deal with `${Xmeta as ...}` incompatible change, by always specifying an `as`, and changing `as tokens`.
* Several typo fixes from GabiNick Mathewson2024-06-111-2/+1
|
* Un-indent a block.Nick Mathewson2024-06-111-42/+39
|
* RPC: Use RPC methods instead of the "ClientConnectionTarget" trait.Nick Mathewson2024-06-112-91/+113
| | | | | | | | | | | | 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: Make RpcMgr::lookup_object return context along with object.Nick Mathewson2024-06-101-6/+12
| | | | The context will make it possible to invoke rpc methods.
* Implement rpc::Context on Connection directlyNick Mathewson2024-06-101-25/+7
| | | | | | | | | | | This lets us get rid of a now-spurious `RequestContext` wrapper type and an extra layer of indirection; it will also make it easier to treat a Connection _as_ a context, so that we can have a context in the socks-rpc interface code. This patch removes a TODO about "treading carefully" when we make this change. When I added that TODO, I had misremembered some implementation details of the RPC object system.
* rpc: allow Connection::lookup_object to take &selfNick Mathewson2024-06-101-7/+16
| | | | This will allow us to implement rpc::Context on Connection directly.
* rpc: Make the connection type always-Arc.Nick Mathewson2024-06-102-5/+5
|
* Use refactored invoke_rpc_method in rpcserver.Nick Mathewson2024-06-101-6/+1
|
* rpc: Pass around our rpc::Context in an Arc.Nick Mathewson2024-06-104-9/+11
| | | | | | | | Formerly we used a Box. That was okay at first, but now that we want RPC methods to be able to invoke other RPC methods, we don't want the Invocable methods to have to consume the Context. This requires that Context become Sync.
* Bump all the unstable tor- and arti- crates to 0.19.Gabriela Moldovan2024-06-051-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unstable crates are: - tor-error - tor-config - tor-units - tor-geoip - tor-rtcompat - tor-rtmock - tor-log-ratelim - tor-rpcbase - tor-memquota - tor-llcrypto - tor-protover - tor-bytes - tor-hscrypto - tor-socksproto - tor-checkable - tor-cert - tor-linkspec - tor-cell - tor-proto - tor-netdoc - tor-consdiff - tor-netdir - tor-relay-selection - tor-persist - tor-chanmgr - tor-ptmgr - tor-guardmgr - tor-circmgr - tor-dirclient - tor-dirmgr - tor-keymgr - tor-hsclient - tor-hsservice - tor-hsrproxy - arti-client - arti-rpcserver - arti-hyper - tor-basic-utils - tor-async-utils Done using ``` for p in "${unstable[@]}"; do cargo set-version -p $p 0.19; done ``` where `unstable` contains the list above
* arti-rpcserver: Reformat Cargo.toml.Gabriela Moldovan2024-06-051-1/+2
|
* Run fixup-features in preparation for release.Gabriela Moldovan2024-06-051-1/+1
|
* RPC: Expose dispatch table from ContextNick Mathewson2024-05-161-0/+4
| | | | | We need to do this so that we can actually invoke RPC functions from one another.
* RPC: Require an Error type in methods.Nick Mathewson2024-05-164-0/+7
| | | | | | | | This is needed so that we can cast special methods' return types properly. I wish I could make this optional, but Rust doesn't allow defaulting an associated type.
* rpc: Move typetag onto subtrait of DynMethodNick Mathewson2024-05-162-7/+8
| | | | | | This will allow us to create dispatchable methods that are only invoked from inside the arti code, and are not themselves serializable.
* RPC: Give error from RpcMgr::new if method name is sufficiently bad.Nick Mathewson2024-05-141-4/+22
| | | | | (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/+6
| | | | | | | | | | | | 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: Use RPC method names in a consistent format.Nick Mathewson2024-05-142-3/+3
| | | | | Specifically, we want a single colon, and we want our method names to be in snake_case.
* RPC: Require DynClone for ClientConnectionError.Nick Mathewson2024-05-141-1/+1
|
* RPC: Document RpcDataSTream state transitions.Nick Mathewson2024-05-141-1/+19
|
* RPC: Rename RpcDataStream::{Waiting => Launching}Nick Mathewson2024-05-141-5/+9
| | | | Also, improve documentation.
* RPC: RpcDataStream type to act as a "stream-shaped hole"Nick Mathewson2024-05-143-0/+229
| | | | | | | | | 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`.
* RPC: Add a trait that can be the target of SOCKS requestsNick Mathewson2024-05-122-6/+56
| | | | | | | | | | | | (These will later become objects that can receive any application request, once we have HTTP connect.) For now, Session and TorClient implement this trait; but soon there will be a new type to hold on to the created DataStreamCtrl. There are some XXXXs here, marking code that is too ugly to live. I should fix it before I merge this branch.
* RPC: Un-parameterize RpcSession.Nick Mathewson2024-05-091-29/+43
| | | | | | | Instead, add a trait so that we can hold TorClient<R> and invoke only the methods on it that we need. This is a partial revert of 47f012829d3381fd896c6b6f20961fbfe2f40f6d.
* rpcserver: rename streams.rs to codecs.rs.Nick Mathewson2024-05-093-2/+2
| | | | I think I'm going to add another stream management module here.
* rpc: Teach RpcSession to expose and isolate clients.Nick Mathewson2024-05-091-1/+39
|
* Make RpcSession parameterized.Nick Mathewson2024-05-092-22/+22
| | | | | | This change allows it to hold a TorClient<R> that isn't type-erased. We'll use this for cases when we need to get the client directly and call functions on it.
* Merge branch 'new_ci_cfg_strategy' into 'main'Nick Mathewson2024-05-071-2/+2
|\ | | | | | | | | | | | | add_warning/CI: New strategy to avoid "unexpected-cfgs" warning Closes #1395 See merge request tpo/core/arti!2129
| * Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | | | | | This commit is automatically generated.
* | TorClient: Slightly cleaner (?) interface for registering RPC methods.Nick Mathewson2024-05-061-0/+19
| |
* | RPC: Implement methods to get and watch client bootstrap status.Nick Mathewson2024-05-062-3/+11
|/