-
Notifications
You must be signed in to change notification settings - Fork 38.8k
[WIP] Add a basic python REST API Server Wrapper #23309
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
20acaf9 to
74c56c6
Compare
74c56c6 to
3d060fe
Compare
|
Strong concept ACK on providing a REST API which is built with the intention to be secure. The current situation where we don't want to vouch for the security of our REST API and instead suggest that our users should roll their own sanitisation via an |
|
@practicalswift That seems entirely orthogonal here. The concern with REST (and also RPC, though RPC has additional exposure) is that it isn't designed to be DoS resistant, so it's assumed to only be exposed to clients that are trusted to not DoS attack the node. Putting in a Python wrapper that translates REST to RPC seems like that would only worsen this. |
|
@sipa it's not worse because a python rest server can enforce things like rate limiting or be configured to use a pool of nodes. If attacked directly, the python server's slowdowns can also function as rate limiting. |
|
Made a few mods here:
|
|
@stickies-v you might be interested in helping with this as well :) |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
Related to #23259, a draft of what a simple external REST API Server would look like. Benefits of this approach would be that we can drop the messy HTTP/Rest code and it should be easier to extend this code for other public information RPCs. Further, using whitelistrpc'd credentials, it improves the security of the REST API to not be able to access any internal state (e.g., a buffer overflow can't write out memory from our core process).
I copied the Authproxy code from the test framework.
The
rest_getutxosis not implemented as I don't think it has valid REST semantics, so we could discuss making it valid rest (using query parameters for multiple args) or hacking it another way.