libzypp
11.13.5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libzypp
Welcome to libzypp
Code Pitfalls - Frequently made mistakes
Code Snippets
Environment Variables
Testing for provided features.
Notes on revisions
Extending ZYpp: Plugins and Hooks
Services
Solver - Vendor protection
Writing and tunning testcases
Libzypp and threads
Todo List
Deprecated List
Modules
Namespaces
Classes
Files
File List
zypp
base
media
proxyinfo
CredentialFileReader.cc
CredentialFileReader.h
CredentialManager.cc
CredentialManager.h
CurlConfig.cc
CurlConfig.h
MediaAccess.cc
MediaAccess.h
MediaAria2c.cc
MediaAria2c.h
MediaBlockList.cc
MediaBlockList.h
MediaCD.cc
MediaCD.h
MediaCIFS.cc
MediaCIFS.h
MediaCurl.cc
MediaCurl.h
MediaDIR.cc
MediaDIR.h
MediaDISK.cc
MediaDISK.h
MediaException.cc
MediaException.h
MediaHandler.cc
MediaHandler.h
MediaISO.cc
MediaISO.h
MediaManager.cc
MediaManager.h
MediaMultiCurl.cc
MediaMultiCurl.h
MediaNFS.cc
MediaNFS.h
MediaPlugin.cc
MediaPlugin.h
MediaPriority.cc
MediaPriority.h
MediaSource.cc
MediaSource.h
MediaUserAuth.cc
MediaUserAuth.h
MetaLinkParser.cc
MetaLinkParser.h
Mount.cc
Mount.h
ProxyInfo.cc
ProxyInfo.h
TransferSettings.cc
TransferSettings.h
UrlResolverPlugin.cc
UrlResolverPlugin.h
ZsyncParser.cc
ZsyncParser.h
misc
parser
pool
repo
sat
solver
target
thread
ui
url
ws
zypp_detail
APIConfig.h
Arch.cc
Arch.h
AutoDispose.h
Bit.h
ByteCount.cc
ByteCount.h
Callback.h
Capabilities.cc
Capabilities.h
Capability.cc
Capability.h
CapMatch.cc
CapMatch.h
Changelog.cc
Changelog.h
CheckSum.cc
CheckSum.h
CountryCode.cc
CountryCode.h
Date.cc
Date.h
Dep.cc
Dep.h
Digest.cc
Digest.h
DiskUsage.cc
DiskUsage.h
DiskUsageCounter.cc
DiskUsageCounter.h
DownloadMode.cc
DownloadMode.h
Edition.cc
Edition.h
ExternalProgram.cc
ExternalProgram.h
Fetcher.cc
Fetcher.h
FileChecker.cc
FileChecker.h
Filter.h
Glob.cc
Glob.h
HistoryLog.cc
HistoryLog.h
HistoryLogData.cc
HistoryLogData.h
IdString.cc
IdString.h
IdStringType.h
InstanceId.cc
InstanceId.h
KeyContext.h
KeyRing.cc
KeyRing.h
KVMap.h
LanguageCode.cc
LanguageCode.h
Locale.cc
Locale.h
Locks.cc
Locks.h
ManagedFile.h
MediaProducts.cc
MediaProducts.h
MediaSetAccess.cc
MediaSetAccess.h
Misc.h
OnMediaLocation.cc
OnMediaLocation.h
Package.cc
Package.h
PackageKeyword.h
Patch.cc
Patch.h
PathInfo.cc
PathInfo.h
Pathname.cc
Pathname.h
Pattern.cc
Pattern.h
PluginFrame.cc
PluginFrame.h
PluginFrameException.cc
PluginFrameException.h
PluginScript.cc
PluginScript.h
PluginScriptException.cc
PluginScriptException.h
PoolItem.cc
PoolItem.h
PoolItemBest.cc
PoolItemBest.h
PoolQuery.cc
PoolQuery.h
PoolQueryResult.cc
PoolQueryResult.h
PoolQueryUtil.tcc
ProblemSolution.cc
ProblemSolution.h
ProblemTypes.h
Product.cc
Product.h
ProgressData.cc
ProgressData.h
ProvideFilePolicy.cc
ProvideFilePolicy.h
PublicKey.cc
PublicKey.h
Range.cc
Range.h
Rel.cc
Rel.h
RelCompare.h
RepoInfo.cc
RepoInfo.h
RepoManager.cc
RepoManager.h
Repository.cc
Repository.h
RepoStatus.cc
RepoStatus.h
ResFilters.h
ResKind.cc
ResKind.h
ResObject.cc
ResObject.h
ResObjects.h
Resolvable.cc
Resolvable.h
Resolver.cc
Resolver.h
ResolverProblem.cc
ResolverProblem.h
ResPool.cc
ResPool.h
ResPoolProxy.cc
ResPoolProxy.h
ResStatus.cc
ResStatus.h
ResTraits.h
ServiceInfo.cc
ServiceInfo.h
Signature.cc
Signature.h
SrcPackage.cc
SrcPackage.h
SysContent.cc
SysContent.h
Target.cc
Target.h
TmpPath.cc
TmpPath.h
TriBool.h
Url.cc
Url.h
Vendor.h
VendorAttr.cc
VendorAttr.h
VendorSupportOptions.cc
VendorSupportOptions.h
ZConfig.cc
ZConfig.h
ZYpp.cc
ZYpp.h
ZYppCallbacks.h
ZYppCommit.h
ZYppCommitPolicy.cc
ZYppCommitPolicy.h
ZYppCommitResult.cc
ZYppCommitResult.h
ZYppFactory.cc
ZYppFactory.h
File Members
MediaUserAuth.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#ifndef ZYPP_MEDIA_USER_AUTH_H
13
#define ZYPP_MEDIA_USER_AUTH_H
14
15
#include "
zypp/APIConfig.h
"
16
17
#include "
zypp/Url.h
"
18
#include "
zypp/base/PtrTypes.h
"
19
20
namespace
zypp {
21
namespace
media {
22
24
25
30
class
AuthData
31
{
32
public
:
33
AuthData
()
34
{}
35
36
AuthData
(
const
Url
&
url
);
37
38
AuthData
(
const
std::string &
username
,
const
std::string &
password
)
39
:
_username
(username),
_password
(password)
40
{}
41
42
virtual
~AuthData
() {};
43
49
virtual
bool
valid
()
const
;
50
51
void
setUrl
(
const
Url
&
url
) {
_url
=
url
; }
52
void
setUsername
(
const
std::string &
username
) {
_username
=
username
; }
53
void
setPassword
(
const
std::string &
password
) {
_password
=
password
; }
54
55
Url
url
()
const
{
return
_url
; }
56
std::string
username
()
const
{
return
_username
; }
57
std::string
password
()
const
{
return
_password
; }
58
59
virtual
std::ostream &
dumpOn
( std::ostream & str )
const
;
60
61
virtual
std::ostream &
dumpAsIniOn
( std::ostream & str )
const
;
62
63
private
:
64
Url
_url
;
65
std::string
_username
;
66
std::string
_password
;
67
};
68
69
typedef
shared_ptr<AuthData>
AuthData_Ptr
;
70
74
class
CurlAuthData
:
public
AuthData
{
75
public
:
80
CurlAuthData
();
81
82
CurlAuthData
(
const
AuthData
& authData);
83
84
CurlAuthData
(std::string &
username
, std::string &
password
, std::string & auth_type)
85
:
AuthData
(username,password),
_auth_type_str
(auth_type)
86
{
87
_auth_type
=
auth_type_str2long
(auth_type);
88
}
89
90
CurlAuthData
(std::string &
username
, std::string &
password
,
long
auth_type)
91
:
AuthData
(username,password),
_auth_type
(auth_type)
92
{
93
_auth_type_str
=
auth_type_long2str
(auth_type);
94
}
95
101
virtual
bool
valid
()
const
;
102
107
void
setAuthType
(std::string auth_type)
108
{
109
_auth_type_str
= auth_type;
_auth_type
=
auth_type_str2long
(auth_type);
110
}
111
112
/*
113
* Set HTTP authentication type(s) to use.
114
* \param HTTP authentication type as in long ORed form.
115
* \see curl.h for available auth types
116
*/
117
void
setAuthType
(
long
auth_type)
118
{
119
_auth_type
= auth_type;
120
_auth_type_str
=
auth_type_long2str
(auth_type);
121
}
122
123
long
authType
() {
return
_auth_type
; }
const
124
std::string
authTypeAsString
() {
return
_auth_type_str
; }
const
125
126
std::string
getUserPwd
()
const
{
return
username
() +
":"
+
password
(); }
127
128
138
static
long
auth_type_str2long
(std::string & auth_type_str);
139
144
static
std::string
auth_type_long2str
(
long
auth_type);
145
146
virtual
std::ostream &
dumpOn
( std::ostream & str )
const
;
147
148
private
:
149
std::string
_auth_type_str
;
150
long
_auth_type
;
151
};
152
153
typedef
shared_ptr<CurlAuthData>
CurlAuthData_Ptr
;
154
155
std::ostream &
operator <<
(std::ostream & str,
const
AuthData
& auth_data);
156
std::ostream &
operator <<
(std::ostream & str,
const
CurlAuthData
& auth_data);
157
159
160
}
// namespace media
161
}
// namespace zypp
162
163
#endif // ZYPP_MEDIA_USER_AUTH_H
zypp
media
MediaUserAuth.h
Generated by
1.8.1