14 #include <restinio/helpers/http_field_parsers/basics.hpp> 16 #include <restinio/variant.hpp> 90 return (to << v.value);
253 if(authorization_value_t::value_form_t::token == v.form)
256 to <<
'"' << v.value <<
'"';
265 return (to << v.name <<
'=' << v.value);
284 operator()(
const authorization_value_t::param_container_t & c )
const 288 for(
const auto & param : c )
301 restinio::visit( printer_t{ to }, p );
311 return (to << v.auth_scheme <<
' ' << v.auth_param);
RESTINIO_NODISCARD bool operator()(const char actual) const noexcept
std::ostream & operator<<(std::ostream &to, const authorization_value_t::auth_param_t &p)
value_form_t
An indicator of the source form of the value of a parameter.
std::string value
The value of a parameter.
std::ostream & operator<<(std::ostream &to, const authorization_value_t::param_value_t &v)
param_value_t value
The value of a parameter.
RESTINIO_NODISCARD auto token68_p()
A storage for a parameter with a name and a value.
value_form_t form
How this value was represented: as a token, or a quoted string?
The value of a parameter was specified as token.
The value of a parameter was specified as quoted_string.
std::string auth_scheme
A value of auth-scheme.
A storage for the value of a parameter.
std::ostream & operator<<(std::ostream &to, const authorization_value_t &v)
std::ostream & operator<<(std::ostream &to, const token68_t &v)
std::string name
The name of a parameter.
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.
static RESTINIO_NODISCARD expected_t< authorization_value_t, restinio::easy_parser::parse_error_t > try_parse(string_view_t what)
An attempt to parse Authorization HTTP-field.
std::ostream & operator<<(std::ostream &to, const authorization_value_t::param_t &v)
A structure for holding a value of token68 from RFC7235.
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 ...
auth_param_t auth_param
A parameter for authorization.