|
libzypp 17.38.15
|
#include <zypp-media/auth/credentialmanager.h>
Classes | |
| struct | Impl |
Public Types | |
| using | CredentialSet = std::set<AuthData_Ptr, AuthDataComparator> |
| using | CredentialSize = CredentialSet::size_type |
| using | CredentialIterator = CredentialSet::const_iterator |
Public Member Functions | |
| CredentialManager (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. | |
| time_t | timestampForCredDatabase (const zypp::Url &url) |
| CredentialIterator | credsGlobalBegin () const |
| CredentialIterator | credsGlobalEnd () const |
| CredentialSize | credsGlobalSize () const |
| bool | credsGlobalEmpty () const |
| CredentialIterator | credsUserBegin () const |
| CredentialIterator | credsUserEnd () const |
| CredentialSize | credsUserSize () const |
| bool | credsUserEmpty () const |
Static Public Member Functions | |
| static AuthData_Ptr | findIn (const CredentialManager::CredentialSet &set, const Url &url, url::ViewOption vopt) |
Private Attributes | |
| RW_pointer< Impl > | _pimpl |
better method names
delete(AuthData) method
Definition at line 63 of file credentialmanager.h.
| using zypp::media::CredentialManager::CredentialSet = std::set<AuthData_Ptr, AuthDataComparator> |
Definition at line 66 of file credentialmanager.h.
| using zypp::media::CredentialManager::CredentialSize = CredentialSet::size_type |
Definition at line 67 of file credentialmanager.h.
| using zypp::media::CredentialManager::CredentialIterator = CredentialSet::const_iterator |
Definition at line 68 of file credentialmanager.h.
| zypp::media::CredentialManager::CredentialManager | ( | CredManagerOptions | opts = CredManagerOptions() | ) |
Definition at line 330 of file credentialmanager.cc.
|
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 335 of file credentialmanager.cc.
| AuthData_Ptr zypp::media::CredentialManager::getCredFromFile | ( | const Pathname & | file | ) |
Read credentials from a file.
Definition at line 344 of file credentialmanager.cc.
Add new global credentials.
Definition at line 378 of file credentialmanager.cc.
Add new user credentials.
Definition at line 397 of file credentialmanager.cc.
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 348 of file credentialmanager.cc.
| void zypp::media::CredentialManager::save | ( | ) |
Saves any unsaved credentials added via addUserCred() or addGlobalCred() methods.
Definition at line 416 of file credentialmanager.cc.
Saves given cred to global credentials file.
Definition at line 427 of file credentialmanager.cc.
Saves given cred to user's credentials file.
Definition at line 434 of file credentialmanager.cc.
| 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 441 of file credentialmanager.cc.
Remove all global or user credentials from memory and disk.
| global | Whether to remove global or user credentials. |
Definition at line 464 of file credentialmanager.cc.
|
static |
Helper function to find a matching AuthData instance in a CredentialSet
Definition at line 188 of file credentialmanager.cc.
| time_t zypp::media::CredentialManager::timestampForCredDatabase | ( | const zypp::Url & | url | ) |
Returns the timestamp of the database the given URL creds would be stored
Definition at line 361 of file credentialmanager.cc.
| CredentialManager::CredentialIterator zypp::media::CredentialManager::credsGlobalBegin | ( | ) | const |
Definition at line 483 of file credentialmanager.cc.
| CredentialManager::CredentialIterator zypp::media::CredentialManager::credsGlobalEnd | ( | ) | const |
Definition at line 486 of file credentialmanager.cc.
| CredentialManager::CredentialSize zypp::media::CredentialManager::credsGlobalSize | ( | ) | const |
Definition at line 489 of file credentialmanager.cc.
| bool zypp::media::CredentialManager::credsGlobalEmpty | ( | ) | const |
Definition at line 492 of file credentialmanager.cc.
| CredentialManager::CredentialIterator zypp::media::CredentialManager::credsUserBegin | ( | ) | const |
Definition at line 496 of file credentialmanager.cc.
| CredentialManager::CredentialIterator zypp::media::CredentialManager::credsUserEnd | ( | ) | const |
Definition at line 499 of file credentialmanager.cc.
| CredentialManager::CredentialSize zypp::media::CredentialManager::credsUserSize | ( | ) | const |
Definition at line 502 of file credentialmanager.cc.
| bool zypp::media::CredentialManager::credsUserEmpty | ( | ) | const |
Definition at line 505 of file credentialmanager.cc.
|
private |
Definition at line 184 of file credentialmanager.h.