Prometheus Client Library for Modern C++
|
Public Types | |
using | AuthFunc = std::function< bool(const std::string &, const std::string &)> |
Public Member Functions | |
BasicAuthHandler (AuthFunc callback, std::string realm) | |
bool | authorize (CivetServer *server, mg_connection *conn) override |
Handler for HTTP Basic authentication for Endpoints.
|
override |
Implements civetweb authorization interface.
Attempts to extract a username and password from the Authorization header to pass to the owning AuthHandler, this->handler
. If handler returns true, permits the request to proceed. If handler returns false, or the Auth header is absent, rejects the request with 401 Unauthorized.