xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
rpc
Role.h
1
#pragma once
2
3
#include <xrpl/beast/net/IPAddress.h>
4
#include <xrpl/beast/net/IPEndpoint.h>
5
#include <xrpl/json/json_value.h>
6
#include <xrpl/resource/Consumer.h>
7
#include <xrpl/resource/ResourceManager.h>
8
#include <xrpl/server/Handoff.h>
9
#include <xrpl/server/Port.h>
10
11
#include <boost/asio/ip/network_v4.hpp>
12
#include <boost/asio/ip/network_v6.hpp>
13
#include <boost/utility/string_view.hpp>
14
15
#include <
string_view
>
16
#include <
vector
>
17
18
namespace
xrpl
{
19
27
enum class
Role
{
GUEST
,
USER
,
IDENTIFIED
,
ADMIN
,
PROXY
,
FORBID
};
28
38
Role
39
requestRole
(
40
Role
const
& required,
41
Port
const
& port,
42
json::Value
const
& params,
43
beast::ip::Endpoint
const
& remoteIp,
44
std::string_view
user);
45
46
resource::Consumer
47
requestInboundEndpoint
(
48
resource::Manager& manager,
49
beast::ip::Endpoint
const
& remoteAddress,
50
Role
const
& role,
51
std::string_view
user,
52
std::string_view
forwardedFor
);
53
57
bool
58
isUnlimited
(
Role
const
& role);
59
67
bool
68
ipAllowed
(
69
beast::ip::Address
const
& remoteIp,
70
std::vector<boost::asio::ip::network_v4>
const
& nets4,
71
std::vector<boost::asio::ip::network_v6>
const
& nets6);
72
73
std::string_view
74
forwardedFor
(
HttpRequestType
const
& request);
75
76
}
// namespace xrpl
std::string_view
beast::ip::Endpoint
A version-independent IP address and port combination.
Definition
IPEndpoint.h:24
json::Value
Represents a JSON value.
Definition
json_value.h:117
beast::ip::Address
boost::asio::ip::address Address
Definition
IPAddress.h:20
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::Role
Role
Indicates the level of administrative permission to grant.
Definition
Role.h:27
xrpl::Role::IDENTIFIED
@ IDENTIFIED
Definition
Role.h:27
xrpl::Role::USER
@ USER
Definition
Role.h:27
xrpl::Role::GUEST
@ GUEST
Definition
Role.h:27
xrpl::Role::ADMIN
@ ADMIN
Definition
Role.h:27
xrpl::Role::FORBID
@ FORBID
Definition
Role.h:27
xrpl::Role::PROXY
@ PROXY
Definition
Role.h:27
xrpl::requestRole
Role requestRole(Role const &required, Port const &port, json::Value const ¶ms, beast::ip::Endpoint const &remoteIp, std::string_view user)
Return the allowed privilege role.
Definition
Role.cpp:88
xrpl::HttpRequestType
boost::beast::http::request< boost::beast::http::dynamic_body > HttpRequestType
Definition
Handoff.h:12
xrpl::forwardedFor
std::string_view forwardedFor(HttpRequestType const &request)
Definition
Role.cpp:251
xrpl::isUnlimited
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
Definition
Role.cpp:115
xrpl::ipAllowed
bool ipAllowed(beast::ip::Address const &remoteIp, std::vector< boost::asio::ip::network_v4 > const &nets4, std::vector< boost::asio::ip::network_v6 > const &nets6)
True if remoteIp is in any of adminIp.
Definition
Role.cpp:42
xrpl::requestInboundEndpoint
resource::Consumer requestInboundEndpoint(resource::Manager &manager, beast::ip::Endpoint const &remoteAddress, Role const &role, std::string_view user, std::string_view forwardedFor)
Definition
Role.cpp:132
string_view
vector
Generated by
1.17.0