signon
8.58
|
Manages the credentials I/O. More...
#include <credentialsdb.h>
Signals | |
void | credentialsUpdated (quint32 id) |
Public Member Functions | |
CredentialsDB (const QString &metaDataDbName, SignOn::AbstractSecretsStorage *secretsStorage) | |
~CredentialsDB () | |
bool | init () |
bool | openSecretsDB (const QString &secretsDbName) |
This method will open the DB file containing the user secrets. More... | |
bool | isSecretsDBOpen () |
void | closeSecretsDB () |
SignOn::CredentialsDBError | lastError () const |
bool | errorOccurred () const |
QStringList | methods (const quint32 id, const QString &securityToken=QString()) |
bool | checkPassword (const quint32 id, const QString &username, const QString &password) |
SignonIdentityInfo | credentials (const quint32 id, bool queryPassword=true) |
QList< SignonIdentityInfo > | credentials (const QMap< QString, QString > &filter) |
quint32 | insertCredentials (const SignonIdentityInfo &info) |
quint32 | updateCredentials (const SignonIdentityInfo &info) |
bool | removeCredentials (const quint32 id) |
bool | clear () |
QStringList | accessControlList (const quint32 identityId) |
QStringList | ownerList (const quint32 identityId) |
QString | credentialsOwnerSecurityToken (const quint32 identityId) |
QVariantMap | loadData (const quint32 id, const QString &method) |
bool | storeData (const quint32 id, const QString &method, const QVariantMap &data) |
bool | removeData (const quint32 id, const QString &method=QString()) |
bool | addReference (const quint32 id, const QString &token, const QString &reference) |
bool | removeReference (const quint32 id, const QString &token, const QString &reference=QString()) |
QStringList | references (const quint32 id, const QString &token=QString()) |
Friends | |
class | ::TestDatabase |
class | ErrorMonitor |
Manages the credentials I/O.
Definition at line 66 of file credentialsdb.h.
SignonDaemonNS::CredentialsDB::CredentialsDB | ( | const QString & | metaDataDbName, |
SignOn::AbstractSecretsStorage * | secretsStorage | ||
) |
Definition at line 1290 of file credentialsdb.cpp.
SignonDaemonNS::CredentialsDB::~CredentialsDB | ( | ) |
Definition at line 1301 of file credentialsdb.cpp.
References SignonDaemonNS::SqlDatabase::connectionName(), and TRACE.
QStringList SignonDaemonNS::CredentialsDB::accessControlList | ( | const quint32 | identityId | ) |
Definition at line 1526 of file credentialsdb.cpp.
References SignonDaemonNS::MetaDataDB::accessControlList(), and INIT_ERROR.
Referenced by SignonDaemonNS::AccessControlManagerHelper::isPeerAllowedToUseIdentity().
bool SignonDaemonNS::CredentialsDB::addReference | ( | const quint32 | id, |
const QString & | token, | ||
const QString & | reference | ||
) |
Definition at line 1545 of file credentialsdb.cpp.
References SignonDaemonNS::MetaDataDB::addReference(), and INIT_ERROR.
Referenced by SignonDaemonNS::SignonIdentity::addReference().
bool SignonDaemonNS::CredentialsDB::checkPassword | ( | const quint32 | id, |
const QString & | username, | ||
const QString & | password | ||
) |
Definition at line 1356 of file credentialsdb.cpp.
References SignonDaemonNS::MetaDataDB::identity(), INIT_ERROR, SignonDaemonNS::SignonIdentityInfo::isUserNameSecret(), RETURN_IF_NO_SECRETS_DB, and SignonDaemonNS::SignonIdentityInfo::userName().
Referenced by SignonDaemonNS::SignonIdentity::verifySecret().
bool SignonDaemonNS::CredentialsDB::clear | ( | ) |
Definition at line 1452 of file credentialsdb.cpp.
References SignonDaemonNS::MetaDataDB::clear(), INIT_ERROR, RETURN_IF_NO_SECRETS_DB, and TRACE.
Referenced by SignonDaemonNS::SignonDaemon::clear().
void SignonDaemonNS::CredentialsDB::closeSecretsDB | ( | ) |
Definition at line 1339 of file credentialsdb.cpp.
SignonIdentityInfo SignonDaemonNS::CredentialsDB::credentials | ( | const quint32 | id, |
bool | queryPassword = true |
||
) |
Definition at line 1371 of file credentialsdb.cpp.
References SignonDaemonNS::MetaDataDB::identity(), INIT_ERROR, SignonDaemonNS::SignonIdentityInfo::isNew(), isSecretsDBOpen(), SignonDaemonNS::SignonIdentityInfo::isUserNameSecret(), SignonDaemonNS::SecretsCache::lookupCredentials(), SignonDaemonNS::SignonIdentityInfo::setPassword(), SignonDaemonNS::SignonIdentityInfo::setUserName(), SignonDaemonNS::SignonIdentityInfo::storePassword(), and TRACE.
Referenced by SignonDaemonNS::SignonAuthSessionAdaptor::process(), SignonDaemonNS::SignonDaemon::queryIdentities(), and SignonDaemonNS::SignonIdentity::queryInfo().
QList< SignonIdentityInfo > SignonDaemonNS::CredentialsDB::credentials | ( | const QMap< QString, QString > & | filter | ) |
Definition at line 1400 of file credentialsdb.cpp.
References SignonDaemonNS::MetaDataDB::identities(), and INIT_ERROR.
QString SignonDaemonNS::CredentialsDB::credentialsOwnerSecurityToken | ( | const quint32 | identityId | ) |
Definition at line 1538 of file credentialsdb.cpp.
References ownerList().
|
signal |
Referenced by updateCredentials().
|
inline |
Definition at line 103 of file credentialsdb.h.
References lastError().
Referenced by SignonDaemonNS::AccessControlManagerHelper::isPeerAllowedToUseIdentity(), SignonDaemonNS::AccessControlManagerHelper::isPeerOwnerOfIdentity(), SignonDaemonNS::SignonDaemon::queryIdentities(), and SignonDaemonNS::SignonIdentity::storeCredentials().
bool SignonDaemonNS::CredentialsDB::init | ( | ) |
Definition at line 1314 of file credentialsdb.cpp.
References SignonDaemonNS::SqlDatabase::init().
quint32 SignonDaemonNS::CredentialsDB::insertCredentials | ( | const SignonIdentityInfo & | info | ) |
Definition at line 1406 of file credentialsdb.cpp.
References SignonDaemonNS::SignonIdentityInfo::isNew(), SignonDaemonNS::SignonIdentityInfo::setNew(), and updateCredentials().
Referenced by SignonDaemonNS::SignonIdentity::storeCredentials().
bool SignonDaemonNS::CredentialsDB::isSecretsDBOpen | ( | ) |
Definition at line 1334 of file credentialsdb.cpp.
Referenced by credentials(), SignonDaemonNS::CredentialsAccessManager::customEvent(), loadData(), storeData(), and updateCredentials().
SignOn::CredentialsDBError SignonDaemonNS::CredentialsDB::lastError | ( | ) | const |
Definition at line 1344 of file credentialsdb.cpp.
Referenced by SignonDaemonNS::SignonDaemon::clear(), errorOccurred(), SignonDaemonNS::SignonDaemon::queryIdentities(), and SignonDaemonNS::SignonIdentity::queryInfo().
QVariantMap SignonDaemonNS::CredentialsDB::loadData | ( | const quint32 | id, |
const QString & | method | ||
) |
Definition at line 1464 of file credentialsdb.cpp.
References INIT_ERROR, isSecretsDBOpen(), SignonDaemonNS::SecretsCache::lookupData(), SignonDaemonNS::MetaDataDB::methodId(), and TRACE.
QStringList SignonDaemonNS::CredentialsDB::methods | ( | const quint32 | id, |
const QString & | securityToken = QString() |
||
) |
Definition at line 1349 of file credentialsdb.cpp.
References INIT_ERROR, and SignonDaemonNS::MetaDataDB::methods().
bool SignonDaemonNS::CredentialsDB::openSecretsDB | ( | const QString & | secretsDbName | ) |
This method will open the DB file containing the user secrets.
If this method is not called, or if it fails, the secrets will not be available.
Definition at line 1319 of file credentialsdb.cpp.
References SignonDaemonNS::SecretsCache::clear(), SignonDaemonNS::SecretsCache::storeToDB(), and TRACE.
QStringList SignonDaemonNS::CredentialsDB::ownerList | ( | const quint32 | identityId | ) |
Definition at line 1532 of file credentialsdb.cpp.
References INIT_ERROR, and SignonDaemonNS::MetaDataDB::ownerList().
Referenced by credentialsOwnerSecurityToken(), and SignonDaemonNS::AccessControlManagerHelper::isPeerOwnerOfIdentity().
QStringList SignonDaemonNS::CredentialsDB::references | ( | const quint32 | id, |
const QString & | token = QString() |
||
) |
Definition at line 1561 of file credentialsdb.cpp.
References INIT_ERROR, and SignonDaemonNS::MetaDataDB::references().
bool SignonDaemonNS::CredentialsDB::removeCredentials | ( | const quint32 | id | ) |
Definition at line 1440 of file credentialsdb.cpp.
References INIT_ERROR, SignonDaemonNS::MetaDataDB::removeIdentity(), and RETURN_IF_NO_SECRETS_DB.
Referenced by SignonDaemonNS::SignonIdentity::remove().
bool SignonDaemonNS::CredentialsDB::removeData | ( | const quint32 | id, |
const QString & | method = QString() |
||
) |
Definition at line 1507 of file credentialsdb.cpp.
References INIT_ERROR, SignonDaemonNS::MetaDataDB::methodId(), RETURN_IF_NO_SECRETS_DB, and TRACE.
Referenced by SignonDaemonNS::SignonIdentity::signOut().
bool SignonDaemonNS::CredentialsDB::removeReference | ( | const quint32 | id, |
const QString & | token, | ||
const QString & | reference = QString() |
||
) |
Definition at line 1553 of file credentialsdb.cpp.
References INIT_ERROR, and SignonDaemonNS::MetaDataDB::removeReference().
Referenced by SignonDaemonNS::SignonIdentity::removeReference().
bool SignonDaemonNS::CredentialsDB::storeData | ( | const quint32 | id, |
const QString & | method, | ||
const QVariantMap & | data | ||
) |
Definition at line 1482 of file credentialsdb.cpp.
References INIT_ERROR, SignonDaemonNS::MetaDataDB::insertMethod(), isSecretsDBOpen(), SignonDaemonNS::MetaDataDB::methodId(), TRACE, and SignonDaemonNS::SecretsCache::updateData().
quint32 SignonDaemonNS::CredentialsDB::updateCredentials | ( | const SignonIdentityInfo & | info | ) |
Definition at line 1414 of file credentialsdb.cpp.
References credentialsUpdated(), SignonDaemonNS::SignonIdentityInfo::hasSecrets(), INIT_ERROR, isSecretsDBOpen(), SignonDaemonNS::SignonIdentityInfo::isUserNameSecret(), SignonDaemonNS::SignonIdentityInfo::password(), SignonDaemonNS::SignonIdentityInfo::storePassword(), SignonDaemonNS::SecretsCache::updateCredentials(), SignonDaemonNS::MetaDataDB::updateIdentity(), and SignonDaemonNS::SignonIdentityInfo::userName().
Referenced by insertCredentials(), SignonDaemonNS::SignonIdentity::queryUiSlot(), and SignonDaemonNS::SignonIdentity::storeCredentials().
|
friend |
Definition at line 71 of file credentialsdb.h.
|
friend |
Definition at line 85 of file credentialsdb.h.