signon
8.41
|
Manages the credentials I/O. More...
#include <credentialsdb.h>
Classes | |
class | ErrorMonitor |
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. | |
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, bool storeSecret=true) |
quint32 | updateCredentials (const SignonIdentityInfo &info, bool storeSecret=true) |
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 270 of file credentialsdb.h.
SignonDaemonNS::CredentialsDB::CredentialsDB | ( | const QString & | metaDataDbName, |
SignOn::AbstractSecretsStorage * | secretsStorage | ||
) |
Definition at line 1198 of file credentialsdb.cpp.
SignonDaemonNS::CredentialsDB::~CredentialsDB | ( | ) |
Definition at line 1208 of file credentialsdb.cpp.
References SignonDaemonNS::SqlDatabase::connectionName(), and TRACE.
QStringList SignonDaemonNS::CredentialsDB::accessControlList | ( | const quint32 | identityId | ) |
Definition at line 1404 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 1423 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 1258 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 1339 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 1241 of file credentialsdb.cpp.
SignonIdentityInfo SignonDaemonNS::CredentialsDB::credentials | ( | const quint32 | id, |
bool | queryPassword = true |
||
) |
Definition at line 1273 of file credentialsdb.cpp.
References SignonDaemonNS::MetaDataDB::identity(), INIT_ERROR, SignonDaemonNS::SignonIdentityInfo::isNew(), isSecretsDBOpen(), SignonDaemonNS::SignonIdentityInfo::isUserNameSecret(), SignonDaemonNS::SignonIdentityInfo::setPassword(), SignonDaemonNS::SignonIdentityInfo::setUserName(), 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 1290 of file credentialsdb.cpp.
References SignonDaemonNS::MetaDataDB::identities(), and INIT_ERROR.
QString SignonDaemonNS::CredentialsDB::credentialsOwnerSecurityToken | ( | const quint32 | identityId | ) |
Definition at line 1416 of file credentialsdb.cpp.
References ownerList().
|
inline |
Definition at line 307 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 1218 of file credentialsdb.cpp.
References SignonDaemonNS::SqlDatabase::init().
quint32 SignonDaemonNS::CredentialsDB::insertCredentials | ( | const SignonIdentityInfo & | info, |
bool | storeSecret = true |
||
) |
Definition at line 1296 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 1236 of file credentialsdb.cpp.
Referenced by credentials(), SignonDaemonNS::CredentialsAccessManager::customEvent(), SignonDaemonNS::SignonIdentity::storeCredentials(), and updateCredentials().
SignOn::CredentialsDBError SignonDaemonNS::CredentialsDB::lastError | ( | ) | const |
Definition at line 1246 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 1351 of file credentialsdb.cpp.
References INIT_ERROR, SignonDaemonNS::MetaDataDB::methodId(), RETURN_IF_NO_SECRETS_DB, and TRACE.
QStringList SignonDaemonNS::CredentialsDB::methods | ( | const quint32 | id, |
const QString & | securityToken = QString() |
||
) |
Definition at line 1251 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 1223 of file credentialsdb.cpp.
References TRACE.
QStringList SignonDaemonNS::CredentialsDB::ownerList | ( | const quint32 | identityId | ) |
Definition at line 1410 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 1439 of file credentialsdb.cpp.
References INIT_ERROR, and SignonDaemonNS::MetaDataDB::references().
bool SignonDaemonNS::CredentialsDB::removeCredentials | ( | const quint32 | id | ) |
Definition at line 1327 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 1385 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 1431 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 1365 of file credentialsdb.cpp.
References INIT_ERROR, SignonDaemonNS::MetaDataDB::insertMethod(), SignonDaemonNS::MetaDataDB::methodId(), RETURN_IF_NO_SECRETS_DB, and TRACE.
quint32 SignonDaemonNS::CredentialsDB::updateCredentials | ( | const SignonIdentityInfo & | info, |
bool | storeSecret = true |
||
) |
Definition at line 1305 of file credentialsdb.cpp.
References INIT_ERROR, isSecretsDBOpen(), SignonDaemonNS::SignonIdentityInfo::isUserNameSecret(), SignonDaemonNS::SignonIdentityInfo::password(), SignonDaemonNS::SignonIdentityInfo::storePassword(), SignonDaemonNS::MetaDataDB::updateIdentity(), and SignonDaemonNS::SignonIdentityInfo::userName().
Referenced by insertCredentials(), SignonDaemonNS::SignonIdentity::queryUiSlot(), and SignonDaemonNS::SignonIdentity::storeCredentials().
|
friend |
Definition at line 275 of file credentialsdb.h.
|
friend |
Definition at line 289 of file credentialsdb.h.