17#ifndef QGSCREDENTIALS_H
18#define QGSCREDENTIALS_H
66 bool get(
const QString &realm, QString &username
SIP_INOUT, QString &password
SIP_INOUT,
const QString &message = QString(),
bool requestCredentials =
true );
77 void put(
const QString &realm,
const QString &username,
const QString &password );
99 QMutex *
mutex() {
return &mAuthMutex; }
106 virtual bool request(
const QString &realm, QString &username
SIP_INOUT, QString &password
SIP_INOUT,
const QString &message = QString() ) = 0;
122 QMap< QString, QPair<QString, QString> > mCredentialCache;
153 bool request(
const QString &realm, QString &username
SIP_INOUT, QString &password
SIP_INOUT,
const QString &message = QString() )
override;
178 bool request(
const QString &realm, QString &username
SIP_INOUT, QString &password
SIP_INOUT,
const QString &message = QString() )
override;
bool requestMasterPassword(QString &password, bool stored=false) override
request a master password
bool request(const QString &realm, QString &username, QString &password, const QString &message=QString()) override
request a password
void destroyed()
signals that object will be destroyed and shouldn't be used anymore
bool requestMasterPassword(QString &password, bool stored=false) override
request a master password
void destroyed()
signals that object will be destroyed and shouldn't be used anymore
bool request(const QString &realm, QString &username, QString &password, const QString &message=QString()) override
request a password
QMutex * mutex()
Returns pointer to mutex.
virtual bool requestMasterPassword(QString &password, bool stored=false)=0
request a master password
void setInstance(QgsCredentials *instance)
register instance
static QgsCredentials * instance()
retrieves instance
void lock()
Lock the instance against access from multiple threads.
bool get(const QString &realm, QString &username, QString &password, const QString &message=QString(), bool requestCredentials=true)
Requests credentials for the specified realm.
bool getMasterPassword(QString &password, bool stored=false)
virtual ~QgsCredentials()=default
void unlock()
Unlock the instance after being locked.
void put(const QString &realm, const QString &username, const QString &password)
Stores the correct username and password for the specified realm.
virtual bool request(const QString &realm, QString &username, QString &password, const QString &message=QString())=0
request a password