14 #include <restinio/helpers/http_field_parsers/authorization.hpp> 16 #include <restinio/utils/base64.hpp> 18 #include <restinio/http_headers.hpp> 19 #include <restinio/request_handler.hpp> 20 #include <restinio/expected.hpp> RESTINIO_NODISCARD expected_t< params_t, extraction_error_t > try_extract_params(const generic_request_t< Extra_Data > &req, http_field_t auth_field_id)
Helper function for getting parameters of basic authentification from a request.
There is no HTTP field with authentification parameters.
RESTINIO_NODISCARD expected_t< params_t, extraction_error_t > perform_extraction_attempt(const optional_t< string_view_t > opt_field_value)
Invalid value of parameter for basic authentification scheme. The single parameter in the form of tok...
Wrong format for username:password in decoded token68 parameter. Maybe there is no colon symbol...
Value of token68 parameter for basic authentification can't be decoded.
std::string password
Password for a user.
Empty user name in username:password pair.
extraction_error_t
Error codes for failures of extraction of basic authentification parameters.
The HTTP field with authentification parameters can't be parsed.
std::string username
Name of a user.
RESTINIO_NODISCARD auto try_parse_field(const generic_request_t< Extra_Data > &req, http_field_t field_id, string_view_t default_value=string_view_t{})
A helper function for extraction and parsing a value of HTTP-field.
Different authentification scheme found. Basic authentification scheme is expected.
Parameters for basic authentification.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists ...