libzypp: zypp::media::CurlAuthData Class Reference

libzypp 17.38.10

zypp::media::CurlAuthData Class Reference

Curl HTTP authentication data. More...

`#include <zypp-curl/auth/curlauthdata.h>`

Inheritance diagram for zypp::media::CurlAuthData:

## Public Member Functions
| CurlAuthData ()
| Default constructor.
| 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)
bool | valid () const override
| Checks validity of authentication data.
void | setAuthType (std::string auth_type)
| Set HTTP authentication type(s) to use.
void | setAuthType (long auth_type)
| Set HTTP authentication type(s) to use.
long | authType () const
std::string | authTypeAsString () const
std::string | getUserPwd () const
std::ostream & | dumpOn (std::ostream &str) const override
Public Member Functions inherited from zypp::media::AuthData
| AuthData ()
| AuthData (const Url &url)
| AuthData (std::string username, 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
time_t | lastDatabaseUpdate () const
void | setLastDatabaseUpdate (time_t time)
const std::map< std::string, std::string > & | extraValues () const
std::map< std::string, std::string > & | extraValues ()
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.
static long | auth_type_str2long (const std::string &auth_type_str)
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.

## Private Attributes
std::string | _auth_type_str
long | _auth_type

## Detailed Description

Curl HTTP authentication data.

Definition at line 22 of file curlauthdata.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 26 of file curlauthdata.cc.

## ◆ CurlAuthData() [2/4]

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

Definition at line 32 of file curlauthdata.cc.

## ◆ CurlAuthData() [3/4]

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

Definition at line 32 of file curlauthdata.h.

## ◆ CurlAuthData() [4/4]

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

Definition at line 38 of file curlauthdata.h.

## Member Function Documentation

## ◆ valid()

bool zypp::media::CurlAuthData::valid | ( |  | ) | const
| overridevirtual

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 38 of file curlauthdata.cc.

## ◆ setAuthType() [1/2]

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

Set HTTP authentication type(s) to use.

Parameters

  comma | separated list of HTTP authentication type names

Definition at line 55 of file curlauthdata.h.

## ◆ setAuthType() [2/2]

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

Set HTTP authentication type(s) to use.

Parameters

  HTTP | authentication type as in long ORed form.

See also
  curl.h for available auth types

Definition at line 65 of file curlauthdata.h.

## ◆ authType()

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

Definition at line 71 of file curlauthdata.h.

## ◆ authTypeAsString()

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

Definition at line 72 of file curlauthdata.h.

## ◆ getUserPwd()

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

Definition at line 74 of file curlauthdata.h.

## ◆ auth_type_str2long() [1/2]

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

  MediaException | if an invalid authentication type name is encountered.

Definition at line 50 of file curlauthdata.cc.

## ◆ auth_type_str2long() [2/2]

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

Definition at line 55 of file curlauthdata.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 104 of file curlauthdata.cc.

## ◆ dumpOn()

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

Reimplemented from zypp::media::AuthData.

Definition at line 43 of file curlauthdata.cc.

## Member Data Documentation

## ◆ _auth_type_str

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

Definition at line 98 of file curlauthdata.h.

## ◆ _auth_type

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

Definition at line 99 of file curlauthdata.h.

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

- zypp-curl/auth/curlauthdata.h
- zypp-curl/auth/curlauthdata.cc