Skip to content

Conversation

@str4d
Copy link
Collaborator

@str4d str4d commented Jan 23, 2025

jsonrpsee logic adapted from zebra-rpc and zebrad crates.

@str4d str4d force-pushed the 11-json-rpc branch 3 times, most recently from 53d19e2 to c1cd082 Compare January 24, 2025 07:39
@str4d str4d marked this pull request as ready for review January 24, 2025 07:39
@str4d str4d force-pushed the 11-json-rpc branch 2 times, most recently from b6638eb to 5669a0d Compare January 24, 2025 10:49
/// - supplied `content-type` start with `text/plain`, for example:
/// - `text/plain`
/// - `text/plain;`
/// - `text/plain; charset=utf-8`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we instead match on "text/plain" [";" *]?

/// In particular, the "application/x-www-form-urlencoded" header should be rejected, so browser forms can't be used to attack
/// a local RPC port. See "The Role of Routers in the CSRF Attack" in
/// <https://www.invicti.com/blog/web-security/importance-content-type-header-http-requests/>
/// - Checking all the headers is secure, but only because hyper has custom code that just reads the first content-type header.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from this review by teor: ZcashFoundation/zebra#6885 (review)

Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ACK with questions/requests for additional documentation

Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

str4d added 3 commits January 24, 2025 18:50
As `jsonrpsee` requires at least one RPC method, we mock out the
`getwalletinfo` RPC method.

Adapted from `zebra-rpc` and `zebrad` crates.
The code from `zebra-rpc` was only handling the `lightwalletd` client
format which includes a `"jsonrpc": "1.0"` entry.
@str4d
Copy link
Collaborator Author

str4d commented Jan 24, 2025

Force-pushed to address review comments.

Copy link
Contributor

@nuttycom nuttycom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-utACK 481460a

@nuttycom nuttycom merged commit 7ba78d8 into main Jan 24, 2025
@str4d str4d deleted the 11-json-rpc branch January 24, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants