oxen-core/contrib/epee/include/storages
Jason Rhinelander 899d1e4eaf Wallet RPC server modernization
- Replaces the wallet RPC classes with ones like the core RPC server
(with serialization code moved into a new .cpp file).
  - Restricted commands are now carried through the RPC serialization
    types (by inheriting from RESTRICTED instead of RPC_COMMAND) and
    restrictions are handled in one place rather than being handled in
    each of the 49 restricted endpoints.  This differs a little from how
    the core http server works (which has a PUBLIC base class) because
    for the wallet rpc server unrestricted really doesn't mean "public",
    it means something closer to view-only.
  - GET_TRANSFERS_CSV is now restricted (it looks like an oversight that
    it wasn't before since GET_TRANSFERS is restricted)
  - GET_ADDRESS_BOOK_ENTRY is now restricted.  Since restricted mode is
    meant to provide something like view-only access, it doesn't make
    much sense that address book entries were available.

- Use uWebSockets to provide the wallet RPC server HTTP functionality.
  This version is quite a bit simpler than the core RPC version since it
  doesn't support multithreaded (parallel) requests, and so we don't
  have to worry about queuing jobs.

- Converted all the numeric wallet rpc error codes defines to constexprs

- Changed how endpoints get called; previous this was called:

    bool on_some_endpoint(const wallet_rpc::COMMAND_RPC_SOME_ENDPOINT::request& req, wallet_rpc::COMMAND_RPC_SOME_ENDPOINT::response& res, epee::json_rpc::error& er, const connection_context *ctx = NULL)

  This PR changes it similarly to how core_rpc_server's endpoints work:

    wallet_rpc::SOME_ENDPOINT invoke(wallet_rpc::COMMAND_RPC_SOME_ENDPOINT::request&& req);

  That is:
  - the response is now returned
  - the request is provided by mutable rvalue reference
  - the error object is gone (just throw instead)
  - the connection_context is gone (it was not used at all by any wallet
    rpc endpoint).

- Consolidated most of the (identical) exception handling to the RPC
  method invocation point rather than needing to repeat it in each
  individual endpoint.  This means each endpoint's `invoke` method can
  now just throw (or not catch) exceptions.  Some try/catches are still
  there because they are converting one type of exception into another,
  but the generic ones that return a generic error are gone.

- Removed all remaining epee http code.

- DRYed out some wallet rpc code.
2020-08-07 17:14:03 -03:00
..
levin_abstract_invoke2.h Replace a few boost::bind's with lambda 2020-07-02 12:52:12 -03:00
parserse_base_utils.h Replace boost::string_ref with std::string_view 2020-07-02 12:52:12 -03:00
portable_storage.h epee/portable_storage: move code to .cpp 2020-07-02 12:52:13 -03:00
portable_storage_base.h epee serialization code: std::variant & C++17 modernization 2020-07-02 12:52:12 -03:00
portable_storage_from_bin.h epee serialization code: std::variant & C++17 modernization 2020-07-02 12:52:12 -03:00
portable_storage_from_json.h epee serialization code: std::variant & C++17 modernization 2020-07-02 12:52:12 -03:00
portable_storage_template_helper.h epee serialization code: std::variant & C++17 modernization 2020-07-02 12:52:12 -03:00
portable_storage_to_bin.h epee serialization code: std::variant & C++17 modernization 2020-07-02 12:52:12 -03:00
portable_storage_to_json.h RPC overhaul 2020-05-11 18:44:45 -03:00
portable_storage_val_converters.h epee serialization code: std::variant & C++17 modernization 2020-07-02 12:52:12 -03:00