rippled
Context.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #ifndef RIPPLE_RPC_CONTEXT_H_INCLUDED
21 #define RIPPLE_RPC_CONTEXT_H_INCLUDED
22 
23 #include <ripple/core/Config.h>
24 #include <ripple/core/JobQueue.h>
25 #include <ripple/net/InfoSub.h>
26 #include <ripple/rpc/Role.h>
27 
28 #include <ripple/beast/utility/Journal.h>
29 
30 namespace ripple {
31 
32 class Application;
33 class NetworkOPs;
34 class LedgerMaster;
35 
36 namespace RPC {
37 
39 struct Context
40 {
50  unsigned int apiVersion;
51 };
52 
53 struct JsonContext : public Context
54 {
58  struct Headers
59  {
60  boost::string_view user;
61  boost::string_view forwardedFor;
62  };
63 
65 
67 };
68 
69 template <class RequestType>
70 struct GRPCContext : public Context
71 {
72  RequestType params;
73 };
74 
75 } // namespace RPC
76 } // namespace ripple
77 
78 #endif
ripple::NetworkOPs
Provides server functionality for clients.
Definition: NetworkOPs.h:86
ripple::Application
Definition: Application.h:115
ripple::RPC::Context::infoSub
InfoSub::pointer infoSub
Definition: Context.h:49
ripple::RPC::JsonContext
Definition: Context.h:53
std::shared_ptr
STL class.
ripple::RPC::JsonContext::Headers::user
boost::string_view user
Definition: Context.h:60
ripple::LedgerMaster
Definition: LedgerMaster.h:70
ripple::RPC::Context::loadType
Resource::Charge & loadType
Definition: Context.h:43
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition: Context.h:45
ripple::RPC::Context::role
Role role
Definition: Context.h:47
ripple::RPC::JsonContext::headers
Headers headers
Definition: Context.h:66
ripple::RPC::Context::j
const beast::Journal j
Definition: Context.h:41
ripple::RPC::Context::consumer
Resource::Consumer & consumer
Definition: Context.h:46
ripple::RPC::GRPCContext
Definition: Context.h:70
ripple::RPC::Context::app
Application & app
Definition: Context.h:42
ripple::RPC::Context::coro
std::shared_ptr< JobQueue::Coro > coro
Definition: Context.h:48
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
ripple::RPC::Context::netOps
NetworkOPs & netOps
Definition: Context.h:44
ripple::RPC::GRPCContext::params
RequestType params
Definition: Context.h:72
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::RPC::Context::apiVersion
unsigned int apiVersion
Definition: Context.h:50
ripple::Resource::Consumer
An endpoint that consumes resources.
Definition: Consumer.h:34
ripple::Resource::Charge
A consumption charge.
Definition: Charge.h:30
ripple::RPC::JsonContext::Headers::forwardedFor
boost::string_view forwardedFor
Definition: Context.h:61
ripple::RPC::JsonContext::Headers
Data passed in from HTTP headers.
Definition: Context.h:58
ripple::RPC::JsonContext::params
Json::Value params
Definition: Context.h:64
ripple::RPC::Context
The context of information needed to call an RPC.
Definition: Context.h:39
ripple::Role
Role
Indicates the level of administrative permission to grant.
Definition: Role.h:43
Json::Value
Represents a JSON value.
Definition: json_value.h:145