Admin verification strategy that checks the password from the request header.
More...
#include <AdminVerificationStrategy.hpp>
|
static constexpr std::string_view | kPASSWORD_PREFIX = "Password " |
| The prefix for the password in the request header.
|
|
|
using | RequestHeader = boost::beast::http::request<boost::beast::http::string_body>::header_type |
|
Admin verification strategy that checks the password from the request header.
◆ PasswordAdminVerificationStrategy()
web::PasswordAdminVerificationStrategy::PasswordAdminVerificationStrategy |
( |
std::string const & | password | ) |
|
◆ isAdmin()
bool web::PasswordAdminVerificationStrategy::isAdmin |
( |
RequestHeader const & | request, |
|
|
std::string_view | ) const |
|
overridevirtual |
Checks whether request is from a host that is considered authorized as admin using the password (if any) from the request.
- Parameters
-
request | The request from a host |
- Returns
- true if the password from request matches admin password from config
Implements web::AdminVerificationStrategy.
The documentation for this class was generated from the following files: