aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-rpcserver
Commit message (Collapse)AuthorAgeFilesLines
...
* rpc: Make an RpcMgr type to own the DispatchTable.Nick Mathewson2023-05-045-13/+56
| | | | | | | | | In the future, this will probably hold more data as well, like a TorClient and some configuration info. The TorClient will present an issue; I've made comments about that. Closes #820
* Upgrade tracing to 0.1.36.Nick Mathewson2023-05-031-1/+1
| | | | | | This is the first version to impl Value for String. With luck, this will get minimal_versions CI passing.
* Increment crate versions.Nick Mathewson2023-05-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the errorkind bumps, we're calling this a breaking change in everything lower-level than `arti`. Generated with: ``` cargo set-version -p tor-basic-utils --bump minor cargo set-version -p tor-async-utils --bump minor cargo set-version -p caret --bump minor cargo set-version -p fs-mistrust --bump minor cargo set-version -p safelog --bump minor cargo set-version -p retry-error --bump minor cargo set-version -p tor-error --bump minor cargo set-version -p tor-config --bump minor cargo set-version -p tor-events --bump minor cargo set-version -p tor-units --bump minor cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-rtmock --bump minor cargo set-version -p tor-rpcbase --bump minor cargo set-version -p tor-llcrypto --bump minor cargo set-version -p tor-protover --bump minor cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-hscrypto --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-checkable --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-linkspec --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump minor cargo set-version -p tor-consdiff --bump minor cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-congestion --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-ptmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump minor cargo set-version -p tor-dirclient --bump minor cargo set-version -p tor-dirmgr --bump minor cargo set-version -p tor-hsclient --bump minor cargo set-version -p tor-hsservice --bump minor cargo set-version -p arti-client --bump minor cargo set-version -p arti-rpcserver --bump minor cargo set-version -p arti-config --bump minor cargo set-version -p arti-hyper --bump minor cargo set-version -p arti --bump patch cargo set-version -p arti-bench --bump patch cargo set-version -p arti-testing --bump patch ```
* RPC: Log all internal errors.Nick Mathewson2023-04-191-1/+6
|
* Arti: Add ability to remember the list of methods names.Nick Mathewson2023-04-193-12/+17
| | | | | | | | | | | | Right now, this lets us say whether the method was unrecognized or whether the parameter type was incorrect. We'll use this to enforce correct method names later on. (I have to add another `inventory` here, since the `typetag` maintainer does not want to expose this functionality: see https://github.com/dtolnay/typetag/issues/57#issuecomment-1506106290 )
* rpcserver: Use with_fn.Nick Mathewson2023-04-192-12/+8
|
* rpc: Use Method types to determine type of method outputs, updates.Nick Mathewson2023-04-191-17/+39
| | | | This lets us do much less in our rpc_invoke_fn functions.
* rpc: Split Method into DynMethod and MethodNick Mathewson2023-04-192-19/+26
| | | | | Now `Method` has an Output and Update associated type, and `decl_method` can do a little more.
* Merge branch 'rpc_refactoring_v2' into 'main'Ian Jackson2023-04-181-141/+92
|\ | | | | | | | | | | | | A few RPC refactorings Closes #817 and #824 See merge request tpo/core/arti!1144
| * rpc: simplify API by always providing a sink.Nick Mathewson2023-04-161-7/+6
| | | | | | | | | | Previously we have two places where we had to do "make a `Drain` sink if updates aren't wanted"; now there's only one.
| * rpc: Ensure well-ordering of responses.Nick Mathewson2023-04-161-60/+88
| | | | | | | | | | | | | | | | | | | | | | | | Previously the main loop received updates via a `mpsc::channel`, and final responses via a `futures::unordered`. This could lead to final responses being transmitted to the user before the updates were all flushed. Now all of the responses are sent to the main loop via the same channel, and they can't get out-of-sequence. Closes #817 and (IMO) simplifies the code a bit.
| * rpc: Move update sink out of context.Nick Mathewson2023-04-161-101/+25
| | | | | | | | | | Now the update sink is its own boxed object. It is not yet passed to the invoke functions that want it.
* | rpcserver: Fix a couple of broken rustdoc linksNick Mathewson2023-04-162-3/+5
|/
* rpc: Change `id=<SYNTAX>` to "no id".Nick Mathewson2023-04-133-14/+32
| | | | | | | Now instead of hoping that buggy clients will detect a magic `id`, we can simply tell them that they will get no `id` at all. If they can't handle that case, no major harm is done: the connection will get closed anyway.
* rpc: Require that errors are RpcError.Nick Mathewson2023-04-133-7/+22
| | | | | | Since we're serializing everything in this format, let's enforce it. With this change, we can no longer cram arbitrary junk into an RPC error, so we have to clean up our handling of cancelled requests.
* rpc: Improve error reporting for invalid requestsNick Mathewson2023-04-127-17/+291
| | | | | | | | | | | | | | | | This is a bit big, but it's not that _complicated_. The idea here is that we use serde's "untagged" enum facility when parsing our `Request`s, such that if parsing as a `Request` fails, we parse as an `InvalidRequest` and try to report what the problem was exactly. This lets us determine the ID of a request (if it had one), so we can report that ID in our error message. We can also recover from a much broader variety of errors. We now also conform with the spec reporting errors about completely wrong json, requests without IDs, and so on.
* arti-rpcserver: Be careful about saying "result".Nick Mathewson2023-04-123-7/+12
| | | | | | Even though json-rpc uses "result" to mean "a successful return value from a method", we can't: Rust's `Result` type is so pervasive that confusion would be inevitable.
* arti-rpcserver: Rename Authentication{Method => Scheme}.Nick Mathewson2023-04-121-7/+7
|
* arti-rpcserver: rename cmd to method.Nick Mathewson2023-04-121-2/+2
|
* arti-rpcserver: rename command to method.Nick Mathewson2023-04-122-19/+19
|
* tor-rpcbase: Rename and rephrase "command" to "method"Nick Mathewson2023-04-122-7/+7
|
* Rename tor-rpccmd to tor-rpcbase.Nick Mathewson2023-04-123-4/+4
|
* rpc: Make AuthenticationMethod an enum.Nick Mathewson2023-04-121-13/+20
|
* rpc: Reify and expose DispatchTable.Nick Mathewson2023-04-122-1/+10
|
* rpc: Use Pin<Box<Stream/Sink>> for run_loopNick Mathewson2023-04-122-16/+24
|
* rpc: Import Pin/Context/Poll.Nick Mathewson2023-04-121-29/+13
| | | | | (Except for one case where we are using crate::Context and task::Context at the same time.)
* rpc: Document our intended read-blocking behavior.Nick Mathewson2023-04-121-0/+4
|
* rpc: Switch JsonLinesEncoder to have Default, not new.Nick Mathewson2023-04-122-6/+5
|
* rpc: Rename BoxedResponseBody => ResponseBodyNick Mathewson2023-04-123-18/+18
|
* rpc: Remove anyhow dependencyNick Mathewson2023-04-122-6/+13
|
* rpc: Add standard warnings to arti-rpcserverNick Mathewson2023-04-125-7/+85
|
* rpc: Add an authentication step.Nick Mathewson2023-04-122-1/+71
| | | | | | | | Per our design, every connection starts out unauthenticated, and needs one authenticate command to become authenticated. Right now the only authentication type is "This is a unix named socket where everybody who can connect has permission."
* RPC: add a temporary "listen" function.Nick Mathewson2023-04-123-1/+63
| | | | | It requires tokio, it's unix-only, and makes some unfortunate shortcuts. Probably good enough for initial testing.
* rpc: Declare a trivial Echo command that works on a session.Nick Mathewson2023-04-121-1/+24
|
* rpc: Wire up arti-rpcserver to use tor-rpccmd.Nick Mathewson2023-04-122-24/+159
|
* rpc: do a better job of hiding impl_const_type_id!Nick Mathewson2023-04-121-1/+2
|
* RPC: Initial implementation of a multiple-argument dispatchNick Mathewson2023-04-121-0/+1
| | | | | | | | | | This code uses some kludges (discussed with Ian previously and hopefully well documented here) to get a type-identifier for each type in a const context. It then defines a macro to declare a type-erased versions of a concrete implementation functions, and register those implementations to be called later. We will probably want to tweak a bunch of this code as we move ahead.
* Start on a lower-level tor-rpccmd crate.Nick Mathewson2023-04-122-35/+11
| | | | | This crate will hold the backend pieces of RPC interaction that different parts of Arti get to implement.
* rpc: Add a Session object and an interaction loop.Nick Mathewson2023-04-122-0/+184
|
* rpc: Add asynchronous_codec wrapper for jsonlines.Nick Mathewson2023-04-123-0/+102
|
* rpc: Add a cancellable future type.Nick Mathewson2023-04-123-0/+136
| | | | | | Ordinarily you can cancel a future just by dropping it, but we'll want the ability to cancel futures that we no longer own (because we gave them to a `FuturesUnordered`).
* rpc: Implement json message types for serde.Nick Mathewson2023-04-124-0/+253