Go to the documentation of this file.
14 #include <curl/curl.h>
46 str <<
"[<no-url>]" << endl;
48 <<
"password: " << (
_password.empty() ?
"<empty>" :
"<non-empty>");
72 , _auth_type(CURLAUTH_NONE)
78 , _auth_type(CURLAUTH_NONE)
100 curl_version_info_data *curl_info = curl_version_info(CURLVERSION_NOW);
102 std::vector<std::string> list;
103 std::vector<std::string>::const_iterator it;
104 long auth_type = CURLAUTH_NONE;
108 for(it = list.begin(); it != list.end(); ++it)
112 auth_type |= CURLAUTH_BASIC;
117 auth_type |= CURLAUTH_DIGEST;
120 if((curl_info && (curl_info->features & CURL_VERSION_NTLM)) &&
123 auth_type |= CURLAUTH_NTLM;
126 if((curl_info && (curl_info->features & CURL_VERSION_SPNEGO)) &&
127 (*it ==
"spnego" || *it ==
"negotiate"))
130 auth_type |= CURLAUTH_GSSNEGOTIATE;
133 if((curl_info && (curl_info->features & CURL_VERSION_GSSNEGOTIATE)) &&
134 (*it ==
"gssnego" || *it ==
"negotiate"))
136 auth_type |= CURLAUTH_GSSNEGOTIATE;
149 std::list<std::string> auth_list;
151 if(auth_type & CURLAUTH_GSSNEGOTIATE)
152 auth_list.push_back(
"negotiate");
154 if(auth_type & CURLAUTH_NTLM)
155 auth_list.push_back(
"ntlm");
157 if(auth_type & CURLAUTH_DIGEST)
158 auth_list.push_back(
"digest");
160 if(auth_type & CURLAUTH_BASIC)
161 auth_list.push_back(
"basic");
static const ViewOption WITH_USERNAME
Option to include username in the URL string.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
static const ViewOption WITH_PASSWORD
Option to include password in the URL string.
std::string asString() const
Returns a default string representation of the Url object.
bool isValid() const
Verifies the Url.
Easy-to use interface to the ZYPP dependency resolver.
std::string join(TIterator begin, TIterator end, const C_Str &sep_r=" ")
Join strings using separator sep_r (defaults to BLANK).
String related utilities and Regular expression matching.
std::string getPassword(EEncoding eflag=zypp::url::E_DECODED) const
Returns the password from the URL authority.
Url::asString() view options.
std::string getUsername(EEncoding eflag=zypp::url::E_DECODED) const
Returns the username from the URL authority.