libzypp 17.37.17
credentialmanager.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_MEDIA_AUTH_CREDENTIALMANAGER_H
13#define ZYPP_MEDIA_AUTH_CREDENTIALMANAGER_H
14
15#include <set>
16
17#include <zypp-core/Globals.h>
18#include <zypp-core/Pathname.h>
19#include <zypp-media/auth/AuthData>
20
22namespace zypp
23{
24
25 class Url;
26
28 namespace media
29 {
30
31
33 //
34 // CLASS NAME : CredManagerOptions
35 //
47
48
49 // comparator for CredentialSet
51 {
52 bool operator()(const AuthData_Ptr & lhs, const AuthData_Ptr & rhs) const;
53 };
54
56 //
57 // CLASS NAME : CredentialManager
58 //
64 {
65 public:
66 using CredentialSet = std::set<AuthData_Ptr, AuthDataComparator>;
67 using CredentialSize = CredentialSet::size_type;
68 using CredentialIterator = CredentialSet::const_iterator;
69
70
72
75
76 public:
88 AuthData_Ptr getCred(const Url & url);
89
93 AuthData_Ptr getCredFromFile(const Pathname & file);
94
98 void addGlobalCred(const AuthData & cred);
99
103 void addUserCred(const AuthData & cred);
104
119 void addCred(const AuthData & cred);
120
125 void save();
126
134 void saveInGlobal(const AuthData & cred);
135
143 void saveInUser(const AuthData & cred);
144
153 void saveInFile(const AuthData &, const Pathname & credFile);
154
160 void clearAll(bool global = false);
161
165 static AuthData_Ptr findIn( const CredentialManager::CredentialSet & set, const Url & url, url::ViewOption vopt );
166
170 time_t timestampForCredDatabase ( const zypp::Url &url );
171
172 CredentialIterator credsGlobalBegin() const;
173 CredentialIterator credsGlobalEnd() const;
174 CredentialSize credsGlobalSize() const;
175 bool credsGlobalEmpty() const;
176
177 CredentialIterator credsUserBegin() const;
178 CredentialIterator credsUserEnd() const;
179 CredentialSize credsUserSize() const;
180 bool credsUserEmpty() const;
181
182 struct Impl;
183 private:
185 };
186
187
188
190 } // media
193} // zypp
195
196#endif /* ZYPP_MEDIA_AUTH_CREDENTIALMANAGER_H */
Url manipulation class.
Definition Url.h:93
Class for handling media authentication data.
Definition authdata.h:31
CredentialManager(CredManagerOptions opts=CredManagerOptions())
std::set< AuthData_Ptr, AuthDataComparator > CredentialSet
CredentialSet::size_type CredentialSize
CredentialSet::const_iterator CredentialIterator
shared_ptr< AuthData > AuthData_Ptr
Definition authdata.h:81
Url details namespace.
Definition UrlBase.cc:58
Easy-to use interface to the ZYPP dependency resolver.
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293
bool operator()(const AuthData_Ptr &lhs, const AuthData_Ptr &rhs) const
CredManagerOptions(const Pathname &rootdir="")
Url::asString() view options.
Definition UrlBase.h:41
Provides API related macros.