-
Notifications
You must be signed in to change notification settings - Fork 13
Add zcashd-compatible JSON-RPC endpoint
#12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
53d19e2 to
c1cd082
Compare
b6638eb to
5669a0d
Compare
zallet/src/components/json_rpc/methods/list_unified_receivers.rs
Outdated
Show resolved
Hide resolved
zallet/src/components/json_rpc/server/http_request_compatibility.rs
Outdated
Show resolved
Hide resolved
| /// - supplied `content-type` start with `text/plain`, for example: | ||
| /// - `text/plain` | ||
| /// - `text/plain;` | ||
| /// - `text/plain; charset=utf-8` |
There was a problem hiding this comment.
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" [";" *]?
zallet/src/components/json_rpc/server/http_request_compatibility.rs
Outdated
Show resolved
Hide resolved
| /// 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
zallet/src/components/json_rpc/server/http_request_compatibility.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
zallet/src/components/json_rpc/server/http_request_compatibility.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
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.
|
Force-pushed to address review comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-utACK 481460a
jsonrpseelogic adapted fromzebra-rpcandzebradcrates.