aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-rpc-client-core/src/msgs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-092-0/+2
| | | | | | | | | | | | 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.
* rpc: Clean up pub items in nb_stream.Nick Mathewson2026-02-042-1/+3
| | | | | (We don't need as many of these to be public as I had originally thought.)
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-062-2/+2
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-2/+2
| | | | | | | | | | | | | | 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.
* rpc-client: Increase test coverage for the msgs modulevcrn2025-03-182-1/+35
|
* rpclib: Obey error Display convention wrt sources.Nick Mathewson2025-02-041-2/+2
| | | | | | | In general, we try to obey the convention that an error's Display method does not display that error's sources. Part of #1650.
* Implement banner for RPC protocol.Nick Mathewson2025-01-091-0/+5
| | | | Closes #1753
* rpclib: Rename ParsedRequest to ParsedRequestFieldsNick Mathewson2024-08-071-11/+10
| | | | | | | | | | | | | This name change should emphasize that the (module-private) `ParsedRequestFields` type is only for parsing, and we aren't supposed to actually construct them for our own requests. With this change, and the others on the branch, there's no longer a risk of trying to serialize a ParsedRequestFields (since it doesn't implement Serialize), or to deserialize a Request (since it doesn't implement Deserialize). Closes #1511.
* rpclib: Use JsonValue to re-encode requests.Nick Mathewson2024-08-071-96/+54
| | | | | | | | As with responses, we previously used a strategy that could have failed in the future, if we forgot to add an "unexpected_fields" member to one of our structs. Closes #1512.
* rpclib: Unify error type for ValidatedRequest failure.Nick Mathewson2024-08-071-7/+28
|
* rpclib: Refactor request canonicalizationNick Mathewson2024-08-071-9/+30
| | | | | | This lets us make a couple of types module-private, and prepares the way for using the serde_json::Value trick on requests too.
* rpclib: Ensure that re-encoded responses end with NLNick Mathewson2024-08-071-1/+4
|
* rpclib: Use JsonValue to re-encode responsesNick Mathewson2024-08-071-38/+54
| | | | | | | | This approach keeps the property that we still preserve any unrecognized fields, but takes a different approach. Instead of using our own `structs` to round-trip the json, we use a `serde_json::Value`, to ensure that we cannot forget to add the `unexpected_fields` element to a struct.
* Merge branch 'rpc-reencoding' into 'main'Nick Mathewson2024-08-052-82/+177
|\ | | | | | | | | | | | | rpc-client-core: Always re-encode requests and responses, and preserve unrecognized struct fields. Closes #1491 See merge request tpo/core/arti!2312
| * rpclib: Apply serde(default) to RpcMeta::updates.Nick Mathewson2024-08-051-0/+1
| | | | | | | | This enable a `meta` object to have no `updates` field set.
| * rpclib: re-encode responses from arti, and preserve fields.Nick Mathewson2024-08-041-60/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to re-encode responses to avoid possible mismatch between how arti-rpc-client-core parses messages and how the user application parses messages. (In theory this shouldn't be necessary so long as arti-rpc-client-core and arti have the same json implementation, and arti-rpc-client-core is only used for talking to arti. But those assumptions might change in the future.) Closes #1491. We want to preserve fields so that, if Arti adds any new elements to response or error in the future, and the client knows about them, they won't be lost simply because arti-rpc-client-core hasn't heard of them.
| * rpclib: preserve unrecognized request fieldsNick Mathewson2024-08-041-4/+38
| | | | | | | | | | | | When writing a request, we want to keep any fields that we don't recognize, in case the application (and arti) know about some field that we haven't heard of.
| * rpclib: Split ParsedRequest and Request types.Nick Mathewson2024-08-041-18/+51
| | | | | | | | (They are about to diverge even further.)
* | rpc-client-core: Add thiserror #[source] annotationsNick Mathewson2024-08-031-1/+1
|/ | | | | This will make error outputs more usable, and will make it possible to expose OS error codes.
* Rename Utf8CStr=>Utf8CStringNick Mathewson2024-07-311-2/+2
|
* RPC: Make message types able to be CStr or str.Nick Mathewson2024-07-311-13/+17
| | | | (Internally, it is a boxed CStr that is always UTF-8.)
* rpc: Rename the error codes for something like consistency.Nick Mathewson2024-07-251-3/+3
|
* rpc: Remove RpcError data field and use ReportNick Mathewson2024-07-251-12/+0
| | | | | | | | | | | | 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: split "method not found"Nick Mathewson2024-07-251-4/+2
| | | | | We've wanted separate error codes for "no such method exists" and "this method exists, but this object doesn't have it."
* rpclib: Initial tests for RpcConnNick Mathewson2024-07-242-3/+3
| | | | | | The "complex" test here is fairly involved, since it tries to detect deadlocks and race conditions by using multiple threads and answering requests out of order.
* rpclib: do not include `"meta":null` when serializing.Nick Mathewson2024-07-241-0/+1
|
* rpc: Rename response_err and add a TODO about removing itNick Mathewson2024-07-161-1/+6
|
* rpc: Make "meta" an Option.Nick Mathewson2024-07-161-6/+11
|
* rpc client: Documentation.Nick Mathewson2024-07-162-3/+72
|
* Tests and documentation about NULs in the RPC stream.Nick Mathewson2024-07-161-0/+14
|
* Make ErrorResponse (a string) our preferred way to return an error.Nick Mathewson2024-07-161-6/+34
| | | | | | | | If we return RpcError by default, we don't give a good way to actually access the original error string. (Nonetheless, we still enforce that errors can be decoded as RpcError.)
* rpc-client: Resolve some dead-code warnings.Nick Mathewson2024-07-162-20/+9
|
* Rename CmdError to ProtoError.Nick Mathewson2024-07-161-3/+3
|
* RPC: Implement connection negotiation.Nick Mathewson2024-07-161-9/+23
|
* WIP: Lower and middle levels of Arti rpc core.Nick Mathewson2024-07-162-0/+485