22#include <boost/json/object.hpp>
27namespace web::dosguard {
55 [[nodiscard]]
virtual bool
65 [[nodiscard]]
virtual bool
66 isOk(std::string
const& ip)
const noexcept = 0;
96 [[maybe_unused]]
virtual bool
97 add(std::string
const& ip, uint32_t numObjects)
noexcept = 0;
109 [[maybe_unused]]
virtual bool
110 request(std::string
const& ip, boost::json::object
const& request) = 0;
The interface of a denial of service guard.
Definition DOSGuardInterface.hpp:32
virtual void clear() noexcept=0
Clears implementation-defined counters.
The interface of a denial of service guard.
Definition DOSGuardInterface.hpp:46
virtual bool isWhiteListed(std::string_view const ip) const noexcept=0
Check whether an ip address is in the whitelist or not.
virtual bool request(std::string const &ip, boost::json::object const &request)=0
Adds one request for the given ip address.
virtual void decrement(std::string const &ip) noexcept=0
Decrement connection count for the given ip address.
virtual void increment(std::string const &ip) noexcept=0
Increment connection count for the given ip address.
virtual bool add(std::string const &ip, uint32_t numObjects) noexcept=0
Adds numObjects of usage for the given ip address.
virtual bool isOk(std::string const &ip) const noexcept=0
Check whether an ip address is currently rate limited or not.