RESTinio
|
Tools for working with the value of Authorization HTTP-field. More...
#include <authorization.hpp>
Classes | |
struct | param_t |
A storage for a parameter with a name and a value. More... | |
struct | param_value_t |
A storage for the value of a parameter. More... | |
Public Types | |
enum class | value_form_t { token , quoted_string } |
An indicator of the source form of the value of a parameter. More... | |
using | param_container_t = std::vector< param_t > |
Type of container for holding parameters. More... | |
using | token68_t = authorization_details::token68_t |
Type for holding a value of token68 from RFC7235. More... | |
using | auth_param_t = variant_t< token68_t, param_container_t > |
Type for holding a parameter for authorization. More... | |
Static Public Member Functions | |
static RESTINIO_NODISCARD auto | make_parser () |
A factory function for a parser of Authorization value. More... | |
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. More... | |
Public Attributes | |
std::string | auth_scheme |
A value of auth-scheme. More... | |
auth_param_t | auth_param |
A parameter for authorization. More... | |
Tools for working with the value of Authorization HTTP-field.
This struct represents parsed value of HTTP-field Authorization (see https://tools.ietf.org/html/rfc7235):
Authorization = credentials credentials = auth-scheme [ 1*SP ( token68 / [ #auth-param ] ) ] auth-scheme = token auth-param = token BWS "=" BWS ( token / quoted-string ) token68 = 1*( ALPHA / DIGIT / "-" / "." / "_" / "~" / "+" / "/" ) *"="
Definition at line 132 of file authorization.hpp.
using restinio::http_field_parsers::authorization_value_t::auth_param_t = variant_t< token68_t, param_container_t > |
Type for holding a parameter for authorization.
Definition at line 168 of file authorization.hpp.
using restinio::http_field_parsers::authorization_value_t::param_container_t = std::vector< param_t > |
Type of container for holding parameters.
Definition at line 162 of file authorization.hpp.
using restinio::http_field_parsers::authorization_value_t::token68_t = authorization_details::token68_t |
Type for holding a value of token68 from RFC7235.
Definition at line 165 of file authorization.hpp.
|
strong |
An indicator of the source form of the value of a parameter.
Enumerator | |
---|---|
token | The value of a parameter was specified as token. |
quoted_string | The value of a parameter was specified as quoted_string. |
Definition at line 135 of file authorization.hpp.
|
inlinestatic |
A factory function for a parser of Authorization value.
Definition at line 186 of file authorization.hpp.
|
inlinestatic |
An attempt to parse Authorization HTTP-field.
Definition at line 239 of file authorization.hpp.
auth_param_t restinio::http_field_parsers::authorization_value_t::auth_param |
A parameter for authorization.
Definition at line 177 of file authorization.hpp.
std::string restinio::http_field_parsers::authorization_value_t::auth_scheme |
A value of auth-scheme.
Definition at line 171 of file authorization.hpp.