summaryrefslogtreecommitdiff
path: root/crates/arti-rpcserver/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'rpc-clean-up-after-auth' into 'main'Nick Mathewson2025-01-151-0/+5
|\ | | | | | | | | rpclib: Clean up after performing cookie auth See merge request tpo/core/arti!2716
| * rpc: More documentation on cookie_continue.Nick Mathewson2025-01-151-0/+5
| |
* | Merge branch 'rpc-renaming-2' into 'main'Nick Mathewson2025-01-152-62/+56
|\ \ | | | | | | | | | | | | | | | | | | rpc: Rename new_stream_handle to new_oneshot_client. Closes #1664 See merge request tpo/core/arti!2715
| * | rpc: Clean up documenation surrounding OneshotClientNick Mathewson2025-01-151-11/+13
| | |
| * | rpc: Rename new_stream_handle to new_oneshot_client.Nick Mathewson2025-01-152-52/+44
| |/ | | | | | | | | | | | | | | This method doesn't actually create a new stream; it creates a single-use client object that can be used with SOCKS to launch a new stream, and capture an RPC object for that stream. Closes #1664.
* / arti-rpcserver: Rename MethodNotFound to NoSuchMethod.Nick Mathewson2025-01-153-4/+4
|/ | | | Closes #1500.
* rpc: Clarify auth-repetition rules.Nick Mathewson2025-01-151-2/+5
|
* rpc: Document cookie messages a little more.Nick Mathewson2025-01-151-1/+14
|
* rpc: Refactor Cookie and UnloadedCookie into a single type.Nick Mathewson2025-01-152-2/+11
|
* rpc: consolodate naming of "inherent" auth.Nick Mathewson2025-01-152-9/+13
| | | | | | | | | We don't want to call this "unix path" anywhere, since it corresponds to _any_ case where the ability to negotiate a successful connection means that the client is authorized. We also don't want to call it "none": The authentication is inherent to the connection, not nonexistent.
* rpc: Tweak cookie protocol to bind both nonces.Nick Mathewson2025-01-151-4/+9
| | | | | | | | | | Previously participants in the cookie protocol only bound the peer nonce in their MACs. With this change, they bind both nonces. This change is _probably_ not necessary for security, but it can't hurt. It follows a general principle that Adam Langley told me a long time ago: you won't regret binding more, but you might regret binding less.
* rpc: Keep Cookie in an Arc.Nick Mathewson2025-01-151-2/+2
| | | | | Since this is a secret value, it's probably best not to copy it all over the place.
* arti-rpcserver: Server side of cookie auth.Nick Mathewson2025-01-153-8/+189
|
* arti-rpcserver: Tell connections what kind of auth to expect.Nick Mathewson2025-01-154-14/+32
|
* arti-rpcserver: move inherent authentication to its own module.Nick Mathewson2025-01-152-69/+83
|
* arti-rpcserver: remove some dead code.Nick Mathewson2025-01-151-57/+0
| | | | | Now that we have a solid idea of how connections happen, it's clear we won't need to enable this negotiation mechanism.
* Implement banner for RPC protocol.Nick Mathewson2025-01-091-2/+12
| | | | Closes #1753
* 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.
* Remove echo structsNeel Chauhan2024-10-251-14/+0
|
* arti-rpcserver: Remove echo_on_sessionNeel Chauhan2024-10-251-12/+0
|
* rpc: Tweak release_owned to give an error on second removal of "connection".Nick Mathewson2024-10-231-16/+20
|
* rpc: Use a const for the "connection" object ID.Nick Mathewson2024-10-231-2/+9
|
* rpc: Simplify method-dispatch-bypass logic a bitNick Mathewson2024-10-232-9/+2
| | | | | | | | | | | | | | | This commit removes the separate function for asking whether to bypass the dispatch code. Instead, it gives the "invoke with bypass" function an error to return when no dispatch is warranted, and moves the whole responsibility for method dispatch or non-dispatch back into tor-rpcbase. I had to add an ObjectId argument to `invoke_rpc_method` to make this work, but that's probably a good thing. Additionally, this commit tweaks the derive-deftly macro to prevent you from asking for dispatch bypass on special methods, where it isn't implemented (and doesn't really make sense).
* rpc: Add support for dropping the special "connection" object ID.Nick Mathewson2024-10-231-9/+19
|
* rpc: Move "rpc:release" to be a method on the rpc object.Nick Mathewson2024-10-231-24/+24
| | | | | | | Now, instead of telling the session or the connection to drop the object ID, we tell the object ID to go away. Closes #1663.
* rpcserver: detect and use methods that bypass method dispatch.Nick Mathewson2024-10-231-3/+8
|
* rpc: Remove unimplemented rpc:downgrade method for now.Nick Mathewson2024-10-231-9/+0
| | | | | If and when we implement this, it will likely be different; arti#868 has some thoughts on the implications.
* rpc: Move some object-id-manipulation methods to a new module.Nick Mathewson2024-10-233-50/+63
| | | | | These will have different implementations soon; this is a more logical place for them.
* Merge branch 'arti-rpcserver-comment' into 'main'wesleyac2024-10-211-1/+1
|\ | | | | | | | | Fix typo in arti-rpcserver auth.rs comment See merge request tpo/core/arti!2558
| * Fix typo in arti-rpcserver auth.rs commentNeel Chauhan2024-10-181-1/+1
| |
* | rpc: List missing required features in error dataNick Mathewson2024-10-171-5/+7
| | | | | | | | | | | | | | | | | | | | Our spec says that when the RPC client has said "I require you to have feature X" and we don't have it, we need to include the feature(s) we don't have in an `rpc:unsupported_features` field of our error. Also, add an integration test for this behavior. Closes #1662
* | Remove Rpc* variants from tor_error::ErrorKindNick Mathewson2024-10-173-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | These are not regular ErrorKinds, since they can never occur in an error that's meant to be returned from a Rust API like `arti-client`. Instead, they only exist for errors returned from RpcError. (I can't find the place where we discussed this previously, but the rationale is that if an ErrorKind never makes sense in response to something that the user does from Rust, we should never have that be an ErrorKind. The fact that the removed kinds do not actually appear outside the RPC system suggests that this is reasonable.)
* | rpcserver: Wrap InvokeError as internal errorNick Mathewson2024-10-172-6/+8
|/ | | | | | | | | I'm about to remove HasKind from InvokeError, which would otherwise break this code. These errors are all in fact internal errors, since in this context they can only stem from incorrectly formed calls to `invoke_special_method`.
* Merge branch 'mq-prevent' into 'main'Ian Jackson2024-10-151-2/+5
|\ | | | | | | | | | | | | Use clippy to prevent non-mq use of mpsc::channel Closes #1659 See merge request tpo/core/arti!2536
| * Use mpsc_channel_no_memquota in the RPC system (adding a TODO)Ian Jackson2024-10-151-2/+5
| | | | | | | | | | We need to decide whether RPC will participate in memquota. Perhaps it should. But that's for the future.
* | Replace _ => panic!() elsewhereIan Jackson2024-10-151-1/+1
|/
* arti-rpcserver: minimal handling for request.meta.requireNick Mathewson2024-10-072-2/+30
| | | | | | | | | | We have defined a forward-compatibility mechanism for the RPC system, where a request may list one or more required "features", and if any feature is absent, the request will fail. Since no "features" are currently implemented, this code does the bare minimum to implement this mechanism, by rejecting every request with a nonempty "require" field.
* arti-rpcserver: Correctly handle rpc.meta without `updates`Nick Mathewson2024-10-071-0/+1
| | | | | The `update` field in request.meta is optional, so we should allow it to default to `false` when it is absent.
* rpcserver: Remove TODO about optionality of paramsNick Mathewson2024-10-071-3/+0
| | | | | | | The spec no longer says that `params` is optional, so we can remove the TODO about making it optional. Closes #1665.
* rpc: clarify documentation and fix typosNick Mathewson2024-10-022-3/+6
| | | | Based on review from @opara.
* Revise RPC documentation to be more informative.Nick Mathewson2024-10-024-13/+73
| | | | | | Previous documentation was more-or-less meant for the Arti developer only. This new documentation is intended for actual users of RPC functionality. It's meant to be extracted with `maint/rpc-doc-tool`.
* rpc: Rename SingletonId to SingleIdResponseNick Mathewson2024-09-242-8/+8
| | | | | | | | | | Calling it "singleton" might have suggested that it was using the [singleton pattern](https://en.wikipedia.org/wiki/Singleton_pattern), which it isn't. (Renaming done with rust-analyzer and double-checked with `git grep`.) Closes #1585.
* rpcserver: Split a few long lines.Nick Mathewson2024-09-161-5/+10
|
* rpcserver: move is_connection_close detection into run_loop.Nick Mathewson2024-09-161-6/+10
| | | | | | I've used an `async{ expr }.await` pattern, to make sure that _every_ error returned by the `loop{select!{}}` construct is actually transformed.
* rpcserver: Add an extra level of braces.Nick Mathewson2024-09-161-50/+52
| | | | (This will make the next commit easier to read.)
* rpcserver: Apply documentation suggestion.Nick Mathewson2024-09-161-0/+2
|
* rpcserver: Use a struct to enforce explicit ContinueNick Mathewson2024-09-161-2/+10
| | | | Per suggestion from @diziet.
* rpc: Simplify simplified close logic even furtherNick Mathewson2024-09-162-35/+38
| | | | | | Instead of classifying errors and complicating our behavior _early_ in our loop, instead we just decide whether an error indicates an EOF immediately before we return it.
* rpc: Simplify close logic even further.Nick Mathewson2024-09-161-6/+4
| | | | | | Make it more clear than the previous match statement that once we get an Err() from request_stream.next(), we aren't going to continue the loop.