Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
web::dosguard::WhitelistHandler Class Reference

A simple handler to add/check elements in a whitelist. More...

#include <WhitelistHandler.hpp>

Inheritance diagram for web::dosguard::WhitelistHandler:
Collaboration diagram for web::dosguard::WhitelistHandler:

Public Member Functions

template<SomeResolver HostnameResolverType = Resolver>
 WhitelistHandler (util::config::ClioConfigDefinition const &config, HostnameResolverType &&resolver={})
 Adds all whitelisted IPs and masks from the given config.
 
bool isWhiteListed (std::string_view ip) const override
 Checks to see if the given IP is whitelisted.
 
- Public Member Functions inherited from web::dosguard::WhitelistHandlerInterface
virtual ~WhitelistHandlerInterface ()=default
 Virtual destructor.
 

Detailed Description

A simple handler to add/check elements in a whitelist.

Constructor & Destructor Documentation

◆ WhitelistHandler()

template<SomeResolver HostnameResolverType = Resolver>
web::dosguard::WhitelistHandler::WhitelistHandler ( util::config::ClioConfigDefinition const & config,
HostnameResolverType && resolver = {} )
inline

Adds all whitelisted IPs and masks from the given config.

Parameters
configThe Clio config to use
resolverThe resolver to use for hostname resolution

Member Function Documentation

◆ isWhiteListed()

bool web::dosguard::WhitelistHandler::isWhiteListed ( std::string_view ip) const
inlineoverridevirtual

Checks to see if the given IP is whitelisted.

Parameters
ipThe IP to check
Returns
true if the given IP is whitelisted; false otherwise

Implements web::dosguard::WhitelistHandlerInterface.


The documentation for this class was generated from the following file: