RESTinio
Classes | Namespaces | Enumerations | Functions
basic_auth.hpp File Reference

Helpers for dealing with basic authentification. More...

#include <restinio/helpers/http_field_parsers/authorization.hpp>
#include <restinio/utils/base64.hpp>
#include <restinio/http_headers.hpp>
#include <restinio/request_handler.hpp>
#include <restinio/expected.hpp>
#include <iostream>

Go to the source code of this file.

Classes

struct  restinio::http_field_parsers::basic_auth::params_t
 Parameters for basic authentification. More...
 

Namespaces

namespace  restinio
 
namespace  restinio::http_field_parsers
 
namespace  restinio::http_field_parsers::basic_auth
 
namespace  restinio::http_field_parsers::basic_auth::impl
 

Enumerations

enum class  restinio::http_field_parsers::basic_auth::extraction_error_t {
  restinio::http_field_parsers::basic_auth::no_auth_http_field , restinio::http_field_parsers::basic_auth::illegal_http_field_value , restinio::http_field_parsers::basic_auth::not_basic_auth_scheme , restinio::http_field_parsers::basic_auth::invalid_basic_auth_param ,
  restinio::http_field_parsers::basic_auth::token68_decode_error , restinio::http_field_parsers::basic_auth::invalid_username_password_pair , restinio::http_field_parsers::basic_auth::empty_username
}
 Error codes for failures of extraction of basic authentification parameters. More...
 

Functions

RESTINIO_NODISCARD string_view_t restinio::http_field_parsers::basic_auth::to_string_view (extraction_error_t what) noexcept
 Helper function to get a string name of extraction_error enum. More...
 
RESTINIO_NODISCARD expected_t< params_t, extraction_error_t > restinio::http_field_parsers::basic_auth::try_extract_params (const authorization_value_t &http_field)
 Helper function for getting parameters of basic authentification from an already parsed HTTP-field. More...
 
RESTINIO_NODISCARD expected_t< params_t, extraction_error_t > restinio::http_field_parsers::basic_auth::impl::perform_extraction_attempt (const optional_t< string_view_t > opt_field_value)
 
RESTINIO_NODISCARD expected_t< params_t, extraction_error_t > restinio::http_field_parsers::basic_auth::try_extract_params (const http_header_fields_t &fields, string_view_t auth_field_name)
 Helper function for getting parameters of basic authentification from a set of HTTP-fields. More...
 
template<typename Extra_Data >
RESTINIO_NODISCARD expected_t< params_t, extraction_error_t > restinio::http_field_parsers::basic_auth::try_extract_params (const generic_request_t< Extra_Data > &req, string_view_t auth_field_name)
 Helper function for getting parameters of basic authentification from a request. More...
 
RESTINIO_NODISCARD expected_t< params_t, extraction_error_t > restinio::http_field_parsers::basic_auth::try_extract_params (const http_header_fields_t &fields, http_field_t auth_field_id)
 Helper function for getting parameters of basic authentification from a set of HTTP-fields. More...
 
template<typename Extra_Data >
RESTINIO_NODISCARD expected_t< params_t, extraction_error_t > restinio::http_field_parsers::basic_auth::try_extract_params (const generic_request_t< Extra_Data > &req, http_field_t auth_field_id)
 Helper function for getting parameters of basic authentification from a request. More...
 

Detailed Description

Helpers for dealing with basic authentification.

Since
v.0.6.7

Definition in file basic_auth.hpp.