libzypp  17.14.0
zypp::media::CurlAuthData Class Reference

Curl HTTP authentication data. More...

#include <MediaUserAuth.h>

Inheritance diagram for zypp::media::CurlAuthData:

Public Member Functions

 CurlAuthData ()
 Default constructor. More...
 
 CurlAuthData (const AuthData &authData)
 
 CurlAuthData (std::string &username, std::string &password, std::string &auth_type)
 
 CurlAuthData (std::string &username, std::string &password, long auth_type)
 
virtual bool valid () const
 Checks validity of authentication data. More...
 
void setAuthType (std::string auth_type)
 Set HTTP authentication type(s) to use. More...
 
void setAuthType (long auth_type)
 
long authType ()
 
const std::string authTypeAsString ()
 
const std::string getUserPwd () const
 
virtual std::ostream & dumpOn (std::ostream &str) const
 
- Public Member Functions inherited from zypp::media::AuthData
 AuthData ()
 
 AuthData (const Url &url)
 
 AuthData (const std::string &username, const std::string &password)
 
virtual ~AuthData ()
 
void setUrl (const Url &url)
 
void setUsername (const std::string &username)
 
void setPassword (const std::string &password)
 
Url url () const
 
std::string username () const
 
std::string password () const
 
virtual std::ostream & dumpAsIniOn (std::ostream &str) const
 

Static Public Member Functions

static long auth_type_str2long (std::string &auth_type_str)
 Converts a string of comma separated list of authetication type names into a long of ORed CURLAUTH_* identifiers. More...
 
static std::string auth_type_long2str (long auth_type)
 Converts a long of ORed CURLAUTH_* identifiers into a string of comma separated list of authentication type names. More...
 

Private Attributes

std::string _auth_type_str
 
long _auth_type
 

Detailed Description

Curl HTTP authentication data.

Definition at line 74 of file MediaUserAuth.h.

Constructor & Destructor Documentation

◆ CurlAuthData() [1/4]

zypp::media::CurlAuthData::CurlAuthData ( )

Default constructor.

Initializes username and password to empty strings and authetication type to CURLAUTH_NONE.

Definition at line 70 of file MediaUserAuth.cc.

◆ CurlAuthData() [2/4]

zypp::media::CurlAuthData::CurlAuthData ( const AuthData authData)

Definition at line 76 of file MediaUserAuth.cc.

◆ CurlAuthData() [3/4]

zypp::media::CurlAuthData::CurlAuthData ( std::string &  username,
std::string &  password,
std::string &  auth_type 
)
inline

Definition at line 84 of file MediaUserAuth.h.

◆ CurlAuthData() [4/4]

zypp::media::CurlAuthData::CurlAuthData ( std::string &  username,
std::string &  password,
long  auth_type 
)
inline

Definition at line 90 of file MediaUserAuth.h.

Member Function Documentation

◆ valid()

bool zypp::media::CurlAuthData::valid ( ) const
virtual

Checks validity of authentication data.

Returns
true if the object contains non-empty username, non-empty password, and specifies authentication type; false otherwise.

Reimplemented from zypp::media::AuthData.

Definition at line 82 of file MediaUserAuth.cc.

◆ setAuthType() [1/2]

void zypp::media::CurlAuthData::setAuthType ( std::string  auth_type)
inline

Set HTTP authentication type(s) to use.

Parameters
commaseparated list of HTTP authentication type names

Definition at line 107 of file MediaUserAuth.h.

◆ setAuthType() [2/2]

void zypp::media::CurlAuthData::setAuthType ( long  auth_type)
inline

Definition at line 117 of file MediaUserAuth.h.

◆ authType()

long zypp::media::CurlAuthData::authType ( )
inline

Definition at line 123 of file MediaUserAuth.h.

◆ authTypeAsString()

const std::string zypp::media::CurlAuthData::authTypeAsString ( )
inline

Definition at line 124 of file MediaUserAuth.h.

◆ getUserPwd()

const std::string zypp::media::CurlAuthData::getUserPwd ( ) const
inline

Definition at line 126 of file MediaUserAuth.h.

◆ auth_type_str2long()

long zypp::media::CurlAuthData::auth_type_str2long ( std::string &  auth_type_str)
static

Converts a string of comma separated list of authetication type names into a long of ORed CURLAUTH_* identifiers.

The method also automatically leaves out any auth types declared not supported by curl_version_info().

Exceptions
MediaExceptionif an invalid authentication type name is encountered.

Definition at line 94 of file MediaUserAuth.cc.

◆ auth_type_long2str()

std::string zypp::media::CurlAuthData::auth_type_long2str ( long  auth_type)
static

Converts a long of ORed CURLAUTH_* identifiers into a string of comma separated list of authentication type names.

Definition at line 143 of file MediaUserAuth.cc.

◆ dumpOn()

std::ostream & zypp::media::CurlAuthData::dumpOn ( std::ostream &  str) const
virtual

Reimplemented from zypp::media::AuthData.

Definition at line 87 of file MediaUserAuth.cc.

Member Data Documentation

◆ _auth_type_str

std::string zypp::media::CurlAuthData::_auth_type_str
private

Definition at line 149 of file MediaUserAuth.h.

◆ _auth_type

long zypp::media::CurlAuthData::_auth_type
private

Definition at line 150 of file MediaUserAuth.h.


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