rippled
Loading...
Searching...
No Matches
Role.h
1#ifndef XRPL_SERVER_ROLE_H_INCLUDED
2#define XRPL_SERVER_ROLE_H_INCLUDED
3
4#include <xrpl/beast/net/IPEndpoint.h>
5#include <xrpl/json/json_value.h>
6#include <xrpl/resource/ResourceManager.h>
7#include <xrpl/server/Handoff.h>
8#include <xrpl/server/Port.h>
9
10#include <boost/asio/ip/network_v4.hpp>
11#include <boost/asio/ip/network_v6.hpp>
12#include <boost/utility/string_view.hpp>
13
14#include <string>
15#include <vector>
16
17namespace ripple {
18
26
35Role
37 Role const& required,
38 Port const& port,
39 Json::Value const& params,
40 beast::IP::Endpoint const& remoteIp,
41 std::string_view user);
42
43Resource::Consumer
45 Resource::Manager& manager,
46 beast::IP::Endpoint const& remoteAddress,
47 Role const& role,
50
54bool
55isUnlimited(Role const& role);
56
64bool
66 beast::IP::Address const& remoteIp,
69
71forwardedFor(http_request_type const& request);
72
73} // namespace ripple
74
75#endif
Represents a JSON value.
Definition json_value.h:131
A version-independent IP address and port combination.
Definition IPEndpoint.h:19
boost::asio::ip::address Address
Definition IPAddress.h:20
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
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:123
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
Definition Role.cpp:106
std::string_view forwardedFor(http_request_type const &request)
Definition Role.cpp:243
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
Definition Handoff.h:14
Role
Indicates the level of administrative permission to grant.
Definition Role.h:25
Role requestRole(Role const &required, Port const &port, Json::Value const &params, beast::IP::Endpoint const &remoteIp, std::string_view user)
Return the allowed privilege role.
Definition Role.cpp:76
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:27