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_getutxos
is 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.