MySQL 8.0.39
Source Code Documentation
HttpAuthCredentials Class Reference

Authorization message. More...

#include <http_auth.h>

Public Member Functions

 HttpAuthCredentials (const std::string &scheme, const std::string &token, const std::vector< std::pair< std::string, std::string > > params)
 construct Authorization message from fields. More...
 
std::string str () const
 string representation of 'credentials'. More...
 
std::string scheme () const
 authentication scheme of the Authorization message. More...
 
std::string token () const
 token part of the Authorization message. More...
 
std::vector< std::pair< std::string, std::string > > params ()
 params part of the Authorization message. More...
 

Static Public Member Functions

static HttpAuthCredentials from_header (const std::string &hdr, std::error_code &ec)
 parse a 'credentials' field. More...
 

Private Attributes

std::string scheme_
 
std::string token_
 
std::vector< std::pair< std::string, std::string > > params_
 

Detailed Description

Authorization message.

sent from client to server.

See also
https://tools.ietf.org/html/rfc7235#section-4.2

Constructor & Destructor Documentation

◆ HttpAuthCredentials()

HttpAuthCredentials::HttpAuthCredentials ( const std::string &  scheme,
const std::string &  token,
const std::vector< std::pair< std::string, std::string > >  params 
)
inline

construct Authorization message from fields.

Member Function Documentation

◆ from_header()

HttpAuthCredentials HttpAuthCredentials::from_header ( const std::string &  hdr,
std::error_code &  ec 
)
static

parse a 'credentials' field.

ec MUST be checked before using the return-value.

Parameters
hdrcontent of Authorization header
ecerror code
Returns
a HttpAuthCredentials message ... and error_code

◆ params()

std::vector< std::pair< std::string, std::string > > HttpAuthCredentials::params ( )
inline

params part of the Authorization message.

for Bearer this is a list of params

◆ scheme()

std::string HttpAuthCredentials::scheme ( ) const
inline

authentication scheme of the Authorization message.

e.g.: Basic

◆ str()

std::string HttpAuthCredentials::str ( ) const

string representation of 'credentials'.

according to RFC 7235

◆ token()

std::string HttpAuthCredentials::token ( ) const
inline

token part of the Authorization message.

for Basic this is a Base64 encoded strings.

Member Data Documentation

◆ params_

std::vector<std::pair<std::string, std::string> > HttpAuthCredentials::params_
private

◆ scheme_

std::string HttpAuthCredentials::scheme_
private

◆ token_

std::string HttpAuthCredentials::token_
private

The documentation for this class was generated from the following files: