RESTinio
Loading...
Searching...
No Matches
restinio::http_field_parsers::authorization_value_t Struct Reference

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.
using token68_t = authorization_details::token68_t
 Type for holding a value of token68 from RFC7235.
using auth_param_t = std::variant< token68_t, param_container_t >
 Type for holding a parameter for authorization.

Static Public Member Functions

static auto make_parser ()
 A factory function for a parser of Authorization value.
static expected_t< authorization_value_t, restinio::easy_parser::parse_error_ttry_parse (string_view_t what)
 An attempt to parse Authorization HTTP-field.

Public Attributes

std::string auth_scheme
 A value of auth-scheme.
auth_param_t auth_param
 A parameter for authorization.

Detailed Description

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 / "-" / "." / "_" / "~" / "+" / "/" ) *"="
Since
v.0.6.7

Definition at line 131 of file authorization.hpp.

Member Typedef Documentation

◆ auth_param_t

Type for holding a parameter for authorization.

Definition at line 167 of file authorization.hpp.

◆ param_container_t

Type of container for holding parameters.

Definition at line 161 of file authorization.hpp.

◆ token68_t

Type for holding a value of token68 from RFC7235.

Definition at line 164 of file authorization.hpp.

Member Enumeration Documentation

◆ value_form_t

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 134 of file authorization.hpp.

Member Function Documentation

◆ make_parser()

auto restinio::http_field_parsers::authorization_value_t::make_parser ( )
inlinestaticnodiscard

A factory function for a parser of Authorization value.

Since
v.0.6.7

Definition at line 185 of file authorization.hpp.

◆ try_parse()

expected_t< authorization_value_t, restinio::easy_parser::parse_error_t > restinio::http_field_parsers::authorization_value_t::try_parse ( string_view_t what)
inlinestaticnodiscard

An attempt to parse Authorization HTTP-field.

Since
v.0.6.7

Definition at line 238 of file authorization.hpp.

Member Data Documentation

◆ auth_param

auth_param_t restinio::http_field_parsers::authorization_value_t::auth_param

A parameter for authorization.

Note
It can be empty.

Definition at line 176 of file authorization.hpp.

◆ auth_scheme

std::string restinio::http_field_parsers::authorization_value_t::auth_scheme

A value of auth-scheme.

Definition at line 170 of file authorization.hpp.


The documentation for this struct was generated from the following file: