17 #ifndef QGSAUTHMETHOD_H 18 #define QGSAUTHMETHOD_H 22 #include <QNetworkReply> 23 #include <QNetworkRequest> 24 #include <QStringList> 28 #include "qgis_core.h" 56 GenericDataSourceUri = 0x8,
58 All = NetworkRequest | NetworkReply | DataSourceUri | GenericDataSourceUri | NetworkProxy
63 virtual QString key()
const = 0;
66 virtual QString description()
const = 0;
69 virtual QString displayDescription()
const = 0;
96 const QString &dataprovider = QString() )
100 Q_UNUSED( dataprovider )
113 const QString &dataprovider = QString() )
117 Q_UNUSED( dataprovider )
130 const QString &dataprovider = QString() )
132 Q_UNUSED( connectionItems )
134 Q_UNUSED( dataprovider )
147 const QString &dataprovider = QString() )
151 Q_UNUSED( dataprovider )
161 virtual void clearCachedConfig(
const QString &authcfg ) = 0;
176 : mMutex( QMutex::RecursionMode::Recursive )
181 static QString
authMethodTag() {
return QObject::tr(
"Authentication method" ); }
187 void setExpansions( QgsAuthMethod::Expansions expansions ) { mExpansions = expansions; }
189 void setDataProviders(
const QStringList &dataproviders ) { mDataProviders = dataproviders; }
191 QgsAuthMethod::Expansions mExpansions = QgsAuthMethod::Expansions();
201 #endif // QGSAUTHMETHOD_H int version() const
Increment this if method is significantly updated, allow updater code to be written for previously st...
QStringList mDataProviders
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
virtual bool updateDataSourceUriItems(QStringList &connectionItems, const QString &authcfg, const QString &dataprovider=QString())
Update data source connection items with authentication components.
static QString authMethodTag()
Tag signifying that this is an authentcation method (e.g. for use as title in message log panel outpu...
QgsAuthMethod()
Construct a default authentication method.
virtual bool updateNetworkRequest(QNetworkRequest &request, const QString &authcfg, const QString &dataprovider=QString())
Update a network request with authentication components.
Expansion
Flags that represent the update points (where authentication configurations are expanded) supported b...
void setDataProviders(const QStringList &dataproviders)
Sets list of data providers this auth method supports.
Configuration storage class for authentication method configurations.
QStringList supportedDataProviders() const
The data providers that the method supports, allowing for filtering out authcfgs that are not applica...
virtual bool updateNetworkProxy(QNetworkProxy &proxy, const QString &authcfg, const QString &dataprovider=QString())
Update proxy settings with authentication components.
Abstract base class for authentication method plugins.
void setVersion(int version)
Sets the version of the auth method (useful for future upgrading)
virtual bool updateNetworkReply(QNetworkReply *reply, const QString &authcfg, const QString &dataprovider=QString())
Update a network reply with authentication components.
QgsAuthMethod::Expansions supportedExpansions() const
Flags that represent the update points (where authentication configurations are expanded) supported b...
void setExpansions(QgsAuthMethod::Expansions expansions)
Sets the support expansions (points in providers where the authentication is injected) of the auth me...
QHash< QString, QgsAuthMethod * > QgsAuthMethodsMap