|
libzypp
9.1.2
|
#include <CredentialManager.h>
Classes | |
| struct | Impl |
Public Types | |
| typedef std::set< AuthData_Ptr, AuthDataComparator > | CredentialSet |
| typedef CredentialSet::size_type | CredentialSize |
| typedef CredentialSet::const_iterator | CredentialIterator |
Public Member Functions | |
| CredentialManager (const CredManagerOptions &opts=CredManagerOptions()) | |
| ~CredentialManager () | |
| AuthData_Ptr | getCred (const Url &url) |
| Get credentials for the specified url. | |
| AuthData_Ptr | getCredFromFile (const Pathname &file) |
| Read credentials from a file. | |
| void | addGlobalCred (const AuthData &cred) |
| Add new global credentials. | |
| void | addUserCred (const AuthData &cred) |
| Add new user credentials. | |
| void | addCred (const AuthData &cred) |
| Add new credentials with user callbacks. | |
| void | save () |
| Saves any unsaved credentials added via addUserCred() or addGlobalCred() methods. | |
| void | saveInGlobal (const AuthData &cred) |
| Saves given cred to global credentials file. | |
| void | saveInUser (const AuthData &cred) |
| Saves given cred to user's credentials file. | |
| void | saveInFile (const AuthData &, const Pathname &credFile) |
| Saves given cred to user specified credentials file. | |
| void | clearAll (bool global=false) |
| Remove all global or user credentials from memory and disk. | |
| CredentialIterator | credsGlobalBegin () const |
| CredentialIterator | credsGlobalEnd () const |
| CredentialSize | credsGlobalSize () const |
| bool | credsGlobalEmpty () const |
| CredentialIterator | credsUserBegin () const |
| CredentialIterator | credsUserEnd () const |
| CredentialSize | credsUserSize () const |
| bool | credsUserEmpty () const |
Private Attributes | |
| RW_pointer< Impl > | _pimpl |
better method names
delete(AuthData) method
Definition at line 63 of file CredentialManager.h.
| typedef std::set<AuthData_Ptr, AuthDataComparator> zypp::media::CredentialManager::CredentialSet |
Definition at line 66 of file CredentialManager.h.
| typedef CredentialSet::size_type zypp::media::CredentialManager::CredentialSize |
Definition at line 67 of file CredentialManager.h.
| typedef CredentialSet::const_iterator zypp::media::CredentialManager::CredentialIterator |
Definition at line 68 of file CredentialManager.h.
| zypp::media::CredentialManager::CredentialManager | ( | const CredManagerOptions & | opts = CredManagerOptions() | ) |
Definition at line 293 of file CredentialManager.cc.
| zypp::media::CredentialManager::~CredentialManager | ( | ) | [inline] |
Definition at line 73 of file CredentialManager.h.
| AuthData_Ptr zypp::media::CredentialManager::getCred | ( | const Url & | url | ) |
Get credentials for the specified url.
If the URL contains also username, it will be used to find the match for this user (in case mutliple are available).
| url | URL to find credentials for. |
Definition at line 298 of file CredentialManager.cc.
References _pimpl, zypp::media::CredentialManager::Impl::getCred(), zypp::media::CredentialManager::Impl::getCredFromFile(), and zypp::Url::getQueryParam().
Referenced by zypp::media::MediaCIFS::attachTo(), zypp::media::MediaCIFS::authenticate(), and zypp::media::MediaCurl::authenticate().
| AuthData_Ptr zypp::media::CredentialManager::getCredFromFile | ( | const Pathname & | file | ) |
Read credentials from a file.
Definition at line 307 of file CredentialManager.cc.
References _pimpl, and zypp::media::CredentialManager::Impl::getCredFromFile().
| void zypp::media::CredentialManager::addGlobalCred | ( | const AuthData & | cred | ) |
Add new global credentials.
Definition at line 322 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsGlobal, zypp::media::CredentialManager::Impl::_globalDirty, _pimpl, and zypp::media::AuthData::password().
Referenced by saveInGlobal().
| void zypp::media::CredentialManager::addUserCred | ( | const AuthData & | cred | ) |
Add new user credentials.
Definition at line 338 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsUser, _pimpl, zypp::media::CredentialManager::Impl::_userDirty, and zypp::media::AuthData::password().
Referenced by addCred(), and saveInUser().
| void zypp::media::CredentialManager::addCred | ( | const AuthData & | cred | ) |
Add new credentials with user callbacks.
If the cred->url() contains 'credentials' query parameter, the credentials will be automatically saved to the specified file using the saveInFile() method.
Otherwise a callback will be called asking whether to save to custom file, or to global or user's credentials catalog.
Definition at line 311 of file CredentialManager.cc.
References addUserCred(), zypp::Url::getQueryParam(), saveInFile(), and zypp::media::AuthData::url().
Referenced by zypp::media::MediaCIFS::authenticate(), and zypp::media::MediaCurl::authenticate().
| void zypp::media::CredentialManager::save | ( | ) |
Saves any unsaved credentials added via addUserCred() or addGlobalCred() methods.
Definition at line 354 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_globalDirty, _pimpl, zypp::media::CredentialManager::Impl::_userDirty, zypp::media::CredentialManager::Impl::saveGlobalCredentials(), and zypp::media::CredentialManager::Impl::saveUserCredentials().
Referenced by zypp::media::MediaCIFS::authenticate(), zypp::media::MediaCurl::authenticate(), saveInGlobal(), and saveInUser().
| void zypp::media::CredentialManager::saveInGlobal | ( | const AuthData & | cred | ) |
Saves given cred to global credentials file.
Definition at line 365 of file CredentialManager.cc.
References addGlobalCred(), and save().
| void zypp::media::CredentialManager::saveInUser | ( | const AuthData & | cred | ) |
Saves given cred to user's credentials file.
Definition at line 372 of file CredentialManager.cc.
References addUserCred(), and save().
Referenced by zypp::RepoManager::addRepository(), and zypp::RepoManager::addService().
| void zypp::media::CredentialManager::saveInFile | ( | const AuthData & | cred, |
| const Pathname & | credFile | ||
| ) |
Saves given cred to user specified credentials file.
If the credFile path is absolute, it will be saved at that precise location. If credFile is just a filename, it will be saved in CredManagerOptions::customCredFileDir. Otherwise the current working directory will be prepended to the file path.
Definition at line 379 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_options, _pimpl, zypp::media::CredManagerOptions::customCredFileDir, ERR, and zypp::media::save_creds_in_file().
Referenced by addCred().
| void zypp::media::CredentialManager::clearAll | ( | bool | global = false | ) |
Remove all global or user credentials from memory and disk.
| global | Whether to remove global or user credentials. |
Definition at line 402 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsGlobal, zypp::media::CredentialManager::Impl::_credsUser, zypp::media::CredentialManager::Impl::_options, _pimpl, ERR, zypp::media::CredManagerOptions::globalCredFilePath, zypp::filesystem::unlink(), and zypp::media::CredManagerOptions::userCredFilePath.
Definition at line 421 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsGlobal, and _pimpl.
Definition at line 424 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsGlobal, and _pimpl.
Definition at line 427 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsGlobal, and _pimpl.
| bool zypp::media::CredentialManager::credsGlobalEmpty | ( | ) | const |
Definition at line 430 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsGlobal, and _pimpl.
Definition at line 434 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsUser, and _pimpl.
Definition at line 437 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsUser, and _pimpl.
Definition at line 440 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsUser, and _pimpl.
| bool zypp::media::CredentialManager::credsUserEmpty | ( | ) | const |
Definition at line 443 of file CredentialManager.cc.
References zypp::media::CredentialManager::Impl::_credsUser, and _pimpl.
RW_pointer<Impl> zypp::media::CredentialManager::_pimpl [private] |
Definition at line 173 of file CredentialManager.h.
Referenced by addGlobalCred(), addUserCred(), clearAll(), credsGlobalBegin(), credsGlobalEmpty(), credsGlobalEnd(), credsGlobalSize(), credsUserBegin(), credsUserEmpty(), credsUserEnd(), credsUserSize(), getCred(), getCredFromFile(), save(), and saveInFile().
1.7.6.1