2
3
6
7
8
9
10
14#include <restinio/helpers/http_field_parsers/basics.hpp>
34
35
36
37
38
66 return restinio::easy_parser::impl::symbol_producer_template_t<
67 is_token68_char_predicate_t >{};
74
75
76
77
78
79
80
87operator<<( std::ostream & to,
const token68_t & v )
100 produce< std::string >(
101 repeat( 1,
N, token68_symbol_p() >> to_container() ),
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
173
174
175
179
180
181
182
198 auto token68_seq = sequence(
199 token68_p() >> as_result(),
200 not_clause( any_symbol_p() >> skip() ) );
202 auto params_seq = maybe_empty_comma_separated_list_p< param_container_t >(
204 token_p() >> to_lower() >> ¶m_t::name,
208 produce< param_value_t >(
210 token_p() >> convert( token_to_v ) >> as_result(),
211 quoted_string_p() >> convert( qstring_to_v )
219 token_p() >> to_lower() >> &authorization_value_t::auth_scheme,
222 produce< auth_param_t >(
223 alternatives( token68_seq, params_seq )
224 ) >> &authorization_value_t::auth_param
230
231
232
233
255 to <<
'"' << v
.value <<
'"';
270 const authorization_value_t::auth_param_t & p )
283 operator()(
const authorization_value_t::param_container_t & c )
const
287 for(
const auto & param : c )
300 std::visit( printer_t{ to }, p );
auto space() noexcept
A factory function to create a clause that expects a space, extracts it and then skips it.
auto to_container()
A factory function to create a to_container_consumer.
auto symbol_p(char expected) noexcept
A factory function to create a symbol_producer.
constexpr std::size_t N
A special marker that means infinite repetitions.
A preducate for symbol_producer_template that checks that a symbol can be used inside token68 from RF...
hfp_impl::is_alphanum_predicate_t base_type_t
bool operator()(const char actual) const noexcept
A structure for holding a value of token68 from RFC7235.
A storage for a parameter with a name and a value.
std::string name
The name of a parameter.
param_value_t value
The value of a parameter.
A storage for the value of a parameter.
value_form_t form
How this value was represented: as a token, or a quoted string?
std::string value
The value of a parameter.
Tools for working with the value of Authorization HTTP-field.
auth_param_t auth_param
A parameter for authorization.
std::string auth_scheme
A value of auth-scheme.
static auto make_parser()
A factory function for a parser of Authorization value.
static expected_t< authorization_value_t, restinio::easy_parser::parse_error_t > try_parse(string_view_t what)
An attempt to parse Authorization HTTP-field.
value_form_t
An indicator of the source form of the value of a parameter.
@ token
The value of a parameter was specified as token.
@ quoted_string
The value of a parameter was specified as quoted_string.
authorization_details::token68_t token68_t
Type for holding a value of token68 from RFC7235.
A preducate for symbol_producer_template that checks that a symbol is an alpha or numeric.
bool operator()(const char actual) const noexcept