RESTinio

Classes | Public Types | Static Public Member Functions | Public Attributes | List of all members
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. 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...

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

## Member Typedef Documentation

## ◆ auth_param_t

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.

## ◆ param_container_t

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.

## ◆ token68_t

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.

## Member Enumeration Documentation

## ◆ value_form_t

enum class restinio::http_field_parsers::authorization_value_t::value_form_t
| 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.

## Member Function Documentation

## ◆ make_parser()

static RESTINIO_NODISCARD auto restinio::http_field_parsers::authorization_value_t::make_parser | ( |  | ) |
| inline static

A factory function for a parser of Authorization value.

Since
  v.0.6.7

Definition at line 186 of file authorization.hpp.

## ◆ try_parse()

static RESTINIO_NODISCARD expected_t< authorization_value_t, restinio::easy_parser::parse_error_t > restinio::http_field_parsers::authorization_value_t::try_parse | ( | string_view_t | what | ) |
| inline static

An attempt to parse Authorization HTTP-field.

Since
  v.0.6.7

Definition at line 239 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 177 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 171 of file authorization.hpp.

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

- restinio/helpers/http_field_parsers/authorization.hpp